diff --git a/src/apis/abusiveexperiencereport/v1.ts b/src/apis/abusiveexperiencereport/v1.ts index e34ff51e44f..482619b78a3 100644 --- a/src/apis/abusiveexperiencereport/v1.ts +++ b/src/apis/abusiveexperiencereport/v1.ts @@ -167,6 +167,55 @@ export namespace abusiveexperiencereport_v1 { /** * abusiveexperiencereport.sites.get * @desc Gets a site's Abusive Experience Report summary. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/abusiveexperiencereport.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 abusiveexperiencereport = google.abusiveexperiencereport('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: [], + * }); + * + * // 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 abusiveexperiencereport.sites.get({ + * // Required. The name of the site whose summary to get, e.g. + * // `sites/http%3A%2F%2Fwww.google.com%2F`. + * // + * // Format: `sites/{site}` + * name: 'sites/my-site', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "abusiveStatus": "my_abusiveStatus", + * // "enforcementTime": "my_enforcementTime", + * // "filterStatus": "my_filterStatus", + * // "lastChangeTime": "my_lastChangeTime", + * // "reportUrl": "my_reportUrl", + * // "reviewedSite": "my_reviewedSite", + * // "underReview": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias abusiveexperiencereport.sites.get * @memberOf! () * @@ -257,6 +306,43 @@ export namespace abusiveexperiencereport_v1 { /** * abusiveexperiencereport.violatingSites.list * @desc Lists sites that are failing in the Abusive Experience Report. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/abusiveexperiencereport.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 abusiveexperiencereport = google.abusiveexperiencereport('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: [], + * }); + * + * // 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 abusiveexperiencereport.violatingSites.list({}); + * console.log(res.data); + * + * // Example response + * // { + * // "violatingSites": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias abusiveexperiencereport.violatingSites.list * @memberOf! () * diff --git a/src/apis/acceleratedmobilepageurl/v1.ts b/src/apis/acceleratedmobilepageurl/v1.ts index 8c6981a2454..58e382d5aa1 100644 --- a/src/apis/acceleratedmobilepageurl/v1.ts +++ b/src/apis/acceleratedmobilepageurl/v1.ts @@ -183,6 +183,53 @@ export namespace acceleratedmobilepageurl_v1 { /** * acceleratedmobilepageurl.ampUrls.batchGet * @desc Returns AMP URL(s) and equivalent [AMP Cache URL(s)](/amp/cache/overview#amp-cache-url-format). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/acceleratedmobilepageurl.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 acceleratedmobilepageurl = google.acceleratedmobilepageurl('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: [], + * }); + * + * // 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 acceleratedmobilepageurl.ampUrls.batchGet({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "lookupStrategy": "my_lookupStrategy", + * // "urls": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ampUrls": [], + * // "urlErrors": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias acceleratedmobilepageurl.ampUrls.batchGet * @memberOf! () * diff --git a/src/apis/accessapproval/v1.ts b/src/apis/accessapproval/v1.ts index b216f40c6ef..c6616686131 100644 --- a/src/apis/accessapproval/v1.ts +++ b/src/apis/accessapproval/v1.ts @@ -290,6 +290,44 @@ export namespace accessapproval_v1 { /** * accessapproval.folders.deleteAccessApprovalSettings * @desc Deletes the settings associated with a project, folder, or organization. This will have the effect of disabling Access Approval for the project, folder, or organization, but only if all ancestors also have Access Approval disabled. If Access Approval is enabled at a higher level of the hierarchy, then Access Approval will still be enabled at this level as the settings are inherited. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.folders.deleteAccessApprovalSettings({ + * // Name of the AccessApprovalSettings to delete. + * name: 'folders/my-folder/accessApprovalSettings', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.folders.deleteAccessApprovalSettings * @memberOf! () * @@ -362,6 +400,49 @@ export namespace accessapproval_v1 { /** * accessapproval.folders.getAccessApprovalSettings * @desc Gets the settings associated with a project, folder, or organization. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.folders.getAccessApprovalSettings({ + * // Name of the AccessApprovalSettings to retrieve. + * name: 'folders/my-folder/accessApprovalSettings', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "enrolledAncestor": false, + * // "enrolledServices": [], + * // "name": "my_name", + * // "notificationEmails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.folders.getAccessApprovalSettings * @memberOf! () * @@ -438,6 +519,76 @@ export namespace accessapproval_v1 { /** * accessapproval.folders.updateAccessApprovalSettings * @desc Updates the settings associated with a project, folder, or organization. Settings to update are determined by the value of field_mask. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.folders.updateAccessApprovalSettings({ + * // The resource name of the settings. Format is one of: + * //
    + * //
  1. "projects/{project_id}/accessApprovalSettings"
  2. + * //
  3. "folders/{folder_id}/accessApprovalSettings"
  4. + * //
  5. "organizations/{organization_id}/accessApprovalSettings"
  6. + * //
      + * name: 'folders/my-folder/accessApprovalSettings', + * // The update mask applies to the settings. Only the top level fields of + * // AccessApprovalSettings (notification_emails & enrolled_services) are + * // supported. For each field, if it is included, the currently stored value + * // will be entirely overwritten with the value of the field passed in this + * // request. + * // + * // For the `FieldMask` definition, see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * // If this field is left unset, only the notification_emails field will be + * // updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "enrolledAncestor": false, + * // "enrolledServices": [], + * // "name": "my_name", + * // "notificationEmails": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "enrolledAncestor": false, + * // "enrolledServices": [], + * // "name": "my_name", + * // "notificationEmails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.folders.updateAccessApprovalSettings * @memberOf! () * @@ -569,6 +720,62 @@ export namespace accessapproval_v1 { /** * accessapproval.folders.approvalRequests.approve * @desc Approves a request and returns the updated ApprovalRequest. Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the request exists but is not in a pending state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.folders.approvalRequests.approve({ + * // Name of the approval request to approve. + * name: 'folders/my-folder/approvalRequests/my-approvalRequest', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "expireTime": "my_expireTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approve": {}, + * // "dismiss": {}, + * // "name": "my_name", + * // "requestTime": "my_requestTime", + * // "requestedExpiration": "my_requestedExpiration", + * // "requestedLocations": {}, + * // "requestedReason": {}, + * // "requestedResourceName": "my_requestedResourceName", + * // "requestedResourceProperties": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.folders.approvalRequests.approve * @memberOf! () * @@ -645,6 +852,60 @@ export namespace accessapproval_v1 { /** * accessapproval.folders.approvalRequests.dismiss * @desc Dismisses a request. Returns the updated ApprovalRequest. NOTE: This does not deny access to the resource if another request has been made and approved. It is equivalent in effect to ignoring the request altogether. Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the request exists but is not in a pending state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.folders.approvalRequests.dismiss({ + * // Name of the ApprovalRequest to dismiss. + * name: 'folders/my-folder/approvalRequests/my-approvalRequest', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approve": {}, + * // "dismiss": {}, + * // "name": "my_name", + * // "requestTime": "my_requestTime", + * // "requestedExpiration": "my_requestedExpiration", + * // "requestedLocations": {}, + * // "requestedReason": {}, + * // "requestedResourceName": "my_requestedResourceName", + * // "requestedResourceProperties": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.folders.approvalRequests.dismiss * @memberOf! () * @@ -721,6 +982,54 @@ export namespace accessapproval_v1 { /** * accessapproval.folders.approvalRequests.get * @desc Gets an approval request. Returns NOT_FOUND if the request does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.folders.approvalRequests.get({ + * // Name of the approval request to retrieve. + * name: 'folders/my-folder/approvalRequests/my-approvalRequest', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approve": {}, + * // "dismiss": {}, + * // "name": "my_name", + * // "requestTime": "my_requestTime", + * // "requestedExpiration": "my_requestedExpiration", + * // "requestedLocations": {}, + * // "requestedReason": {}, + * // "requestedResourceName": "my_requestedResourceName", + * // "requestedResourceProperties": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.folders.approvalRequests.get * @memberOf! () * @@ -793,6 +1102,62 @@ export namespace accessapproval_v1 { /** * accessapproval.folders.approvalRequests.list * @desc Lists approval requests associated with a project, folder, or organization. Approval requests can be filtered by state (pending, active, dismissed). The order is reverse chronological. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.folders.approvalRequests.list({ + * // A filter on the type of approval requests to retrieve. Must be one of the + * // following values: + * //
        + * //
      1. [not set]: Requests that are pending or have active approvals.
      2. + * //
      3. ALL: All requests.
      4. + * //
      5. PENDING: Only pending requests.
      6. + * //
      7. ACTIVE: Only active (i.e. currently approved) requests.
      8. + * //
      9. DISMISSED: Only dismissed (including expired) requests.
      10. + * //
      + * filter: 'placeholder-value', + * // Requested page size. + * pageSize: 'placeholder-value', + * // A token identifying the page of results to return. + * pageToken: 'placeholder-value', + * // The parent resource. This may be "projects/{project_id}", + * // "folders/{folder_id}", or "organizations/{organization_id}". + * parent: 'folders/my-folder', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approvalRequests": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.folders.approvalRequests.list * @memberOf! () * @@ -962,6 +1327,44 @@ export namespace accessapproval_v1 { /** * accessapproval.organizations.deleteAccessApprovalSettings * @desc Deletes the settings associated with a project, folder, or organization. This will have the effect of disabling Access Approval for the project, folder, or organization, but only if all ancestors also have Access Approval disabled. If Access Approval is enabled at a higher level of the hierarchy, then Access Approval will still be enabled at this level as the settings are inherited. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.organizations.deleteAccessApprovalSettings({ + * // Name of the AccessApprovalSettings to delete. + * name: 'organizations/my-organization/accessApprovalSettings', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.organizations.deleteAccessApprovalSettings * @memberOf! () * @@ -1034,6 +1437,49 @@ export namespace accessapproval_v1 { /** * accessapproval.organizations.getAccessApprovalSettings * @desc Gets the settings associated with a project, folder, or organization. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.organizations.getAccessApprovalSettings({ + * // Name of the AccessApprovalSettings to retrieve. + * name: 'organizations/my-organization/accessApprovalSettings', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "enrolledAncestor": false, + * // "enrolledServices": [], + * // "name": "my_name", + * // "notificationEmails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.organizations.getAccessApprovalSettings * @memberOf! () * @@ -1110,6 +1556,76 @@ export namespace accessapproval_v1 { /** * accessapproval.organizations.updateAccessApprovalSettings * @desc Updates the settings associated with a project, folder, or organization. Settings to update are determined by the value of field_mask. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.organizations.updateAccessApprovalSettings({ + * // The resource name of the settings. Format is one of: + * //
        + * //
      1. "projects/{project_id}/accessApprovalSettings"
      2. + * //
      3. "folders/{folder_id}/accessApprovalSettings"
      4. + * //
      5. "organizations/{organization_id}/accessApprovalSettings"
      6. + * //
          + * name: 'organizations/my-organization/accessApprovalSettings', + * // The update mask applies to the settings. Only the top level fields of + * // AccessApprovalSettings (notification_emails & enrolled_services) are + * // supported. For each field, if it is included, the currently stored value + * // will be entirely overwritten with the value of the field passed in this + * // request. + * // + * // For the `FieldMask` definition, see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * // If this field is left unset, only the notification_emails field will be + * // updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "enrolledAncestor": false, + * // "enrolledServices": [], + * // "name": "my_name", + * // "notificationEmails": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "enrolledAncestor": false, + * // "enrolledServices": [], + * // "name": "my_name", + * // "notificationEmails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.organizations.updateAccessApprovalSettings * @memberOf! () * @@ -1241,6 +1757,62 @@ export namespace accessapproval_v1 { /** * accessapproval.organizations.approvalRequests.approve * @desc Approves a request and returns the updated ApprovalRequest. Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the request exists but is not in a pending state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.organizations.approvalRequests.approve({ + * // Name of the approval request to approve. + * name: 'organizations/my-organization/approvalRequests/my-approvalRequest', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "expireTime": "my_expireTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approve": {}, + * // "dismiss": {}, + * // "name": "my_name", + * // "requestTime": "my_requestTime", + * // "requestedExpiration": "my_requestedExpiration", + * // "requestedLocations": {}, + * // "requestedReason": {}, + * // "requestedResourceName": "my_requestedResourceName", + * // "requestedResourceProperties": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.organizations.approvalRequests.approve * @memberOf! () * @@ -1317,6 +1889,60 @@ export namespace accessapproval_v1 { /** * accessapproval.organizations.approvalRequests.dismiss * @desc Dismisses a request. Returns the updated ApprovalRequest. NOTE: This does not deny access to the resource if another request has been made and approved. It is equivalent in effect to ignoring the request altogether. Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the request exists but is not in a pending state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.organizations.approvalRequests.dismiss({ + * // Name of the ApprovalRequest to dismiss. + * name: 'organizations/my-organization/approvalRequests/my-approvalRequest', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approve": {}, + * // "dismiss": {}, + * // "name": "my_name", + * // "requestTime": "my_requestTime", + * // "requestedExpiration": "my_requestedExpiration", + * // "requestedLocations": {}, + * // "requestedReason": {}, + * // "requestedResourceName": "my_requestedResourceName", + * // "requestedResourceProperties": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.organizations.approvalRequests.dismiss * @memberOf! () * @@ -1393,6 +2019,54 @@ export namespace accessapproval_v1 { /** * accessapproval.organizations.approvalRequests.get * @desc Gets an approval request. Returns NOT_FOUND if the request does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.organizations.approvalRequests.get({ + * // Name of the approval request to retrieve. + * name: 'organizations/my-organization/approvalRequests/my-approvalRequest', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approve": {}, + * // "dismiss": {}, + * // "name": "my_name", + * // "requestTime": "my_requestTime", + * // "requestedExpiration": "my_requestedExpiration", + * // "requestedLocations": {}, + * // "requestedReason": {}, + * // "requestedResourceName": "my_requestedResourceName", + * // "requestedResourceProperties": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.organizations.approvalRequests.get * @memberOf! () * @@ -1465,6 +2139,62 @@ export namespace accessapproval_v1 { /** * accessapproval.organizations.approvalRequests.list * @desc Lists approval requests associated with a project, folder, or organization. Approval requests can be filtered by state (pending, active, dismissed). The order is reverse chronological. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.organizations.approvalRequests.list({ + * // A filter on the type of approval requests to retrieve. Must be one of the + * // following values: + * //
            + * //
          1. [not set]: Requests that are pending or have active approvals.
          2. + * //
          3. ALL: All requests.
          4. + * //
          5. PENDING: Only pending requests.
          6. + * //
          7. ACTIVE: Only active (i.e. currently approved) requests.
          8. + * //
          9. DISMISSED: Only dismissed (including expired) requests.
          10. + * //
          + * filter: 'placeholder-value', + * // Requested page size. + * pageSize: 'placeholder-value', + * // A token identifying the page of results to return. + * pageToken: 'placeholder-value', + * // The parent resource. This may be "projects/{project_id}", + * // "folders/{folder_id}", or "organizations/{organization_id}". + * parent: 'organizations/my-organization', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approvalRequests": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.organizations.approvalRequests.list * @memberOf! () * @@ -1634,6 +2364,44 @@ export namespace accessapproval_v1 { /** * accessapproval.projects.deleteAccessApprovalSettings * @desc Deletes the settings associated with a project, folder, or organization. This will have the effect of disabling Access Approval for the project, folder, or organization, but only if all ancestors also have Access Approval disabled. If Access Approval is enabled at a higher level of the hierarchy, then Access Approval will still be enabled at this level as the settings are inherited. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.projects.deleteAccessApprovalSettings({ + * // Name of the AccessApprovalSettings to delete. + * name: 'projects/my-project/accessApprovalSettings', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.projects.deleteAccessApprovalSettings * @memberOf! () * @@ -1706,6 +2474,49 @@ export namespace accessapproval_v1 { /** * accessapproval.projects.getAccessApprovalSettings * @desc Gets the settings associated with a project, folder, or organization. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.projects.getAccessApprovalSettings({ + * // Name of the AccessApprovalSettings to retrieve. + * name: 'projects/my-project/accessApprovalSettings', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "enrolledAncestor": false, + * // "enrolledServices": [], + * // "name": "my_name", + * // "notificationEmails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.projects.getAccessApprovalSettings * @memberOf! () * @@ -1782,6 +2593,76 @@ export namespace accessapproval_v1 { /** * accessapproval.projects.updateAccessApprovalSettings * @desc Updates the settings associated with a project, folder, or organization. Settings to update are determined by the value of field_mask. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.projects.updateAccessApprovalSettings({ + * // The resource name of the settings. Format is one of: + * //
            + * //
          1. "projects/{project_id}/accessApprovalSettings"
          2. + * //
          3. "folders/{folder_id}/accessApprovalSettings"
          4. + * //
          5. "organizations/{organization_id}/accessApprovalSettings"
          6. + * //
              + * name: 'projects/my-project/accessApprovalSettings', + * // The update mask applies to the settings. Only the top level fields of + * // AccessApprovalSettings (notification_emails & enrolled_services) are + * // supported. For each field, if it is included, the currently stored value + * // will be entirely overwritten with the value of the field passed in this + * // request. + * // + * // For the `FieldMask` definition, see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * // If this field is left unset, only the notification_emails field will be + * // updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "enrolledAncestor": false, + * // "enrolledServices": [], + * // "name": "my_name", + * // "notificationEmails": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "enrolledAncestor": false, + * // "enrolledServices": [], + * // "name": "my_name", + * // "notificationEmails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.projects.updateAccessApprovalSettings * @memberOf! () * @@ -1913,6 +2794,62 @@ export namespace accessapproval_v1 { /** * accessapproval.projects.approvalRequests.approve * @desc Approves a request and returns the updated ApprovalRequest. Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the request exists but is not in a pending state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.projects.approvalRequests.approve({ + * // Name of the approval request to approve. + * name: 'projects/my-project/approvalRequests/my-approvalRequest', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "expireTime": "my_expireTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approve": {}, + * // "dismiss": {}, + * // "name": "my_name", + * // "requestTime": "my_requestTime", + * // "requestedExpiration": "my_requestedExpiration", + * // "requestedLocations": {}, + * // "requestedReason": {}, + * // "requestedResourceName": "my_requestedResourceName", + * // "requestedResourceProperties": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.projects.approvalRequests.approve * @memberOf! () * @@ -1989,6 +2926,60 @@ export namespace accessapproval_v1 { /** * accessapproval.projects.approvalRequests.dismiss * @desc Dismisses a request. Returns the updated ApprovalRequest. NOTE: This does not deny access to the resource if another request has been made and approved. It is equivalent in effect to ignoring the request altogether. Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the request exists but is not in a pending state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.projects.approvalRequests.dismiss({ + * // Name of the ApprovalRequest to dismiss. + * name: 'projects/my-project/approvalRequests/my-approvalRequest', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approve": {}, + * // "dismiss": {}, + * // "name": "my_name", + * // "requestTime": "my_requestTime", + * // "requestedExpiration": "my_requestedExpiration", + * // "requestedLocations": {}, + * // "requestedReason": {}, + * // "requestedResourceName": "my_requestedResourceName", + * // "requestedResourceProperties": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.projects.approvalRequests.dismiss * @memberOf! () * @@ -2065,6 +3056,54 @@ export namespace accessapproval_v1 { /** * accessapproval.projects.approvalRequests.get * @desc Gets an approval request. Returns NOT_FOUND if the request does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.projects.approvalRequests.get({ + * // Name of the approval request to retrieve. + * name: 'projects/my-project/approvalRequests/my-approvalRequest', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approve": {}, + * // "dismiss": {}, + * // "name": "my_name", + * // "requestTime": "my_requestTime", + * // "requestedExpiration": "my_requestedExpiration", + * // "requestedLocations": {}, + * // "requestedReason": {}, + * // "requestedResourceName": "my_requestedResourceName", + * // "requestedResourceProperties": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.projects.approvalRequests.get * @memberOf! () * @@ -2137,6 +3176,62 @@ export namespace accessapproval_v1 { /** * accessapproval.projects.approvalRequests.list * @desc Lists approval requests associated with a project, folder, or organization. Approval requests can be filtered by state (pending, active, dismissed). The order is reverse chronological. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('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/cloud-platform'], + * }); + * + * // 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 accessapproval.projects.approvalRequests.list({ + * // A filter on the type of approval requests to retrieve. Must be one of the + * // following values: + * //
                + * //
              1. [not set]: Requests that are pending or have active approvals.
              2. + * //
              3. ALL: All requests.
              4. + * //
              5. PENDING: Only pending requests.
              6. + * //
              7. ACTIVE: Only active (i.e. currently approved) requests.
              8. + * //
              9. DISMISSED: Only dismissed (including expired) requests.
              10. + * //
              + * filter: 'placeholder-value', + * // Requested page size. + * pageSize: 'placeholder-value', + * // A token identifying the page of results to return. + * pageToken: 'placeholder-value', + * // The parent resource. This may be "projects/{project_id}", + * // "folders/{folder_id}", or "organizations/{organization_id}". + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approvalRequests": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.projects.approvalRequests.list * @memberOf! () * diff --git a/src/apis/accessapproval/v1beta1.ts b/src/apis/accessapproval/v1beta1.ts index acb12f084da..e9334003d08 100644 --- a/src/apis/accessapproval/v1beta1.ts +++ b/src/apis/accessapproval/v1beta1.ts @@ -290,6 +290,44 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.folders.deleteAccessApprovalSettings * @desc Deletes the settings associated with a project, folder, or organization. This will have the effect of disabling Access Approval for the project, folder, or organization, but only if all ancestors also have Access Approval disabled. If Access Approval is enabled at a higher level of the hierarchy, then Access Approval will still be enabled at this level as the settings are inherited. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.folders.deleteAccessApprovalSettings({ + * // Name of the AccessApprovalSettings to delete. + * name: 'folders/my-folder/accessApprovalSettings', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.folders.deleteAccessApprovalSettings * @memberOf! () * @@ -362,6 +400,49 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.folders.getAccessApprovalSettings * @desc Gets the settings associated with a project, folder, or organization. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.folders.getAccessApprovalSettings({ + * // Name of the AccessApprovalSettings to retrieve. + * name: 'folders/my-folder/accessApprovalSettings', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "enrolledAncestor": false, + * // "enrolledServices": [], + * // "name": "my_name", + * // "notificationEmails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.folders.getAccessApprovalSettings * @memberOf! () * @@ -438,6 +519,70 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.folders.updateAccessApprovalSettings * @desc Updates the settings associated with a project, folder, or organization. Settings to update are determined by the value of field_mask. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.folders.updateAccessApprovalSettings({ + * // The resource name of the settings. Format is one of: + * //
                + * //
              1. "projects/{project_id}/accessApprovalSettings"
              2. + * //
              3. "folders/{folder_id}/accessApprovalSettings"
              4. + * //
              5. "organizations/{organization_id}/accessApprovalSettings"
              6. + * //
                  + * name: 'folders/my-folder/accessApprovalSettings', + * // For the `FieldMask` definition, see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * // If this field is left unset, only the notification_emails field will be + * // updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "enrolledAncestor": false, + * // "enrolledServices": [], + * // "name": "my_name", + * // "notificationEmails": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "enrolledAncestor": false, + * // "enrolledServices": [], + * // "name": "my_name", + * // "notificationEmails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.folders.updateAccessApprovalSettings * @memberOf! () * @@ -569,6 +714,62 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.folders.approvalRequests.approve * @desc Approves a request and returns the updated ApprovalRequest. Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the request exists but is not in a pending state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.folders.approvalRequests.approve({ + * // Name of the approval request to approve. + * name: 'folders/my-folder/approvalRequests/my-approvalRequest', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "expireTime": "my_expireTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approve": {}, + * // "dismiss": {}, + * // "name": "my_name", + * // "requestTime": "my_requestTime", + * // "requestedExpiration": "my_requestedExpiration", + * // "requestedLocations": {}, + * // "requestedReason": {}, + * // "requestedResourceName": "my_requestedResourceName", + * // "requestedResourceProperties": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.folders.approvalRequests.approve * @memberOf! () * @@ -645,6 +846,60 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.folders.approvalRequests.dismiss * @desc Dismisses a request. Returns the updated ApprovalRequest. NOTE: This does not deny access to the resource if another request has been made and approved. It is equivalent in effect to ignoring the request altogether. Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the request exists but is not in a pending state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.folders.approvalRequests.dismiss({ + * // Name of the ApprovalRequest to dismiss. + * name: 'folders/my-folder/approvalRequests/my-approvalRequest', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approve": {}, + * // "dismiss": {}, + * // "name": "my_name", + * // "requestTime": "my_requestTime", + * // "requestedExpiration": "my_requestedExpiration", + * // "requestedLocations": {}, + * // "requestedReason": {}, + * // "requestedResourceName": "my_requestedResourceName", + * // "requestedResourceProperties": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.folders.approvalRequests.dismiss * @memberOf! () * @@ -721,6 +976,54 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.folders.approvalRequests.get * @desc Gets an approval request. Returns NOT_FOUND if the request does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.folders.approvalRequests.get({ + * // Name of the approval request to retrieve. + * name: 'folders/my-folder/approvalRequests/my-approvalRequest', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approve": {}, + * // "dismiss": {}, + * // "name": "my_name", + * // "requestTime": "my_requestTime", + * // "requestedExpiration": "my_requestedExpiration", + * // "requestedLocations": {}, + * // "requestedReason": {}, + * // "requestedResourceName": "my_requestedResourceName", + * // "requestedResourceProperties": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.folders.approvalRequests.get * @memberOf! () * @@ -793,6 +1096,62 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.folders.approvalRequests.list * @desc Lists approval requests associated with a project, folder, or organization. Approval requests can be filtered by state (pending, active, dismissed). The order is reverse chronological. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.folders.approvalRequests.list({ + * // A filter on the type of approval requests to retrieve. Must be one of the + * // following values: + * //
                    + * //
                  1. [not set]: Requests that are pending or have active approvals.
                  2. + * //
                  3. ALL: All requests.
                  4. + * //
                  5. PENDING: Only pending requests.
                  6. + * //
                  7. ACTIVE: Only active (i.e. currently approved) requests.
                  8. + * //
                  9. DISMISSED: Only dismissed (including expired) requests.
                  10. + * //
                  + * filter: 'placeholder-value', + * // Requested page size. + * pageSize: 'placeholder-value', + * // A token identifying the page of results to return. + * pageToken: 'placeholder-value', + * // The parent resource. This may be "projects/{project_id}", + * // "folders/{folder_id}", or "organizations/{organization_id}". + * parent: 'folders/my-folder', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approvalRequests": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.folders.approvalRequests.list * @memberOf! () * @@ -962,6 +1321,44 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.organizations.deleteAccessApprovalSettings * @desc Deletes the settings associated with a project, folder, or organization. This will have the effect of disabling Access Approval for the project, folder, or organization, but only if all ancestors also have Access Approval disabled. If Access Approval is enabled at a higher level of the hierarchy, then Access Approval will still be enabled at this level as the settings are inherited. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.organizations.deleteAccessApprovalSettings({ + * // Name of the AccessApprovalSettings to delete. + * name: 'organizations/my-organization/accessApprovalSettings', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.organizations.deleteAccessApprovalSettings * @memberOf! () * @@ -1034,6 +1431,49 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.organizations.getAccessApprovalSettings * @desc Gets the settings associated with a project, folder, or organization. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.organizations.getAccessApprovalSettings({ + * // Name of the AccessApprovalSettings to retrieve. + * name: 'organizations/my-organization/accessApprovalSettings', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "enrolledAncestor": false, + * // "enrolledServices": [], + * // "name": "my_name", + * // "notificationEmails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.organizations.getAccessApprovalSettings * @memberOf! () * @@ -1110,6 +1550,70 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.organizations.updateAccessApprovalSettings * @desc Updates the settings associated with a project, folder, or organization. Settings to update are determined by the value of field_mask. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.organizations.updateAccessApprovalSettings({ + * // The resource name of the settings. Format is one of: + * //
                    + * //
                  1. "projects/{project_id}/accessApprovalSettings"
                  2. + * //
                  3. "folders/{folder_id}/accessApprovalSettings"
                  4. + * //
                  5. "organizations/{organization_id}/accessApprovalSettings"
                  6. + * //
                      + * name: 'organizations/my-organization/accessApprovalSettings', + * // For the `FieldMask` definition, see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * // If this field is left unset, only the notification_emails field will be + * // updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "enrolledAncestor": false, + * // "enrolledServices": [], + * // "name": "my_name", + * // "notificationEmails": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "enrolledAncestor": false, + * // "enrolledServices": [], + * // "name": "my_name", + * // "notificationEmails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.organizations.updateAccessApprovalSettings * @memberOf! () * @@ -1241,6 +1745,62 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.organizations.approvalRequests.approve * @desc Approves a request and returns the updated ApprovalRequest. Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the request exists but is not in a pending state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.organizations.approvalRequests.approve({ + * // Name of the approval request to approve. + * name: 'organizations/my-organization/approvalRequests/my-approvalRequest', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "expireTime": "my_expireTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approve": {}, + * // "dismiss": {}, + * // "name": "my_name", + * // "requestTime": "my_requestTime", + * // "requestedExpiration": "my_requestedExpiration", + * // "requestedLocations": {}, + * // "requestedReason": {}, + * // "requestedResourceName": "my_requestedResourceName", + * // "requestedResourceProperties": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.organizations.approvalRequests.approve * @memberOf! () * @@ -1317,6 +1877,60 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.organizations.approvalRequests.dismiss * @desc Dismisses a request. Returns the updated ApprovalRequest. NOTE: This does not deny access to the resource if another request has been made and approved. It is equivalent in effect to ignoring the request altogether. Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the request exists but is not in a pending state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.organizations.approvalRequests.dismiss({ + * // Name of the ApprovalRequest to dismiss. + * name: 'organizations/my-organization/approvalRequests/my-approvalRequest', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approve": {}, + * // "dismiss": {}, + * // "name": "my_name", + * // "requestTime": "my_requestTime", + * // "requestedExpiration": "my_requestedExpiration", + * // "requestedLocations": {}, + * // "requestedReason": {}, + * // "requestedResourceName": "my_requestedResourceName", + * // "requestedResourceProperties": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.organizations.approvalRequests.dismiss * @memberOf! () * @@ -1393,6 +2007,54 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.organizations.approvalRequests.get * @desc Gets an approval request. Returns NOT_FOUND if the request does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.organizations.approvalRequests.get({ + * // Name of the approval request to retrieve. + * name: 'organizations/my-organization/approvalRequests/my-approvalRequest', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approve": {}, + * // "dismiss": {}, + * // "name": "my_name", + * // "requestTime": "my_requestTime", + * // "requestedExpiration": "my_requestedExpiration", + * // "requestedLocations": {}, + * // "requestedReason": {}, + * // "requestedResourceName": "my_requestedResourceName", + * // "requestedResourceProperties": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.organizations.approvalRequests.get * @memberOf! () * @@ -1465,6 +2127,62 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.organizations.approvalRequests.list * @desc Lists approval requests associated with a project, folder, or organization. Approval requests can be filtered by state (pending, active, dismissed). The order is reverse chronological. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.organizations.approvalRequests.list({ + * // A filter on the type of approval requests to retrieve. Must be one of the + * // following values: + * //
                        + * //
                      1. [not set]: Requests that are pending or have active approvals.
                      2. + * //
                      3. ALL: All requests.
                      4. + * //
                      5. PENDING: Only pending requests.
                      6. + * //
                      7. ACTIVE: Only active (i.e. currently approved) requests.
                      8. + * //
                      9. DISMISSED: Only dismissed (including expired) requests.
                      10. + * //
                      + * filter: 'placeholder-value', + * // Requested page size. + * pageSize: 'placeholder-value', + * // A token identifying the page of results to return. + * pageToken: 'placeholder-value', + * // The parent resource. This may be "projects/{project_id}", + * // "folders/{folder_id}", or "organizations/{organization_id}". + * parent: 'organizations/my-organization', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approvalRequests": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.organizations.approvalRequests.list * @memberOf! () * @@ -1634,6 +2352,44 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.projects.deleteAccessApprovalSettings * @desc Deletes the settings associated with a project, folder, or organization. This will have the effect of disabling Access Approval for the project, folder, or organization, but only if all ancestors also have Access Approval disabled. If Access Approval is enabled at a higher level of the hierarchy, then Access Approval will still be enabled at this level as the settings are inherited. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.projects.deleteAccessApprovalSettings({ + * // Name of the AccessApprovalSettings to delete. + * name: 'projects/my-project/accessApprovalSettings', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.projects.deleteAccessApprovalSettings * @memberOf! () * @@ -1706,6 +2462,49 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.projects.getAccessApprovalSettings * @desc Gets the settings associated with a project, folder, or organization. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.projects.getAccessApprovalSettings({ + * // Name of the AccessApprovalSettings to retrieve. + * name: 'projects/my-project/accessApprovalSettings', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "enrolledAncestor": false, + * // "enrolledServices": [], + * // "name": "my_name", + * // "notificationEmails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.projects.getAccessApprovalSettings * @memberOf! () * @@ -1782,6 +2581,70 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.projects.updateAccessApprovalSettings * @desc Updates the settings associated with a project, folder, or organization. Settings to update are determined by the value of field_mask. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.projects.updateAccessApprovalSettings({ + * // The resource name of the settings. Format is one of: + * //
                        + * //
                      1. "projects/{project_id}/accessApprovalSettings"
                      2. + * //
                      3. "folders/{folder_id}/accessApprovalSettings"
                      4. + * //
                      5. "organizations/{organization_id}/accessApprovalSettings"
                      6. + * //
                          + * name: 'projects/my-project/accessApprovalSettings', + * // For the `FieldMask` definition, see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * // If this field is left unset, only the notification_emails field will be + * // updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "enrolledAncestor": false, + * // "enrolledServices": [], + * // "name": "my_name", + * // "notificationEmails": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "enrolledAncestor": false, + * // "enrolledServices": [], + * // "name": "my_name", + * // "notificationEmails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.projects.updateAccessApprovalSettings * @memberOf! () * @@ -1913,6 +2776,62 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.projects.approvalRequests.approve * @desc Approves a request and returns the updated ApprovalRequest. Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the request exists but is not in a pending state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.projects.approvalRequests.approve({ + * // Name of the approval request to approve. + * name: 'projects/my-project/approvalRequests/my-approvalRequest', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "expireTime": "my_expireTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approve": {}, + * // "dismiss": {}, + * // "name": "my_name", + * // "requestTime": "my_requestTime", + * // "requestedExpiration": "my_requestedExpiration", + * // "requestedLocations": {}, + * // "requestedReason": {}, + * // "requestedResourceName": "my_requestedResourceName", + * // "requestedResourceProperties": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.projects.approvalRequests.approve * @memberOf! () * @@ -1989,6 +2908,60 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.projects.approvalRequests.dismiss * @desc Dismisses a request. Returns the updated ApprovalRequest. NOTE: This does not deny access to the resource if another request has been made and approved. It is equivalent in effect to ignoring the request altogether. Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the request exists but is not in a pending state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.projects.approvalRequests.dismiss({ + * // Name of the ApprovalRequest to dismiss. + * name: 'projects/my-project/approvalRequests/my-approvalRequest', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approve": {}, + * // "dismiss": {}, + * // "name": "my_name", + * // "requestTime": "my_requestTime", + * // "requestedExpiration": "my_requestedExpiration", + * // "requestedLocations": {}, + * // "requestedReason": {}, + * // "requestedResourceName": "my_requestedResourceName", + * // "requestedResourceProperties": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.projects.approvalRequests.dismiss * @memberOf! () * @@ -2065,6 +3038,54 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.projects.approvalRequests.get * @desc Gets an approval request. Returns NOT_FOUND if the request does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.projects.approvalRequests.get({ + * // Name of the approval request to retrieve. + * name: 'projects/my-project/approvalRequests/my-approvalRequest', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approve": {}, + * // "dismiss": {}, + * // "name": "my_name", + * // "requestTime": "my_requestTime", + * // "requestedExpiration": "my_requestedExpiration", + * // "requestedLocations": {}, + * // "requestedReason": {}, + * // "requestedResourceName": "my_requestedResourceName", + * // "requestedResourceProperties": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.projects.approvalRequests.get * @memberOf! () * @@ -2137,6 +3158,62 @@ export namespace accessapproval_v1beta1 { /** * accessapproval.projects.approvalRequests.list * @desc Lists approval requests associated with a project, folder, or organization. Approval requests can be filtered by state (pending, active, dismissed). The order is reverse chronological. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accessapproval.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 accessapproval = google.accessapproval('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accessapproval.projects.approvalRequests.list({ + * // A filter on the type of approval requests to retrieve. Must be one of the + * // following values: + * //
                            + * //
                          1. [not set]: Requests that are pending or have active approvals.
                          2. + * //
                          3. ALL: All requests.
                          4. + * //
                          5. PENDING: Only pending requests.
                          6. + * //
                          7. ACTIVE: Only active (i.e. currently approved) requests.
                          8. + * //
                          9. DISMISSED: Only dismissed (including expired) requests.
                          10. + * //
                          + * filter: 'placeholder-value', + * // Requested page size. + * pageSize: 'placeholder-value', + * // A token identifying the page of results to return. + * pageToken: 'placeholder-value', + * // The parent resource. This may be "projects/{project_id}", + * // "folders/{folder_id}", or "organizations/{organization_id}". + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approvalRequests": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accessapproval.projects.approvalRequests.list * @memberOf! () * diff --git a/src/apis/accesscontextmanager/v1.ts b/src/apis/accesscontextmanager/v1.ts index 6c0aaa1ce49..cb2cfe7ed38 100644 --- a/src/apis/accesscontextmanager/v1.ts +++ b/src/apis/accesscontextmanager/v1.ts @@ -528,6 +528,58 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.accessPolicies.create * @desc Create an `AccessPolicy`. Fails if this organization already has a `AccessPolicy`. The longrunning Operation will have a successful status once the `AccessPolicy` has propagated to long-lasting storage. Syntactic and basic semantic errors will be returned in `metadata` as a BadRequest proto. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "name": "my_name", + * // "parent": "my_parent", + * // "title": "my_title" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.create * @memberOf! () * @@ -600,6 +652,52 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.accessPolicies.delete * @desc Delete an AccessPolicy by resource name. The longrunning Operation will have a successful status once the AccessPolicy has been removed from long-lasting storage. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.delete({ + * // Required. Resource name for the access policy to delete. + * // + * // Format `accessPolicies/{policy_id}` + * name: 'accessPolicies/my-accessPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.delete * @memberOf! () * @@ -672,6 +770,51 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.accessPolicies.get * @desc Get an AccessPolicy by name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.get({ + * // Required. Resource name for the access policy to get. + * // + * // Format `accessPolicies/{policy_id}` + * name: 'accessPolicies/my-accessPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "name": "my_name", + * // "parent": "my_parent", + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.get * @memberOf! () * @@ -744,6 +887,56 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.accessPolicies.list * @desc List all AccessPolicies under a container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.list({ + * // Number of AccessPolicy instances to include in the list. Default 100. + * pageSize: 'placeholder-value', + * // Next page token for the next batch of AccessPolicy instances. Defaults to + * // the first page of results. + * pageToken: 'placeholder-value', + * // Required. Resource name for the container to list AccessPolicy instances + * // from. + * // + * // Format: + * // `organizations/{org_id}` + * parent: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accessPolicies": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.list * @memberOf! () * @@ -825,6 +1018,64 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.accessPolicies.patch * @desc Update an AccessPolicy. The longrunning Operation from this RPC will have a successful status once the changes to the AccessPolicy have propagated to long-lasting storage. Syntactic and basic semantic errors will be returned in `metadata` as a BadRequest proto. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.patch({ + * // Output only. Resource name of the `AccessPolicy`. Format: + * // `accessPolicies/{policy_id}` + * name: 'accessPolicies/my-accessPolicie', + * // Required. Mask to control which fields get updated. Must be non-empty. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "name": "my_name", + * // "parent": "my_parent", + * // "title": "my_title" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.patch * @memberOf! () * @@ -984,6 +1235,65 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.accessPolicies.accessLevels.create * @desc Create an Access Level. The longrunning operation from this RPC will have a successful status once the Access Level has propagated to long-lasting storage. Access Levels containing errors will result in an error response for the first error encountered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.accessLevels.create({ + * // Required. Resource name for the access policy which owns this Access + * // Level. + * // + * // Format: `accessPolicies/{policy_id}` + * parent: 'accessPolicies/my-accessPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "basic": {}, + * // "custom": {}, + * // "description": "my_description", + * // "name": "my_name", + * // "title": "my_title" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.accessLevels.create * @memberOf! () * @@ -1060,6 +1370,53 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.accessPolicies.accessLevels.delete * @desc Delete an Access Level by resource name. The longrunning operation from this RPC will have a successful status once the Access Level has been removed from long-lasting storage. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.accessLevels.delete({ + * // Required. Resource name for the Access Level. + * // + * // Format: + * // `accessPolicies/{policy_id}/accessLevels/{access_level_id}` + * name: 'accessPolicies/my-accessPolicie/accessLevels/my-accessLevel', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.accessLevels.delete * @memberOf! () * @@ -1132,6 +1489,61 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.accessPolicies.accessLevels.get * @desc Get an Access Level by resource name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.accessLevels.get({ + * // Whether to return `BasicLevels` in the Cloud Common Expression + * // Language rather than as `BasicLevels`. Defaults to AS_DEFINED, where + * // Access Levels + * // are returned as `BasicLevels` or `CustomLevels` based on how they were + * // created. If set to CEL, all Access Levels are returned as + * // `CustomLevels`. In the CEL case, `BasicLevels` are translated to equivalent + * // `CustomLevels`. + * accessLevelFormat: 'placeholder-value', + * // Required. Resource name for the Access Level. + * // + * // Format: + * // `accessPolicies/{policy_id}/accessLevels/{access_level_id}` + * name: 'accessPolicies/my-accessPolicie/accessLevels/my-accessLevel', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "basic": {}, + * // "custom": {}, + * // "description": "my_description", + * // "name": "my_name", + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.accessLevels.get * @memberOf! () * @@ -1205,6 +1617,60 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.accessPolicies.accessLevels.list * @desc List all Access Levels for an access policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.accessLevels.list({ + * // Whether to return `BasicLevels` in the Cloud Common Expression language, as + * // `CustomLevels`, rather than as `BasicLevels`. Defaults to returning + * // `AccessLevels` in the format they were defined. + * accessLevelFormat: 'placeholder-value', + * // Number of Access Levels to include in + * // the list. Default 100. + * pageSize: 'placeholder-value', + * // Next page token for the next batch of Access Level instances. + * // Defaults to the first page of results. + * pageToken: 'placeholder-value', + * // Required. Resource name for the access policy to list Access Levels from. + * // + * // Format: + * // `accessPolicies/{policy_id}` + * parent: 'accessPolicies/my-accessPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accessLevels": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.accessLevels.list * @memberOf! () * @@ -1285,6 +1751,67 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.accessPolicies.accessLevels.patch * @desc Update an Access Level. The longrunning operation from this RPC will have a successful status once the changes to the Access Level have propagated to long-lasting storage. Access Levels containing errors will result in an error response for the first error encountered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.accessLevels.patch({ + * // Required. Resource name for the Access Level. The `short_name` component + * // must begin with a letter and only include alphanumeric and '_'. Format: + * // `accessPolicies/{policy_id}/accessLevels/{short_name}`. The maximum length + * // of the `short_name` component is 50 characters. + * name: 'accessPolicies/my-accessPolicie/accessLevels/my-accessLevel', + * // Required. Mask to control which fields get updated. Must be non-empty. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "basic": {}, + * // "custom": {}, + * // "description": "my_description", + * // "name": "my_name", + * // "title": "my_title" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.accessLevels.patch * @memberOf! () * @@ -1359,6 +1886,64 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.accessPolicies.accessLevels.replaceAll * @desc Replace all existing Access Levels in an Access Policy with the Access Levels provided. This is done atomically. The longrunning operation from this RPC will have a successful status once all replacements have propagated to long-lasting storage. Replacements containing errors will result in an error response for the first error encountered. Replacement will be cancelled on error, existing Access Levels will not be affected. Operation.response field will contain ReplaceAccessLevelsResponse. Removing Access Levels contained in existing Service Perimeters will result in error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.accessLevels.replaceAll( + * { + * // Required. Resource name for the access policy which owns these + * // Access Levels. + * // + * // Format: `accessPolicies/{policy_id}` + * parent: 'accessPolicies/my-accessPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accessLevels": [], + * // "etag": "my_etag" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.accessLevels.replaceAll * @memberOf! () * @@ -1550,6 +2135,64 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.accessPolicies.servicePerimeters.commit * @desc Commit the dry-run spec for all the Service Perimeters in an Access Policy. A commit operation on a Service Perimeter involves copying its `spec` field to that Service Perimeter's `status` field. Only Service Perimeters with `use_explicit_dry_run_spec` field set to true are affected by a commit operation. The longrunning operation from this RPC will have a successful status once the dry-run specs for all the Service Perimeters have been committed. If a commit fails, it will cause the longrunning operation to return an error response and the entire commit operation will be cancelled. When successful, Operation.response field will contain CommitServicePerimetersResponse. The `dry_run` and the `spec` fields will be cleared after a successful commit operation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.servicePerimeters.commit( + * { + * // Required. Resource name for the parent Access Policy which owns all + * // Service Perimeters in scope for + * // the commit operation. + * // + * // Format: `accessPolicies/{policy_id}` + * parent: 'accessPolicies/my-accessPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.servicePerimeters.commit * @memberOf! () * @@ -1626,6 +2269,69 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.accessPolicies.servicePerimeters.create * @desc Create a Service Perimeter. The longrunning operation from this RPC will have a successful status once the Service Perimeter has propagated to long-lasting storage. Service Perimeters containing errors will result in an error response for the first error encountered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.servicePerimeters.create( + * { + * // Required. Resource name for the access policy which owns this Service + * // Perimeter. + * // + * // Format: `accessPolicies/{policy_id}` + * parent: 'accessPolicies/my-accessPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "perimeterType": "my_perimeterType", + * // "spec": {}, + * // "status": {}, + * // "title": "my_title", + * // "useExplicitDryRunSpec": false + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.servicePerimeters.create * @memberOf! () * @@ -1702,6 +2408,56 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.accessPolicies.servicePerimeters.delete * @desc Delete a Service Perimeter by resource name. The longrunning operation from this RPC will have a successful status once the Service Perimeter has been removed from long-lasting storage. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.servicePerimeters.delete( + * { + * // Required. Resource name for the Service Perimeter. + * // + * // Format: + * // `accessPolicies/{policy_id}/servicePerimeters/{service_perimeter_id}` + * name: + * 'accessPolicies/my-accessPolicie/servicePerimeters/my-servicePerimeter', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.servicePerimeters.delete * @memberOf! () * @@ -1774,6 +2530,56 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.accessPolicies.servicePerimeters.get * @desc Get a Service Perimeter by resource name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.servicePerimeters.get({ + * // Required. Resource name for the Service Perimeter. + * // + * // Format: + * // `accessPolicies/{policy_id}/servicePerimeters/{service_perimeters_id}` + * name: + * 'accessPolicies/my-accessPolicie/servicePerimeters/my-servicePerimeter', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "perimeterType": "my_perimeterType", + * // "spec": {}, + * // "status": {}, + * // "title": "my_title", + * // "useExplicitDryRunSpec": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.servicePerimeters.get * @memberOf! () * @@ -1846,6 +2652,56 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.accessPolicies.servicePerimeters.list * @desc List all Service Perimeters for an access policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.servicePerimeters.list({ + * // Number of Service Perimeters to include + * // in the list. Default 100. + * pageSize: 'placeholder-value', + * // Next page token for the next batch of Service Perimeter instances. + * // Defaults to the first page of results. + * pageToken: 'placeholder-value', + * // Required. Resource name for the access policy to list Service Perimeters from. + * // + * // Format: + * // `accessPolicies/{policy_id}` + * parent: 'accessPolicies/my-accessPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "servicePerimeters": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.servicePerimeters.list * @memberOf! () * @@ -1932,6 +2788,71 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.accessPolicies.servicePerimeters.patch * @desc Update a Service Perimeter. The longrunning operation from this RPC will have a successful status once the changes to the Service Perimeter have propagated to long-lasting storage. Service Perimeter containing errors will result in an error response for the first error encountered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.servicePerimeters.patch( + * { + * // Required. Resource name for the ServicePerimeter. The `short_name` + * // component must begin with a letter and only include alphanumeric and '_'. + * // Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}` + * name: + * 'accessPolicies/my-accessPolicie/servicePerimeters/my-servicePerimeter', + * // Required. Mask to control which fields get updated. Must be non-empty. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "perimeterType": "my_perimeterType", + * // "spec": {}, + * // "status": {}, + * // "title": "my_title", + * // "useExplicitDryRunSpec": false + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.servicePerimeters.patch * @memberOf! () * @@ -2006,6 +2927,64 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.accessPolicies.servicePerimeters.replaceAll * @desc Replace all existing Service Perimeters in an Access Policy with the Service Perimeters provided. This is done atomically. The longrunning operation from this RPC will have a successful status once all replacements have propagated to long-lasting storage. Replacements containing errors will result in an error response for the first error encountered. Replacement will be cancelled on error, existing Service Perimeters will not be affected. Operation.response field will contain ReplaceServicePerimetersResponse. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.servicePerimeters.replaceAll( + * { + * // Required. Resource name for the access policy which owns these + * // Service Perimeters. + * // + * // Format: `accessPolicies/{policy_id}` + * parent: 'accessPolicies/my-accessPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "servicePerimeters": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.servicePerimeters.replaceAll * @memberOf! () * @@ -2205,6 +3184,50 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'operations/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.operations.cancel * @memberOf! () * @@ -2276,6 +3299,44 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'operations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.operations.delete * @memberOf! () * @@ -2346,6 +3407,50 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.operations.get({ + * // The name of the operation resource. + * name: 'operations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.operations.get * @memberOf! () * @@ -2417,6 +3522,53 @@ export namespace accesscontextmanager_v1 { /** * accesscontextmanager.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.operations.list * @memberOf! () * diff --git a/src/apis/accesscontextmanager/v1beta.ts b/src/apis/accesscontextmanager/v1beta.ts index 58aa62c5a89..90420e67df5 100644 --- a/src/apis/accesscontextmanager/v1beta.ts +++ b/src/apis/accesscontextmanager/v1beta.ts @@ -437,6 +437,57 @@ export namespace accesscontextmanager_v1beta { /** * accesscontextmanager.accessPolicies.create * @desc Create an `AccessPolicy`. Fails if this organization already has a `AccessPolicy`. The longrunning Operation will have a successful status once the `AccessPolicy` has propagated to long-lasting storage. Syntactic and basic semantic errors will be returned in `metadata` as a BadRequest proto. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name", + * // "parent": "my_parent", + * // "title": "my_title" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.create * @memberOf! () * @@ -512,6 +563,52 @@ export namespace accesscontextmanager_v1beta { /** * accesscontextmanager.accessPolicies.delete * @desc Delete an AccessPolicy by resource name. The longrunning Operation will have a successful status once the AccessPolicy has been removed from long-lasting storage. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.delete({ + * // Required. Resource name for the access policy to delete. + * // + * // Format `accessPolicies/{policy_id}` + * name: 'accessPolicies/my-accessPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.delete * @memberOf! () * @@ -584,6 +681,50 @@ export namespace accesscontextmanager_v1beta { /** * accesscontextmanager.accessPolicies.get * @desc Get an AccessPolicy by name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.get({ + * // Required. Resource name for the access policy to get. + * // + * // Format `accessPolicies/{policy_id}` + * name: 'accessPolicies/my-accessPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "parent": "my_parent", + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.get * @memberOf! () * @@ -656,6 +797,56 @@ export namespace accesscontextmanager_v1beta { /** * accesscontextmanager.accessPolicies.list * @desc List all AccessPolicies under a container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.list({ + * // Number of AccessPolicy instances to include in the list. Default 100. + * pageSize: 'placeholder-value', + * // Next page token for the next batch of AccessPolicy instances. Defaults to + * // the first page of results. + * pageToken: 'placeholder-value', + * // Required. Resource name for the container to list AccessPolicy instances + * // from. + * // + * // Format: + * // `organizations/{org_id}` + * parent: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accessPolicies": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.list * @memberOf! () * @@ -740,6 +931,63 @@ export namespace accesscontextmanager_v1beta { /** * accesscontextmanager.accessPolicies.patch * @desc Update an AccessPolicy. The longrunning Operation from this RPC will have a successful status once the changes to the AccessPolicy have propagated to long-lasting storage. Syntactic and basic semantic errors will be returned in `metadata` as a BadRequest proto. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.patch({ + * // Output only. Resource name of the `AccessPolicy`. Format: + * // `accessPolicies/{policy_id}` + * name: 'accessPolicies/my-accessPolicie', + * // Required. Mask to control which fields get updated. Must be non-empty. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name", + * // "parent": "my_parent", + * // "title": "my_title" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.patch * @memberOf! () * @@ -899,6 +1147,65 @@ export namespace accesscontextmanager_v1beta { /** * accesscontextmanager.accessPolicies.accessLevels.create * @desc Create an Access Level. The longrunning operation from this RPC will have a successful status once the Access Level has propagated to long-lasting storage. Access Levels containing errors will result in an error response for the first error encountered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.accessLevels.create({ + * // Required. Resource name for the access policy which owns this Access + * // Level. + * // + * // Format: `accessPolicies/{policy_id}` + * parent: 'accessPolicies/my-accessPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "basic": {}, + * // "custom": {}, + * // "description": "my_description", + * // "name": "my_name", + * // "title": "my_title" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.accessLevels.create * @memberOf! () * @@ -975,6 +1282,53 @@ export namespace accesscontextmanager_v1beta { /** * accesscontextmanager.accessPolicies.accessLevels.delete * @desc Delete an Access Level by resource name. The longrunning operation from this RPC will have a successful status once the Access Level has been removed from long-lasting storage. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.accessLevels.delete({ + * // Required. Resource name for the Access Level. + * // + * // Format: + * // `accessPolicies/{policy_id}/accessLevels/{access_level_id}` + * name: 'accessPolicies/my-accessPolicie/accessLevels/my-accessLevel', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.accessLevels.delete * @memberOf! () * @@ -1047,6 +1401,61 @@ export namespace accesscontextmanager_v1beta { /** * accesscontextmanager.accessPolicies.accessLevels.get * @desc Get an Access Level by resource name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.accessLevels.get({ + * // Whether to return `BasicLevels` in the Cloud Common Expression + * // Language rather than as `BasicLevels`. Defaults to AS_DEFINED, where + * // Access Levels + * // are returned as `BasicLevels` or `CustomLevels` based on how they were + * // created. If set to CEL, all Access Levels are returned as + * // `CustomLevels`. In the CEL case, `BasicLevels` are translated to equivalent + * // `CustomLevels`. + * accessLevelFormat: 'placeholder-value', + * // Required. Resource name for the Access Level. + * // + * // Format: + * // `accessPolicies/{policy_id}/accessLevels/{access_level_id}` + * name: 'accessPolicies/my-accessPolicie/accessLevels/my-accessLevel', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "basic": {}, + * // "custom": {}, + * // "description": "my_description", + * // "name": "my_name", + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.accessLevels.get * @memberOf! () * @@ -1120,6 +1529,60 @@ export namespace accesscontextmanager_v1beta { /** * accesscontextmanager.accessPolicies.accessLevels.list * @desc List all Access Levels for an access policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.accessLevels.list({ + * // Whether to return `BasicLevels` in the Cloud Common Expression language, as + * // `CustomLevels`, rather than as `BasicLevels`. Defaults to returning + * // `AccessLevels` in the format they were defined. + * accessLevelFormat: 'placeholder-value', + * // Number of Access Levels to include in + * // the list. Default 100. + * pageSize: 'placeholder-value', + * // Next page token for the next batch of Access Level instances. + * // Defaults to the first page of results. + * pageToken: 'placeholder-value', + * // Required. Resource name for the access policy to list Access Levels from. + * // + * // Format: + * // `accessPolicies/{policy_id}` + * parent: 'accessPolicies/my-accessPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accessLevels": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.accessLevels.list * @memberOf! () * @@ -1200,6 +1663,67 @@ export namespace accesscontextmanager_v1beta { /** * accesscontextmanager.accessPolicies.accessLevels.patch * @desc Update an Access Level. The longrunning operation from this RPC will have a successful status once the changes to the Access Level have propagated to long-lasting storage. Access Levels containing errors will result in an error response for the first error encountered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.accessLevels.patch({ + * // Required. Resource name for the Access Level. The `short_name` component + * // must begin with a letter and only include alphanumeric and '_'. Format: + * // `accessPolicies/{policy_id}/accessLevels/{short_name}`. The maximum length + * // // of the `short_name` component is 50 characters. + * name: 'accessPolicies/my-accessPolicie/accessLevels/my-accessLevel', + * // Required. Mask to control which fields get updated. Must be non-empty. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "basic": {}, + * // "custom": {}, + * // "description": "my_description", + * // "name": "my_name", + * // "title": "my_title" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.accessLevels.patch * @memberOf! () * @@ -1372,6 +1896,67 @@ export namespace accesscontextmanager_v1beta { /** * accesscontextmanager.accessPolicies.servicePerimeters.create * @desc Create a Service Perimeter. The longrunning operation from this RPC will have a successful status once the Service Perimeter has propagated to long-lasting storage. Service Perimeters containing errors will result in an error response for the first error encountered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.servicePerimeters.create( + * { + * // Required. Resource name for the access policy which owns this Service + * // Perimeter. + * // + * // Format: `accessPolicies/{policy_id}` + * parent: 'accessPolicies/my-accessPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "perimeterType": "my_perimeterType", + * // "status": {}, + * // "title": "my_title" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.servicePerimeters.create * @memberOf! () * @@ -1448,6 +2033,56 @@ export namespace accesscontextmanager_v1beta { /** * accesscontextmanager.accessPolicies.servicePerimeters.delete * @desc Delete a Service Perimeter by resource name. The longrunning operation from this RPC will have a successful status once the Service Perimeter has been removed from long-lasting storage. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.servicePerimeters.delete( + * { + * // Required. Resource name for the Service Perimeter. + * // + * // Format: + * // `accessPolicies/{policy_id}/servicePerimeters/{service_perimeter_id}` + * name: + * 'accessPolicies/my-accessPolicie/servicePerimeters/my-servicePerimeter', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.servicePerimeters.delete * @memberOf! () * @@ -1520,6 +2155,54 @@ export namespace accesscontextmanager_v1beta { /** * accesscontextmanager.accessPolicies.servicePerimeters.get * @desc Get a Service Perimeter by resource name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.servicePerimeters.get({ + * // Required. Resource name for the Service Perimeter. + * // + * // Format: + * // `accessPolicies/{policy_id}/servicePerimeters/{service_perimeters_id}` + * name: + * 'accessPolicies/my-accessPolicie/servicePerimeters/my-servicePerimeter', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "perimeterType": "my_perimeterType", + * // "status": {}, + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.servicePerimeters.get * @memberOf! () * @@ -1592,6 +2275,56 @@ export namespace accesscontextmanager_v1beta { /** * accesscontextmanager.accessPolicies.servicePerimeters.list * @desc List all Service Perimeters for an access policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.servicePerimeters.list({ + * // Number of Service Perimeters to include + * // in the list. Default 100. + * pageSize: 'placeholder-value', + * // Next page token for the next batch of Service Perimeter instances. + * // Defaults to the first page of results. + * pageToken: 'placeholder-value', + * // Required. Resource name for the access policy to list Service Perimeters from. + * // + * // Format: + * // `accessPolicies/{policy_id}` + * parent: 'accessPolicies/my-accessPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "servicePerimeters": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.servicePerimeters.list * @memberOf! () * @@ -1678,6 +2411,69 @@ export namespace accesscontextmanager_v1beta { /** * accesscontextmanager.accessPolicies.servicePerimeters.patch * @desc Update a Service Perimeter. The longrunning operation from this RPC will have a successful status once the changes to the Service Perimeter have propagated to long-lasting storage. Service Perimeter containing errors will result in an error response for the first error encountered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.accessPolicies.servicePerimeters.patch( + * { + * // Required. Resource name for the ServicePerimeter. The `short_name` + * // component must begin with a letter and only include alphanumeric and '_'. + * // Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}` + * name: + * 'accessPolicies/my-accessPolicie/servicePerimeters/my-servicePerimeter', + * // Required. Mask to control which fields get updated. Must be non-empty. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "perimeterType": "my_perimeterType", + * // "status": {}, + * // "title": "my_title" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.accessPolicies.servicePerimeters.patch * @memberOf! () * @@ -1842,6 +2638,50 @@ export namespace accesscontextmanager_v1beta { /** * accesscontextmanager.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/accesscontextmanager.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 accesscontextmanager = google.accesscontextmanager('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 accesscontextmanager.operations.get({ + * // The name of the operation resource. + * name: 'operations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias accesscontextmanager.operations.get * @memberOf! () * diff --git a/src/apis/adexchangebuyer/v1.2.ts b/src/apis/adexchangebuyer/v1.2.ts index dd6190abb7f..eb1ef48c6f2 100644 --- a/src/apis/adexchangebuyer/v1.2.ts +++ b/src/apis/adexchangebuyer/v1.2.ts @@ -280,6 +280,53 @@ export namespace adexchangebuyer_v1_2 { /** * adexchangebuyer.accounts.get * @desc Gets one account by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.2'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.accounts.get({ + * // The account id + * id: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bidderLocation": [], + * // "cookieMatchingNid": "my_cookieMatchingNid", + * // "cookieMatchingUrl": "my_cookieMatchingUrl", + * // "id": 0, + * // "kind": "my_kind", + * // "maximumActiveCreatives": 0, + * // "maximumTotalQps": 0, + * // "numberActiveCreatives": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.accounts.get * @memberOf! () * @@ -351,6 +398,44 @@ export namespace adexchangebuyer_v1_2 { /** * adexchangebuyer.accounts.list * @desc Retrieves the authenticated user's list of accounts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.2'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.accounts.list({}); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.accounts.list * @memberOf! () * @@ -423,6 +508,68 @@ export namespace adexchangebuyer_v1_2 { /** * adexchangebuyer.accounts.patch * @desc Updates an existing account. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.2'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.accounts.patch({ + * // The account id + * id: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bidderLocation": [], + * // "cookieMatchingNid": "my_cookieMatchingNid", + * // "cookieMatchingUrl": "my_cookieMatchingUrl", + * // "id": 0, + * // "kind": "my_kind", + * // "maximumActiveCreatives": 0, + * // "maximumTotalQps": 0, + * // "numberActiveCreatives": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bidderLocation": [], + * // "cookieMatchingNid": "my_cookieMatchingNid", + * // "cookieMatchingUrl": "my_cookieMatchingUrl", + * // "id": 0, + * // "kind": "my_kind", + * // "maximumActiveCreatives": 0, + * // "maximumTotalQps": 0, + * // "numberActiveCreatives": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.accounts.patch * @memberOf! () * @@ -495,6 +642,68 @@ export namespace adexchangebuyer_v1_2 { /** * adexchangebuyer.accounts.update * @desc Updates an existing account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.2'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.accounts.update({ + * // The account id + * id: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bidderLocation": [], + * // "cookieMatchingNid": "my_cookieMatchingNid", + * // "cookieMatchingUrl": "my_cookieMatchingUrl", + * // "id": 0, + * // "kind": "my_kind", + * // "maximumActiveCreatives": 0, + * // "maximumTotalQps": 0, + * // "numberActiveCreatives": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bidderLocation": [], + * // "cookieMatchingNid": "my_cookieMatchingNid", + * // "cookieMatchingUrl": "my_cookieMatchingUrl", + * // "id": 0, + * // "kind": "my_kind", + * // "maximumActiveCreatives": 0, + * // "maximumTotalQps": 0, + * // "numberActiveCreatives": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.accounts.update * @memberOf! () * @@ -624,6 +833,70 @@ export namespace adexchangebuyer_v1_2 { /** * adexchangebuyer.creatives.get * @desc Gets the status for a single creative. A creative will be available 30-40 minutes after submission. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.2'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.creatives.get({ + * // The id for the account that will serve this creative. + * accountId: 'placeholder-value', + * // The buyer-specific id for this creative. + * buyerCreativeId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "HTMLSnippet": "my_HTMLSnippet", + * // "accountId": 0, + * // "advertiserId": [], + * // "advertiserName": "my_advertiserName", + * // "agencyId": "my_agencyId", + * // "apiUploadTimestamp": "my_apiUploadTimestamp", + * // "attribute": [], + * // "buyerCreativeId": "my_buyerCreativeId", + * // "clickThroughUrl": [], + * // "corrections": [], + * // "disapprovalReasons": [], + * // "filteringReasons": {}, + * // "height": 0, + * // "impressionTrackingUrl": [], + * // "kind": "my_kind", + * // "productCategories": [], + * // "restrictedCategories": [], + * // "sensitiveCategories": [], + * // "status": "my_status", + * // "vendorType": [], + * // "version": 0, + * // "videoURL": "my_videoURL", + * // "width": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.creatives.get * @memberOf! () * @@ -696,6 +969,95 @@ export namespace adexchangebuyer_v1_2 { /** * adexchangebuyer.creatives.insert * @desc Submit a new creative. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.2'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.creatives.insert({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "HTMLSnippet": "my_HTMLSnippet", + * // "accountId": 0, + * // "advertiserId": [], + * // "advertiserName": "my_advertiserName", + * // "agencyId": "my_agencyId", + * // "apiUploadTimestamp": "my_apiUploadTimestamp", + * // "attribute": [], + * // "buyerCreativeId": "my_buyerCreativeId", + * // "clickThroughUrl": [], + * // "corrections": [], + * // "disapprovalReasons": [], + * // "filteringReasons": {}, + * // "height": 0, + * // "impressionTrackingUrl": [], + * // "kind": "my_kind", + * // "productCategories": [], + * // "restrictedCategories": [], + * // "sensitiveCategories": [], + * // "status": "my_status", + * // "vendorType": [], + * // "version": 0, + * // "videoURL": "my_videoURL", + * // "width": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "HTMLSnippet": "my_HTMLSnippet", + * // "accountId": 0, + * // "advertiserId": [], + * // "advertiserName": "my_advertiserName", + * // "agencyId": "my_agencyId", + * // "apiUploadTimestamp": "my_apiUploadTimestamp", + * // "attribute": [], + * // "buyerCreativeId": "my_buyerCreativeId", + * // "clickThroughUrl": [], + * // "corrections": [], + * // "disapprovalReasons": [], + * // "filteringReasons": {}, + * // "height": 0, + * // "impressionTrackingUrl": [], + * // "kind": "my_kind", + * // "productCategories": [], + * // "restrictedCategories": [], + * // "sensitiveCategories": [], + * // "status": "my_status", + * // "vendorType": [], + * // "version": 0, + * // "videoURL": "my_videoURL", + * // "width": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.creatives.insert * @memberOf! () * @@ -767,6 +1129,52 @@ export namespace adexchangebuyer_v1_2 { /** * adexchangebuyer.creatives.list * @desc Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.2'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.creatives.list({ + * // Maximum number of entries returned on one result page. If not set, the default is 100. Optional. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. Optional. + * pageToken: 'placeholder-value', + * // When specified, only creatives having the given status are returned. + * statusFilter: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.creatives.list * @memberOf! () * diff --git a/src/apis/adexchangebuyer/v1.3.ts b/src/apis/adexchangebuyer/v1.3.ts index d5405109c60..7c2c9b545c2 100644 --- a/src/apis/adexchangebuyer/v1.3.ts +++ b/src/apis/adexchangebuyer/v1.3.ts @@ -665,6 +665,53 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.accounts.get * @desc Gets one account by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.accounts.get({ + * // The account id + * id: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bidderLocation": [], + * // "cookieMatchingNid": "my_cookieMatchingNid", + * // "cookieMatchingUrl": "my_cookieMatchingUrl", + * // "id": 0, + * // "kind": "my_kind", + * // "maximumActiveCreatives": 0, + * // "maximumTotalQps": 0, + * // "numberActiveCreatives": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.accounts.get * @memberOf! () * @@ -736,6 +783,44 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.accounts.list * @desc Retrieves the authenticated user's list of accounts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.accounts.list({}); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.accounts.list * @memberOf! () * @@ -808,6 +893,68 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.accounts.patch * @desc Updates an existing account. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.accounts.patch({ + * // The account id + * id: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bidderLocation": [], + * // "cookieMatchingNid": "my_cookieMatchingNid", + * // "cookieMatchingUrl": "my_cookieMatchingUrl", + * // "id": 0, + * // "kind": "my_kind", + * // "maximumActiveCreatives": 0, + * // "maximumTotalQps": 0, + * // "numberActiveCreatives": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bidderLocation": [], + * // "cookieMatchingNid": "my_cookieMatchingNid", + * // "cookieMatchingUrl": "my_cookieMatchingUrl", + * // "id": 0, + * // "kind": "my_kind", + * // "maximumActiveCreatives": 0, + * // "maximumTotalQps": 0, + * // "numberActiveCreatives": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.accounts.patch * @memberOf! () * @@ -880,6 +1027,68 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.accounts.update * @desc Updates an existing account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.accounts.update({ + * // The account id + * id: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bidderLocation": [], + * // "cookieMatchingNid": "my_cookieMatchingNid", + * // "cookieMatchingUrl": "my_cookieMatchingUrl", + * // "id": 0, + * // "kind": "my_kind", + * // "maximumActiveCreatives": 0, + * // "maximumTotalQps": 0, + * // "numberActiveCreatives": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bidderLocation": [], + * // "cookieMatchingNid": "my_cookieMatchingNid", + * // "cookieMatchingUrl": "my_cookieMatchingUrl", + * // "id": 0, + * // "kind": "my_kind", + * // "maximumActiveCreatives": 0, + * // "maximumTotalQps": 0, + * // "numberActiveCreatives": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.accounts.update * @memberOf! () * @@ -1009,6 +1218,49 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.billingInfo.get * @desc Returns the billing information for one account specified by account ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.billingInfo.get({ + * // The account id. + * accountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": 0, + * // "accountName": "my_accountName", + * // "billingId": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.billingInfo.get * @memberOf! () * @@ -1081,6 +1333,44 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.billingInfo.list * @desc Retrieves a list of billing information for all accounts of the authenticated user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.billingInfo.list({}); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.billingInfo.list * @memberOf! () * @@ -1178,6 +1468,53 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.budget.get * @desc Returns the budget information for the adgroup specified by the accountId and billingId. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.budget.get({ + * // The account id to get the budget information for. + * accountId: 'placeholder-value', + * // The billing id to get the budget information for. + * billingId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "billingId": "my_billingId", + * // "budgetAmount": "my_budgetAmount", + * // "currencyCode": "my_currencyCode", + * // "id": "my_id", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.budget.get * @memberOf! () * @@ -1250,6 +1587,66 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.budget.patch * @desc Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.budget.patch({ + * // The account id associated with the budget being updated. + * accountId: 'placeholder-value', + * // The billing id associated with the budget being updated. + * billingId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "billingId": "my_billingId", + * // "budgetAmount": "my_budgetAmount", + * // "currencyCode": "my_currencyCode", + * // "id": "my_id", + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "billingId": "my_billingId", + * // "budgetAmount": "my_budgetAmount", + * // "currencyCode": "my_currencyCode", + * // "id": "my_id", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.budget.patch * @memberOf! () * @@ -1323,6 +1720,66 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.budget.update * @desc Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.budget.update({ + * // The account id associated with the budget being updated. + * accountId: 'placeholder-value', + * // The billing id associated with the budget being updated. + * billingId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "billingId": "my_billingId", + * // "budgetAmount": "my_budgetAmount", + * // "currencyCode": "my_currencyCode", + * // "id": "my_id", + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "billingId": "my_billingId", + * // "budgetAmount": "my_budgetAmount", + * // "currencyCode": "my_currencyCode", + * // "id": "my_id", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.budget.update * @memberOf! () * @@ -1459,6 +1916,72 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.creatives.get * @desc Gets the status for a single creative. A creative will be available 30-40 minutes after submission. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.creatives.get({ + * // The id for the account that will serve this creative. + * accountId: 'placeholder-value', + * // The buyer-specific id for this creative. + * buyerCreativeId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "HTMLSnippet": "my_HTMLSnippet", + * // "accountId": 0, + * // "adTechnologyProviders": {}, + * // "advertiserId": [], + * // "advertiserName": "my_advertiserName", + * // "agencyId": "my_agencyId", + * // "apiUploadTimestamp": "my_apiUploadTimestamp", + * // "attribute": [], + * // "buyerCreativeId": "my_buyerCreativeId", + * // "clickThroughUrl": [], + * // "corrections": [], + * // "disapprovalReasons": [], + * // "filteringReasons": {}, + * // "height": 0, + * // "impressionTrackingUrl": [], + * // "kind": "my_kind", + * // "nativeAd": {}, + * // "productCategories": [], + * // "restrictedCategories": [], + * // "sensitiveCategories": [], + * // "status": "my_status", + * // "vendorType": [], + * // "version": 0, + * // "videoURL": "my_videoURL", + * // "width": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.creatives.get * @memberOf! () * @@ -1531,6 +2054,99 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.creatives.insert * @desc Submit a new creative. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.creatives.insert({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "HTMLSnippet": "my_HTMLSnippet", + * // "accountId": 0, + * // "adTechnologyProviders": {}, + * // "advertiserId": [], + * // "advertiserName": "my_advertiserName", + * // "agencyId": "my_agencyId", + * // "apiUploadTimestamp": "my_apiUploadTimestamp", + * // "attribute": [], + * // "buyerCreativeId": "my_buyerCreativeId", + * // "clickThroughUrl": [], + * // "corrections": [], + * // "disapprovalReasons": [], + * // "filteringReasons": {}, + * // "height": 0, + * // "impressionTrackingUrl": [], + * // "kind": "my_kind", + * // "nativeAd": {}, + * // "productCategories": [], + * // "restrictedCategories": [], + * // "sensitiveCategories": [], + * // "status": "my_status", + * // "vendorType": [], + * // "version": 0, + * // "videoURL": "my_videoURL", + * // "width": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "HTMLSnippet": "my_HTMLSnippet", + * // "accountId": 0, + * // "adTechnologyProviders": {}, + * // "advertiserId": [], + * // "advertiserName": "my_advertiserName", + * // "agencyId": "my_agencyId", + * // "apiUploadTimestamp": "my_apiUploadTimestamp", + * // "attribute": [], + * // "buyerCreativeId": "my_buyerCreativeId", + * // "clickThroughUrl": [], + * // "corrections": [], + * // "disapprovalReasons": [], + * // "filteringReasons": {}, + * // "height": 0, + * // "impressionTrackingUrl": [], + * // "kind": "my_kind", + * // "nativeAd": {}, + * // "productCategories": [], + * // "restrictedCategories": [], + * // "sensitiveCategories": [], + * // "status": "my_status", + * // "vendorType": [], + * // "version": 0, + * // "videoURL": "my_videoURL", + * // "width": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.creatives.insert * @memberOf! () * @@ -1602,6 +2218,56 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.creatives.list * @desc Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.creatives.list({ + * // When specified, only creatives for the given account ids are returned. + * accountId: 'placeholder-value', + * // When specified, only creatives for the given buyer creative ids are returned. + * buyerCreativeId: 'placeholder-value', + * // Maximum number of entries returned on one result page. If not set, the default is 100. Optional. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. Optional. + * pageToken: 'placeholder-value', + * // When specified, only creatives having the given status are returned. + * statusFilter: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.creatives.list * @memberOf! () * @@ -1740,6 +2406,60 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.directDeals.get * @desc Gets one direct deal by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.directDeals.get({ + * // The direct deal id + * id: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": 0, + * // "advertiser": "my_advertiser", + * // "allowsAlcohol": false, + * // "buyerAccountId": "my_buyerAccountId", + * // "currencyCode": "my_currencyCode", + * // "dealTier": "my_dealTier", + * // "endTime": "my_endTime", + * // "fixedCpm": "my_fixedCpm", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "privateExchangeMinCpm": "my_privateExchangeMinCpm", + * // "publisherBlocksOverriden": false, + * // "sellerNetwork": "my_sellerNetwork", + * // "startTime": "my_startTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.directDeals.get * @memberOf! () * @@ -1813,6 +2533,44 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.directDeals.list * @desc Retrieves the authenticated user's list of direct deals. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.directDeals.list({}); + * console.log(res.data); + * + * // Example response + * // { + * // "directDeals": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.directDeals.list * @memberOf! () * @@ -1910,6 +2668,55 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.performanceReport.list * @desc Retrieves the authenticated user's list of performance metrics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.performanceReport.list({ + * // The account id to get the reports. + * accountId: 'placeholder-value', + * // The end time of the report in ISO 8601 timestamp format using UTC. + * endDateTime: 'placeholder-value', + * // Maximum number of entries returned on one result page. If not set, the default is 100. Optional. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through performance reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. Optional. + * pageToken: 'placeholder-value', + * // The start time of the report in ISO 8601 timestamp format using UTC. + * startDateTime: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "performanceReport": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.performanceReport.list * @memberOf! () * @@ -2026,6 +2833,43 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.pretargetingConfig.delete * @desc Deletes an existing pretargeting config. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.pretargetingConfig.delete({ + * // The account id to delete the pretargeting config for. + * accountId: 'placeholder-value', + * // The specific id of the configuration to delete. + * configId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.pretargetingConfig.delete * @memberOf! () * @@ -2099,6 +2943,71 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.pretargetingConfig.get * @desc Gets a specific pretargeting configuration + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.pretargetingConfig.get({ + * // The account id to get the pretargeting config for. + * accountId: 'placeholder-value', + * // The specific id of the configuration to retrieve. + * configId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billingId": "my_billingId", + * // "configId": "my_configId", + * // "configName": "my_configName", + * // "creativeType": [], + * // "dimensions": [], + * // "excludedContentLabels": [], + * // "excludedGeoCriteriaIds": [], + * // "excludedPlacements": [], + * // "excludedUserLists": [], + * // "excludedVerticals": [], + * // "geoCriteriaIds": [], + * // "isActive": false, + * // "kind": "my_kind", + * // "languages": [], + * // "maximumQps": "my_maximumQps", + * // "mobileCarriers": [], + * // "mobileDevices": [], + * // "mobileOperatingSystemVersions": [], + * // "placements": [], + * // "platforms": [], + * // "supportedCreativeAttributes": [], + * // "userLists": [], + * // "vendorTypes": [], + * // "verticals": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.pretargetingConfig.get * @memberOf! () * @@ -2174,6 +3083,100 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.pretargetingConfig.insert * @desc Inserts a new pretargeting configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.pretargetingConfig.insert({ + * // The account id to insert the pretargeting config for. + * accountId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "billingId": "my_billingId", + * // "configId": "my_configId", + * // "configName": "my_configName", + * // "creativeType": [], + * // "dimensions": [], + * // "excludedContentLabels": [], + * // "excludedGeoCriteriaIds": [], + * // "excludedPlacements": [], + * // "excludedUserLists": [], + * // "excludedVerticals": [], + * // "geoCriteriaIds": [], + * // "isActive": false, + * // "kind": "my_kind", + * // "languages": [], + * // "maximumQps": "my_maximumQps", + * // "mobileCarriers": [], + * // "mobileDevices": [], + * // "mobileOperatingSystemVersions": [], + * // "placements": [], + * // "platforms": [], + * // "supportedCreativeAttributes": [], + * // "userLists": [], + * // "vendorTypes": [], + * // "verticals": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billingId": "my_billingId", + * // "configId": "my_configId", + * // "configName": "my_configName", + * // "creativeType": [], + * // "dimensions": [], + * // "excludedContentLabels": [], + * // "excludedGeoCriteriaIds": [], + * // "excludedPlacements": [], + * // "excludedUserLists": [], + * // "excludedVerticals": [], + * // "geoCriteriaIds": [], + * // "isActive": false, + * // "kind": "my_kind", + * // "languages": [], + * // "maximumQps": "my_maximumQps", + * // "mobileCarriers": [], + * // "mobileDevices": [], + * // "mobileOperatingSystemVersions": [], + * // "placements": [], + * // "platforms": [], + * // "supportedCreativeAttributes": [], + * // "userLists": [], + * // "vendorTypes": [], + * // "verticals": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.pretargetingConfig.insert * @memberOf! () * @@ -2248,6 +3251,47 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.pretargetingConfig.list * @desc Retrieves a list of the authenticated user's pretargeting configurations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.pretargetingConfig.list({ + * // The account id to get the pretargeting configs for. + * accountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.pretargetingConfig.list * @memberOf! () * @@ -2323,6 +3367,102 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.pretargetingConfig.patch * @desc Updates an existing pretargeting config. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.pretargetingConfig.patch({ + * // The account id to update the pretargeting config for. + * accountId: 'placeholder-value', + * // The specific id of the configuration to update. + * configId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "billingId": "my_billingId", + * // "configId": "my_configId", + * // "configName": "my_configName", + * // "creativeType": [], + * // "dimensions": [], + * // "excludedContentLabels": [], + * // "excludedGeoCriteriaIds": [], + * // "excludedPlacements": [], + * // "excludedUserLists": [], + * // "excludedVerticals": [], + * // "geoCriteriaIds": [], + * // "isActive": false, + * // "kind": "my_kind", + * // "languages": [], + * // "maximumQps": "my_maximumQps", + * // "mobileCarriers": [], + * // "mobileDevices": [], + * // "mobileOperatingSystemVersions": [], + * // "placements": [], + * // "platforms": [], + * // "supportedCreativeAttributes": [], + * // "userLists": [], + * // "vendorTypes": [], + * // "verticals": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billingId": "my_billingId", + * // "configId": "my_configId", + * // "configName": "my_configName", + * // "creativeType": [], + * // "dimensions": [], + * // "excludedContentLabels": [], + * // "excludedGeoCriteriaIds": [], + * // "excludedPlacements": [], + * // "excludedUserLists": [], + * // "excludedVerticals": [], + * // "geoCriteriaIds": [], + * // "isActive": false, + * // "kind": "my_kind", + * // "languages": [], + * // "maximumQps": "my_maximumQps", + * // "mobileCarriers": [], + * // "mobileDevices": [], + * // "mobileOperatingSystemVersions": [], + * // "placements": [], + * // "platforms": [], + * // "supportedCreativeAttributes": [], + * // "userLists": [], + * // "vendorTypes": [], + * // "verticals": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.pretargetingConfig.patch * @memberOf! () * @@ -2399,6 +3539,102 @@ export namespace adexchangebuyer_v1_3 { /** * adexchangebuyer.pretargetingConfig.update * @desc Updates an existing pretargeting config. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.pretargetingConfig.update({ + * // The account id to update the pretargeting config for. + * accountId: 'placeholder-value', + * // The specific id of the configuration to update. + * configId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "billingId": "my_billingId", + * // "configId": "my_configId", + * // "configName": "my_configName", + * // "creativeType": [], + * // "dimensions": [], + * // "excludedContentLabels": [], + * // "excludedGeoCriteriaIds": [], + * // "excludedPlacements": [], + * // "excludedUserLists": [], + * // "excludedVerticals": [], + * // "geoCriteriaIds": [], + * // "isActive": false, + * // "kind": "my_kind", + * // "languages": [], + * // "maximumQps": "my_maximumQps", + * // "mobileCarriers": [], + * // "mobileDevices": [], + * // "mobileOperatingSystemVersions": [], + * // "placements": [], + * // "platforms": [], + * // "supportedCreativeAttributes": [], + * // "userLists": [], + * // "vendorTypes": [], + * // "verticals": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billingId": "my_billingId", + * // "configId": "my_configId", + * // "configName": "my_configName", + * // "creativeType": [], + * // "dimensions": [], + * // "excludedContentLabels": [], + * // "excludedGeoCriteriaIds": [], + * // "excludedPlacements": [], + * // "excludedUserLists": [], + * // "excludedVerticals": [], + * // "geoCriteriaIds": [], + * // "isActive": false, + * // "kind": "my_kind", + * // "languages": [], + * // "maximumQps": "my_maximumQps", + * // "mobileCarriers": [], + * // "mobileDevices": [], + * // "mobileOperatingSystemVersions": [], + * // "placements": [], + * // "platforms": [], + * // "supportedCreativeAttributes": [], + * // "userLists": [], + * // "vendorTypes": [], + * // "verticals": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.pretargetingConfig.update * @memberOf! () * diff --git a/src/apis/adexchangebuyer/v1.4.ts b/src/apis/adexchangebuyer/v1.4.ts index a3a2862ad62..9efc91a41f1 100644 --- a/src/apis/adexchangebuyer/v1.4.ts +++ b/src/apis/adexchangebuyer/v1.4.ts @@ -1632,6 +1632,54 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.accounts.get * @desc Gets one account by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.accounts.get({ + * // The account id + * id: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applyPretargetingToNonGuaranteedDeals": false, + * // "bidderLocation": [], + * // "cookieMatchingNid": "my_cookieMatchingNid", + * // "cookieMatchingUrl": "my_cookieMatchingUrl", + * // "id": 0, + * // "kind": "my_kind", + * // "maximumActiveCreatives": 0, + * // "maximumTotalQps": 0, + * // "numberActiveCreatives": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.accounts.get * @memberOf! () * @@ -1703,6 +1751,44 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.accounts.list * @desc Retrieves the authenticated user's list of accounts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.accounts.list({}); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.accounts.list * @memberOf! () * @@ -1775,6 +1861,72 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.accounts.patch * @desc Updates an existing account. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.accounts.patch({ + * // Confirmation for erasing bidder and cookie matching urls. + * confirmUnsafeAccountChange: 'placeholder-value', + * // The account id + * id: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "applyPretargetingToNonGuaranteedDeals": false, + * // "bidderLocation": [], + * // "cookieMatchingNid": "my_cookieMatchingNid", + * // "cookieMatchingUrl": "my_cookieMatchingUrl", + * // "id": 0, + * // "kind": "my_kind", + * // "maximumActiveCreatives": 0, + * // "maximumTotalQps": 0, + * // "numberActiveCreatives": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applyPretargetingToNonGuaranteedDeals": false, + * // "bidderLocation": [], + * // "cookieMatchingNid": "my_cookieMatchingNid", + * // "cookieMatchingUrl": "my_cookieMatchingUrl", + * // "id": 0, + * // "kind": "my_kind", + * // "maximumActiveCreatives": 0, + * // "maximumTotalQps": 0, + * // "numberActiveCreatives": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.accounts.patch * @memberOf! () * @@ -1848,6 +2000,72 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.accounts.update * @desc Updates an existing account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.accounts.update({ + * // Confirmation for erasing bidder and cookie matching urls. + * confirmUnsafeAccountChange: 'placeholder-value', + * // The account id + * id: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "applyPretargetingToNonGuaranteedDeals": false, + * // "bidderLocation": [], + * // "cookieMatchingNid": "my_cookieMatchingNid", + * // "cookieMatchingUrl": "my_cookieMatchingUrl", + * // "id": 0, + * // "kind": "my_kind", + * // "maximumActiveCreatives": 0, + * // "maximumTotalQps": 0, + * // "numberActiveCreatives": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applyPretargetingToNonGuaranteedDeals": false, + * // "bidderLocation": [], + * // "cookieMatchingNid": "my_cookieMatchingNid", + * // "cookieMatchingUrl": "my_cookieMatchingUrl", + * // "id": 0, + * // "kind": "my_kind", + * // "maximumActiveCreatives": 0, + * // "maximumTotalQps": 0, + * // "numberActiveCreatives": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.accounts.update * @memberOf! () * @@ -1986,6 +2204,49 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.billingInfo.get * @desc Returns the billing information for one account specified by account ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.billingInfo.get({ + * // The account id. + * accountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": 0, + * // "accountName": "my_accountName", + * // "billingId": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.billingInfo.get * @memberOf! () * @@ -2058,6 +2319,44 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.billingInfo.list * @desc Retrieves a list of billing information for all accounts of the authenticated user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.billingInfo.list({}); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.billingInfo.list * @memberOf! () * @@ -2155,6 +2454,53 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.budget.get * @desc Returns the budget information for the adgroup specified by the accountId and billingId. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.budget.get({ + * // The account id to get the budget information for. + * accountId: 'placeholder-value', + * // The billing id to get the budget information for. + * billingId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "billingId": "my_billingId", + * // "budgetAmount": "my_budgetAmount", + * // "currencyCode": "my_currencyCode", + * // "id": "my_id", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.budget.get * @memberOf! () * @@ -2227,6 +2573,66 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.budget.patch * @desc Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.budget.patch({ + * // The account id associated with the budget being updated. + * accountId: 'placeholder-value', + * // The billing id associated with the budget being updated. + * billingId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "billingId": "my_billingId", + * // "budgetAmount": "my_budgetAmount", + * // "currencyCode": "my_currencyCode", + * // "id": "my_id", + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "billingId": "my_billingId", + * // "budgetAmount": "my_budgetAmount", + * // "currencyCode": "my_currencyCode", + * // "id": "my_id", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.budget.patch * @memberOf! () * @@ -2300,6 +2706,66 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.budget.update * @desc Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.budget.update({ + * // The account id associated with the budget being updated. + * accountId: 'placeholder-value', + * // The billing id associated with the budget being updated. + * billingId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "billingId": "my_billingId", + * // "budgetAmount": "my_budgetAmount", + * // "currencyCode": "my_currencyCode", + * // "id": "my_id", + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "billingId": "my_billingId", + * // "budgetAmount": "my_budgetAmount", + * // "currencyCode": "my_currencyCode", + * // "id": "my_id", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.budget.update * @memberOf! () * @@ -2436,6 +2902,45 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.creatives.addDeal * @desc Add a deal id association for the creative. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.creatives.addDeal({ + * // The id for the account that will serve this creative. + * accountId: 'placeholder-value', + * // The buyer-specific id for this creative. + * buyerCreativeId: 'placeholder-value', + * // The id of the deal id to associate with this creative. + * dealId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.creatives.addDeal * @memberOf! () * @@ -2510,6 +3015,78 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.creatives.get * @desc Gets the status for a single creative. A creative will be available 30-40 minutes after submission. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.creatives.get({ + * // The id for the account that will serve this creative. + * accountId: 'placeholder-value', + * // The buyer-specific id for this creative. + * buyerCreativeId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "HTMLSnippet": "my_HTMLSnippet", + * // "accountId": 0, + * // "adChoicesDestinationUrl": "my_adChoicesDestinationUrl", + * // "adTechnologyProviders": {}, + * // "advertiserId": [], + * // "advertiserName": "my_advertiserName", + * // "agencyId": "my_agencyId", + * // "apiUploadTimestamp": "my_apiUploadTimestamp", + * // "attribute": [], + * // "buyerCreativeId": "my_buyerCreativeId", + * // "clickThroughUrl": [], + * // "corrections": [], + * // "creativeStatusIdentityType": "my_creativeStatusIdentityType", + * // "dealsStatus": "my_dealsStatus", + * // "detectedDomains": [], + * // "filteringReasons": {}, + * // "height": 0, + * // "impressionTrackingUrl": [], + * // "kind": "my_kind", + * // "languages": [], + * // "nativeAd": {}, + * // "openAuctionStatus": "my_openAuctionStatus", + * // "productCategories": [], + * // "restrictedCategories": [], + * // "sensitiveCategories": [], + * // "servingRestrictions": [], + * // "vendorType": [], + * // "version": 0, + * // "videoURL": "my_videoURL", + * // "videoVastXML": "my_videoVastXML", + * // "width": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.creatives.get * @memberOf! () * @@ -2582,6 +3159,111 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.creatives.insert * @desc Submit a new creative. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.creatives.insert({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "HTMLSnippet": "my_HTMLSnippet", + * // "accountId": 0, + * // "adChoicesDestinationUrl": "my_adChoicesDestinationUrl", + * // "adTechnologyProviders": {}, + * // "advertiserId": [], + * // "advertiserName": "my_advertiserName", + * // "agencyId": "my_agencyId", + * // "apiUploadTimestamp": "my_apiUploadTimestamp", + * // "attribute": [], + * // "buyerCreativeId": "my_buyerCreativeId", + * // "clickThroughUrl": [], + * // "corrections": [], + * // "creativeStatusIdentityType": "my_creativeStatusIdentityType", + * // "dealsStatus": "my_dealsStatus", + * // "detectedDomains": [], + * // "filteringReasons": {}, + * // "height": 0, + * // "impressionTrackingUrl": [], + * // "kind": "my_kind", + * // "languages": [], + * // "nativeAd": {}, + * // "openAuctionStatus": "my_openAuctionStatus", + * // "productCategories": [], + * // "restrictedCategories": [], + * // "sensitiveCategories": [], + * // "servingRestrictions": [], + * // "vendorType": [], + * // "version": 0, + * // "videoURL": "my_videoURL", + * // "videoVastXML": "my_videoVastXML", + * // "width": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "HTMLSnippet": "my_HTMLSnippet", + * // "accountId": 0, + * // "adChoicesDestinationUrl": "my_adChoicesDestinationUrl", + * // "adTechnologyProviders": {}, + * // "advertiserId": [], + * // "advertiserName": "my_advertiserName", + * // "agencyId": "my_agencyId", + * // "apiUploadTimestamp": "my_apiUploadTimestamp", + * // "attribute": [], + * // "buyerCreativeId": "my_buyerCreativeId", + * // "clickThroughUrl": [], + * // "corrections": [], + * // "creativeStatusIdentityType": "my_creativeStatusIdentityType", + * // "dealsStatus": "my_dealsStatus", + * // "detectedDomains": [], + * // "filteringReasons": {}, + * // "height": 0, + * // "impressionTrackingUrl": [], + * // "kind": "my_kind", + * // "languages": [], + * // "nativeAd": {}, + * // "openAuctionStatus": "my_openAuctionStatus", + * // "productCategories": [], + * // "restrictedCategories": [], + * // "sensitiveCategories": [], + * // "servingRestrictions": [], + * // "vendorType": [], + * // "version": 0, + * // "videoURL": "my_videoURL", + * // "videoVastXML": "my_videoVastXML", + * // "width": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.creatives.insert * @memberOf! () * @@ -2653,6 +3335,58 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.creatives.list * @desc Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.creatives.list({ + * // When specified, only creatives for the given account ids are returned. + * accountId: 'placeholder-value', + * // When specified, only creatives for the given buyer creative ids are returned. + * buyerCreativeId: 'placeholder-value', + * // When specified, only creatives having the given deals status are returned. + * dealsStatusFilter: 'placeholder-value', + * // Maximum number of entries returned on one result page. If not set, the default is 100. Optional. + * maxResults: 'placeholder-value', + * // When specified, only creatives having the given open auction status are returned. + * openAuctionStatusFilter: 'placeholder-value', + * // A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. Optional. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.creatives.list * @memberOf! () * @@ -2731,6 +3465,49 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.creatives.listDeals * @desc Lists the external deal ids associated with the creative. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.creatives.listDeals({ + * // The id for the account that will serve this creative. + * accountId: 'placeholder-value', + * // The buyer-specific id for this creative. + * buyerCreativeId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dealStatuses": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.creatives.listDeals * @memberOf! () * @@ -2806,6 +3583,45 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.creatives.removeDeal * @desc Remove a deal id associated with the creative. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.creatives.removeDeal({ + * // The id for the account that will serve this creative. + * accountId: 'placeholder-value', + * // The buyer-specific id for this creative. + * buyerCreativeId: 'placeholder-value', + * // The id of the deal id to disassociate with this creative. + * dealId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.creatives.removeDeal * @memberOf! () * @@ -3001,6 +3817,57 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.marketplacedeals.delete * @desc Delete the specified deals from the proposal + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.marketplacedeals.delete({ + * // The proposalId to delete deals from. + * proposalId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dealIds": [], + * // "proposalRevisionNumber": "my_proposalRevisionNumber", + * // "updateAction": "my_updateAction" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deals": [], + * // "proposalRevisionNumber": "my_proposalRevisionNumber" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.marketplacedeals.delete * @memberOf! () * @@ -3080,6 +3947,57 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.marketplacedeals.insert * @desc Add new deals for the specified proposal + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.marketplacedeals.insert({ + * // proposalId for which deals need to be added. + * proposalId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deals": [], + * // "proposalRevisionNumber": "my_proposalRevisionNumber", + * // "updateAction": "my_updateAction" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deals": [], + * // "proposalRevisionNumber": "my_proposalRevisionNumber" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.marketplacedeals.insert * @memberOf! () * @@ -3157,6 +4075,48 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.marketplacedeals.list * @desc List all the deals for a given proposal + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.marketplacedeals.list({ + * // Query string to retrieve specific deals. + * pqlQuery: 'placeholder-value', + * // The proposalId to get deals for. To search across all proposals specify order_id = '-' as part of the URL. + * proposalId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deals": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.marketplacedeals.list * @memberOf! () * @@ -3233,6 +4193,58 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.marketplacedeals.update * @desc Replaces all the deals in the proposal with the passed in deals + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.marketplacedeals.update({ + * // The proposalId to edit deals on. + * proposalId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deals": [], + * // "proposal": {}, + * // "proposalRevisionNumber": "my_proposalRevisionNumber", + * // "updateAction": "my_updateAction" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deals": [], + * // "orderRevisionNumber": "my_orderRevisionNumber" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.marketplacedeals.update * @memberOf! () * @@ -3390,6 +4402,54 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.marketplacenotes.insert * @desc Add notes to the proposal + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.marketplacenotes.insert({ + * // The proposalId to add notes for. + * proposalId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "notes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "notes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.marketplacenotes.insert * @memberOf! () * @@ -3467,6 +4527,48 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.marketplacenotes.list * @desc Get all the notes associated with a proposal + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.marketplacenotes.list({ + * // Query string to retrieve specific notes. To search the text contents of notes, please use syntax like "WHERE note.note = "foo" or "WHERE note.note LIKE "%bar%" + * pqlQuery: 'placeholder-value', + * // The proposalId to get notes for. To search across all proposals specify order_id = '-' as part of the URL. + * proposalId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "notes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.marketplacenotes.list * @memberOf! () * @@ -3584,6 +4686,52 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.marketplaceprivateauction.updateproposal * @desc Update a given private auction proposal + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.marketplaceprivateauction.updateproposal({ + * // The private auction id to be updated. + * privateAuctionId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "externalDealId": "my_externalDealId", + * // "note": {}, + * // "proposalRevisionNumber": "my_proposalRevisionNumber", + * // "updateAction": "my_updateAction" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.marketplaceprivateauction.updateproposal * @memberOf! () * @@ -3682,6 +4830,55 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.performanceReport.list * @desc Retrieves the authenticated user's list of performance metrics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.performanceReport.list({ + * // The account id to get the reports. + * accountId: 'placeholder-value', + * // The end time of the report in ISO 8601 timestamp format using UTC. + * endDateTime: 'placeholder-value', + * // Maximum number of entries returned on one result page. If not set, the default is 100. Optional. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through performance reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. Optional. + * pageToken: 'placeholder-value', + * // The start time of the report in ISO 8601 timestamp format using UTC. + * startDateTime: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "performanceReport": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.performanceReport.list * @memberOf! () * @@ -3798,6 +4995,43 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.pretargetingConfig.delete * @desc Deletes an existing pretargeting config. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.pretargetingConfig.delete({ + * // The account id to delete the pretargeting config for. + * accountId: 'placeholder-value', + * // The specific id of the configuration to delete. + * configId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.pretargetingConfig.delete * @memberOf! () * @@ -3871,6 +5105,74 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.pretargetingConfig.get * @desc Gets a specific pretargeting configuration + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.pretargetingConfig.get({ + * // The account id to get the pretargeting config for. + * accountId: 'placeholder-value', + * // The specific id of the configuration to retrieve. + * configId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billingId": "my_billingId", + * // "configId": "my_configId", + * // "configName": "my_configName", + * // "creativeType": [], + * // "dimensions": [], + * // "excludedContentLabels": [], + * // "excludedGeoCriteriaIds": [], + * // "excludedPlacements": [], + * // "excludedUserLists": [], + * // "excludedVerticals": [], + * // "geoCriteriaIds": [], + * // "isActive": false, + * // "kind": "my_kind", + * // "languages": [], + * // "maximumQps": "my_maximumQps", + * // "minimumViewabilityDecile": 0, + * // "mobileCarriers": [], + * // "mobileDevices": [], + * // "mobileOperatingSystemVersions": [], + * // "placements": [], + * // "platforms": [], + * // "supportedCreativeAttributes": [], + * // "userIdentifierDataRequired": [], + * // "userLists": [], + * // "vendorTypes": [], + * // "verticals": [], + * // "videoPlayerSizes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.pretargetingConfig.get * @memberOf! () * @@ -3946,6 +5248,106 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.pretargetingConfig.insert * @desc Inserts a new pretargeting configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.pretargetingConfig.insert({ + * // The account id to insert the pretargeting config for. + * accountId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "billingId": "my_billingId", + * // "configId": "my_configId", + * // "configName": "my_configName", + * // "creativeType": [], + * // "dimensions": [], + * // "excludedContentLabels": [], + * // "excludedGeoCriteriaIds": [], + * // "excludedPlacements": [], + * // "excludedUserLists": [], + * // "excludedVerticals": [], + * // "geoCriteriaIds": [], + * // "isActive": false, + * // "kind": "my_kind", + * // "languages": [], + * // "maximumQps": "my_maximumQps", + * // "minimumViewabilityDecile": 0, + * // "mobileCarriers": [], + * // "mobileDevices": [], + * // "mobileOperatingSystemVersions": [], + * // "placements": [], + * // "platforms": [], + * // "supportedCreativeAttributes": [], + * // "userIdentifierDataRequired": [], + * // "userLists": [], + * // "vendorTypes": [], + * // "verticals": [], + * // "videoPlayerSizes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billingId": "my_billingId", + * // "configId": "my_configId", + * // "configName": "my_configName", + * // "creativeType": [], + * // "dimensions": [], + * // "excludedContentLabels": [], + * // "excludedGeoCriteriaIds": [], + * // "excludedPlacements": [], + * // "excludedUserLists": [], + * // "excludedVerticals": [], + * // "geoCriteriaIds": [], + * // "isActive": false, + * // "kind": "my_kind", + * // "languages": [], + * // "maximumQps": "my_maximumQps", + * // "minimumViewabilityDecile": 0, + * // "mobileCarriers": [], + * // "mobileDevices": [], + * // "mobileOperatingSystemVersions": [], + * // "placements": [], + * // "platforms": [], + * // "supportedCreativeAttributes": [], + * // "userIdentifierDataRequired": [], + * // "userLists": [], + * // "vendorTypes": [], + * // "verticals": [], + * // "videoPlayerSizes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.pretargetingConfig.insert * @memberOf! () * @@ -4020,6 +5422,47 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.pretargetingConfig.list * @desc Retrieves a list of the authenticated user's pretargeting configurations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.pretargetingConfig.list({ + * // The account id to get the pretargeting configs for. + * accountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.pretargetingConfig.list * @memberOf! () * @@ -4095,6 +5538,108 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.pretargetingConfig.patch * @desc Updates an existing pretargeting config. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.pretargetingConfig.patch({ + * // The account id to update the pretargeting config for. + * accountId: 'placeholder-value', + * // The specific id of the configuration to update. + * configId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "billingId": "my_billingId", + * // "configId": "my_configId", + * // "configName": "my_configName", + * // "creativeType": [], + * // "dimensions": [], + * // "excludedContentLabels": [], + * // "excludedGeoCriteriaIds": [], + * // "excludedPlacements": [], + * // "excludedUserLists": [], + * // "excludedVerticals": [], + * // "geoCriteriaIds": [], + * // "isActive": false, + * // "kind": "my_kind", + * // "languages": [], + * // "maximumQps": "my_maximumQps", + * // "minimumViewabilityDecile": 0, + * // "mobileCarriers": [], + * // "mobileDevices": [], + * // "mobileOperatingSystemVersions": [], + * // "placements": [], + * // "platforms": [], + * // "supportedCreativeAttributes": [], + * // "userIdentifierDataRequired": [], + * // "userLists": [], + * // "vendorTypes": [], + * // "verticals": [], + * // "videoPlayerSizes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billingId": "my_billingId", + * // "configId": "my_configId", + * // "configName": "my_configName", + * // "creativeType": [], + * // "dimensions": [], + * // "excludedContentLabels": [], + * // "excludedGeoCriteriaIds": [], + * // "excludedPlacements": [], + * // "excludedUserLists": [], + * // "excludedVerticals": [], + * // "geoCriteriaIds": [], + * // "isActive": false, + * // "kind": "my_kind", + * // "languages": [], + * // "maximumQps": "my_maximumQps", + * // "minimumViewabilityDecile": 0, + * // "mobileCarriers": [], + * // "mobileDevices": [], + * // "mobileOperatingSystemVersions": [], + * // "placements": [], + * // "platforms": [], + * // "supportedCreativeAttributes": [], + * // "userIdentifierDataRequired": [], + * // "userLists": [], + * // "vendorTypes": [], + * // "verticals": [], + * // "videoPlayerSizes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.pretargetingConfig.patch * @memberOf! () * @@ -4171,6 +5716,108 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.pretargetingConfig.update * @desc Updates an existing pretargeting config. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.pretargetingConfig.update({ + * // The account id to update the pretargeting config for. + * accountId: 'placeholder-value', + * // The specific id of the configuration to update. + * configId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "billingId": "my_billingId", + * // "configId": "my_configId", + * // "configName": "my_configName", + * // "creativeType": [], + * // "dimensions": [], + * // "excludedContentLabels": [], + * // "excludedGeoCriteriaIds": [], + * // "excludedPlacements": [], + * // "excludedUserLists": [], + * // "excludedVerticals": [], + * // "geoCriteriaIds": [], + * // "isActive": false, + * // "kind": "my_kind", + * // "languages": [], + * // "maximumQps": "my_maximumQps", + * // "minimumViewabilityDecile": 0, + * // "mobileCarriers": [], + * // "mobileDevices": [], + * // "mobileOperatingSystemVersions": [], + * // "placements": [], + * // "platforms": [], + * // "supportedCreativeAttributes": [], + * // "userIdentifierDataRequired": [], + * // "userLists": [], + * // "vendorTypes": [], + * // "verticals": [], + * // "videoPlayerSizes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billingId": "my_billingId", + * // "configId": "my_configId", + * // "configName": "my_configName", + * // "creativeType": [], + * // "dimensions": [], + * // "excludedContentLabels": [], + * // "excludedGeoCriteriaIds": [], + * // "excludedPlacements": [], + * // "excludedUserLists": [], + * // "excludedVerticals": [], + * // "geoCriteriaIds": [], + * // "isActive": false, + * // "kind": "my_kind", + * // "languages": [], + * // "maximumQps": "my_maximumQps", + * // "minimumViewabilityDecile": 0, + * // "mobileCarriers": [], + * // "mobileDevices": [], + * // "mobileOperatingSystemVersions": [], + * // "placements": [], + * // "platforms": [], + * // "supportedCreativeAttributes": [], + * // "userIdentifierDataRequired": [], + * // "userLists": [], + * // "vendorTypes": [], + * // "verticals": [], + * // "videoPlayerSizes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.pretargetingConfig.update * @memberOf! () * @@ -4358,6 +6005,72 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.products.get * @desc Gets the requested product by id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.products.get({ + * // The id for the product to get the head revision for. + * productId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billedBuyer": {}, + * // "buyer": {}, + * // "creationTimeMs": "my_creationTimeMs", + * // "creatorContacts": [], + * // "creatorRole": "my_creatorRole", + * // "deliveryControl": {}, + * // "flightEndTimeMs": "my_flightEndTimeMs", + * // "flightStartTimeMs": "my_flightStartTimeMs", + * // "hasCreatorSignedOff": false, + * // "inventorySource": "my_inventorySource", + * // "kind": "my_kind", + * // "labels": [], + * // "lastUpdateTimeMs": "my_lastUpdateTimeMs", + * // "legacyOfferId": "my_legacyOfferId", + * // "marketplacePublisherProfileId": "my_marketplacePublisherProfileId", + * // "name": "my_name", + * // "privateAuctionId": "my_privateAuctionId", + * // "productId": "my_productId", + * // "publisherProfileId": "my_publisherProfileId", + * // "publisherProvidedForecast": {}, + * // "revisionNumber": "my_revisionNumber", + * // "seller": {}, + * // "sharedTargetings": [], + * // "state": "my_state", + * // "syndicationProduct": "my_syndicationProduct", + * // "terms": {}, + * // "webPropertyCode": "my_webPropertyCode" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.products.get * @memberOf! () * @@ -4428,6 +6141,46 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.products.search * @desc Gets the requested product. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.products.search({ + * // The pql query used to query for products. + * pqlQuery: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "products": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.products.search * @memberOf! () * @@ -4531,6 +6284,68 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.proposals.get * @desc Get a proposal given its id + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.proposals.get({ + * // Id of the proposal to retrieve. + * proposalId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billedBuyer": {}, + * // "buyer": {}, + * // "buyerContacts": [], + * // "buyerPrivateData": {}, + * // "dbmAdvertiserIds": [], + * // "hasBuyerSignedOff": false, + * // "hasSellerSignedOff": false, + * // "inventorySource": "my_inventorySource", + * // "isRenegotiating": false, + * // "isSetupComplete": false, + * // "kind": "my_kind", + * // "labels": [], + * // "lastUpdaterOrCommentorRole": "my_lastUpdaterOrCommentorRole", + * // "name": "my_name", + * // "negotiationId": "my_negotiationId", + * // "originatorRole": "my_originatorRole", + * // "privateAuctionId": "my_privateAuctionId", + * // "proposalId": "my_proposalId", + * // "proposalState": "my_proposalState", + * // "revisionNumber": "my_revisionNumber", + * // "revisionTimeMs": "my_revisionTimeMs", + * // "seller": {}, + * // "sellerContacts": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.proposals.get * @memberOf! () * @@ -4601,6 +6416,52 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.proposals.insert * @desc Create the given list of proposals + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.proposals.insert({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "proposals": [], + * // "webPropertyCode": "my_webPropertyCode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "proposals": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.proposals.insert * @memberOf! () * @@ -4676,6 +6537,102 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.proposals.patch * @desc Update the given proposal. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.proposals.patch({ + * // The proposal id to update. + * proposalId: 'placeholder-value', + * // The last known revision number to update. If the head revision in the marketplace database has since changed, an error will be thrown. The caller should then fetch the latest proposal at head revision and retry the update at that revision. + * revisionNumber: 'placeholder-value', + * // The proposed action to take on the proposal. This field is required and it must be set when updating a proposal. + * updateAction: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "billedBuyer": {}, + * // "buyer": {}, + * // "buyerContacts": [], + * // "buyerPrivateData": {}, + * // "dbmAdvertiserIds": [], + * // "hasBuyerSignedOff": false, + * // "hasSellerSignedOff": false, + * // "inventorySource": "my_inventorySource", + * // "isRenegotiating": false, + * // "isSetupComplete": false, + * // "kind": "my_kind", + * // "labels": [], + * // "lastUpdaterOrCommentorRole": "my_lastUpdaterOrCommentorRole", + * // "name": "my_name", + * // "negotiationId": "my_negotiationId", + * // "originatorRole": "my_originatorRole", + * // "privateAuctionId": "my_privateAuctionId", + * // "proposalId": "my_proposalId", + * // "proposalState": "my_proposalState", + * // "revisionNumber": "my_revisionNumber", + * // "revisionTimeMs": "my_revisionTimeMs", + * // "seller": {}, + * // "sellerContacts": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billedBuyer": {}, + * // "buyer": {}, + * // "buyerContacts": [], + * // "buyerPrivateData": {}, + * // "dbmAdvertiserIds": [], + * // "hasBuyerSignedOff": false, + * // "hasSellerSignedOff": false, + * // "inventorySource": "my_inventorySource", + * // "isRenegotiating": false, + * // "isSetupComplete": false, + * // "kind": "my_kind", + * // "labels": [], + * // "lastUpdaterOrCommentorRole": "my_lastUpdaterOrCommentorRole", + * // "name": "my_name", + * // "negotiationId": "my_negotiationId", + * // "originatorRole": "my_originatorRole", + * // "privateAuctionId": "my_privateAuctionId", + * // "proposalId": "my_proposalId", + * // "proposalState": "my_proposalState", + * // "revisionNumber": "my_revisionNumber", + * // "revisionTimeMs": "my_revisionTimeMs", + * // "seller": {}, + * // "sellerContacts": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.proposals.patch * @memberOf! () * @@ -4750,6 +6707,46 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.proposals.search * @desc Search for proposals using pql query + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.proposals.search({ + * // Query string to retrieve specific proposals. + * pqlQuery: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "proposals": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.proposals.search * @memberOf! () * @@ -4823,6 +6820,41 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.proposals.setupcomplete * @desc Update the given proposal to indicate that setup has been completed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.proposals.setupcomplete({ + * // The proposal id for which the setup is complete + * proposalId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.proposals.setupcomplete * @memberOf! () * @@ -4895,6 +6927,102 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.proposals.update * @desc Update the given proposal + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.proposals.update({ + * // The proposal id to update. + * proposalId: 'placeholder-value', + * // The last known revision number to update. If the head revision in the marketplace database has since changed, an error will be thrown. The caller should then fetch the latest proposal at head revision and retry the update at that revision. + * revisionNumber: 'placeholder-value', + * // The proposed action to take on the proposal. This field is required and it must be set when updating a proposal. + * updateAction: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "billedBuyer": {}, + * // "buyer": {}, + * // "buyerContacts": [], + * // "buyerPrivateData": {}, + * // "dbmAdvertiserIds": [], + * // "hasBuyerSignedOff": false, + * // "hasSellerSignedOff": false, + * // "inventorySource": "my_inventorySource", + * // "isRenegotiating": false, + * // "isSetupComplete": false, + * // "kind": "my_kind", + * // "labels": [], + * // "lastUpdaterOrCommentorRole": "my_lastUpdaterOrCommentorRole", + * // "name": "my_name", + * // "negotiationId": "my_negotiationId", + * // "originatorRole": "my_originatorRole", + * // "privateAuctionId": "my_privateAuctionId", + * // "proposalId": "my_proposalId", + * // "proposalState": "my_proposalState", + * // "revisionNumber": "my_revisionNumber", + * // "revisionTimeMs": "my_revisionTimeMs", + * // "seller": {}, + * // "sellerContacts": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billedBuyer": {}, + * // "buyer": {}, + * // "buyerContacts": [], + * // "buyerPrivateData": {}, + * // "dbmAdvertiserIds": [], + * // "hasBuyerSignedOff": false, + * // "hasSellerSignedOff": false, + * // "inventorySource": "my_inventorySource", + * // "isRenegotiating": false, + * // "isSetupComplete": false, + * // "kind": "my_kind", + * // "labels": [], + * // "lastUpdaterOrCommentorRole": "my_lastUpdaterOrCommentorRole", + * // "name": "my_name", + * // "negotiationId": "my_negotiationId", + * // "originatorRole": "my_originatorRole", + * // "privateAuctionId": "my_privateAuctionId", + * // "proposalId": "my_proposalId", + * // "proposalState": "my_proposalState", + * // "revisionNumber": "my_revisionNumber", + * // "revisionTimeMs": "my_revisionTimeMs", + * // "seller": {}, + * // "sellerContacts": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.proposals.update * @memberOf! () * @@ -5070,6 +7198,46 @@ export namespace adexchangebuyer_v1_4 { /** * adexchangebuyer.pubprofiles.list * @desc Gets the requested publisher profile(s) by publisher accountId. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer.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 adexchangebuyer = google.adexchangebuyer('v1.4'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer.pubprofiles.list({ + * // The accountId of the publisher to get profiles for. + * accountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "profiles": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer.pubprofiles.list * @memberOf! () * diff --git a/src/apis/adexchangebuyer2/v2beta1.ts b/src/apis/adexchangebuyer2/v2beta1.ts index 456d05212cd..99b158dc2b4 100644 --- a/src/apis/adexchangebuyer2/v2beta1.ts +++ b/src/apis/adexchangebuyer2/v2beta1.ts @@ -2130,6 +2130,71 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.clients.create * @desc Creates a new client buyer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.clients.create({ + * // Unique numerical account ID for the buyer of which the client buyer + * // is a customer; the sponsor buyer to create a client for. (required) + * accountId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clientAccountId": "my_clientAccountId", + * // "clientName": "my_clientName", + * // "entityId": "my_entityId", + * // "entityName": "my_entityName", + * // "entityType": "my_entityType", + * // "partnerClientId": "my_partnerClientId", + * // "role": "my_role", + * // "status": "my_status", + * // "visibleToSeller": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientAccountId": "my_clientAccountId", + * // "clientName": "my_clientName", + * // "entityId": "my_entityId", + * // "entityName": "my_entityName", + * // "entityType": "my_entityType", + * // "partnerClientId": "my_partnerClientId", + * // "role": "my_role", + * // "status": "my_status", + * // "visibleToSeller": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.clients.create * @memberOf! () * @@ -2204,6 +2269,56 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.clients.get * @desc Gets a client buyer with a given client account ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.clients.get({ + * // Numerical account ID of the client's sponsor buyer. (required) + * accountId: 'placeholder-value', + * // Numerical account ID of the client buyer to retrieve. (required) + * clientAccountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientAccountId": "my_clientAccountId", + * // "clientName": "my_clientName", + * // "entityId": "my_entityId", + * // "entityName": "my_entityName", + * // "entityType": "my_entityType", + * // "partnerClientId": "my_partnerClientId", + * // "role": "my_role", + * // "status": "my_status", + * // "visibleToSeller": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.clients.get * @memberOf! () * @@ -2278,6 +2393,61 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.clients.list * @desc Lists all the clients for the current sponsor buyer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.clients.list({ + * // Unique numerical account ID of the sponsor buyer to list the clients for. + * accountId: 'placeholder-value', + * // Requested page size. The server may return fewer clients than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListClientsResponse.nextPageToken + * // returned from the previous call to the + * // accounts.clients.list + * // method. + * pageToken: 'placeholder-value', + * // Optional unique identifier (from the standpoint of an Ad Exchange sponsor + * // buyer partner) of the client to return. + * // If specified, at most one client will be returned in the response. + * partnerClientId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clients": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.clients.list * @memberOf! () * @@ -2356,6 +2526,73 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.clients.update * @desc Updates an existing client buyer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.clients.update({ + * // Unique numerical account ID for the buyer of which the client buyer + * // is a customer; the sponsor buyer to update a client for. (required) + * accountId: 'placeholder-value', + * // Unique numerical account ID of the client to update. (required) + * clientAccountId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clientAccountId": "my_clientAccountId", + * // "clientName": "my_clientName", + * // "entityId": "my_entityId", + * // "entityName": "my_entityName", + * // "entityType": "my_entityType", + * // "partnerClientId": "my_partnerClientId", + * // "role": "my_role", + * // "status": "my_status", + * // "visibleToSeller": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientAccountId": "my_clientAccountId", + * // "clientName": "my_clientName", + * // "entityId": "my_entityId", + * // "entityName": "my_entityName", + * // "entityType": "my_entityType", + * // "partnerClientId": "my_partnerClientId", + * // "role": "my_role", + * // "status": "my_status", + * // "visibleToSeller": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.clients.update * @memberOf! () * @@ -2517,6 +2754,61 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.clients.invitations.create * @desc Creates and sends out an email invitation to access an Ad Exchange client buyer account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.clients.invitations.create({ + * // Numerical account ID of the client's sponsor buyer. (required) + * accountId: 'placeholder-value', + * // Numerical account ID of the client buyer that the user + * // should be associated with. (required) + * clientAccountId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clientAccountId": "my_clientAccountId", + * // "email": "my_email", + * // "invitationId": "my_invitationId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientAccountId": "my_clientAccountId", + * // "email": "my_email", + * // "invitationId": "my_invitationId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.clients.invitations.create * @memberOf! () * @@ -2596,6 +2888,53 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.clients.invitations.get * @desc Retrieves an existing client user invitation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.clients.invitations.get({ + * // Numerical account ID of the client's sponsor buyer. (required) + * accountId: 'placeholder-value', + * // Numerical account ID of the client buyer that the user invitation + * // to be retrieved is associated with. (required) + * clientAccountId: 'placeholder-value', + * // Numerical identifier of the user invitation to retrieve. (required) + * invitationId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientAccountId": "my_clientAccountId", + * // "email": "my_email", + * // "invitationId": "my_invitationId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.clients.invitations.get * @memberOf! () * @@ -2675,6 +3014,64 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.clients.invitations.list * @desc Lists all the client users invitations for a client with a given account ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.clients.invitations.list({ + * // Numerical account ID of the client's sponsor buyer. (required) + * accountId: 'placeholder-value', + * // Numerical account ID of the client buyer to list invitations for. + * // (required) + * // You must either specify a string representation of a + * // numerical account identifier or the `-` character + * // to list all the invitations for all the clients + * // of a given sponsor buyer. + * clientAccountId: 'placeholder-value', + * // Requested page size. Server may return fewer clients than requested. + * // If unspecified, server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListClientUserInvitationsResponse.nextPageToken + * // returned from the previous call to the + * // clients.invitations.list + * // method. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "invitations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.clients.invitations.list * @memberOf! () * @@ -2835,6 +3232,54 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.clients.users.get * @desc Retrieves an existing client user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.clients.users.get({ + * // Numerical account ID of the client's sponsor buyer. (required) + * accountId: 'placeholder-value', + * // Numerical account ID of the client buyer + * // that the user to be retrieved is associated with. (required) + * clientAccountId: 'placeholder-value', + * // Numerical identifier of the user to retrieve. (required) + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientAccountId": "my_clientAccountId", + * // "email": "my_email", + * // "status": "my_status", + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.clients.users.get * @memberOf! () * @@ -2912,6 +3357,64 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.clients.users.list * @desc Lists all the known client users for a specified sponsor buyer account ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.clients.users.list({ + * // Numerical account ID of the sponsor buyer of the client to list users for. + * // (required) + * accountId: 'placeholder-value', + * // The account ID of the client buyer to list users for. (required) + * // You must specify either a string representation of a + * // numerical account identifier or the `-` character + * // to list all the client users for all the clients + * // of a given sponsor buyer. + * clientAccountId: 'placeholder-value', + * // Requested page size. The server may return fewer clients than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListClientUsersResponse.nextPageToken + * // returned from the previous call to the + * // accounts.clients.users.list + * // method. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "users": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.clients.users.list * @memberOf! () * @@ -2992,6 +3495,65 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.clients.users.update * @desc Updates an existing client user. Only the user status can be changed on update. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.clients.users.update({ + * // Numerical account ID of the client's sponsor buyer. (required) + * accountId: 'placeholder-value', + * // Numerical account ID of the client buyer that the user to be retrieved + * // is associated with. (required) + * clientAccountId: 'placeholder-value', + * // Numerical identifier of the user to retrieve. (required) + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clientAccountId": "my_clientAccountId", + * // "email": "my_email", + * // "status": "my_status", + * // "userId": "my_userId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientAccountId": "my_clientAccountId", + * // "email": "my_email", + * // "status": "my_status", + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.clients.users.update * @memberOf! () * @@ -3151,6 +3713,110 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.creatives.create * @desc Creates a creative. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.creatives.create({ + * // The account that this creative belongs to. + * // Can be used to filter the response of the + * // creatives.list + * // method. + * accountId: 'placeholder-value', + * // Indicates if multiple creatives can share an ID or not. Default is + * // NO_DUPLICATES (one ID per creative). + * duplicateIdMode: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "adChoicesDestinationUrl": "my_adChoicesDestinationUrl", + * // "adTechnologyProviders": {}, + * // "advertiserName": "my_advertiserName", + * // "agencyId": "my_agencyId", + * // "apiUpdateTime": "my_apiUpdateTime", + * // "attributes": [], + * // "clickThroughUrls": [], + * // "corrections": [], + * // "creativeId": "my_creativeId", + * // "dealsStatus": "my_dealsStatus", + * // "declaredClickThroughUrls": [], + * // "detectedAdvertiserIds": [], + * // "detectedDomains": [], + * // "detectedLanguages": [], + * // "detectedProductCategories": [], + * // "detectedSensitiveCategories": [], + * // "html": {}, + * // "impressionTrackingUrls": [], + * // "native": {}, + * // "openAuctionStatus": "my_openAuctionStatus", + * // "restrictedCategories": [], + * // "servingRestrictions": [], + * // "vendorIds": [], + * // "version": 0, + * // "video": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adChoicesDestinationUrl": "my_adChoicesDestinationUrl", + * // "adTechnologyProviders": {}, + * // "advertiserName": "my_advertiserName", + * // "agencyId": "my_agencyId", + * // "apiUpdateTime": "my_apiUpdateTime", + * // "attributes": [], + * // "clickThroughUrls": [], + * // "corrections": [], + * // "creativeId": "my_creativeId", + * // "dealsStatus": "my_dealsStatus", + * // "declaredClickThroughUrls": [], + * // "detectedAdvertiserIds": [], + * // "detectedDomains": [], + * // "detectedLanguages": [], + * // "detectedProductCategories": [], + * // "detectedSensitiveCategories": [], + * // "html": {}, + * // "impressionTrackingUrls": [], + * // "native": {}, + * // "openAuctionStatus": "my_openAuctionStatus", + * // "restrictedCategories": [], + * // "servingRestrictions": [], + * // "vendorIds": [], + * // "version": 0, + * // "video": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.creatives.create * @memberOf! () * @@ -3226,6 +3892,73 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.creatives.get * @desc Gets a creative. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.creatives.get({ + * // The account the creative belongs to. + * accountId: 'placeholder-value', + * // The ID of the creative to retrieve. + * creativeId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adChoicesDestinationUrl": "my_adChoicesDestinationUrl", + * // "adTechnologyProviders": {}, + * // "advertiserName": "my_advertiserName", + * // "agencyId": "my_agencyId", + * // "apiUpdateTime": "my_apiUpdateTime", + * // "attributes": [], + * // "clickThroughUrls": [], + * // "corrections": [], + * // "creativeId": "my_creativeId", + * // "dealsStatus": "my_dealsStatus", + * // "declaredClickThroughUrls": [], + * // "detectedAdvertiserIds": [], + * // "detectedDomains": [], + * // "detectedLanguages": [], + * // "detectedProductCategories": [], + * // "detectedSensitiveCategories": [], + * // "html": {}, + * // "impressionTrackingUrls": [], + * // "native": {}, + * // "openAuctionStatus": "my_openAuctionStatus", + * // "restrictedCategories": [], + * // "servingRestrictions": [], + * // "vendorIds": [], + * // "version": 0, + * // "video": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.creatives.get * @memberOf! () * @@ -3299,6 +4032,75 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.creatives.list * @desc Lists creatives. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.creatives.list({ + * // The account to list the creatives from. + * // Specify "-" to list all creatives the current user has access to. + * accountId: 'placeholder-value', + * // Requested page size. The server may return fewer creatives than requested + * // (due to timeout constraint) even if more are available via another call. + * // If unspecified, server will pick an appropriate default. + * // Acceptable values are 1 to 1000, inclusive. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListCreativesResponse.next_page_token + * // returned from the previous call to 'ListCreatives' method. + * pageToken: 'placeholder-value', + * // An optional query string to filter creatives. If no filter is specified, + * // all active creatives will be returned. + * //

                          Supported queries are: + * //

                            + * //
                          • accountId=account_id_string + * //
                          • creativeId=creative_id_string + * //
                          • dealsStatus: {approved, conditionally_approved, disapproved, + * // not_checked} + * //
                          • openAuctionStatus: {approved, conditionally_approved, disapproved, + * // not_checked} + * //
                          • attribute: {a numeric attribute from the list of attributes} + * //
                          • disapprovalReason: {a reason from + * // DisapprovalReason} + * //
                          + * // Example: 'accountId=12345 AND (dealsStatus:disapproved AND + * // disapprovalReason:unacceptable_content) OR attribute:47' + * query: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creatives": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.creatives.list * @memberOf! () * @@ -3379,6 +4181,53 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.creatives.stopWatching * @desc Stops watching a creative. Will stop push notifications being sent to the topics when the creative changes status. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.creatives.stopWatching({ + * // The account of the creative to stop notifications for. + * accountId: 'placeholder-value', + * // The creative ID of the creative to stop notifications for. + * // Specify "-" to specify stopping account level notifications. + * creativeId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.creatives.stopWatching * @memberOf! () * @@ -3454,6 +4303,112 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.creatives.update * @desc Updates a creative. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.creatives.update({ + * // The account that this creative belongs to. + * // Can be used to filter the response of the + * // creatives.list + * // method. + * accountId: 'placeholder-value', + * // The buyer-defined creative ID of this creative. + * // Can be used to filter the response of the + * // creatives.list + * // method. + * creativeId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "adChoicesDestinationUrl": "my_adChoicesDestinationUrl", + * // "adTechnologyProviders": {}, + * // "advertiserName": "my_advertiserName", + * // "agencyId": "my_agencyId", + * // "apiUpdateTime": "my_apiUpdateTime", + * // "attributes": [], + * // "clickThroughUrls": [], + * // "corrections": [], + * // "creativeId": "my_creativeId", + * // "dealsStatus": "my_dealsStatus", + * // "declaredClickThroughUrls": [], + * // "detectedAdvertiserIds": [], + * // "detectedDomains": [], + * // "detectedLanguages": [], + * // "detectedProductCategories": [], + * // "detectedSensitiveCategories": [], + * // "html": {}, + * // "impressionTrackingUrls": [], + * // "native": {}, + * // "openAuctionStatus": "my_openAuctionStatus", + * // "restrictedCategories": [], + * // "servingRestrictions": [], + * // "vendorIds": [], + * // "version": 0, + * // "video": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adChoicesDestinationUrl": "my_adChoicesDestinationUrl", + * // "adTechnologyProviders": {}, + * // "advertiserName": "my_advertiserName", + * // "agencyId": "my_agencyId", + * // "apiUpdateTime": "my_apiUpdateTime", + * // "attributes": [], + * // "clickThroughUrls": [], + * // "corrections": [], + * // "creativeId": "my_creativeId", + * // "dealsStatus": "my_dealsStatus", + * // "declaredClickThroughUrls": [], + * // "detectedAdvertiserIds": [], + * // "detectedDomains": [], + * // "detectedLanguages": [], + * // "detectedProductCategories": [], + * // "detectedSensitiveCategories": [], + * // "html": {}, + * // "impressionTrackingUrls": [], + * // "native": {}, + * // "openAuctionStatus": "my_openAuctionStatus", + * // "restrictedCategories": [], + * // "servingRestrictions": [], + * // "vendorIds": [], + * // "version": 0, + * // "video": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.creatives.update * @memberOf! () * @@ -3528,6 +4483,58 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.creatives.watch * @desc Watches a creative. Will result in push notifications being sent to the topic when the creative changes status. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.creatives.watch({ + * // The account of the creative to watch. + * accountId: 'placeholder-value', + * // The creative ID to watch for status changes. + * // Specify "-" to watch all creatives under the above account. + * // If both creative-level and account-level notifications are + * // sent, only a single notification will be sent to the + * // creative-level notification topic. + * creativeId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "topic": "my_topic" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.creatives.watch * @memberOf! () * @@ -3735,6 +4742,54 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.creatives.dealAssociations.add * @desc Associate an existing deal with a creative. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.creatives.dealAssociations.add({ + * // The account the creative belongs to. + * accountId: 'placeholder-value', + * // The ID of the creative associated with the deal. + * creativeId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "association": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.creatives.dealAssociations.add * @memberOf! () * @@ -3810,6 +4865,73 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.creatives.dealAssociations.list * @desc List all creative-deal associations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.creatives.dealAssociations.list({ + * // The account to list the associations from. + * // Specify "-" to list all creatives the current user has access to. + * accountId: 'placeholder-value', + * // The creative ID to list the associations from. + * // Specify "-" to list all creatives under the above account. + * creativeId: 'placeholder-value', + * // Requested page size. Server may return fewer associations than requested. + * // If unspecified, server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListDealAssociationsResponse.next_page_token + * // returned from the previous call to 'ListDealAssociations' method. + * pageToken: 'placeholder-value', + * // An optional query string to filter deal associations. If no filter is + * // specified, all associations will be returned. + * // Supported queries are: + * //
                            + * //
                          • accountId=account_id_string + * //
                          • creativeId=creative_id_string + * //
                          • dealsId=deals_id_string + * //
                          • dealsStatus:{approved, conditionally_approved, disapproved, + * // not_checked} + * //
                          • openAuctionStatus:{approved, conditionally_approved, disapproved, + * // not_checked} + * //
                          + * // Example: 'dealsId=12345 AND dealsStatus:disapproved' + * query: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "associations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.creatives.dealAssociations.list * @memberOf! () * @@ -3898,6 +5020,56 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.creatives.dealAssociations.remove * @desc Remove the association between a deal and a creative. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.creatives.dealAssociations.remove( + * { + * // The account the creative belongs to. + * accountId: 'placeholder-value', + * // The ID of the creative associated with the deal. + * creativeId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "association": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.creatives.dealAssociations.remove * @memberOf! () * @@ -4051,6 +5223,60 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.finalizedProposals.list * @desc List finalized proposals, regardless if a proposal is being renegotiated. A filter expression (PQL query) may be specified to filter the results. The notes will not be returned. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.finalizedProposals.list({ + * // Account ID of the buyer. + * accountId: 'placeholder-value', + * // An optional PQL filter query used to query for proposals. + * // + * // Nested repeated fields, such as proposal.deals.targetingCriterion, + * // cannot be filtered. + * filter: 'placeholder-value', + * // Syntax the filter is written in. Current implementation defaults to PQL + * // but in the future it will be LIST_FILTER. + * filterSyntax: 'placeholder-value', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // The page token as returned from ListProposalsResponse. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "proposals": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.finalizedProposals.list * @memberOf! () * @@ -4167,6 +5393,62 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.products.get * @desc Gets the requested product by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.products.get({ + * // Account ID of the buyer. + * accountId: 'placeholder-value', + * // The ID for the product to get the head revision for. + * productId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "availableEndTime": "my_availableEndTime", + * // "availableStartTime": "my_availableStartTime", + * // "createTime": "my_createTime", + * // "creatorContacts": [], + * // "displayName": "my_displayName", + * // "hasCreatorSignedOff": false, + * // "productId": "my_productId", + * // "productRevision": "my_productRevision", + * // "publisherProfileId": "my_publisherProfileId", + * // "seller": {}, + * // "syndicationProduct": "my_syndicationProduct", + * // "targetingCriterion": [], + * // "terms": {}, + * // "updateTime": "my_updateTime", + * // "webPropertyCode": "my_webPropertyCode" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.products.get * @memberOf! () * @@ -4240,6 +5522,59 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.products.list * @desc List all products visible to the buyer (optionally filtered by the specified PQL query). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.products.list({ + * // Account ID of the buyer. + * accountId: 'placeholder-value', + * // An optional PQL query used to query for products. See + * // https://developers.google.com/ad-manager/docs/pqlreference + * // for documentation about PQL and examples. + * // + * // Nested repeated fields, such as product.targetingCriterion.inclusions, + * // cannot be filtered. + * filter: 'placeholder-value', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // The page token as returned from ListProductsResponse. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "products": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.products.list * @memberOf! () * @@ -4368,6 +5703,73 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.proposals.accept * @desc Mark the proposal as accepted at the given revision number. If the number does not match the server's revision number an `ABORTED` error message will be returned. This call updates the proposal_state from `PROPOSED` to `BUYER_ACCEPTED`, or from `SELLER_ACCEPTED` to `FINALIZED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.proposals.accept({ + * // Account ID of the buyer. + * accountId: 'placeholder-value', + * // The ID of the proposal to accept. + * proposalId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "proposalRevision": "my_proposalRevision" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billedBuyer": {}, + * // "buyer": {}, + * // "buyerContacts": [], + * // "buyerPrivateData": {}, + * // "deals": [], + * // "displayName": "my_displayName", + * // "isRenegotiating": false, + * // "isSetupComplete": false, + * // "lastUpdaterOrCommentorRole": "my_lastUpdaterOrCommentorRole", + * // "notes": [], + * // "originatorRole": "my_originatorRole", + * // "privateAuctionId": "my_privateAuctionId", + * // "proposalId": "my_proposalId", + * // "proposalRevision": "my_proposalRevision", + * // "proposalState": "my_proposalState", + * // "seller": {}, + * // "sellerContacts": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.proposals.accept * @memberOf! () * @@ -4443,6 +5845,60 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.proposals.addNote * @desc Create a new note and attach it to the proposal. The note is assigned a unique ID by the server. The proposal revision number will not increase when associated with a new note. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.proposals.addNote({ + * // Account ID of the buyer. + * accountId: 'placeholder-value', + * // The ID of the proposal to attach the note to. + * proposalId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "note": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "creatorRole": "my_creatorRole", + * // "note": "my_note", + * // "noteId": "my_noteId", + * // "proposalRevision": "my_proposalRevision" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.proposals.addNote * @memberOf! () * @@ -4518,6 +5974,71 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.proposals.cancelNegotiation * @desc Cancel an ongoing negotiation on a proposal. This does not cancel or end serving for the deals if the proposal has been finalized, but only cancels a negotiation unilaterally. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.proposals.cancelNegotiation({ + * // Account ID of the buyer. + * accountId: 'placeholder-value', + * // The ID of the proposal to cancel negotiation for. + * proposalId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billedBuyer": {}, + * // "buyer": {}, + * // "buyerContacts": [], + * // "buyerPrivateData": {}, + * // "deals": [], + * // "displayName": "my_displayName", + * // "isRenegotiating": false, + * // "isSetupComplete": false, + * // "lastUpdaterOrCommentorRole": "my_lastUpdaterOrCommentorRole", + * // "notes": [], + * // "originatorRole": "my_originatorRole", + * // "privateAuctionId": "my_privateAuctionId", + * // "proposalId": "my_proposalId", + * // "proposalRevision": "my_proposalRevision", + * // "proposalState": "my_proposalState", + * // "seller": {}, + * // "sellerContacts": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.proposals.cancelNegotiation * @memberOf! () * @@ -4593,6 +6114,71 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.proposals.completeSetup * @desc Update the given proposal to indicate that setup has been completed. This method is called by the buyer when the line items have been created on their end for a finalized proposal and all the required creatives have been uploaded using the creatives API. This call updates the `is_setup_completed` bit on the proposal and also notifies the seller. The server will advance the revision number of the most recent proposal. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.proposals.completeSetup({ + * // Account ID of the buyer. + * accountId: 'placeholder-value', + * // The ID of the proposal to mark as setup completed. + * proposalId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billedBuyer": {}, + * // "buyer": {}, + * // "buyerContacts": [], + * // "buyerPrivateData": {}, + * // "deals": [], + * // "displayName": "my_displayName", + * // "isRenegotiating": false, + * // "isSetupComplete": false, + * // "lastUpdaterOrCommentorRole": "my_lastUpdaterOrCommentorRole", + * // "notes": [], + * // "originatorRole": "my_originatorRole", + * // "privateAuctionId": "my_privateAuctionId", + * // "proposalId": "my_proposalId", + * // "proposalRevision": "my_proposalRevision", + * // "proposalState": "my_proposalState", + * // "seller": {}, + * // "sellerContacts": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.proposals.completeSetup * @memberOf! () * @@ -4668,6 +6254,88 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.proposals.create * @desc Create the given proposal. Each created proposal and any deals it contains are assigned a unique ID by the server. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.proposals.create({ + * // Account ID of the buyer. + * accountId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "billedBuyer": {}, + * // "buyer": {}, + * // "buyerContacts": [], + * // "buyerPrivateData": {}, + * // "deals": [], + * // "displayName": "my_displayName", + * // "isRenegotiating": false, + * // "isSetupComplete": false, + * // "lastUpdaterOrCommentorRole": "my_lastUpdaterOrCommentorRole", + * // "notes": [], + * // "originatorRole": "my_originatorRole", + * // "privateAuctionId": "my_privateAuctionId", + * // "proposalId": "my_proposalId", + * // "proposalRevision": "my_proposalRevision", + * // "proposalState": "my_proposalState", + * // "seller": {}, + * // "sellerContacts": [], + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billedBuyer": {}, + * // "buyer": {}, + * // "buyerContacts": [], + * // "buyerPrivateData": {}, + * // "deals": [], + * // "displayName": "my_displayName", + * // "isRenegotiating": false, + * // "isSetupComplete": false, + * // "lastUpdaterOrCommentorRole": "my_lastUpdaterOrCommentorRole", + * // "notes": [], + * // "originatorRole": "my_originatorRole", + * // "privateAuctionId": "my_privateAuctionId", + * // "proposalId": "my_proposalId", + * // "proposalRevision": "my_proposalRevision", + * // "proposalState": "my_proposalState", + * // "seller": {}, + * // "sellerContacts": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.proposals.create * @memberOf! () * @@ -4742,6 +6410,65 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.proposals.get * @desc Gets a proposal given its ID. The proposal is returned at its head revision. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.proposals.get({ + * // Account ID of the buyer. + * accountId: 'placeholder-value', + * // The unique ID of the proposal + * proposalId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billedBuyer": {}, + * // "buyer": {}, + * // "buyerContacts": [], + * // "buyerPrivateData": {}, + * // "deals": [], + * // "displayName": "my_displayName", + * // "isRenegotiating": false, + * // "isSetupComplete": false, + * // "lastUpdaterOrCommentorRole": "my_lastUpdaterOrCommentorRole", + * // "notes": [], + * // "originatorRole": "my_originatorRole", + * // "privateAuctionId": "my_privateAuctionId", + * // "proposalId": "my_proposalId", + * // "proposalRevision": "my_proposalRevision", + * // "proposalState": "my_proposalState", + * // "seller": {}, + * // "sellerContacts": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.proposals.get * @memberOf! () * @@ -4815,6 +6542,60 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.proposals.list * @desc List proposals. A filter expression (PQL query) may be specified to filter the results. To retrieve all finalized proposals, regardless if a proposal is being renegotiated, see the FinalizedProposals resource. Note that Bidder/ChildSeat relationships differ from the usual behavior. A Bidder account can only see its child seats' proposals by specifying the ChildSeat's accountId in the request path. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.proposals.list({ + * // Account ID of the buyer. + * accountId: 'placeholder-value', + * // An optional PQL filter query used to query for proposals. + * // + * // Nested repeated fields, such as proposal.deals.targetingCriterion, + * // cannot be filtered. + * filter: 'placeholder-value', + * // Syntax the filter is written in. Current implementation defaults to PQL + * // but in the future it will be LIST_FILTER. + * filterSyntax: 'placeholder-value', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // The page token as returned from ListProposalsResponse. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "proposals": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.proposals.list * @memberOf! () * @@ -4896,6 +6677,73 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.proposals.pause * @desc Update the given proposal to pause serving. This method will set the `DealServingMetadata.DealPauseStatus.has_buyer_paused` bit to true for all deals in the proposal. It is a no-op to pause an already-paused proposal. It is an error to call PauseProposal for a proposal that is not finalized or renegotiating. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.proposals.pause({ + * // Account ID of the buyer. + * accountId: 'placeholder-value', + * // The ID of the proposal to pause. + * proposalId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "reason": "my_reason" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billedBuyer": {}, + * // "buyer": {}, + * // "buyerContacts": [], + * // "buyerPrivateData": {}, + * // "deals": [], + * // "displayName": "my_displayName", + * // "isRenegotiating": false, + * // "isSetupComplete": false, + * // "lastUpdaterOrCommentorRole": "my_lastUpdaterOrCommentorRole", + * // "notes": [], + * // "originatorRole": "my_originatorRole", + * // "privateAuctionId": "my_privateAuctionId", + * // "proposalId": "my_proposalId", + * // "proposalRevision": "my_proposalRevision", + * // "proposalState": "my_proposalState", + * // "seller": {}, + * // "sellerContacts": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.proposals.pause * @memberOf! () * @@ -4971,6 +6819,71 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.proposals.resume * @desc Update the given proposal to resume serving. This method will set the `DealServingMetadata.DealPauseStatus.has_buyer_paused` bit to false for all deals in the proposal. Note that if the `has_seller_paused` bit is also set, serving will not resume until the seller also resumes. It is a no-op to resume an already-running proposal. It is an error to call ResumeProposal for a proposal that is not finalized or renegotiating. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.proposals.resume({ + * // Account ID of the buyer. + * accountId: 'placeholder-value', + * // The ID of the proposal to resume. + * proposalId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billedBuyer": {}, + * // "buyer": {}, + * // "buyerContacts": [], + * // "buyerPrivateData": {}, + * // "deals": [], + * // "displayName": "my_displayName", + * // "isRenegotiating": false, + * // "isSetupComplete": false, + * // "lastUpdaterOrCommentorRole": "my_lastUpdaterOrCommentorRole", + * // "notes": [], + * // "originatorRole": "my_originatorRole", + * // "privateAuctionId": "my_privateAuctionId", + * // "proposalId": "my_proposalId", + * // "proposalRevision": "my_proposalRevision", + * // "proposalState": "my_proposalState", + * // "seller": {}, + * // "sellerContacts": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.proposals.resume * @memberOf! () * @@ -5046,6 +6959,90 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.proposals.update * @desc Update the given proposal at the client known revision number. If the server revision has advanced since the passed-in `proposal.proposal_revision`, an `ABORTED` error message will be returned. Only the buyer-modifiable fields of the proposal will be updated. Note that the deals in the proposal will be updated to match the passed-in copy. If a passed-in deal does not have a `deal_id`, the server will assign a new unique ID and create the deal. If passed-in deal has a `deal_id`, it will be updated to match the passed-in copy. Any existing deals not present in the passed-in proposal will be deleted. It is an error to pass in a deal with a `deal_id` not present at head. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.proposals.update({ + * // Account ID of the buyer. + * accountId: 'placeholder-value', + * // The unique ID of the proposal. + * proposalId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "billedBuyer": {}, + * // "buyer": {}, + * // "buyerContacts": [], + * // "buyerPrivateData": {}, + * // "deals": [], + * // "displayName": "my_displayName", + * // "isRenegotiating": false, + * // "isSetupComplete": false, + * // "lastUpdaterOrCommentorRole": "my_lastUpdaterOrCommentorRole", + * // "notes": [], + * // "originatorRole": "my_originatorRole", + * // "privateAuctionId": "my_privateAuctionId", + * // "proposalId": "my_proposalId", + * // "proposalRevision": "my_proposalRevision", + * // "proposalState": "my_proposalState", + * // "seller": {}, + * // "sellerContacts": [], + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billedBuyer": {}, + * // "buyer": {}, + * // "buyerContacts": [], + * // "buyerPrivateData": {}, + * // "deals": [], + * // "displayName": "my_displayName", + * // "isRenegotiating": false, + * // "isSetupComplete": false, + * // "lastUpdaterOrCommentorRole": "my_lastUpdaterOrCommentorRole", + * // "notes": [], + * // "originatorRole": "my_originatorRole", + * // "privateAuctionId": "my_privateAuctionId", + * // "proposalId": "my_proposalId", + * // "proposalRevision": "my_proposalRevision", + * // "proposalState": "my_proposalState", + * // "seller": {}, + * // "sellerContacts": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.proposals.update * @memberOf! () * @@ -5336,6 +7333,63 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.publisherProfiles.get * @desc Gets the requested publisher profile by id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.publisherProfiles.get({ + * // Account ID of the buyer. + * accountId: 'placeholder-value', + * // The id for the publisher profile to get. + * publisherProfileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "audienceDescription": "my_audienceDescription", + * // "buyerPitchStatement": "my_buyerPitchStatement", + * // "directDealsContact": "my_directDealsContact", + * // "displayName": "my_displayName", + * // "domains": [], + * // "googlePlusUrl": "my_googlePlusUrl", + * // "isParent": false, + * // "logoUrl": "my_logoUrl", + * // "mediaKitUrl": "my_mediaKitUrl", + * // "overview": "my_overview", + * // "programmaticDealsContact": "my_programmaticDealsContact", + * // "publisherProfileId": "my_publisherProfileId", + * // "rateCardInfoUrl": "my_rateCardInfoUrl", + * // "samplePageUrl": "my_samplePageUrl", + * // "seller": {}, + * // "topHeadlines": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.publisherProfiles.get * @memberOf! () * @@ -5412,6 +7466,51 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.accounts.publisherProfiles.list * @desc List all publisher profiles visible to the buyer + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.accounts.publisherProfiles.list({ + * // Account ID of the buyer. + * accountId: 'placeholder-value', + * // Specify the number of results to include per page. + * pageSize: 'placeholder-value', + * // The page token as return from ListPublisherProfilesResponse. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "publisherProfiles": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.accounts.publisherProfiles.list * @memberOf! () * @@ -5593,6 +7692,93 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.accounts.filterSets.create * @desc Creates the specified filter set for the account with the given account ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.accounts.filterSets.create({ + * // Whether the filter set is transient, or should be persisted indefinitely. + * // By default, filter sets are not transient. + * // If transient, it will be available for at least 1 hour after creation. + * isTransient: 'placeholder-value', + * // Name of the owner (bidder or account) of the filter set to be created. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: `bidders/123` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456` + * ownerName: 'bidders/my-bidder/accounts/my-account', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "absoluteDateRange": {}, + * // "breakdownDimensions": [], + * // "creativeId": "my_creativeId", + * // "dealId": "my_dealId", + * // "environment": "my_environment", + * // "format": "my_format", + * // "formats": [], + * // "name": "my_name", + * // "platforms": [], + * // "publisherIdentifiers": [], + * // "realtimeTimeRange": {}, + * // "relativeDateRange": {}, + * // "sellerNetworkIds": [], + * // "timeSeriesGranularity": "my_timeSeriesGranularity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "absoluteDateRange": {}, + * // "breakdownDimensions": [], + * // "creativeId": "my_creativeId", + * // "dealId": "my_dealId", + * // "environment": "my_environment", + * // "format": "my_format", + * // "formats": [], + * // "name": "my_name", + * // "platforms": [], + * // "publisherIdentifiers": [], + * // "realtimeTimeRange": {}, + * // "relativeDateRange": {}, + * // "sellerNetworkIds": [], + * // "timeSeriesGranularity": "my_timeSeriesGranularity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.accounts.filterSets.create * @memberOf! () * @@ -5670,6 +7856,54 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.accounts.filterSets.delete * @desc Deletes the requested filter set from the account with the given account ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.accounts.filterSets.delete({ + * // Full name of the resource to delete. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * name: 'bidders/my-bidder/accounts/my-account/filterSets/my-filterSet', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.accounts.filterSets.delete * @memberOf! () * @@ -5740,6 +7974,69 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.accounts.filterSets.get * @desc Retrieves the requested filter set for the account with the given account ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.accounts.filterSets.get({ + * // Full name of the resource being requested. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * name: 'bidders/my-bidder/accounts/my-account/filterSets/my-filterSet', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "absoluteDateRange": {}, + * // "breakdownDimensions": [], + * // "creativeId": "my_creativeId", + * // "dealId": "my_dealId", + * // "environment": "my_environment", + * // "format": "my_format", + * // "formats": [], + * // "name": "my_name", + * // "platforms": [], + * // "publisherIdentifiers": [], + * // "realtimeTimeRange": {}, + * // "relativeDateRange": {}, + * // "sellerNetworkIds": [], + * // "timeSeriesGranularity": "my_timeSeriesGranularity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.accounts.filterSets.get * @memberOf! () * @@ -5812,6 +8109,66 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.accounts.filterSets.list * @desc Lists all filter sets for the account with the given account ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.accounts.filterSets.list({ + * // Name of the owner (bidder or account) of the filter sets to be listed. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: `bidders/123` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456` + * ownerName: 'bidders/my-bidder/accounts/my-account', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListFilterSetsResponse.nextPageToken + * // returned from the previous call to the + * // accounts.filterSets.list + * // method. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "filterSets": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.accounts.filterSets.list * @memberOf! () * @@ -5964,6 +8321,69 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.accounts.filterSets.bidMetrics.list * @desc Lists all metrics that are measured in terms of number of bids. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.accounts.filterSets.bidMetrics.list( + * { + * // Name of the filter set that should be applied to the requested metrics. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * filterSetName: + * 'bidders/my-bidder/accounts/my-account/filterSets/my-filterSet', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListBidMetricsResponse.nextPageToken + * // returned from the previous call to the bidMetrics.list + * // method. + * pageToken: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "bidMetricsRows": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.accounts.filterSets.bidMetrics.list * @memberOf! () * @@ -6071,6 +8491,69 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.accounts.filterSets.bidResponseErrors.list * @desc List all errors that occurred in bid responses, with the number of bid responses affected for each reason. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.accounts.filterSets.bidResponseErrors.list( + * { + * // Name of the filter set that should be applied to the requested metrics. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * filterSetName: + * 'bidders/my-bidder/accounts/my-account/filterSets/my-filterSet', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListBidResponseErrorsResponse.nextPageToken + * // returned from the previous call to the bidResponseErrors.list + * // method. + * pageToken: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "calloutStatusRows": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.accounts.filterSets.bidResponseErrors.list * @memberOf! () * @@ -6184,6 +8667,69 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.accounts.filterSets.bidResponsesWithoutBids.list * @desc List all reasons for which bid responses were considered to have no applicable bids, with the number of bid responses affected for each reason. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.accounts.filterSets.bidResponsesWithoutBids.list( + * { + * // Name of the filter set that should be applied to the requested metrics. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * filterSetName: + * 'bidders/my-bidder/accounts/my-account/filterSets/my-filterSet', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListBidResponsesWithoutBidsResponse.nextPageToken + * // returned from the previous call to the bidResponsesWithoutBids.list + * // method. + * pageToken: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "bidResponseWithoutBidsStatusRows": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.accounts.filterSets.bidResponsesWithoutBids.list * @memberOf! () * @@ -6299,6 +8845,69 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.accounts.filterSets.filteredBidRequests.list * @desc List all reasons that caused a bid request not to be sent for an impression, with the number of bid requests not sent for each reason. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.accounts.filterSets.filteredBidRequests.list( + * { + * // Name of the filter set that should be applied to the requested metrics. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * filterSetName: + * 'bidders/my-bidder/accounts/my-account/filterSets/my-filterSet', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListFilteredBidRequestsResponse.nextPageToken + * // returned from the previous call to the filteredBidRequests.list + * // method. + * pageToken: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "calloutStatusRows": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.accounts.filterSets.filteredBidRequests.list * @memberOf! () * @@ -6420,6 +9029,69 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.accounts.filterSets.filteredBids.list * @desc List all reasons for which bids were filtered, with the number of bids filtered for each reason. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.accounts.filterSets.filteredBids.list( + * { + * // Name of the filter set that should be applied to the requested metrics. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * filterSetName: + * 'bidders/my-bidder/accounts/my-account/filterSets/my-filterSet', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListFilteredBidsResponse.nextPageToken + * // returned from the previous call to the filteredBids.list + * // method. + * pageToken: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "creativeStatusRows": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.accounts.filterSets.filteredBids.list * @memberOf! () * @@ -6527,6 +9199,74 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.accounts.filterSets.filteredBids.creatives.list * @desc List all creatives associated with a specific reason for which bids were filtered, with the number of bids filtered for each creative. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.accounts.filterSets.filteredBids.creatives.list( + * { + * // The ID of the creative status for which to retrieve a breakdown by + * // creative. + * // See + * // [creative-status-codes](https://developers.google.com/authorized-buyers/rtb/downloads/creative-status-codes). + * creativeStatusId: 'placeholder-value', + * // Name of the filter set that should be applied to the requested metrics. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * filterSetName: + * 'bidders/my-bidder/accounts/my-account/filterSets/my-filterSet', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListCreativeStatusBreakdownByCreativeResponse.nextPageToken + * // returned from the previous call to the filteredBids.creatives.list + * // method. + * pageToken: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "filteredBidCreativeRows": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.accounts.filterSets.filteredBids.creatives.list * @memberOf! () * @@ -6662,6 +9402,75 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.accounts.filterSets.filteredBids.details.list * @desc List all details associated with a specific reason for which bids were filtered, with the number of bids filtered for each detail. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.accounts.filterSets.filteredBids.details.list( + * { + * // The ID of the creative status for which to retrieve a breakdown by detail. + * // See + * // [creative-status-codes](https://developers.google.com/authorized-buyers/rtb/downloads/creative-status-codes). + * // Details are only available for statuses 10, 14, 15, 17, 18, 19, 86, and 87. + * creativeStatusId: 'placeholder-value', + * // Name of the filter set that should be applied to the requested metrics. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * filterSetName: + * 'bidders/my-bidder/accounts/my-account/filterSets/my-filterSet', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListCreativeStatusBreakdownByDetailResponse.nextPageToken + * // returned from the previous call to the filteredBids.details.list + * // method. + * pageToken: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "detailType": "my_detailType", + * // "filteredBidDetailRows": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.accounts.filterSets.filteredBids.details.list * @memberOf! () * @@ -6797,6 +9606,69 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.accounts.filterSets.impressionMetrics.list * @desc Lists all metrics that are measured in terms of number of impressions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.accounts.filterSets.impressionMetrics.list( + * { + * // Name of the filter set that should be applied to the requested metrics. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * filterSetName: + * 'bidders/my-bidder/accounts/my-account/filterSets/my-filterSet', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListImpressionMetricsResponse.nextPageToken + * // returned from the previous call to the impressionMetrics.list + * // method. + * pageToken: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "impressionMetricsRows": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.accounts.filterSets.impressionMetrics.list * @memberOf! () * @@ -6910,6 +9782,69 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.accounts.filterSets.losingBids.list * @desc List all reasons for which bids lost in the auction, with the number of bids that lost for each reason. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.accounts.filterSets.losingBids.list( + * { + * // Name of the filter set that should be applied to the requested metrics. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * filterSetName: + * 'bidders/my-bidder/accounts/my-account/filterSets/my-filterSet', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListLosingBidsResponse.nextPageToken + * // returned from the previous call to the losingBids.list + * // method. + * pageToken: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "creativeStatusRows": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.accounts.filterSets.losingBids.list * @memberOf! () * @@ -7017,6 +9952,69 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.accounts.filterSets.nonBillableWinningBids.list * @desc List all reasons for which winning bids were not billable, with the number of bids not billed for each reason. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.accounts.filterSets.nonBillableWinningBids.list( + * { + * // Name of the filter set that should be applied to the requested metrics. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * filterSetName: + * 'bidders/my-bidder/accounts/my-account/filterSets/my-filterSet', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListNonBillableWinningBidsResponse.nextPageToken + * // returned from the previous call to the nonBillableWinningBids.list + * // method. + * pageToken: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "nonBillableWinningBidStatusRows": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.accounts.filterSets.nonBillableWinningBids.list * @memberOf! () * @@ -7162,6 +10160,93 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.filterSets.create * @desc Creates the specified filter set for the account with the given account ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.filterSets.create({ + * // Whether the filter set is transient, or should be persisted indefinitely. + * // By default, filter sets are not transient. + * // If transient, it will be available for at least 1 hour after creation. + * isTransient: 'placeholder-value', + * // Name of the owner (bidder or account) of the filter set to be created. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: `bidders/123` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456` + * ownerName: 'bidders/my-bidder', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "absoluteDateRange": {}, + * // "breakdownDimensions": [], + * // "creativeId": "my_creativeId", + * // "dealId": "my_dealId", + * // "environment": "my_environment", + * // "format": "my_format", + * // "formats": [], + * // "name": "my_name", + * // "platforms": [], + * // "publisherIdentifiers": [], + * // "realtimeTimeRange": {}, + * // "relativeDateRange": {}, + * // "sellerNetworkIds": [], + * // "timeSeriesGranularity": "my_timeSeriesGranularity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "absoluteDateRange": {}, + * // "breakdownDimensions": [], + * // "creativeId": "my_creativeId", + * // "dealId": "my_dealId", + * // "environment": "my_environment", + * // "format": "my_format", + * // "formats": [], + * // "name": "my_name", + * // "platforms": [], + * // "publisherIdentifiers": [], + * // "realtimeTimeRange": {}, + * // "relativeDateRange": {}, + * // "sellerNetworkIds": [], + * // "timeSeriesGranularity": "my_timeSeriesGranularity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.filterSets.create * @memberOf! () * @@ -7239,6 +10324,54 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.filterSets.delete * @desc Deletes the requested filter set from the account with the given account ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.filterSets.delete({ + * // Full name of the resource to delete. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * name: 'bidders/my-bidder/filterSets/my-filterSet', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.filterSets.delete * @memberOf! () * @@ -7309,6 +10442,69 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.filterSets.get * @desc Retrieves the requested filter set for the account with the given account ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.filterSets.get({ + * // Full name of the resource being requested. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * name: 'bidders/my-bidder/filterSets/my-filterSet', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "absoluteDateRange": {}, + * // "breakdownDimensions": [], + * // "creativeId": "my_creativeId", + * // "dealId": "my_dealId", + * // "environment": "my_environment", + * // "format": "my_format", + * // "formats": [], + * // "name": "my_name", + * // "platforms": [], + * // "publisherIdentifiers": [], + * // "realtimeTimeRange": {}, + * // "relativeDateRange": {}, + * // "sellerNetworkIds": [], + * // "timeSeriesGranularity": "my_timeSeriesGranularity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.filterSets.get * @memberOf! () * @@ -7381,6 +10577,66 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.filterSets.list * @desc Lists all filter sets for the account with the given account ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.filterSets.list({ + * // Name of the owner (bidder or account) of the filter sets to be listed. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: `bidders/123` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456` + * ownerName: 'bidders/my-bidder', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListFilterSetsResponse.nextPageToken + * // returned from the previous call to the + * // accounts.filterSets.list + * // method. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "filterSets": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.filterSets.list * @memberOf! () * @@ -7533,6 +10789,66 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.filterSets.bidMetrics.list * @desc Lists all metrics that are measured in terms of number of bids. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.filterSets.bidMetrics.list({ + * // Name of the filter set that should be applied to the requested metrics. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * filterSetName: 'bidders/my-bidder/filterSets/my-filterSet', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListBidMetricsResponse.nextPageToken + * // returned from the previous call to the bidMetrics.list + * // method. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bidMetricsRows": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.filterSets.bidMetrics.list * @memberOf! () * @@ -7640,6 +10956,66 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.filterSets.bidResponseErrors.list * @desc List all errors that occurred in bid responses, with the number of bid responses affected for each reason. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.filterSets.bidResponseErrors.list({ + * // Name of the filter set that should be applied to the requested metrics. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * filterSetName: 'bidders/my-bidder/filterSets/my-filterSet', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListBidResponseErrorsResponse.nextPageToken + * // returned from the previous call to the bidResponseErrors.list + * // method. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "calloutStatusRows": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.filterSets.bidResponseErrors.list * @memberOf! () * @@ -7753,6 +11129,68 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.filterSets.bidResponsesWithoutBids.list * @desc List all reasons for which bid responses were considered to have no applicable bids, with the number of bid responses affected for each reason. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.filterSets.bidResponsesWithoutBids.list( + * { + * // Name of the filter set that should be applied to the requested metrics. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * filterSetName: 'bidders/my-bidder/filterSets/my-filterSet', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListBidResponsesWithoutBidsResponse.nextPageToken + * // returned from the previous call to the bidResponsesWithoutBids.list + * // method. + * pageToken: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "bidResponseWithoutBidsStatusRows": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.filterSets.bidResponsesWithoutBids.list * @memberOf! () * @@ -7868,6 +11306,68 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.filterSets.filteredBidRequests.list * @desc List all reasons that caused a bid request not to be sent for an impression, with the number of bid requests not sent for each reason. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.filterSets.filteredBidRequests.list( + * { + * // Name of the filter set that should be applied to the requested metrics. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * filterSetName: 'bidders/my-bidder/filterSets/my-filterSet', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListFilteredBidRequestsResponse.nextPageToken + * // returned from the previous call to the filteredBidRequests.list + * // method. + * pageToken: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "calloutStatusRows": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.filterSets.filteredBidRequests.list * @memberOf! () * @@ -7989,6 +11489,66 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.filterSets.filteredBids.list * @desc List all reasons for which bids were filtered, with the number of bids filtered for each reason. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.filterSets.filteredBids.list({ + * // Name of the filter set that should be applied to the requested metrics. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * filterSetName: 'bidders/my-bidder/filterSets/my-filterSet', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListFilteredBidsResponse.nextPageToken + * // returned from the previous call to the filteredBids.list + * // method. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creativeStatusRows": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.filterSets.filteredBids.list * @memberOf! () * @@ -8096,6 +11656,73 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.filterSets.filteredBids.creatives.list * @desc List all creatives associated with a specific reason for which bids were filtered, with the number of bids filtered for each creative. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.filterSets.filteredBids.creatives.list( + * { + * // The ID of the creative status for which to retrieve a breakdown by + * // creative. + * // See + * // [creative-status-codes](https://developers.google.com/authorized-buyers/rtb/downloads/creative-status-codes). + * creativeStatusId: 'placeholder-value', + * // Name of the filter set that should be applied to the requested metrics. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * filterSetName: 'bidders/my-bidder/filterSets/my-filterSet', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListCreativeStatusBreakdownByCreativeResponse.nextPageToken + * // returned from the previous call to the filteredBids.creatives.list + * // method. + * pageToken: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "filteredBidCreativeRows": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.filterSets.filteredBids.creatives.list * @memberOf! () * @@ -8231,6 +11858,74 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.filterSets.filteredBids.details.list * @desc List all details associated with a specific reason for which bids were filtered, with the number of bids filtered for each detail. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.filterSets.filteredBids.details.list( + * { + * // The ID of the creative status for which to retrieve a breakdown by detail. + * // See + * // [creative-status-codes](https://developers.google.com/authorized-buyers/rtb/downloads/creative-status-codes). + * // Details are only available for statuses 10, 14, 15, 17, 18, 19, 86, and 87. + * creativeStatusId: 'placeholder-value', + * // Name of the filter set that should be applied to the requested metrics. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * filterSetName: 'bidders/my-bidder/filterSets/my-filterSet', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListCreativeStatusBreakdownByDetailResponse.nextPageToken + * // returned from the previous call to the filteredBids.details.list + * // method. + * pageToken: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "detailType": "my_detailType", + * // "filteredBidDetailRows": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.filterSets.filteredBids.details.list * @memberOf! () * @@ -8366,6 +12061,66 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.filterSets.impressionMetrics.list * @desc Lists all metrics that are measured in terms of number of impressions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.filterSets.impressionMetrics.list({ + * // Name of the filter set that should be applied to the requested metrics. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * filterSetName: 'bidders/my-bidder/filterSets/my-filterSet', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListImpressionMetricsResponse.nextPageToken + * // returned from the previous call to the impressionMetrics.list + * // method. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "impressionMetricsRows": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.filterSets.impressionMetrics.list * @memberOf! () * @@ -8479,6 +12234,66 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.filterSets.losingBids.list * @desc List all reasons for which bids lost in the auction, with the number of bids that lost for each reason. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.filterSets.losingBids.list({ + * // Name of the filter set that should be applied to the requested metrics. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * filterSetName: 'bidders/my-bidder/filterSets/my-filterSet', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListLosingBidsResponse.nextPageToken + * // returned from the previous call to the losingBids.list + * // method. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creativeStatusRows": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.filterSets.losingBids.list * @memberOf! () * @@ -8586,6 +12401,68 @@ export namespace adexchangebuyer2_v2beta1 { /** * adexchangebuyer2.bidders.filterSets.nonBillableWinningBids.list * @desc List all reasons for which winning bids were not billable, with the number of bids not billed for each reason. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexchangebuyer2.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 adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); + * + * 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/adexchange.buyer'], + * }); + * + * // 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 adexchangebuyer2.bidders.filterSets.nonBillableWinningBids.list( + * { + * // Name of the filter set that should be applied to the requested metrics. + * // For example: + * // + * // - For a bidder-level filter set for bidder 123: + * // `bidders/123/filterSets/abc` + * // + * // - For an account-level filter set for the buyer account representing bidder + * // 123: `bidders/123/accounts/123/filterSets/abc` + * // + * // - For an account-level filter set for the child seat buyer account 456 + * // whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * filterSetName: 'bidders/my-bidder/filterSets/my-filterSet', + * // Requested page size. The server may return fewer results than requested. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListNonBillableWinningBidsResponse.nextPageToken + * // returned from the previous call to the nonBillableWinningBids.list + * // method. + * pageToken: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "nonBillableWinningBidStatusRows": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexchangebuyer2.bidders.filterSets.nonBillableWinningBids.list * @memberOf! () * diff --git a/src/apis/adexperiencereport/v1.ts b/src/apis/adexperiencereport/v1.ts index 742740420ad..6ca737cc9ae 100644 --- a/src/apis/adexperiencereport/v1.ts +++ b/src/apis/adexperiencereport/v1.ts @@ -184,6 +184,51 @@ export namespace adexperiencereport_v1 { /** * adexperiencereport.sites.get * @desc Gets a site's Ad Experience Report summary. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexperiencereport.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 adexperiencereport = google.adexperiencereport('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: [], + * }); + * + * // 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 adexperiencereport.sites.get({ + * // Required. The name of the site whose summary to get, e.g. + * // `sites/http%3A%2F%2Fwww.google.com%2F`. + * // + * // Format: `sites/{site}` + * name: 'sites/my-site', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "desktopSummary": {}, + * // "mobileSummary": {}, + * // "reviewedSite": "my_reviewedSite" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexperiencereport.sites.get * @memberOf! () * @@ -274,6 +319,43 @@ export namespace adexperiencereport_v1 { /** * adexperiencereport.violatingSites.list * @desc Lists sites that are failing in the Ad Experience Report on at least one platform. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adexperiencereport.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 adexperiencereport = google.adexperiencereport('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: [], + * }); + * + * // 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 adexperiencereport.violatingSites.list({}); + * console.log(res.data); + * + * // Example response + * // { + * // "violatingSites": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adexperiencereport.violatingSites.list * @memberOf! () * diff --git a/src/apis/admin/datatransfer_v1.ts b/src/apis/admin/datatransfer_v1.ts index 58ef0abb53e..32a9d3f970c 100644 --- a/src/apis/admin/datatransfer_v1.ts +++ b/src/apis/admin/datatransfer_v1.ts @@ -243,6 +243,53 @@ export namespace admin_datatransfer_v1 { /** * datatransfer.applications.get * @desc Retrieves information about an application for the given application ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('datatransfer_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/admin.datatransfer', + * 'https://www.googleapis.com/auth/admin.datatransfer.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 datatransfer.applications.get({ + * // ID of the application resource to be retrieved. + * applicationId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "transferParams": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datatransfer.applications.get * @memberOf! () * @@ -315,6 +362,56 @@ export namespace admin_datatransfer_v1 { /** * datatransfer.applications.list * @desc Lists the applications available for data transfer for a customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('datatransfer_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/admin.datatransfer', + * 'https://www.googleapis.com/auth/admin.datatransfer.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 datatransfer.applications.list({ + * // Immutable ID of the G Suite account. + * customerId: 'placeholder-value', + * // Maximum number of results to return. Default is 100. + * maxResults: 'placeholder-value', + * // Token to specify next page in the list. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applications": [], + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datatransfer.applications.list * @memberOf! () * @@ -432,6 +529,56 @@ export namespace admin_datatransfer_v1 { /** * datatransfer.transfers.get * @desc Retrieves a data transfer request by its resource ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('datatransfer_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/admin.datatransfer', + * 'https://www.googleapis.com/auth/admin.datatransfer.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 datatransfer.transfers.get({ + * // ID of the resource to be retrieved. This is returned in the response from the insert method. + * dataTransferId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applicationDataTransfers": [], + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "newOwnerUserId": "my_newOwnerUserId", + * // "oldOwnerUserId": "my_oldOwnerUserId", + * // "overallTransferStatusCode": "my_overallTransferStatusCode", + * // "requestTime": "my_requestTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datatransfer.transfers.get * @memberOf! () * @@ -504,6 +651,65 @@ export namespace admin_datatransfer_v1 { /** * datatransfer.transfers.insert * @desc Inserts a data transfer request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('datatransfer_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/admin.datatransfer'], + * }); + * + * // 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 datatransfer.transfers.insert({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "applicationDataTransfers": [], + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "newOwnerUserId": "my_newOwnerUserId", + * // "oldOwnerUserId": "my_oldOwnerUserId", + * // "overallTransferStatusCode": "my_overallTransferStatusCode", + * // "requestTime": "my_requestTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applicationDataTransfers": [], + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "newOwnerUserId": "my_newOwnerUserId", + * // "oldOwnerUserId": "my_oldOwnerUserId", + * // "overallTransferStatusCode": "my_overallTransferStatusCode", + * // "requestTime": "my_requestTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datatransfer.transfers.insert * @memberOf! () * @@ -577,6 +783,62 @@ export namespace admin_datatransfer_v1 { /** * datatransfer.transfers.list * @desc Lists the transfers for a customer by source user, destination user, or status. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('datatransfer_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/admin.datatransfer', + * 'https://www.googleapis.com/auth/admin.datatransfer.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 datatransfer.transfers.list({ + * // Immutable ID of the G Suite account. + * customerId: 'placeholder-value', + * // Maximum number of results to return. Default is 100. + * maxResults: 'placeholder-value', + * // Destination user's profile ID. + * newOwnerUserId: 'placeholder-value', + * // Source user's profile ID. + * oldOwnerUserId: 'placeholder-value', + * // Token to specify the next page in the list. + * pageToken: 'placeholder-value', + * // Status of the transfer. + * status: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dataTransfers": [], + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datatransfer.transfers.list * @memberOf! () * diff --git a/src/apis/admin/directory_v1.ts b/src/apis/admin/directory_v1.ts index 784c3734a3c..a44a8e90601 100644 --- a/src/apis/admin/directory_v1.ts +++ b/src/apis/admin/directory_v1.ts @@ -2328,6 +2328,43 @@ export namespace admin_directory_v1 { /** * directory.asps.delete * @desc Delete an ASP issued by a user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user.security'], + * }); + * + * // 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 directory.asps.delete({ + * // The unique ID of the ASP to be deleted. + * codeId: 'placeholder-value', + * // Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. + * userKey: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.asps.delete * @memberOf! () * @@ -2399,6 +2436,54 @@ export namespace admin_directory_v1 { /** * directory.asps.get * @desc Get information about an ASP issued by a user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user.security'], + * }); + * + * // 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 directory.asps.get({ + * // The unique ID of the ASP. + * codeId: 'placeholder-value', + * // Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. + * userKey: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "codeId": 0, + * // "creationTime": "my_creationTime", + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "lastTimeUsed": "my_lastTimeUsed", + * // "name": "my_name", + * // "userKey": "my_userKey" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.asps.get * @memberOf! () * @@ -2470,6 +2555,48 @@ export namespace admin_directory_v1 { /** * directory.asps.list * @desc List the ASPs issued by a user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user.security'], + * }); + * + * // 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 directory.asps.list({ + * // Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. + * userKey: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.asps.list * @memberOf! () * @@ -2590,6 +2717,61 @@ export namespace admin_directory_v1 { /** * admin.channels.stop * @desc Stop watching resources through this channel + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user', + * 'https://www.googleapis.com/auth/admin.directory.user.alias', + * 'https://www.googleapis.com/auth/admin.directory.user.alias.readonly', + * 'https://www.googleapis.com/auth/admin.directory.user.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 admin.channels.stop({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias admin.channels.stop * @memberOf! () * @@ -2679,6 +2861,52 @@ export namespace admin_directory_v1 { /** * directory.chromeosdevices.action * @desc Take action on Chrome OS Device + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.device.chromeos'], + * }); + * + * // 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 directory.chromeosdevices.action({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * // Immutable ID of Chrome OS Device + * resourceId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "deprovisionReason": "my_deprovisionReason" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.chromeosdevices.action * @memberOf! () * @@ -2753,6 +2981,87 @@ export namespace admin_directory_v1 { /** * directory.chromeosdevices.get * @desc Retrieve Chrome OS Device + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.device.chromeos', + * 'https://www.googleapis.com/auth/admin.directory.device.chromeos.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 directory.chromeosdevices.get({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * // Immutable ID of Chrome OS Device + * deviceId: 'placeholder-value', + * // Restrict information returned to a set of selected fields. + * projection: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeTimeRanges": [], + * // "annotatedAssetId": "my_annotatedAssetId", + * // "annotatedLocation": "my_annotatedLocation", + * // "annotatedUser": "my_annotatedUser", + * // "autoUpdateExpiration": "my_autoUpdateExpiration", + * // "bootMode": "my_bootMode", + * // "cpuStatusReports": [], + * // "deviceFiles": [], + * // "deviceId": "my_deviceId", + * // "diskVolumeReports": [], + * // "dockMacAddress": "my_dockMacAddress", + * // "etag": "my_etag", + * // "ethernetMacAddress": "my_ethernetMacAddress", + * // "ethernetMacAddress0": "my_ethernetMacAddress0", + * // "firmwareVersion": "my_firmwareVersion", + * // "kind": "my_kind", + * // "lastEnrollmentTime": "my_lastEnrollmentTime", + * // "lastSync": "my_lastSync", + * // "macAddress": "my_macAddress", + * // "manufactureDate": "my_manufactureDate", + * // "meid": "my_meid", + * // "model": "my_model", + * // "notes": "my_notes", + * // "orderNumber": "my_orderNumber", + * // "orgUnitPath": "my_orgUnitPath", + * // "osVersion": "my_osVersion", + * // "platformVersion": "my_platformVersion", + * // "recentUsers": [], + * // "serialNumber": "my_serialNumber", + * // "status": "my_status", + * // "supportEndDate": "my_supportEndDate", + * // "systemRamFreeReports": [], + * // "systemRamTotal": "my_systemRamTotal", + * // "tpmVersionInfo": {}, + * // "willAutoRenew": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.chromeosdevices.get * @memberOf! () * @@ -2829,6 +3138,66 @@ export namespace admin_directory_v1 { /** * directory.chromeosdevices.list * @desc Retrieve all Chrome OS Devices of a customer (paginated) + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.device.chromeos', + * 'https://www.googleapis.com/auth/admin.directory.device.chromeos.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 directory.chromeosdevices.list({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * // Maximum number of results to return. Max allowed value is 200. + * maxResults: 'placeholder-value', + * // Column to use for sorting results + * orderBy: 'placeholder-value', + * // Full path of the organizational unit or its ID + * orgUnitPath: 'placeholder-value', + * // Token to specify next page in the list + * pageToken: 'placeholder-value', + * // Restrict information returned to a set of selected fields. + * projection: 'placeholder-value', + * // Search string in the format given at http://support.google.com/chromeos/a/bin/answer.py?answer=1698333 + * query: 'placeholder-value', + * // Whether to return results in ascending or descending order. Only of use when orderBy is also used + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "chromeosdevices": [], + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.chromeosdevices.list * @memberOf! () * @@ -2910,6 +3279,51 @@ export namespace admin_directory_v1 { /** * directory.chromeosdevices.moveDevicesToOu * @desc Move or insert multiple Chrome OS Devices to organizational unit + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.device.chromeos'], + * }); + * + * // 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 directory.chromeosdevices.moveDevicesToOu({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * // Full path of the target organizational unit or its ID + * orgUnitPath: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deviceIds": [] + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.chromeosdevices.moveDevicesToOu * @memberOf! () * @@ -2984,6 +3398,126 @@ export namespace admin_directory_v1 { /** * directory.chromeosdevices.patch * @desc Update Chrome OS Device. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.device.chromeos'], + * }); + * + * // 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 directory.chromeosdevices.patch({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * // Immutable ID of Chrome OS Device + * deviceId: 'placeholder-value', + * // Restrict information returned to a set of selected fields. + * projection: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "activeTimeRanges": [], + * // "annotatedAssetId": "my_annotatedAssetId", + * // "annotatedLocation": "my_annotatedLocation", + * // "annotatedUser": "my_annotatedUser", + * // "autoUpdateExpiration": "my_autoUpdateExpiration", + * // "bootMode": "my_bootMode", + * // "cpuStatusReports": [], + * // "deviceFiles": [], + * // "deviceId": "my_deviceId", + * // "diskVolumeReports": [], + * // "dockMacAddress": "my_dockMacAddress", + * // "etag": "my_etag", + * // "ethernetMacAddress": "my_ethernetMacAddress", + * // "ethernetMacAddress0": "my_ethernetMacAddress0", + * // "firmwareVersion": "my_firmwareVersion", + * // "kind": "my_kind", + * // "lastEnrollmentTime": "my_lastEnrollmentTime", + * // "lastSync": "my_lastSync", + * // "macAddress": "my_macAddress", + * // "manufactureDate": "my_manufactureDate", + * // "meid": "my_meid", + * // "model": "my_model", + * // "notes": "my_notes", + * // "orderNumber": "my_orderNumber", + * // "orgUnitPath": "my_orgUnitPath", + * // "osVersion": "my_osVersion", + * // "platformVersion": "my_platformVersion", + * // "recentUsers": [], + * // "serialNumber": "my_serialNumber", + * // "status": "my_status", + * // "supportEndDate": "my_supportEndDate", + * // "systemRamFreeReports": [], + * // "systemRamTotal": "my_systemRamTotal", + * // "tpmVersionInfo": {}, + * // "willAutoRenew": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeTimeRanges": [], + * // "annotatedAssetId": "my_annotatedAssetId", + * // "annotatedLocation": "my_annotatedLocation", + * // "annotatedUser": "my_annotatedUser", + * // "autoUpdateExpiration": "my_autoUpdateExpiration", + * // "bootMode": "my_bootMode", + * // "cpuStatusReports": [], + * // "deviceFiles": [], + * // "deviceId": "my_deviceId", + * // "diskVolumeReports": [], + * // "dockMacAddress": "my_dockMacAddress", + * // "etag": "my_etag", + * // "ethernetMacAddress": "my_ethernetMacAddress", + * // "ethernetMacAddress0": "my_ethernetMacAddress0", + * // "firmwareVersion": "my_firmwareVersion", + * // "kind": "my_kind", + * // "lastEnrollmentTime": "my_lastEnrollmentTime", + * // "lastSync": "my_lastSync", + * // "macAddress": "my_macAddress", + * // "manufactureDate": "my_manufactureDate", + * // "meid": "my_meid", + * // "model": "my_model", + * // "notes": "my_notes", + * // "orderNumber": "my_orderNumber", + * // "orgUnitPath": "my_orgUnitPath", + * // "osVersion": "my_osVersion", + * // "platformVersion": "my_platformVersion", + * // "recentUsers": [], + * // "serialNumber": "my_serialNumber", + * // "status": "my_status", + * // "supportEndDate": "my_supportEndDate", + * // "systemRamFreeReports": [], + * // "systemRamTotal": "my_systemRamTotal", + * // "tpmVersionInfo": {}, + * // "willAutoRenew": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.chromeosdevices.patch * @memberOf! () * @@ -3061,6 +3595,126 @@ export namespace admin_directory_v1 { /** * directory.chromeosdevices.update * @desc Update Chrome OS Device + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.device.chromeos'], + * }); + * + * // 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 directory.chromeosdevices.update({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * // Immutable ID of Chrome OS Device + * deviceId: 'placeholder-value', + * // Restrict information returned to a set of selected fields. + * projection: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "activeTimeRanges": [], + * // "annotatedAssetId": "my_annotatedAssetId", + * // "annotatedLocation": "my_annotatedLocation", + * // "annotatedUser": "my_annotatedUser", + * // "autoUpdateExpiration": "my_autoUpdateExpiration", + * // "bootMode": "my_bootMode", + * // "cpuStatusReports": [], + * // "deviceFiles": [], + * // "deviceId": "my_deviceId", + * // "diskVolumeReports": [], + * // "dockMacAddress": "my_dockMacAddress", + * // "etag": "my_etag", + * // "ethernetMacAddress": "my_ethernetMacAddress", + * // "ethernetMacAddress0": "my_ethernetMacAddress0", + * // "firmwareVersion": "my_firmwareVersion", + * // "kind": "my_kind", + * // "lastEnrollmentTime": "my_lastEnrollmentTime", + * // "lastSync": "my_lastSync", + * // "macAddress": "my_macAddress", + * // "manufactureDate": "my_manufactureDate", + * // "meid": "my_meid", + * // "model": "my_model", + * // "notes": "my_notes", + * // "orderNumber": "my_orderNumber", + * // "orgUnitPath": "my_orgUnitPath", + * // "osVersion": "my_osVersion", + * // "platformVersion": "my_platformVersion", + * // "recentUsers": [], + * // "serialNumber": "my_serialNumber", + * // "status": "my_status", + * // "supportEndDate": "my_supportEndDate", + * // "systemRamFreeReports": [], + * // "systemRamTotal": "my_systemRamTotal", + * // "tpmVersionInfo": {}, + * // "willAutoRenew": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeTimeRanges": [], + * // "annotatedAssetId": "my_annotatedAssetId", + * // "annotatedLocation": "my_annotatedLocation", + * // "annotatedUser": "my_annotatedUser", + * // "autoUpdateExpiration": "my_autoUpdateExpiration", + * // "bootMode": "my_bootMode", + * // "cpuStatusReports": [], + * // "deviceFiles": [], + * // "deviceId": "my_deviceId", + * // "diskVolumeReports": [], + * // "dockMacAddress": "my_dockMacAddress", + * // "etag": "my_etag", + * // "ethernetMacAddress": "my_ethernetMacAddress", + * // "ethernetMacAddress0": "my_ethernetMacAddress0", + * // "firmwareVersion": "my_firmwareVersion", + * // "kind": "my_kind", + * // "lastEnrollmentTime": "my_lastEnrollmentTime", + * // "lastSync": "my_lastSync", + * // "macAddress": "my_macAddress", + * // "manufactureDate": "my_manufactureDate", + * // "meid": "my_meid", + * // "model": "my_model", + * // "notes": "my_notes", + * // "orderNumber": "my_orderNumber", + * // "orgUnitPath": "my_orgUnitPath", + * // "osVersion": "my_osVersion", + * // "platformVersion": "my_platformVersion", + * // "recentUsers": [], + * // "serialNumber": "my_serialNumber", + * // "status": "my_status", + * // "supportEndDate": "my_supportEndDate", + * // "systemRamFreeReports": [], + * // "systemRamTotal": "my_systemRamTotal", + * // "tpmVersionInfo": {}, + * // "willAutoRenew": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.chromeosdevices.update * @memberOf! () * @@ -3298,6 +3952,57 @@ export namespace admin_directory_v1 { /** * directory.customers.get * @desc Retrieves a customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.customer', + * 'https://www.googleapis.com/auth/admin.directory.customer.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 directory.customers.get({ + * // Id of the customer to be retrieved + * customerKey: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateEmail": "my_alternateEmail", + * // "customerCreationTime": "my_customerCreationTime", + * // "customerDomain": "my_customerDomain", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "language": "my_language", + * // "phoneNumber": "my_phoneNumber", + * // "postalAddress": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.customers.get * @memberOf! () * @@ -3368,6 +4073,70 @@ export namespace admin_directory_v1 { /** * directory.customers.patch * @desc Updates a customer. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.customer'], + * }); + * + * // 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 directory.customers.patch({ + * // Id of the customer to be updated + * customerKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternateEmail": "my_alternateEmail", + * // "customerCreationTime": "my_customerCreationTime", + * // "customerDomain": "my_customerDomain", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "language": "my_language", + * // "phoneNumber": "my_phoneNumber", + * // "postalAddress": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateEmail": "my_alternateEmail", + * // "customerCreationTime": "my_customerCreationTime", + * // "customerDomain": "my_customerDomain", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "language": "my_language", + * // "phoneNumber": "my_phoneNumber", + * // "postalAddress": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.customers.patch * @memberOf! () * @@ -3439,6 +4208,70 @@ export namespace admin_directory_v1 { /** * directory.customers.update * @desc Updates a customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.customer'], + * }); + * + * // 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 directory.customers.update({ + * // Id of the customer to be updated + * customerKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternateEmail": "my_alternateEmail", + * // "customerCreationTime": "my_customerCreationTime", + * // "customerDomain": "my_customerDomain", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "language": "my_language", + * // "phoneNumber": "my_phoneNumber", + * // "postalAddress": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateEmail": "my_alternateEmail", + * // "customerCreationTime": "my_customerCreationTime", + * // "customerDomain": "my_customerDomain", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "language": "my_language", + * // "phoneNumber": "my_phoneNumber", + * // "postalAddress": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.customers.update * @memberOf! () * @@ -3561,6 +4394,43 @@ export namespace admin_directory_v1 { /** * directory.domainAliases.delete * @desc Deletes a Domain Alias of the customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.domain'], + * }); + * + * // 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 directory.domainAliases.delete({ + * // Immutable ID of the G Suite account. + * customer: 'placeholder-value', + * // Name of domain alias to be retrieved. + * domainAliasName: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.domainAliases.delete * @memberOf! () * @@ -3634,6 +4504,56 @@ export namespace admin_directory_v1 { /** * directory.domainAliases.get * @desc Retrieves a domain alias of the customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.domain', + * 'https://www.googleapis.com/auth/admin.directory.domain.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 directory.domainAliases.get({ + * // Immutable ID of the G Suite account. + * customer: 'placeholder-value', + * // Name of domain alias to be retrieved. + * domainAliasName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "domainAliasName": "my_domainAliasName", + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "parentDomainName": "my_parentDomainName", + * // "verified": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.domainAliases.get * @memberOf! () * @@ -3709,6 +4629,64 @@ export namespace admin_directory_v1 { /** * directory.domainAliases.insert * @desc Inserts a Domain alias of the customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.domain'], + * }); + * + * // 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 directory.domainAliases.insert({ + * // Immutable ID of the G Suite account. + * customer: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTime": "my_creationTime", + * // "domainAliasName": "my_domainAliasName", + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "parentDomainName": "my_parentDomainName", + * // "verified": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "domainAliasName": "my_domainAliasName", + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "parentDomainName": "my_parentDomainName", + * // "verified": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.domainAliases.insert * @memberOf! () * @@ -3783,6 +4761,53 @@ export namespace admin_directory_v1 { /** * directory.domainAliases.list * @desc Lists the domain aliases of the customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.domain', + * 'https://www.googleapis.com/auth/admin.directory.domain.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 directory.domainAliases.list({ + * // Immutable ID of the G Suite account. + * customer: 'placeholder-value', + * // Name of the parent domain for which domain aliases are to be fetched. + * parentDomainName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domainAliases": [], + * // "etag": "my_etag", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.domainAliases.list * @memberOf! () * @@ -3930,6 +4955,43 @@ export namespace admin_directory_v1 { /** * directory.domains.delete * @desc Deletes a domain of the customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.domain'], + * }); + * + * // 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 directory.domains.delete({ + * // Immutable ID of the G Suite account. + * customer: 'placeholder-value', + * // Name of domain to be deleted + * domainName: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.domains.delete * @memberOf! () * @@ -4002,6 +5064,57 @@ export namespace admin_directory_v1 { /** * directory.domains.get * @desc Retrieves a domain of the customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.domain', + * 'https://www.googleapis.com/auth/admin.directory.domain.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 directory.domains.get({ + * // Immutable ID of the G Suite account. + * customer: 'placeholder-value', + * // Name of domain to be retrieved + * domainName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "domainAliases": [], + * // "domainName": "my_domainName", + * // "etag": "my_etag", + * // "isPrimary": false, + * // "kind": "my_kind", + * // "verified": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.domains.get * @memberOf! () * @@ -4074,6 +5187,66 @@ export namespace admin_directory_v1 { /** * directory.domains.insert * @desc Inserts a domain of the customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.domain'], + * }); + * + * // 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 directory.domains.insert({ + * // Immutable ID of the G Suite account. + * customer: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTime": "my_creationTime", + * // "domainAliases": [], + * // "domainName": "my_domainName", + * // "etag": "my_etag", + * // "isPrimary": false, + * // "kind": "my_kind", + * // "verified": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "domainAliases": [], + * // "domainName": "my_domainName", + * // "etag": "my_etag", + * // "isPrimary": false, + * // "kind": "my_kind", + * // "verified": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.domains.insert * @memberOf! () * @@ -4145,6 +5318,51 @@ export namespace admin_directory_v1 { /** * directory.domains.list * @desc Lists the domains of the customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.domain', + * 'https://www.googleapis.com/auth/admin.directory.domain.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 directory.domains.list({ + * // Immutable ID of the G Suite account. + * customer: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domains": [], + * // "etag": "my_etag", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.domains.list * @memberOf! () * @@ -4282,6 +5500,41 @@ export namespace admin_directory_v1 { /** * directory.groups.delete * @desc Delete Group + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.group'], + * }); + * + * // 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 directory.groups.delete({ + * // Email or immutable ID of the group + * groupKey: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.groups.delete * @memberOf! () * @@ -4353,6 +5606,58 @@ export namespace admin_directory_v1 { /** * directory.groups.get * @desc Retrieve Group + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.group', + * 'https://www.googleapis.com/auth/admin.directory.group.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 directory.groups.get({ + * // Email or immutable ID of the group + * groupKey: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adminCreated": false, + * // "aliases": [], + * // "description": "my_description", + * // "directMembersCount": "my_directMembersCount", + * // "email": "my_email", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "nonEditableAliases": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.groups.get * @memberOf! () * @@ -4424,6 +5729,69 @@ export namespace admin_directory_v1 { /** * directory.groups.insert * @desc Create Group + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.group'], + * }); + * + * // 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 directory.groups.insert({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adminCreated": false, + * // "aliases": [], + * // "description": "my_description", + * // "directMembersCount": "my_directMembersCount", + * // "email": "my_email", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "nonEditableAliases": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adminCreated": false, + * // "aliases": [], + * // "description": "my_description", + * // "directMembersCount": "my_directMembersCount", + * // "email": "my_email", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "nonEditableAliases": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.groups.insert * @memberOf! () * @@ -4495,6 +5863,66 @@ export namespace admin_directory_v1 { /** * directory.groups.list * @desc Retrieve all groups of a domain or of a user given a userKey (paginated) + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.group', + * 'https://www.googleapis.com/auth/admin.directory.group.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 directory.groups.list({ + * // Immutable ID of the G Suite account. In case of multi-domain, to fetch all groups for a customer, fill this field instead of domain. + * customer: 'placeholder-value', + * // Name of the domain. Fill this field to get groups from only this domain. To return all groups in a multi-domain fill customer field instead. + * domain: 'placeholder-value', + * // Maximum number of results to return. Max allowed value is 200. + * maxResults: 'placeholder-value', + * // Column to use for sorting results + * orderBy: 'placeholder-value', + * // Token to specify next page in the list + * pageToken: 'placeholder-value', + * // Query string search. Should be of the form "". Complete documentation is at https://developers.google.com/admin-sdk/directory/v1/guides/search-groups + * query: 'placeholder-value', + * // Whether to return results in ascending or descending order. Only of use when orderBy is also used + * sortOrder: 'placeholder-value', + * // Email or immutable ID of the user if only those groups are to be listed, the given user is a member of. If it's an ID, it should match with the ID of the user object. + * userKey: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "groups": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.groups.list * @memberOf! () * @@ -4573,6 +6001,72 @@ export namespace admin_directory_v1 { /** * directory.groups.patch * @desc Update Group. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.group'], + * }); + * + * // 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 directory.groups.patch({ + * // Email or immutable ID of the group. If ID, it should match with id of group object + * groupKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adminCreated": false, + * // "aliases": [], + * // "description": "my_description", + * // "directMembersCount": "my_directMembersCount", + * // "email": "my_email", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "nonEditableAliases": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adminCreated": false, + * // "aliases": [], + * // "description": "my_description", + * // "directMembersCount": "my_directMembersCount", + * // "email": "my_email", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "nonEditableAliases": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.groups.patch * @memberOf! () * @@ -4645,6 +6139,72 @@ export namespace admin_directory_v1 { /** * directory.groups.update * @desc Update Group + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.group'], + * }); + * + * // 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 directory.groups.update({ + * // Email or immutable ID of the group. If ID, it should match with id of group object + * groupKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adminCreated": false, + * // "aliases": [], + * // "description": "my_description", + * // "directMembersCount": "my_directMembersCount", + * // "email": "my_email", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "nonEditableAliases": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adminCreated": false, + * // "aliases": [], + * // "description": "my_description", + * // "directMembersCount": "my_directMembersCount", + * // "email": "my_email", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "nonEditableAliases": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.groups.update * @memberOf! () * @@ -4829,6 +6389,43 @@ export namespace admin_directory_v1 { /** * directory.groups.aliases.delete * @desc Remove a alias for the group + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.group'], + * }); + * + * // 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 directory.groups.aliases.delete({ + * // The alias to be removed + * alias: 'placeholder-value', + * // Email or immutable ID of the group + * groupKey: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.groups.aliases.delete * @memberOf! () * @@ -4901,6 +6498,62 @@ export namespace admin_directory_v1 { /** * directory.groups.aliases.insert * @desc Add a alias for the group + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.group'], + * }); + * + * // 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 directory.groups.aliases.insert({ + * // Email or immutable ID of the group + * groupKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alias": "my_alias", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "primaryEmail": "my_primaryEmail" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alias": "my_alias", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "primaryEmail": "my_primaryEmail" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.groups.aliases.insert * @memberOf! () * @@ -4973,6 +6626,51 @@ export namespace admin_directory_v1 { /** * directory.groups.aliases.list * @desc List all aliases for a group + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.group', + * 'https://www.googleapis.com/auth/admin.directory.group.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 directory.groups.aliases.list({ + * // Email or immutable ID of the group + * groupKey: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "aliases": [], + * // "etag": "my_etag", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.groups.aliases.list * @memberOf! () * @@ -5097,6 +6795,46 @@ export namespace admin_directory_v1 { /** * directory.members.delete * @desc Remove membership. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.group', + * 'https://www.googleapis.com/auth/admin.directory.group.member', + * ], + * }); + * + * // 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 directory.members.delete({ + * // Email or immutable ID of the group + * groupKey: 'placeholder-value', + * // Email or immutable ID of the member + * memberKey: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.members.delete * @memberOf! () * @@ -5169,6 +6907,60 @@ export namespace admin_directory_v1 { /** * directory.members.get * @desc Retrieve Group Member + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.group', + * 'https://www.googleapis.com/auth/admin.directory.group.member', + * 'https://www.googleapis.com/auth/admin.directory.group.member.readonly', + * 'https://www.googleapis.com/auth/admin.directory.group.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 directory.members.get({ + * // Email or immutable ID of the group + * groupKey: 'placeholder-value', + * // Email or immutable ID of the member + * memberKey: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "delivery_settings": "my_delivery_settings", + * // "email": "my_email", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "status": "my_status", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.members.get * @memberOf! () * @@ -5241,6 +7033,53 @@ export namespace admin_directory_v1 { /** * directory.members.hasMember * @desc Checks whether the given user is a member of the group. Membership can be direct or nested. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.group', + * 'https://www.googleapis.com/auth/admin.directory.group.member', + * 'https://www.googleapis.com/auth/admin.directory.group.member.readonly', + * 'https://www.googleapis.com/auth/admin.directory.group.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 directory.members.hasMember({ + * // Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID. + * groupKey: 'placeholder-value', + * // Identifies the user member in the API request. The value can be the user's primary email address, alias, or unique ID. + * memberKey: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "isMember": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.members.hasMember * @memberOf! () * @@ -5316,6 +7155,71 @@ export namespace admin_directory_v1 { /** * directory.members.insert * @desc Add user to the specified group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.group', + * 'https://www.googleapis.com/auth/admin.directory.group.member', + * ], + * }); + * + * // 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 directory.members.insert({ + * // Email or immutable ID of the group + * groupKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "delivery_settings": "my_delivery_settings", + * // "email": "my_email", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "status": "my_status", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "delivery_settings": "my_delivery_settings", + * // "email": "my_email", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "status": "my_status", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.members.insert * @memberOf! () * @@ -5387,6 +7291,62 @@ export namespace admin_directory_v1 { /** * directory.members.list * @desc Retrieve all members in a group (paginated) + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.group', + * 'https://www.googleapis.com/auth/admin.directory.group.member', + * 'https://www.googleapis.com/auth/admin.directory.group.member.readonly', + * 'https://www.googleapis.com/auth/admin.directory.group.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 directory.members.list({ + * // Email or immutable ID of the group + * groupKey: 'placeholder-value', + * // Whether to list indirect memberships. Default: false. + * includeDerivedMembership: 'placeholder-value', + * // Maximum number of results to return. Max allowed value is 200. + * maxResults: 'placeholder-value', + * // Token to specify next page in the list + * pageToken: 'placeholder-value', + * // Comma separated role values to filter list results on. + * roles: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "members": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.members.list * @memberOf! () * @@ -5461,6 +7421,73 @@ export namespace admin_directory_v1 { /** * directory.members.patch * @desc Update membership of a user in the specified group. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.group', + * 'https://www.googleapis.com/auth/admin.directory.group.member', + * ], + * }); + * + * // 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 directory.members.patch({ + * // Email or immutable ID of the group. If ID, it should match with id of group object + * groupKey: 'placeholder-value', + * // Email or immutable ID of the user. If ID, it should match with id of member object + * memberKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "delivery_settings": "my_delivery_settings", + * // "email": "my_email", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "status": "my_status", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "delivery_settings": "my_delivery_settings", + * // "email": "my_email", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "status": "my_status", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.members.patch * @memberOf! () * @@ -5534,6 +7561,73 @@ export namespace admin_directory_v1 { /** * directory.members.update * @desc Update membership of a user in the specified group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.group', + * 'https://www.googleapis.com/auth/admin.directory.group.member', + * ], + * }); + * + * // 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 directory.members.update({ + * // Email or immutable ID of the group. If ID, it should match with id of group object + * groupKey: 'placeholder-value', + * // Email or immutable ID of the user. If ID, it should match with id of member object + * memberKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "delivery_settings": "my_delivery_settings", + * // "email": "my_email", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "status": "my_status", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "delivery_settings": "my_delivery_settings", + * // "email": "my_email", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "status": "my_status", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.members.update * @memberOf! () * @@ -5744,6 +7838,54 @@ export namespace admin_directory_v1 { /** * directory.mobiledevices.action * @desc Take action on Mobile Device + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.device.mobile', + * 'https://www.googleapis.com/auth/admin.directory.device.mobile.action', + * ], + * }); + * + * // 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 directory.mobiledevices.action({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * // Immutable ID of Mobile Device + * resourceId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.mobiledevices.action * @memberOf! () * @@ -5818,6 +7960,43 @@ export namespace admin_directory_v1 { /** * directory.mobiledevices.delete * @desc Delete Mobile Device + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.device.mobile'], + * }); + * + * // 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 directory.mobiledevices.delete({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * // Immutable ID of Mobile Device + * resourceId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.mobiledevices.delete * @memberOf! () * @@ -5891,6 +8070,93 @@ export namespace admin_directory_v1 { /** * directory.mobiledevices.get * @desc Retrieve Mobile Device + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.device.mobile', + * 'https://www.googleapis.com/auth/admin.directory.device.mobile.action', + * 'https://www.googleapis.com/auth/admin.directory.device.mobile.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 directory.mobiledevices.get({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * // Restrict information returned to a set of selected fields. + * projection: 'placeholder-value', + * // Immutable ID of Mobile Device + * resourceId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adbStatus": false, + * // "applications": [], + * // "basebandVersion": "my_basebandVersion", + * // "bootloaderVersion": "my_bootloaderVersion", + * // "brand": "my_brand", + * // "buildNumber": "my_buildNumber", + * // "defaultLanguage": "my_defaultLanguage", + * // "developerOptionsStatus": false, + * // "deviceCompromisedStatus": "my_deviceCompromisedStatus", + * // "deviceId": "my_deviceId", + * // "devicePasswordStatus": "my_devicePasswordStatus", + * // "email": [], + * // "encryptionStatus": "my_encryptionStatus", + * // "etag": "my_etag", + * // "firstSync": "my_firstSync", + * // "hardware": "my_hardware", + * // "hardwareId": "my_hardwareId", + * // "imei": "my_imei", + * // "kernelVersion": "my_kernelVersion", + * // "kind": "my_kind", + * // "lastSync": "my_lastSync", + * // "managedAccountIsOnOwnerProfile": false, + * // "manufacturer": "my_manufacturer", + * // "meid": "my_meid", + * // "model": "my_model", + * // "name": [], + * // "networkOperator": "my_networkOperator", + * // "os": "my_os", + * // "otherAccountsInfo": [], + * // "privilege": "my_privilege", + * // "releaseVersion": "my_releaseVersion", + * // "resourceId": "my_resourceId", + * // "securityPatchLevel": "my_securityPatchLevel", + * // "serialNumber": "my_serialNumber", + * // "status": "my_status", + * // "supportsWorkProfile": false, + * // "type": "my_type", + * // "unknownSourcesStatus": false, + * // "userAgent": "my_userAgent", + * // "wifiMacAddress": "my_wifiMacAddress" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.mobiledevices.get * @memberOf! () * @@ -5967,6 +8233,65 @@ export namespace admin_directory_v1 { /** * directory.mobiledevices.list * @desc Retrieve all Mobile Devices of a customer (paginated) + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.device.mobile', + * 'https://www.googleapis.com/auth/admin.directory.device.mobile.action', + * 'https://www.googleapis.com/auth/admin.directory.device.mobile.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 directory.mobiledevices.list({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * // Maximum number of results to return. Max allowed value is 100. + * maxResults: 'placeholder-value', + * // Column to use for sorting results + * orderBy: 'placeholder-value', + * // Token to specify next page in the list + * pageToken: 'placeholder-value', + * // Restrict information returned to a set of selected fields. + * projection: 'placeholder-value', + * // Search string in the format given at http://support.google.com/a/bin/answer.py?answer=1408863#search + * query: 'placeholder-value', + * // Whether to return results in ascending or descending order. Only of use when orderBy is also used + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "mobiledevices": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.mobiledevices.list * @memberOf! () * @@ -6148,6 +8473,43 @@ export namespace admin_directory_v1 { /** * directory.notifications.delete * @desc Deletes a notification + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.notifications'], + * }); + * + * // 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 directory.notifications.delete({ + * // The unique ID for the customer's G Suite account. The customerId is also returned as part of the Users resource. + * customer: 'placeholder-value', + * // The unique ID of the notification. + * notificationId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.notifications.delete * @memberOf! () * @@ -6221,6 +8583,55 @@ export namespace admin_directory_v1 { /** * directory.notifications.get * @desc Retrieves a notification. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.notifications'], + * }); + * + * // 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 directory.notifications.get({ + * // The unique ID for the customer's G Suite account. The customerId is also returned as part of the Users resource. + * customer: 'placeholder-value', + * // The unique ID of the notification. + * notificationId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "body": "my_body", + * // "etag": "my_etag", + * // "fromAddress": "my_fromAddress", + * // "isUnread": false, + * // "kind": "my_kind", + * // "notificationId": "my_notificationId", + * // "sendTime": "my_sendTime", + * // "subject": "my_subject" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.notifications.get * @memberOf! () * @@ -6296,6 +8707,56 @@ export namespace admin_directory_v1 { /** * directory.notifications.list * @desc Retrieves a list of notifications. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.notifications'], + * }); + * + * // 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 directory.notifications.list({ + * // The unique ID for the customer's G Suite account. + * customer: 'placeholder-value', + * // The ISO 639-1 code of the language notifications are returned in. The default is English (en). + * language: 'placeholder-value', + * // Maximum number of notifications to return per page. The default is 100. + * maxResults: 'placeholder-value', + * // The token to specify the page of results to retrieve. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "unreadNotificationsCount": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.notifications.list * @memberOf! () * @@ -6372,6 +8833,70 @@ export namespace admin_directory_v1 { /** * directory.notifications.patch * @desc Updates a notification. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.notifications'], + * }); + * + * // 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 directory.notifications.patch({ + * // The unique ID for the customer's G Suite account. + * customer: 'placeholder-value', + * // The unique ID of the notification. + * notificationId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "body": "my_body", + * // "etag": "my_etag", + * // "fromAddress": "my_fromAddress", + * // "isUnread": false, + * // "kind": "my_kind", + * // "notificationId": "my_notificationId", + * // "sendTime": "my_sendTime", + * // "subject": "my_subject" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "body": "my_body", + * // "etag": "my_etag", + * // "fromAddress": "my_fromAddress", + * // "isUnread": false, + * // "kind": "my_kind", + * // "notificationId": "my_notificationId", + * // "sendTime": "my_sendTime", + * // "subject": "my_subject" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.notifications.patch * @memberOf! () * @@ -6448,6 +8973,70 @@ export namespace admin_directory_v1 { /** * directory.notifications.update * @desc Updates a notification. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.notifications'], + * }); + * + * // 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 directory.notifications.update({ + * // The unique ID for the customer's G Suite account. + * customer: 'placeholder-value', + * // The unique ID of the notification. + * notificationId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "body": "my_body", + * // "etag": "my_etag", + * // "fromAddress": "my_fromAddress", + * // "isUnread": false, + * // "kind": "my_kind", + * // "notificationId": "my_notificationId", + * // "sendTime": "my_sendTime", + * // "subject": "my_subject" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "body": "my_body", + * // "etag": "my_etag", + * // "fromAddress": "my_fromAddress", + * // "isUnread": false, + * // "kind": "my_kind", + * // "notificationId": "my_notificationId", + * // "sendTime": "my_sendTime", + * // "subject": "my_subject" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.notifications.update * @memberOf! () * @@ -6630,6 +9219,43 @@ export namespace admin_directory_v1 { /** * directory.orgunits.delete * @desc Remove organizational unit + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.orgunit'], + * }); + * + * // 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 directory.orgunits.delete({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * // Full path of the organizational unit or its ID + * orgUnitPath: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.orgunits.delete * @memberOf! () * @@ -6702,6 +9328,59 @@ export namespace admin_directory_v1 { /** * directory.orgunits.get * @desc Retrieve organizational unit + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.orgunit', + * 'https://www.googleapis.com/auth/admin.directory.orgunit.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 directory.orgunits.get({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * // Full path of the organizational unit or its ID + * orgUnitPath: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "blockInheritance": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "name": "my_name", + * // "orgUnitId": "my_orgUnitId", + * // "orgUnitPath": "my_orgUnitPath", + * // "parentOrgUnitId": "my_parentOrgUnitId", + * // "parentOrgUnitPath": "my_parentOrgUnitPath" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.orgunits.get * @memberOf! () * @@ -6774,6 +9453,70 @@ export namespace admin_directory_v1 { /** * directory.orgunits.insert * @desc Add organizational unit + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.orgunit'], + * }); + * + * // 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 directory.orgunits.insert({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "blockInheritance": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "name": "my_name", + * // "orgUnitId": "my_orgUnitId", + * // "orgUnitPath": "my_orgUnitPath", + * // "parentOrgUnitId": "my_parentOrgUnitId", + * // "parentOrgUnitPath": "my_parentOrgUnitPath" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "blockInheritance": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "name": "my_name", + * // "orgUnitId": "my_orgUnitId", + * // "orgUnitPath": "my_orgUnitPath", + * // "parentOrgUnitId": "my_parentOrgUnitId", + * // "parentOrgUnitPath": "my_parentOrgUnitPath" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.orgunits.insert * @memberOf! () * @@ -6845,6 +9588,55 @@ export namespace admin_directory_v1 { /** * directory.orgunits.list * @desc Retrieve all organizational units + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.orgunit', + * 'https://www.googleapis.com/auth/admin.directory.orgunit.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 directory.orgunits.list({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * // the URL-encoded organizational unit's path or its ID + * orgUnitPath: 'placeholder-value', + * // Whether to return all sub-organizations or just immediate children + * type: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "organizationUnits": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.orgunits.list * @memberOf! () * @@ -6917,6 +9709,72 @@ export namespace admin_directory_v1 { /** * directory.orgunits.patch * @desc Update organizational unit. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.orgunit'], + * }); + * + * // 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 directory.orgunits.patch({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * // Full path of the organizational unit or its ID + * orgUnitPath: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "blockInheritance": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "name": "my_name", + * // "orgUnitId": "my_orgUnitId", + * // "orgUnitPath": "my_orgUnitPath", + * // "parentOrgUnitId": "my_parentOrgUnitId", + * // "parentOrgUnitPath": "my_parentOrgUnitPath" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "blockInheritance": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "name": "my_name", + * // "orgUnitId": "my_orgUnitId", + * // "orgUnitPath": "my_orgUnitPath", + * // "parentOrgUnitId": "my_parentOrgUnitId", + * // "parentOrgUnitPath": "my_parentOrgUnitPath" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.orgunits.patch * @memberOf! () * @@ -6990,6 +9848,72 @@ export namespace admin_directory_v1 { /** * directory.orgunits.update * @desc Update organizational unit + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.orgunit'], + * }); + * + * // 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 directory.orgunits.update({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * // Full path of the organizational unit or its ID + * orgUnitPath: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "blockInheritance": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "name": "my_name", + * // "orgUnitId": "my_orgUnitId", + * // "orgUnitPath": "my_orgUnitPath", + * // "parentOrgUnitId": "my_parentOrgUnitId", + * // "parentOrgUnitPath": "my_parentOrgUnitPath" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "blockInheritance": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "name": "my_name", + * // "orgUnitId": "my_orgUnitId", + * // "orgUnitPath": "my_orgUnitPath", + * // "parentOrgUnitId": "my_parentOrgUnitId", + * // "parentOrgUnitPath": "my_parentOrgUnitPath" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.orgunits.update * @memberOf! () * @@ -7176,6 +10100,51 @@ export namespace admin_directory_v1 { /** * directory.privileges.list * @desc Retrieves a paginated list of all privileges for a customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.rolemanagement', + * 'https://www.googleapis.com/auth/admin.directory.rolemanagement.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 directory.privileges.list({ + * // Immutable ID of the G Suite account. + * customer: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.privileges.list * @memberOf! () * @@ -7281,6 +10250,45 @@ export namespace admin_directory_v1 { /** * directory.resources.buildings.delete * @desc Deletes a building. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.resource.calendar', + * ], + * }); + * + * // 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 directory.resources.buildings.delete({ + * // The ID of the building to delete. + * buildingId: 'placeholder-value', + * // The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * customer: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.resources.buildings.delete * @memberOf! () * @@ -7354,6 +10362,58 @@ export namespace admin_directory_v1 { /** * directory.resources.buildings.get * @desc Retrieves a building. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.resource.calendar', + * 'https://www.googleapis.com/auth/admin.directory.resource.calendar.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 directory.resources.buildings.get({ + * // The unique ID of the building to retrieve. + * buildingId: 'placeholder-value', + * // The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * customer: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": {}, + * // "buildingId": "my_buildingId", + * // "buildingName": "my_buildingName", + * // "coordinates": {}, + * // "description": "my_description", + * // "etags": "my_etags", + * // "floorNames": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.resources.buildings.get * @memberOf! () * @@ -7427,6 +10487,72 @@ export namespace admin_directory_v1 { /** * directory.resources.buildings.insert * @desc Inserts a building. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.resource.calendar', + * ], + * }); + * + * // 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 directory.resources.buildings.insert({ + * // Source from which Building.coordinates are derived. + * coordinatesSource: 'placeholder-value', + * // The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * customer: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": {}, + * // "buildingId": "my_buildingId", + * // "buildingName": "my_buildingName", + * // "coordinates": {}, + * // "description": "my_description", + * // "etags": "my_etags", + * // "floorNames": [], + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": {}, + * // "buildingId": "my_buildingId", + * // "buildingName": "my_buildingName", + * // "coordinates": {}, + * // "description": "my_description", + * // "etags": "my_etags", + * // "floorNames": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.resources.buildings.insert * @memberOf! () * @@ -7501,6 +10627,56 @@ export namespace admin_directory_v1 { /** * directory.resources.buildings.list * @desc Retrieves a list of buildings for an account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.resource.calendar', + * 'https://www.googleapis.com/auth/admin.directory.resource.calendar.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 directory.resources.buildings.list({ + * // The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * customer: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Token to specify the next page in the list. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "buildings": [], + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.resources.buildings.list * @memberOf! () * @@ -7577,6 +10753,74 @@ export namespace admin_directory_v1 { /** * directory.resources.buildings.patch * @desc Updates a building. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.resource.calendar', + * ], + * }); + * + * // 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 directory.resources.buildings.patch({ + * // The ID of the building to update. + * buildingId: 'placeholder-value', + * // Source from which Building.coordinates are derived. + * coordinatesSource: 'placeholder-value', + * // The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * customer: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": {}, + * // "buildingId": "my_buildingId", + * // "buildingName": "my_buildingName", + * // "coordinates": {}, + * // "description": "my_description", + * // "etags": "my_etags", + * // "floorNames": [], + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": {}, + * // "buildingId": "my_buildingId", + * // "buildingName": "my_buildingName", + * // "coordinates": {}, + * // "description": "my_description", + * // "etags": "my_etags", + * // "floorNames": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.resources.buildings.patch * @memberOf! () * @@ -7652,6 +10896,74 @@ export namespace admin_directory_v1 { /** * directory.resources.buildings.update * @desc Updates a building. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.resource.calendar', + * ], + * }); + * + * // 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 directory.resources.buildings.update({ + * // The ID of the building to update. + * buildingId: 'placeholder-value', + * // Source from which Building.coordinates are derived. + * coordinatesSource: 'placeholder-value', + * // The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * customer: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": {}, + * // "buildingId": "my_buildingId", + * // "buildingName": "my_buildingName", + * // "coordinates": {}, + * // "description": "my_description", + * // "etags": "my_etags", + * // "floorNames": [], + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": {}, + * // "buildingId": "my_buildingId", + * // "buildingName": "my_buildingName", + * // "coordinates": {}, + * // "description": "my_description", + * // "etags": "my_etags", + * // "floorNames": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.resources.buildings.update * @memberOf! () * @@ -7858,6 +11170,45 @@ export namespace admin_directory_v1 { /** * directory.resources.calendars.delete * @desc Deletes a calendar resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.resource.calendar', + * ], + * }); + * + * // 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 directory.resources.calendars.delete({ + * // The unique ID of the calendar resource to delete. + * calendarResourceId: 'placeholder-value', + * // The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * customer: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.resources.calendars.delete * @memberOf! () * @@ -7931,6 +11282,65 @@ export namespace admin_directory_v1 { /** * directory.resources.calendars.get * @desc Retrieves a calendar resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.resource.calendar', + * 'https://www.googleapis.com/auth/admin.directory.resource.calendar.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 directory.resources.calendars.get({ + * // The unique ID of the calendar resource to retrieve. + * calendarResourceId: 'placeholder-value', + * // The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * customer: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "buildingId": "my_buildingId", + * // "capacity": 0, + * // "etags": "my_etags", + * // "featureInstances": {}, + * // "floorName": "my_floorName", + * // "floorSection": "my_floorSection", + * // "generatedResourceName": "my_generatedResourceName", + * // "kind": "my_kind", + * // "resourceCategory": "my_resourceCategory", + * // "resourceDescription": "my_resourceDescription", + * // "resourceEmail": "my_resourceEmail", + * // "resourceId": "my_resourceId", + * // "resourceName": "my_resourceName", + * // "resourceType": "my_resourceType", + * // "userVisibleDescription": "my_userVisibleDescription" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.resources.calendars.get * @memberOf! () * @@ -8006,6 +11416,84 @@ export namespace admin_directory_v1 { /** * directory.resources.calendars.insert * @desc Inserts a calendar resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.resource.calendar', + * ], + * }); + * + * // 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 directory.resources.calendars.insert({ + * // The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * customer: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "buildingId": "my_buildingId", + * // "capacity": 0, + * // "etags": "my_etags", + * // "featureInstances": {}, + * // "floorName": "my_floorName", + * // "floorSection": "my_floorSection", + * // "generatedResourceName": "my_generatedResourceName", + * // "kind": "my_kind", + * // "resourceCategory": "my_resourceCategory", + * // "resourceDescription": "my_resourceDescription", + * // "resourceEmail": "my_resourceEmail", + * // "resourceId": "my_resourceId", + * // "resourceName": "my_resourceName", + * // "resourceType": "my_resourceType", + * // "userVisibleDescription": "my_userVisibleDescription" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "buildingId": "my_buildingId", + * // "capacity": 0, + * // "etags": "my_etags", + * // "featureInstances": {}, + * // "floorName": "my_floorName", + * // "floorSection": "my_floorSection", + * // "generatedResourceName": "my_generatedResourceName", + * // "kind": "my_kind", + * // "resourceCategory": "my_resourceCategory", + * // "resourceDescription": "my_resourceDescription", + * // "resourceEmail": "my_resourceEmail", + * // "resourceId": "my_resourceId", + * // "resourceName": "my_resourceName", + * // "resourceType": "my_resourceType", + * // "userVisibleDescription": "my_userVisibleDescription" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.resources.calendars.insert * @memberOf! () * @@ -8081,6 +11569,60 @@ export namespace admin_directory_v1 { /** * directory.resources.calendars.list * @desc Retrieves a list of calendar resources for an account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.resource.calendar', + * 'https://www.googleapis.com/auth/admin.directory.resource.calendar.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 directory.resources.calendars.list({ + * // The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * customer: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Field(s) to sort results by in either ascending or descending order. Supported fields include resourceId, resourceName, capacity, buildingId, and floorName. If no order is specified, defaults to ascending. Should be of the form "field [asc|desc], field [asc|desc], ...". For example buildingId, capacity desc would return results sorted first by buildingId in ascending order then by capacity in descending order. + * orderBy: 'placeholder-value', + * // Token to specify the next page in the list. + * pageToken: 'placeholder-value', + * // String query used to filter results. Should be of the form "field operator value" where field can be any of supported fields and operators can be any of supported operations. Operators include '=' for exact match and ':' for prefix match or HAS match where applicable. For prefix match, the value should always be followed by a *. Supported fields include generatedResourceName, name, buildingId, featureInstances.feature.name. For example buildingId=US-NYC-9TH AND featureInstances.feature.name:Phone. + * query: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.resources.calendars.list * @memberOf! () * @@ -8159,6 +11701,86 @@ export namespace admin_directory_v1 { /** * directory.resources.calendars.patch * @desc Updates a calendar resource. This method supports patch semantics, meaning you only need to include the fields you wish to update. Fields that are not present in the request will be preserved. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.resource.calendar', + * ], + * }); + * + * // 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 directory.resources.calendars.patch({ + * // The unique ID of the calendar resource to update. + * calendarResourceId: 'placeholder-value', + * // The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * customer: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "buildingId": "my_buildingId", + * // "capacity": 0, + * // "etags": "my_etags", + * // "featureInstances": {}, + * // "floorName": "my_floorName", + * // "floorSection": "my_floorSection", + * // "generatedResourceName": "my_generatedResourceName", + * // "kind": "my_kind", + * // "resourceCategory": "my_resourceCategory", + * // "resourceDescription": "my_resourceDescription", + * // "resourceEmail": "my_resourceEmail", + * // "resourceId": "my_resourceId", + * // "resourceName": "my_resourceName", + * // "resourceType": "my_resourceType", + * // "userVisibleDescription": "my_userVisibleDescription" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "buildingId": "my_buildingId", + * // "capacity": 0, + * // "etags": "my_etags", + * // "featureInstances": {}, + * // "floorName": "my_floorName", + * // "floorSection": "my_floorSection", + * // "generatedResourceName": "my_generatedResourceName", + * // "kind": "my_kind", + * // "resourceCategory": "my_resourceCategory", + * // "resourceDescription": "my_resourceDescription", + * // "resourceEmail": "my_resourceEmail", + * // "resourceId": "my_resourceId", + * // "resourceName": "my_resourceName", + * // "resourceType": "my_resourceType", + * // "userVisibleDescription": "my_userVisibleDescription" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.resources.calendars.patch * @memberOf! () * @@ -8235,6 +11857,86 @@ export namespace admin_directory_v1 { /** * directory.resources.calendars.update * @desc Updates a calendar resource. This method supports patch semantics, meaning you only need to include the fields you wish to update. Fields that are not present in the request will be preserved. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.resource.calendar', + * ], + * }); + * + * // 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 directory.resources.calendars.update({ + * // The unique ID of the calendar resource to update. + * calendarResourceId: 'placeholder-value', + * // The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * customer: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "buildingId": "my_buildingId", + * // "capacity": 0, + * // "etags": "my_etags", + * // "featureInstances": {}, + * // "floorName": "my_floorName", + * // "floorSection": "my_floorSection", + * // "generatedResourceName": "my_generatedResourceName", + * // "kind": "my_kind", + * // "resourceCategory": "my_resourceCategory", + * // "resourceDescription": "my_resourceDescription", + * // "resourceEmail": "my_resourceEmail", + * // "resourceId": "my_resourceId", + * // "resourceName": "my_resourceName", + * // "resourceType": "my_resourceType", + * // "userVisibleDescription": "my_userVisibleDescription" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "buildingId": "my_buildingId", + * // "capacity": 0, + * // "etags": "my_etags", + * // "featureInstances": {}, + * // "floorName": "my_floorName", + * // "floorSection": "my_floorSection", + * // "generatedResourceName": "my_generatedResourceName", + * // "kind": "my_kind", + * // "resourceCategory": "my_resourceCategory", + * // "resourceDescription": "my_resourceDescription", + * // "resourceEmail": "my_resourceEmail", + * // "resourceId": "my_resourceId", + * // "resourceName": "my_resourceName", + * // "resourceType": "my_resourceType", + * // "userVisibleDescription": "my_userVisibleDescription" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.resources.calendars.update * @memberOf! () * @@ -8438,6 +12140,45 @@ export namespace admin_directory_v1 { /** * directory.resources.features.delete * @desc Deletes a feature. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.resource.calendar', + * ], + * }); + * + * // 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 directory.resources.features.delete({ + * // The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * customer: 'placeholder-value', + * // The unique ID of the feature to delete. + * featureKey: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.resources.features.delete * @memberOf! () * @@ -8511,6 +12252,53 @@ export namespace admin_directory_v1 { /** * directory.resources.features.get * @desc Retrieves a feature. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.resource.calendar', + * 'https://www.googleapis.com/auth/admin.directory.resource.calendar.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 directory.resources.features.get({ + * // The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * customer: 'placeholder-value', + * // The unique ID of the feature to retrieve. + * featureKey: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etags": "my_etags", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.resources.features.get * @memberOf! () * @@ -8584,6 +12372,60 @@ export namespace admin_directory_v1 { /** * directory.resources.features.insert * @desc Inserts a feature. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.resource.calendar', + * ], + * }); + * + * // 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 directory.resources.features.insert({ + * // The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * customer: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etags": "my_etags", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etags": "my_etags", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.resources.features.insert * @memberOf! () * @@ -8657,6 +12499,56 @@ export namespace admin_directory_v1 { /** * directory.resources.features.list * @desc Retrieves a list of features for an account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.resource.calendar', + * 'https://www.googleapis.com/auth/admin.directory.resource.calendar.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 directory.resources.features.list({ + * // The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * customer: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Token to specify the next page in the list. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "features": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.resources.features.list * @memberOf! () * @@ -8731,6 +12623,62 @@ export namespace admin_directory_v1 { /** * directory.resources.features.patch * @desc Updates a feature. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.resource.calendar', + * ], + * }); + * + * // 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 directory.resources.features.patch({ + * // The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * customer: 'placeholder-value', + * // The unique ID of the feature to update. + * featureKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etags": "my_etags", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etags": "my_etags", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.resources.features.patch * @memberOf! () * @@ -8805,6 +12753,53 @@ export namespace admin_directory_v1 { /** * directory.resources.features.rename * @desc Renames a feature. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.resource.calendar', + * ], + * }); + * + * // 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 directory.resources.features.rename({ + * // The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * customer: 'placeholder-value', + * // The unique ID of the feature to rename. + * oldName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "newName": "my_newName" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.resources.features.rename * @memberOf! () * @@ -8879,6 +12874,62 @@ export namespace admin_directory_v1 { /** * directory.resources.features.update * @desc Updates a feature. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.resource.calendar', + * ], + * }); + * + * // 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 directory.resources.features.update({ + * // The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * customer: 'placeholder-value', + * // The unique ID of the feature to update. + * featureKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etags": "my_etags", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etags": "my_etags", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.resources.features.update * @memberOf! () * @@ -9093,6 +13144,43 @@ export namespace admin_directory_v1 { /** * directory.roleAssignments.delete * @desc Deletes a role assignment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.rolemanagement'], + * }); + * + * // 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 directory.roleAssignments.delete({ + * // Immutable ID of the G Suite account. + * customer: 'placeholder-value', + * // Immutable ID of the role assignment. + * roleAssignmentId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.roleAssignments.delete * @memberOf! () * @@ -9166,6 +13254,57 @@ export namespace admin_directory_v1 { /** * directory.roleAssignments.get * @desc Retrieve a role assignment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.rolemanagement', + * 'https://www.googleapis.com/auth/admin.directory.rolemanagement.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 directory.roleAssignments.get({ + * // Immutable ID of the G Suite account. + * customer: 'placeholder-value', + * // Immutable ID of the role assignment. + * roleAssignmentId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assignedTo": "my_assignedTo", + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "orgUnitId": "my_orgUnitId", + * // "roleAssignmentId": "my_roleAssignmentId", + * // "roleId": "my_roleId", + * // "scopeType": "my_scopeType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.roleAssignments.get * @memberOf! () * @@ -9241,6 +13380,66 @@ export namespace admin_directory_v1 { /** * directory.roleAssignments.insert * @desc Creates a role assignment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.rolemanagement'], + * }); + * + * // 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 directory.roleAssignments.insert({ + * // Immutable ID of the G Suite account. + * customer: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "assignedTo": "my_assignedTo", + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "orgUnitId": "my_orgUnitId", + * // "roleAssignmentId": "my_roleAssignmentId", + * // "roleId": "my_roleId", + * // "scopeType": "my_scopeType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assignedTo": "my_assignedTo", + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "orgUnitId": "my_orgUnitId", + * // "roleAssignmentId": "my_roleAssignmentId", + * // "roleId": "my_roleId", + * // "scopeType": "my_scopeType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.roleAssignments.insert * @memberOf! () * @@ -9316,6 +13515,60 @@ export namespace admin_directory_v1 { /** * directory.roleAssignments.list * @desc Retrieves a paginated list of all roleAssignments. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.rolemanagement', + * 'https://www.googleapis.com/auth/admin.directory.rolemanagement.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 directory.roleAssignments.list({ + * // Immutable ID of the G Suite account. + * customer: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Token to specify the next page in the list. + * pageToken: 'placeholder-value', + * // Immutable ID of a role. If included in the request, returns only role assignments containing this role ID. + * roleId: 'placeholder-value', + * // The user's primary email address, alias email address, or unique user ID. If included in the request, returns role assignments only for this user. + * userKey: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.roleAssignments.list * @memberOf! () * @@ -9479,6 +13732,43 @@ export namespace admin_directory_v1 { /** * directory.roles.delete * @desc Deletes a role. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.rolemanagement'], + * }); + * + * // 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 directory.roles.delete({ + * // Immutable ID of the G Suite account. + * customer: 'placeholder-value', + * // Immutable ID of the role. + * roleId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.roles.delete * @memberOf! () * @@ -9550,6 +13840,58 @@ export namespace admin_directory_v1 { /** * directory.roles.get * @desc Retrieves a role. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.rolemanagement', + * 'https://www.googleapis.com/auth/admin.directory.rolemanagement.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 directory.roles.get({ + * // Immutable ID of the G Suite account. + * customer: 'placeholder-value', + * // Immutable ID of the role. + * roleId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "isSuperAdminRole": false, + * // "isSystemRole": false, + * // "kind": "my_kind", + * // "roleDescription": "my_roleDescription", + * // "roleId": "my_roleId", + * // "roleName": "my_roleName", + * // "rolePrivileges": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.roles.get * @memberOf! () * @@ -9621,6 +13963,68 @@ export namespace admin_directory_v1 { /** * directory.roles.insert * @desc Creates a role. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.rolemanagement'], + * }); + * + * // 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 directory.roles.insert({ + * // Immutable ID of the G Suite account. + * customer: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "isSuperAdminRole": false, + * // "isSystemRole": false, + * // "kind": "my_kind", + * // "roleDescription": "my_roleDescription", + * // "roleId": "my_roleId", + * // "roleName": "my_roleName", + * // "rolePrivileges": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "isSuperAdminRole": false, + * // "isSystemRole": false, + * // "kind": "my_kind", + * // "roleDescription": "my_roleDescription", + * // "roleId": "my_roleId", + * // "roleName": "my_roleName", + * // "rolePrivileges": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.roles.insert * @memberOf! () * @@ -9692,6 +14096,56 @@ export namespace admin_directory_v1 { /** * directory.roles.list * @desc Retrieves a paginated list of all the roles in a domain. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.rolemanagement', + * 'https://www.googleapis.com/auth/admin.directory.rolemanagement.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 directory.roles.list({ + * // Immutable ID of the G Suite account. + * customer: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Token to specify the next page in the list. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.roles.list * @memberOf! () * @@ -9764,6 +14218,70 @@ export namespace admin_directory_v1 { /** * directory.roles.patch * @desc Updates a role. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.rolemanagement'], + * }); + * + * // 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 directory.roles.patch({ + * // Immutable ID of the G Suite account. + * customer: 'placeholder-value', + * // Immutable ID of the role. + * roleId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "isSuperAdminRole": false, + * // "isSystemRole": false, + * // "kind": "my_kind", + * // "roleDescription": "my_roleDescription", + * // "roleId": "my_roleId", + * // "roleName": "my_roleName", + * // "rolePrivileges": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "isSuperAdminRole": false, + * // "isSystemRole": false, + * // "kind": "my_kind", + * // "roleDescription": "my_roleDescription", + * // "roleId": "my_roleId", + * // "roleName": "my_roleName", + * // "rolePrivileges": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.roles.patch * @memberOf! () * @@ -9836,6 +14354,70 @@ export namespace admin_directory_v1 { /** * directory.roles.update * @desc Updates a role. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.rolemanagement'], + * }); + * + * // 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 directory.roles.update({ + * // Immutable ID of the G Suite account. + * customer: 'placeholder-value', + * // Immutable ID of the role. + * roleId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "isSuperAdminRole": false, + * // "isSystemRole": false, + * // "kind": "my_kind", + * // "roleDescription": "my_roleDescription", + * // "roleId": "my_roleId", + * // "roleName": "my_roleName", + * // "rolePrivileges": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "isSuperAdminRole": false, + * // "isSystemRole": false, + * // "kind": "my_kind", + * // "roleDescription": "my_roleDescription", + * // "roleId": "my_roleId", + * // "roleName": "my_roleName", + * // "rolePrivileges": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.roles.update * @memberOf! () * @@ -10021,6 +14603,43 @@ export namespace admin_directory_v1 { /** * directory.schemas.delete * @desc Delete schema + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.userschema'], + * }); + * + * // 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 directory.schemas.delete({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * // Name or immutable ID of the schema + * schemaKey: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.schemas.delete * @memberOf! () * @@ -10093,6 +14712,56 @@ export namespace admin_directory_v1 { /** * directory.schemas.get * @desc Retrieve schema + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.userschema', + * 'https://www.googleapis.com/auth/admin.directory.userschema.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 directory.schemas.get({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * // Name or immutable ID of the schema + * schemaKey: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "etag": "my_etag", + * // "fields": [], + * // "kind": "my_kind", + * // "schemaId": "my_schemaId", + * // "schemaName": "my_schemaName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.schemas.get * @memberOf! () * @@ -10165,6 +14834,64 @@ export namespace admin_directory_v1 { /** * directory.schemas.insert * @desc Create schema. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.userschema'], + * }); + * + * // 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 directory.schemas.insert({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "etag": "my_etag", + * // "fields": [], + * // "kind": "my_kind", + * // "schemaId": "my_schemaId", + * // "schemaName": "my_schemaName" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "etag": "my_etag", + * // "fields": [], + * // "kind": "my_kind", + * // "schemaId": "my_schemaId", + * // "schemaName": "my_schemaName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.schemas.insert * @memberOf! () * @@ -10236,6 +14963,51 @@ export namespace admin_directory_v1 { /** * directory.schemas.list * @desc Retrieve all schemas for a customer + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.userschema', + * 'https://www.googleapis.com/auth/admin.directory.userschema.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 directory.schemas.list({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "schemas": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.schemas.list * @memberOf! () * @@ -10306,6 +15078,66 @@ export namespace admin_directory_v1 { /** * directory.schemas.patch * @desc Update schema. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.userschema'], + * }); + * + * // 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 directory.schemas.patch({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * // Name or immutable ID of the schema. + * schemaKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "etag": "my_etag", + * // "fields": [], + * // "kind": "my_kind", + * // "schemaId": "my_schemaId", + * // "schemaName": "my_schemaName" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "etag": "my_etag", + * // "fields": [], + * // "kind": "my_kind", + * // "schemaId": "my_schemaId", + * // "schemaName": "my_schemaName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.schemas.patch * @memberOf! () * @@ -10379,6 +15211,66 @@ export namespace admin_directory_v1 { /** * directory.schemas.update * @desc Update schema + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.userschema'], + * }); + * + * // 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 directory.schemas.update({ + * // Immutable ID of the G Suite account + * customerId: 'placeholder-value', + * // Name or immutable ID of the schema. + * schemaKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "etag": "my_etag", + * // "fields": [], + * // "kind": "my_kind", + * // "schemaId": "my_schemaId", + * // "schemaName": "my_schemaName" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "etag": "my_etag", + * // "fields": [], + * // "kind": "my_kind", + * // "schemaId": "my_schemaId", + * // "schemaName": "my_schemaName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.schemas.update * @memberOf! () * @@ -10557,6 +15449,43 @@ export namespace admin_directory_v1 { /** * directory.tokens.delete * @desc Delete all access tokens issued by a user for an application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user.security'], + * }); + * + * // 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 directory.tokens.delete({ + * // The Client ID of the application the token is issued to. + * clientId: 'placeholder-value', + * // Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. + * userKey: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.tokens.delete * @memberOf! () * @@ -10628,6 +15557,55 @@ export namespace admin_directory_v1 { /** * directory.tokens.get * @desc Get information about an access token issued by a user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user.security'], + * }); + * + * // 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 directory.tokens.get({ + * // The Client ID of the application the token is issued to. + * clientId: 'placeholder-value', + * // Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. + * userKey: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "anonymous": false, + * // "clientId": "my_clientId", + * // "displayText": "my_displayText", + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "nativeApp": false, + * // "scopes": [], + * // "userKey": "my_userKey" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.tokens.get * @memberOf! () * @@ -10699,6 +15677,48 @@ export namespace admin_directory_v1 { /** * directory.tokens.list * @desc Returns the set of tokens specified user has issued to 3rd party applications. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user.security'], + * }); + * + * // 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 directory.tokens.list({ + * // Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. + * userKey: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.tokens.list * @memberOf! () * @@ -10822,6 +15842,41 @@ export namespace admin_directory_v1 { /** * directory.users.delete * @desc Delete user + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user'], + * }); + * + * // 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 directory.users.delete({ + * // Email or immutable ID of the user + * userKey: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.users.delete * @memberOf! () * @@ -10893,6 +15948,100 @@ export namespace admin_directory_v1 { /** * directory.users.get * @desc retrieve user + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user', + * 'https://www.googleapis.com/auth/admin.directory.user.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 directory.users.get({ + * // Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom. + * customFieldMask: 'placeholder-value', + * // What subset of fields to fetch for this user. + * projection: 'placeholder-value', + * // Email or immutable ID of the user + * userKey: 'placeholder-value', + * // Whether to fetch the ADMIN_VIEW or DOMAIN_PUBLIC view of the user. + * viewType: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "addresses": {}, + * // "agreedToTerms": false, + * // "aliases": [], + * // "archived": false, + * // "changePasswordAtNextLogin": false, + * // "creationTime": "my_creationTime", + * // "customSchemas": {}, + * // "customerId": "my_customerId", + * // "deletionTime": "my_deletionTime", + * // "emails": {}, + * // "etag": "my_etag", + * // "externalIds": {}, + * // "gender": {}, + * // "hashFunction": "my_hashFunction", + * // "id": "my_id", + * // "ims": {}, + * // "includeInGlobalAddressList": false, + * // "ipWhitelisted": false, + * // "isAdmin": false, + * // "isDelegatedAdmin": false, + * // "isEnforcedIn2Sv": false, + * // "isEnrolledIn2Sv": false, + * // "isMailboxSetup": false, + * // "keywords": {}, + * // "kind": "my_kind", + * // "languages": {}, + * // "lastLoginTime": "my_lastLoginTime", + * // "locations": {}, + * // "name": {}, + * // "nonEditableAliases": [], + * // "notes": {}, + * // "orgUnitPath": "my_orgUnitPath", + * // "organizations": {}, + * // "password": "my_password", + * // "phones": {}, + * // "posixAccounts": {}, + * // "primaryEmail": "my_primaryEmail", + * // "recoveryEmail": "my_recoveryEmail", + * // "recoveryPhone": "my_recoveryPhone", + * // "relations": {}, + * // "sshPublicKeys": {}, + * // "suspended": false, + * // "suspensionReason": "my_suspensionReason", + * // "thumbnailPhotoEtag": "my_thumbnailPhotoEtag", + * // "thumbnailPhotoUrl": "my_thumbnailPhotoUrl", + * // "websites": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.users.get * @memberOf! () * @@ -10967,6 +16116,141 @@ export namespace admin_directory_v1 { /** * directory.users.insert * @desc create user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user'], + * }); + * + * // 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 directory.users.insert({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "addresses": {}, + * // "agreedToTerms": false, + * // "aliases": [], + * // "archived": false, + * // "changePasswordAtNextLogin": false, + * // "creationTime": "my_creationTime", + * // "customSchemas": {}, + * // "customerId": "my_customerId", + * // "deletionTime": "my_deletionTime", + * // "emails": {}, + * // "etag": "my_etag", + * // "externalIds": {}, + * // "gender": {}, + * // "hashFunction": "my_hashFunction", + * // "id": "my_id", + * // "ims": {}, + * // "includeInGlobalAddressList": false, + * // "ipWhitelisted": false, + * // "isAdmin": false, + * // "isDelegatedAdmin": false, + * // "isEnforcedIn2Sv": false, + * // "isEnrolledIn2Sv": false, + * // "isMailboxSetup": false, + * // "keywords": {}, + * // "kind": "my_kind", + * // "languages": {}, + * // "lastLoginTime": "my_lastLoginTime", + * // "locations": {}, + * // "name": {}, + * // "nonEditableAliases": [], + * // "notes": {}, + * // "orgUnitPath": "my_orgUnitPath", + * // "organizations": {}, + * // "password": "my_password", + * // "phones": {}, + * // "posixAccounts": {}, + * // "primaryEmail": "my_primaryEmail", + * // "recoveryEmail": "my_recoveryEmail", + * // "recoveryPhone": "my_recoveryPhone", + * // "relations": {}, + * // "sshPublicKeys": {}, + * // "suspended": false, + * // "suspensionReason": "my_suspensionReason", + * // "thumbnailPhotoEtag": "my_thumbnailPhotoEtag", + * // "thumbnailPhotoUrl": "my_thumbnailPhotoUrl", + * // "websites": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "addresses": {}, + * // "agreedToTerms": false, + * // "aliases": [], + * // "archived": false, + * // "changePasswordAtNextLogin": false, + * // "creationTime": "my_creationTime", + * // "customSchemas": {}, + * // "customerId": "my_customerId", + * // "deletionTime": "my_deletionTime", + * // "emails": {}, + * // "etag": "my_etag", + * // "externalIds": {}, + * // "gender": {}, + * // "hashFunction": "my_hashFunction", + * // "id": "my_id", + * // "ims": {}, + * // "includeInGlobalAddressList": false, + * // "ipWhitelisted": false, + * // "isAdmin": false, + * // "isDelegatedAdmin": false, + * // "isEnforcedIn2Sv": false, + * // "isEnrolledIn2Sv": false, + * // "isMailboxSetup": false, + * // "keywords": {}, + * // "kind": "my_kind", + * // "languages": {}, + * // "lastLoginTime": "my_lastLoginTime", + * // "locations": {}, + * // "name": {}, + * // "nonEditableAliases": [], + * // "notes": {}, + * // "orgUnitPath": "my_orgUnitPath", + * // "organizations": {}, + * // "password": "my_password", + * // "phones": {}, + * // "posixAccounts": {}, + * // "primaryEmail": "my_primaryEmail", + * // "recoveryEmail": "my_recoveryEmail", + * // "recoveryPhone": "my_recoveryPhone", + * // "relations": {}, + * // "sshPublicKeys": {}, + * // "suspended": false, + * // "suspensionReason": "my_suspensionReason", + * // "thumbnailPhotoEtag": "my_thumbnailPhotoEtag", + * // "thumbnailPhotoUrl": "my_thumbnailPhotoUrl", + * // "websites": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.users.insert * @memberOf! () * @@ -11038,6 +16322,76 @@ export namespace admin_directory_v1 { /** * directory.users.list * @desc Retrieve either deleted users or all users in a domain (paginated) + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user', + * 'https://www.googleapis.com/auth/admin.directory.user.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 directory.users.list({ + * // Immutable ID of the G Suite account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain. + * customer: 'placeholder-value', + * // Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom. + * customFieldMask: 'placeholder-value', + * // Name of the domain. Fill this field to get users from only this domain. To return all users in a multi-domain fill customer field instead. + * domain: 'placeholder-value', + * // Event on which subscription is intended (if subscribing) + * event: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Column to use for sorting results + * orderBy: 'placeholder-value', + * // Token to specify next page in the list + * pageToken: 'placeholder-value', + * // What subset of fields to fetch for this user. + * projection: 'placeholder-value', + * // Query string search. Should be of the form "". Complete documentation is at https://developers.google.com/admin-sdk/directory/v1/guides/search-users + * query: 'placeholder-value', + * // If set to true, retrieves the list of deleted users. (Default: false) + * showDeleted: 'placeholder-value', + * // Whether to return results in ascending or descending order. + * sortOrder: 'placeholder-value', + * // Whether to fetch the ADMIN_VIEW or DOMAIN_PUBLIC view of the user. + * viewType: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "trigger_event": "my_trigger_event", + * // "users": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.users.list * @memberOf! () * @@ -11120,6 +16474,49 @@ export namespace admin_directory_v1 { /** * directory.users.makeAdmin * @desc change admin status of a user + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user'], + * }); + * + * // 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 directory.users.makeAdmin({ + * // Email or immutable ID of the user as admin + * userKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "status": false + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.users.makeAdmin * @memberOf! () * @@ -11191,6 +16588,144 @@ export namespace admin_directory_v1 { /** * directory.users.patch * @desc update user. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user'], + * }); + * + * // 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 directory.users.patch({ + * // Email or immutable ID of the user. If ID, it should match with id of user object + * userKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "addresses": {}, + * // "agreedToTerms": false, + * // "aliases": [], + * // "archived": false, + * // "changePasswordAtNextLogin": false, + * // "creationTime": "my_creationTime", + * // "customSchemas": {}, + * // "customerId": "my_customerId", + * // "deletionTime": "my_deletionTime", + * // "emails": {}, + * // "etag": "my_etag", + * // "externalIds": {}, + * // "gender": {}, + * // "hashFunction": "my_hashFunction", + * // "id": "my_id", + * // "ims": {}, + * // "includeInGlobalAddressList": false, + * // "ipWhitelisted": false, + * // "isAdmin": false, + * // "isDelegatedAdmin": false, + * // "isEnforcedIn2Sv": false, + * // "isEnrolledIn2Sv": false, + * // "isMailboxSetup": false, + * // "keywords": {}, + * // "kind": "my_kind", + * // "languages": {}, + * // "lastLoginTime": "my_lastLoginTime", + * // "locations": {}, + * // "name": {}, + * // "nonEditableAliases": [], + * // "notes": {}, + * // "orgUnitPath": "my_orgUnitPath", + * // "organizations": {}, + * // "password": "my_password", + * // "phones": {}, + * // "posixAccounts": {}, + * // "primaryEmail": "my_primaryEmail", + * // "recoveryEmail": "my_recoveryEmail", + * // "recoveryPhone": "my_recoveryPhone", + * // "relations": {}, + * // "sshPublicKeys": {}, + * // "suspended": false, + * // "suspensionReason": "my_suspensionReason", + * // "thumbnailPhotoEtag": "my_thumbnailPhotoEtag", + * // "thumbnailPhotoUrl": "my_thumbnailPhotoUrl", + * // "websites": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "addresses": {}, + * // "agreedToTerms": false, + * // "aliases": [], + * // "archived": false, + * // "changePasswordAtNextLogin": false, + * // "creationTime": "my_creationTime", + * // "customSchemas": {}, + * // "customerId": "my_customerId", + * // "deletionTime": "my_deletionTime", + * // "emails": {}, + * // "etag": "my_etag", + * // "externalIds": {}, + * // "gender": {}, + * // "hashFunction": "my_hashFunction", + * // "id": "my_id", + * // "ims": {}, + * // "includeInGlobalAddressList": false, + * // "ipWhitelisted": false, + * // "isAdmin": false, + * // "isDelegatedAdmin": false, + * // "isEnforcedIn2Sv": false, + * // "isEnrolledIn2Sv": false, + * // "isMailboxSetup": false, + * // "keywords": {}, + * // "kind": "my_kind", + * // "languages": {}, + * // "lastLoginTime": "my_lastLoginTime", + * // "locations": {}, + * // "name": {}, + * // "nonEditableAliases": [], + * // "notes": {}, + * // "orgUnitPath": "my_orgUnitPath", + * // "organizations": {}, + * // "password": "my_password", + * // "phones": {}, + * // "posixAccounts": {}, + * // "primaryEmail": "my_primaryEmail", + * // "recoveryEmail": "my_recoveryEmail", + * // "recoveryPhone": "my_recoveryPhone", + * // "relations": {}, + * // "sshPublicKeys": {}, + * // "suspended": false, + * // "suspensionReason": "my_suspensionReason", + * // "thumbnailPhotoEtag": "my_thumbnailPhotoEtag", + * // "thumbnailPhotoUrl": "my_thumbnailPhotoUrl", + * // "websites": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.users.patch * @memberOf! () * @@ -11263,6 +16798,49 @@ export namespace admin_directory_v1 { /** * directory.users.undelete * @desc Undelete a deleted user + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user'], + * }); + * + * // 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 directory.users.undelete({ + * // The immutable id of the user + * userKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "orgUnitPath": "my_orgUnitPath" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.users.undelete * @memberOf! () * @@ -11334,6 +16912,144 @@ export namespace admin_directory_v1 { /** * directory.users.update * @desc update user + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user'], + * }); + * + * // 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 directory.users.update({ + * // Email or immutable ID of the user. If ID, it should match with id of user object + * userKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "addresses": {}, + * // "agreedToTerms": false, + * // "aliases": [], + * // "archived": false, + * // "changePasswordAtNextLogin": false, + * // "creationTime": "my_creationTime", + * // "customSchemas": {}, + * // "customerId": "my_customerId", + * // "deletionTime": "my_deletionTime", + * // "emails": {}, + * // "etag": "my_etag", + * // "externalIds": {}, + * // "gender": {}, + * // "hashFunction": "my_hashFunction", + * // "id": "my_id", + * // "ims": {}, + * // "includeInGlobalAddressList": false, + * // "ipWhitelisted": false, + * // "isAdmin": false, + * // "isDelegatedAdmin": false, + * // "isEnforcedIn2Sv": false, + * // "isEnrolledIn2Sv": false, + * // "isMailboxSetup": false, + * // "keywords": {}, + * // "kind": "my_kind", + * // "languages": {}, + * // "lastLoginTime": "my_lastLoginTime", + * // "locations": {}, + * // "name": {}, + * // "nonEditableAliases": [], + * // "notes": {}, + * // "orgUnitPath": "my_orgUnitPath", + * // "organizations": {}, + * // "password": "my_password", + * // "phones": {}, + * // "posixAccounts": {}, + * // "primaryEmail": "my_primaryEmail", + * // "recoveryEmail": "my_recoveryEmail", + * // "recoveryPhone": "my_recoveryPhone", + * // "relations": {}, + * // "sshPublicKeys": {}, + * // "suspended": false, + * // "suspensionReason": "my_suspensionReason", + * // "thumbnailPhotoEtag": "my_thumbnailPhotoEtag", + * // "thumbnailPhotoUrl": "my_thumbnailPhotoUrl", + * // "websites": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "addresses": {}, + * // "agreedToTerms": false, + * // "aliases": [], + * // "archived": false, + * // "changePasswordAtNextLogin": false, + * // "creationTime": "my_creationTime", + * // "customSchemas": {}, + * // "customerId": "my_customerId", + * // "deletionTime": "my_deletionTime", + * // "emails": {}, + * // "etag": "my_etag", + * // "externalIds": {}, + * // "gender": {}, + * // "hashFunction": "my_hashFunction", + * // "id": "my_id", + * // "ims": {}, + * // "includeInGlobalAddressList": false, + * // "ipWhitelisted": false, + * // "isAdmin": false, + * // "isDelegatedAdmin": false, + * // "isEnforcedIn2Sv": false, + * // "isEnrolledIn2Sv": false, + * // "isMailboxSetup": false, + * // "keywords": {}, + * // "kind": "my_kind", + * // "languages": {}, + * // "lastLoginTime": "my_lastLoginTime", + * // "locations": {}, + * // "name": {}, + * // "nonEditableAliases": [], + * // "notes": {}, + * // "orgUnitPath": "my_orgUnitPath", + * // "organizations": {}, + * // "password": "my_password", + * // "phones": {}, + * // "posixAccounts": {}, + * // "primaryEmail": "my_primaryEmail", + * // "recoveryEmail": "my_recoveryEmail", + * // "recoveryPhone": "my_recoveryPhone", + * // "relations": {}, + * // "sshPublicKeys": {}, + * // "suspended": false, + * // "suspensionReason": "my_suspensionReason", + * // "thumbnailPhotoEtag": "my_thumbnailPhotoEtag", + * // "thumbnailPhotoUrl": "my_thumbnailPhotoUrl", + * // "websites": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.users.update * @memberOf! () * @@ -11406,6 +17122,98 @@ export namespace admin_directory_v1 { /** * directory.users.watch * @desc Watch for changes in users list + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user', + * 'https://www.googleapis.com/auth/admin.directory.user.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 directory.users.watch({ + * // Immutable ID of the G Suite account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain. + * customer: 'placeholder-value', + * // Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom. + * customFieldMask: 'placeholder-value', + * // Name of the domain. Fill this field to get users from only this domain. To return all users in a multi-domain fill customer field instead. + * domain: 'placeholder-value', + * // Event on which subscription is intended (if subscribing) + * event: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Column to use for sorting results + * orderBy: 'placeholder-value', + * // Token to specify next page in the list + * pageToken: 'placeholder-value', + * // What subset of fields to fetch for this user. + * projection: 'placeholder-value', + * // Query string search. Should be of the form "". Complete documentation is at https://developers.google.com/admin-sdk/directory/v1/guides/search-users + * query: 'placeholder-value', + * // If set to true, retrieves the list of deleted users. (Default: false) + * showDeleted: 'placeholder-value', + * // Whether to return results in ascending or descending order. + * sortOrder: 'placeholder-value', + * // Whether to fetch the ADMIN_VIEW or DOMAIN_PUBLIC view of the user. + * viewType: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.users.watch * @memberOf! () * @@ -11721,6 +17529,46 @@ export namespace admin_directory_v1 { /** * directory.users.aliases.delete * @desc Remove a alias for the user + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user', + * 'https://www.googleapis.com/auth/admin.directory.user.alias', + * ], + * }); + * + * // 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 directory.users.aliases.delete({ + * // The alias to be removed + * alias: 'placeholder-value', + * // Email or immutable ID of the user + * userKey: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.users.aliases.delete * @memberOf! () * @@ -11793,6 +17641,65 @@ export namespace admin_directory_v1 { /** * directory.users.aliases.insert * @desc Add a alias for the user + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user', + * 'https://www.googleapis.com/auth/admin.directory.user.alias', + * ], + * }); + * + * // 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 directory.users.aliases.insert({ + * // Email or immutable ID of the user + * userKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alias": "my_alias", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "primaryEmail": "my_primaryEmail" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alias": "my_alias", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "primaryEmail": "my_primaryEmail" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.users.aliases.insert * @memberOf! () * @@ -11865,6 +17772,55 @@ export namespace admin_directory_v1 { /** * directory.users.aliases.list * @desc List all aliases for a user + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user', + * 'https://www.googleapis.com/auth/admin.directory.user.alias', + * 'https://www.googleapis.com/auth/admin.directory.user.alias.readonly', + * 'https://www.googleapis.com/auth/admin.directory.user.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 directory.users.aliases.list({ + * // Event on which subscription is intended (if subscribing) + * event: 'placeholder-value', + * // Email or immutable ID of the user + * userKey: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "aliases": [], + * // "etag": "my_etag", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.users.aliases.list * @memberOf! () * @@ -11937,6 +17893,79 @@ export namespace admin_directory_v1 { /** * directory.users.aliases.watch * @desc Watch for changes in user aliases list + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user', + * 'https://www.googleapis.com/auth/admin.directory.user.alias', + * 'https://www.googleapis.com/auth/admin.directory.user.alias.readonly', + * 'https://www.googleapis.com/auth/admin.directory.user.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 directory.users.aliases.watch({ + * // Event on which subscription is intended (if subscribing) + * event: 'placeholder-value', + * // Email or immutable ID of the user + * userKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.users.aliases.watch * @memberOf! () * @@ -12088,6 +18117,41 @@ export namespace admin_directory_v1 { /** * directory.users.photos.delete * @desc Remove photos for the user + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user'], + * }); + * + * // 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 directory.users.photos.delete({ + * // Email or immutable ID of the user + * userKey: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.users.photos.delete * @memberOf! () * @@ -12159,6 +18223,56 @@ export namespace admin_directory_v1 { /** * directory.users.photos.get * @desc Retrieve photo of a user + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user', + * 'https://www.googleapis.com/auth/admin.directory.user.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 directory.users.photos.get({ + * // Email or immutable ID of the user + * userKey: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "height": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mimeType": "my_mimeType", + * // "photoData": "my_photoData", + * // "primaryEmail": "my_primaryEmail", + * // "width": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.users.photos.get * @memberOf! () * @@ -12231,6 +18345,68 @@ export namespace admin_directory_v1 { /** * directory.users.photos.patch * @desc Add a photo for the user. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user'], + * }); + * + * // 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 directory.users.photos.patch({ + * // Email or immutable ID of the user + * userKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "height": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mimeType": "my_mimeType", + * // "photoData": "my_photoData", + * // "primaryEmail": "my_primaryEmail", + * // "width": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "height": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mimeType": "my_mimeType", + * // "photoData": "my_photoData", + * // "primaryEmail": "my_primaryEmail", + * // "width": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.users.photos.patch * @memberOf! () * @@ -12305,6 +18481,68 @@ export namespace admin_directory_v1 { /** * directory.users.photos.update * @desc Add a photo for the user + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user'], + * }); + * + * // 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 directory.users.photos.update({ + * // Email or immutable ID of the user + * userKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "height": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mimeType": "my_mimeType", + * // "photoData": "my_photoData", + * // "primaryEmail": "my_primaryEmail", + * // "width": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "height": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mimeType": "my_mimeType", + * // "photoData": "my_photoData", + * // "primaryEmail": "my_primaryEmail", + * // "width": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.users.photos.update * @memberOf! () * @@ -12444,6 +18682,41 @@ export namespace admin_directory_v1 { /** * directory.verificationCodes.generate * @desc Generate new backup verification codes for the user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user.security'], + * }); + * + * // 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 directory.verificationCodes.generate({ + * // Email or immutable ID of the user + * userKey: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.verificationCodes.generate * @memberOf! () * @@ -12516,6 +18789,41 @@ export namespace admin_directory_v1 { /** * directory.verificationCodes.invalidate * @desc Invalidate the current backup verification codes for the user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user.security'], + * }); + * + * // 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 directory.verificationCodes.invalidate({ + * // Email or immutable ID of the user + * userKey: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.verificationCodes.invalidate * @memberOf! () * @@ -12588,6 +18896,48 @@ export namespace admin_directory_v1 { /** * directory.verificationCodes.list * @desc Returns the current set of valid backup verification codes for the specified user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('directory_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/admin.directory.user.security'], + * }); + * + * // 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 directory.verificationCodes.list({ + * // Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. + * userKey: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias directory.verificationCodes.list * @memberOf! () * diff --git a/src/apis/admin/reports_v1.ts b/src/apis/admin/reports_v1.ts index 24b109c2b11..5c011121971 100644 --- a/src/apis/admin/reports_v1.ts +++ b/src/apis/admin/reports_v1.ts @@ -336,6 +336,93 @@ export namespace admin_reports_v1 { /** * reports.activities.list * @desc Retrieves a list of activities for a specific customer's account and application such as the Admin console application or the Google Drive application. For more information, see the guides for administrator and Google Drive activity reports. For more information about the activity report's parameters, see the activity parameters reference guides. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('reports_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/admin.reports.audit.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 reports.activities.list({ + * // The Internet Protocol (IP) Address of host where the event was performed. This is an additional way to filter a report's summary using the IP address of the user whose activity is being reported. This IP address may or may not reflect the user's physical location. For example, the IP address can be the user's proxy server's address or a virtual private network (VPN) address. This parameter supports both IPv4 and IPv6 address versions. + * actorIpAddress: 'placeholder-value', + * // Application name for which the events are to be retrieved. + * applicationName: + * '(admin)|(calendar)|(drive)|(login)|(mobile)|(token)|(groups)|(saml)|(chat)|(gplus)|(rules)|(jamboard)|(meet)|(user_accounts)|(access_transparency)|(groups_enterprise)|(gcp)', + * // The unique ID of the customer to retrieve data for. + * customerId: 'C.+', + * // Sets the end of the range of time shown in the report. The date is in the RFC 3339 format, for example 2010-10-28T10:26:35.000Z. The default value is the approximate time of the API request. An API report has three basic time concepts: + * // - Date of the API's request for a report: When the API created and retrieved the report. + * // - Report's start time: The beginning of the timespan shown in the report. The startTime must be before the endTime (if specified) and the current time when the request is made, or the API returns an error. + * // - Report's end time: The end of the timespan shown in the report. For example, the timespan of events summarized in a report can start in April and end in May. The report itself can be requested in August. If the endTime is not specified, the report returns all activities from the startTime until the current time or the most recent 180 days if the startTime is more than 180 days in the past. + * endTime: '(dddd)-(dd)-(dd)T(dd):(dd):(dd)(?:.(d+))?(?:(Z)|([-+])(dd):(dd))', + * // The name of the event being queried by the API. Each eventName is related to a specific G Suite service or feature which the API organizes into types of events. An example is the Google Calendar events in the Admin console application's reports. The Calendar Settings type structure has all of the Calendar eventName activities reported by the API. When an administrator changes a Calendar setting, the API reports this activity in the Calendar Settings type and eventName parameters. For more information about eventName query strings and parameters, see the list of event names for various applications above in applicationName. + * eventName: 'placeholder-value', + * // The filters query string is a comma-separated list. The list is composed of event parameters that are manipulated by relational operators. Event parameters are in the form [parameter1 name][relational operator][parameter1 value],[parameter2 name][relational operator][parameter2 value],... + * // These event parameters are associated with a specific eventName. An empty report is returned if the filtered request's parameter does not belong to the eventName. For more information about eventName parameters, see the list of event names for various applications above in applicationName. + * // + * // In the following Admin Activity example, the <> operator is URL-encoded in the request's query string (%3C%3E): + * // GET...&eventName=CHANGE_CALENDAR_SETTING &filters=NEW_VALUE%3C%3EREAD_ONLY_ACCESS + * // + * // In the following Drive example, the list can be a view or edit event's doc_id parameter with a value that is manipulated by an 'equal to' (==) or 'not equal to' (<>) relational operator. In the first example, the report returns each edited document's doc_id. In the second example, the report returns each viewed document's doc_id that equals the value 12345 and does not return any viewed document's which have a doc_id value of 98765. The <> operator is URL-encoded in the request's query string (%3C%3E): + * // + * // GET...&eventName=edit&filters=doc_id GET...&eventName=view&filters=doc_id==12345,doc_id%3C%3E98765 + * // + * // The relational operators include: + * // - == - 'equal to'. + * // - <> - 'not equal to'. It is URL-encoded (%3C%3E). + * // - < - 'less than'. It is URL-encoded (%3C). + * // - <= - 'less than or equal to'. It is URL-encoded (%3C=). + * // - > - 'greater than'. It is URL-encoded (%3E). + * // - >= - 'greater than or equal to'. It is URL-encoded (%3E=). + * // Note: The API doesn't accept multiple values of a parameter. If a particular parameter is supplied more than once in the API request, the API only accepts the last value of that request parameter. + * // In addition, if an invalid request parameter is supplied in the API request, the API ignores that request parameter and returns the response corresponding to the remaining valid request parameters. If no parameters are requested, all parameters are returned. + * filters: + * '(.+[<,<=,==,>=,>,<>].+,)*(.+[<,<=,==,>=,>,<>].+)', + * // Determines how many activity records are shown on each response page. For example, if the request sets maxResults=1 and the report has two activities, the report has two pages. The response's nextPageToken property has the token to the second page. The maxResults query string is optional in the request. The default value is 1000. + * maxResults: 'placeholder-value', + * // ID of the organizational unit to report on. Activity records will be shown only for users who belong to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in the filtered results. + * orgUnitID: '(id:[a-z0-9]+)', + * // The token to specify next page. A report with multiple pages has a nextPageToken property in the response. In your follow-on request getting the next page of the report, enter the nextPageToken value in the pageToken query string. + * pageToken: 'placeholder-value', + * // Sets the beginning of the range of time shown in the report. The date is in the RFC 3339 format, for example 2010-10-28T10:26:35.000Z. The report returns all activities from startTime until endTime. The startTime must be before the endTime (if specified) and the current time when the request is made, or the API returns an error. + * startTime: + * '(dddd)-(dd)-(dd)T(dd):(dd):(dd)(?:.(d+))?(?:(Z)|([-+])(dd):(dd))', + * // Represents the profile ID or the user email for which the data should be filtered. Can be all for all information, or userKey for a user's unique G Suite profile ID or their primary email address. + * userKey: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reports.activities.list * @memberOf! () * @@ -419,6 +506,116 @@ export namespace admin_reports_v1 { /** * reports.activities.watch * @desc Start receiving notifications for account activities. For more information, see Receiving Push Notifications. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('reports_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/admin.reports.audit.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 reports.activities.watch({ + * // The Internet Protocol (IP) Address of host where the event was performed. This is an additional way to filter a report's summary using the IP address of the user whose activity is being reported. This IP address may or may not reflect the user's physical location. For example, the IP address can be the user's proxy server's address or a virtual private network (VPN) address. This parameter supports both IPv4 and IPv6 address versions. + * actorIpAddress: 'placeholder-value', + * // Application name for which the events are to be retrieved. + * applicationName: + * '(admin)|(calendar)|(drive)|(login)|(mobile)|(token)|(groups)|(saml)|(chat)|(gplus)|(rules)|(jamboard)|(meet)|(user_accounts)|(access_transparency)|(groups_enterprise)|(gcp)', + * // The unique ID of the customer to retrieve data for. + * customerId: 'C.+', + * // Sets the end of the range of time shown in the report. The date is in the RFC 3339 format, for example 2010-10-28T10:26:35.000Z. The default value is the approximate time of the API request. An API report has three basic time concepts: + * // - Date of the API's request for a report: When the API created and retrieved the report. + * // - Report's start time: The beginning of the timespan shown in the report. The startTime must be before the endTime (if specified) and the current time when the request is made, or the API returns an error. + * // - Report's end time: The end of the timespan shown in the report. For example, the timespan of events summarized in a report can start in April and end in May. The report itself can be requested in August. If the endTime is not specified, the report returns all activities from the startTime until the current time or the most recent 180 days if the startTime is more than 180 days in the past. + * endTime: '(dddd)-(dd)-(dd)T(dd):(dd):(dd)(?:.(d+))?(?:(Z)|([-+])(dd):(dd))', + * // The name of the event being queried by the API. Each eventName is related to a specific G Suite service or feature which the API organizes into types of events. An example is the Google Calendar events in the Admin console application's reports. The Calendar Settings type structure has all of the Calendar eventName activities reported by the API. When an administrator changes a Calendar setting, the API reports this activity in the Calendar Settings type and eventName parameters. For more information about eventName query strings and parameters, see the list of event names for various applications above in applicationName. + * eventName: 'placeholder-value', + * // The filters query string is a comma-separated list. The list is composed of event parameters that are manipulated by relational operators. Event parameters are in the form [parameter1 name][relational operator][parameter1 value],[parameter2 name][relational operator][parameter2 value],... + * // These event parameters are associated with a specific eventName. An empty report is returned if the filtered request's parameter does not belong to the eventName. For more information about eventName parameters, see the list of event names for various applications above in applicationName. + * // + * // In the following Admin Activity example, the <> operator is URL-encoded in the request's query string (%3C%3E): + * // GET...&eventName=CHANGE_CALENDAR_SETTING &filters=NEW_VALUE%3C%3EREAD_ONLY_ACCESS + * // + * // In the following Drive example, the list can be a view or edit event's doc_id parameter with a value that is manipulated by an 'equal to' (==) or 'not equal to' (<>) relational operator. In the first example, the report returns each edited document's doc_id. In the second example, the report returns each viewed document's doc_id that equals the value 12345 and does not return any viewed document's which have a doc_id value of 98765. The <> operator is URL-encoded in the request's query string (%3C%3E): + * // + * // GET...&eventName=edit&filters=doc_id GET...&eventName=view&filters=doc_id==12345,doc_id%3C%3E98765 + * // + * // The relational operators include: + * // - == - 'equal to'. + * // - <> - 'not equal to'. It is URL-encoded (%3C%3E). + * // - < - 'less than'. It is URL-encoded (%3C). + * // - <= - 'less than or equal to'. It is URL-encoded (%3C=). + * // - > - 'greater than'. It is URL-encoded (%3E). + * // - >= - 'greater than or equal to'. It is URL-encoded (%3E=). + * // Note: The API doesn't accept multiple values of a parameter. If a particular parameter is supplied more than once in the API request, the API only accepts the last value of that request parameter. + * // In addition, if an invalid request parameter is supplied in the API request, the API ignores that request parameter and returns the response corresponding to the remaining valid request parameters. If no parameters are requested, all parameters are returned. + * filters: + * '(.+[<,<=,==,>=,>,<>].+,)*(.+[<,<=,==,>=,>,<>].+)', + * // Determines how many activity records are shown on each response page. For example, if the request sets maxResults=1 and the report has two activities, the report has two pages. The response's nextPageToken property has the token to the second page. The maxResults query string is optional in the request. The default value is 1000. + * maxResults: 'placeholder-value', + * // ID of the organizational unit to report on. Activity records will be shown only for users who belong to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in the filtered results. + * orgUnitID: '(id:[a-z0-9]+)', + * // The token to specify next page. A report with multiple pages has a nextPageToken property in the response. In your follow-on request getting the next page of the report, enter the nextPageToken value in the pageToken query string. + * pageToken: 'placeholder-value', + * // Sets the beginning of the range of time shown in the report. The date is in the RFC 3339 format, for example 2010-10-28T10:26:35.000Z. The report returns all activities from startTime until endTime. The startTime must be before the endTime (if specified) and the current time when the request is made, or the API returns an error. + * startTime: + * '(dddd)-(dd)-(dd)T(dd):(dd):(dd)(?:.(d+))?(?:(Z)|([-+])(dd):(dd))', + * // Represents the profile ID or the user email for which the data should be filtered. Can be all for all information, or userKey for a user's unique G Suite profile ID or their primary email address. + * userKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reports.activities.watch * @memberOf! () * @@ -616,6 +813,55 @@ export namespace admin_reports_v1 { /** * admin.channels.stop * @desc Stop watching resources through this channel + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('reports_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/admin.reports.audit.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 admin.channels.stop({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias admin.channels.stop * @memberOf! () * @@ -705,6 +951,62 @@ export namespace admin_reports_v1 { /** * reports.customerUsageReports.get * @desc Retrieves a report which is a collection of properties and statistics for a specific customer's account. For more information, see the Customers Usage Report guide. For more information about the customer report's parameters, see the Customers Usage parameters reference guides. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('reports_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/admin.reports.usage.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 reports.customerUsageReports.get({ + * // The unique ID of the customer to retrieve data for. + * customerId: 'C.+', + * // Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We recommend you use your account's time zone for this. + * date: '(d){4}-(d){2}-(d){2}', + * // Token to specify next page. A report with multiple pages has a nextPageToken property in the response. For your follow-on requests getting all of the report's pages, enter the nextPageToken value in the pageToken query string. + * pageToken: 'placeholder-value', + * // The parameters query string is a comma-separated list of event parameters that refine a report's results. The parameter is associated with a specific application. The application values for the Customers usage report include accounts, app_maker, apps_scripts, calendar, classroom, cros, docs, gmail, gplus, device_management, meet, and sites. + * // A parameters query string is in the CSV form of app_name1:param_name1, app_name2:param_name2. + * // Note: The API doesn't accept multiple values of a parameter. If a particular parameter is supplied more than once in the API request, the API only accepts the last value of that request parameter. + * // In addition, if an invalid request parameter is supplied in the API request, the API ignores that request parameter and returns the response corresponding to the remaining valid request parameters. + * // + * // An example of an invalid request parameter is one that does not belong to the application. If no parameters are requested, all parameters are returned. + * parameters: + * '(((accounts)|(app_maker)|(apps_scripts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)|(meet)):[^,]+,)*(((accounts)|(app_maker)|(apps_scripts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)|(meet)):[^,]+)', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "usageReports": [], + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reports.customerUsageReports.get * @memberOf! () * @@ -814,6 +1116,83 @@ export namespace admin_reports_v1 { /** * reports.entityUsageReports.get * @desc Retrieves a report which is a collection of properties and statistics for entities used by users within the account. For more information, see the Entities Usage Report guide. For more information about the entities report's parameters, see the Entities Usage parameters reference guides. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('reports_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/admin.reports.usage.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 reports.entityUsageReports.get({ + * // The unique ID of the customer to retrieve data for. + * customerId: 'C.+', + * // Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We recommend you use your account's time zone for this. + * date: '(d){4}-(d){2}-(d){2}', + * // Represents the key of the object to filter the data with. + * entityKey: 'placeholder-value', + * // Represents the type of entity for the report. + * entityType: '(gplus_communities)', + * // The filters query string is a comma-separated list of an application's event parameters where the parameter's value is manipulated by a relational operator. The filters query string includes the name of the application whose usage is returned in the report. The application values for the Entities usage report include accounts, docs, and gmail. + * // Filters are in the form [application name]:[parameter name][relational operator][parameter value],.... + * // + * // In this example, the <> 'not equal to' operator is URL-encoded in the request's query string (%3C%3E): + * // GET https://www.googleapis.com/admin/reports/v1/usage/gplus_communities/all/dates/2017-12-01 ?parameters=gplus:community_name,gplus:num_total_members &filters=gplus:num_total_members>0 + * // + * // + * // The relational operators include: + * // - == - 'equal to'. + * // - <> - 'not equal to'. It is URL-encoded (%3C%3E). + * // - < - 'less than'. It is URL-encoded (%3C). + * // - <= - 'less than or equal to'. It is URL-encoded (%3C=). + * // - > - 'greater than'. It is URL-encoded (%3E). + * // - >= - 'greater than or equal to'. It is URL-encoded (%3E=). Filters can only be applied to numeric parameters. + * filters: + * '(((gplus)):[a-z0-9_]+[<,<=,==,>=,>,!=][^,]+,)*(((gplus)):[a-z0-9_]+[<,<=,==,>=,>,!=][^,]+)', + * // Determines how many activity records are shown on each response page. For example, if the request sets maxResults=1 and the report has two activities, the report has two pages. The response's nextPageToken property has the token to the second page. + * maxResults: 'placeholder-value', + * // Token to specify next page. A report with multiple pages has a nextPageToken property in the response. In your follow-on request getting the next page of the report, enter the nextPageToken value in the pageToken query string. + * pageToken: 'placeholder-value', + * // The parameters query string is a comma-separated list of event parameters that refine a report's results. The parameter is associated with a specific application. The application values for the Entities usage report are only gplus. + * // A parameter query string is in the CSV form of [app_name1:param_name1], [app_name2:param_name2].... + * // Note: The API doesn't accept multiple values of a parameter. If a particular parameter is supplied more than once in the API request, the API only accepts the last value of that request parameter. + * // In addition, if an invalid request parameter is supplied in the API request, the API ignores that request parameter and returns the response corresponding to the remaining valid request parameters. + * // + * // An example of an invalid request parameter is one that does not belong to the application. If no parameters are requested, all parameters are returned. + * parameters: '(((gplus)):[^,]+,)*(((gplus)):[^,]+)', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "usageReports": [], + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reports.entityUsageReports.get * @memberOf! () * @@ -943,6 +1322,85 @@ export namespace admin_reports_v1 { /** * reports.userUsageReport.get * @desc Retrieves a report which is a collection of properties and statistics for a set of users with the account. For more information, see the User Usage Report guide. For more information about the user report's parameters, see the Users Usage parameters reference guides. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admin.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 admin = google.admin('reports_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/admin.reports.usage.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 reports.userUsageReport.get({ + * // The unique ID of the customer to retrieve data for. + * customerId: 'C.+', + * // Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We recommend you use your account's time zone for this. + * date: '(d){4}-(d){2}-(d){2}', + * // The filters query string is a comma-separated list of an application's event parameters where the parameter's value is manipulated by a relational operator. The filters query string includes the name of the application whose usage is returned in the report. The application values for the Users Usage Report include accounts, docs, and gmail. + * // Filters are in the form [application name]:[parameter name][relational operator][parameter value],.... + * // + * // In this example, the <> 'not equal to' operator is URL-encoded in the request's query string (%3C%3E): + * // GET https://www.googleapis.com/admin/reports/v1/usage/users/all/dates/2013-03-03 ?parameters=accounts:last_login_time &filters=accounts:last_login_time>2010-10-28T10:26:35.000Z + * // + * // + * // The relational operators include: + * // - == - 'equal to'. + * // - <> - 'not equal to'. It is URL-encoded (%3C%3E). + * // - < - 'less than'. It is URL-encoded (%3C). + * // - <= - 'less than or equal to'. It is URL-encoded (%3C=). + * // - > - 'greater than'. It is URL-encoded (%3E). + * // - >= - 'greater than or equal to'. It is URL-encoded (%3E=). + * filters: + * '(((accounts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)):[a-z0-9_]+[<,<=,==,>=,>,!=][^,]+,)*(((accounts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)):[a-z0-9_]+[<,<=,==,>=,>,!=][^,]+)', + * // Determines how many activity records are shown on each response page. For example, if the request sets maxResults=1 and the report has two activities, the report has two pages. The response's nextPageToken property has the token to the second page. + * // The maxResults query string is optional. + * maxResults: 'placeholder-value', + * // ID of the organizational unit to report on. User activity will be shown only for users who belong to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in the filtered results. + * orgUnitID: '(id:[a-z0-9]+)', + * // Token to specify next page. A report with multiple pages has a nextPageToken property in the response. In your follow-on request getting the next page of the report, enter the nextPageToken value in the pageToken query string. + * pageToken: 'placeholder-value', + * // The parameters query string is a comma-separated list of event parameters that refine a report's results. The parameter is associated with a specific application. The application values for the Customers usage report include accounts, app_maker, apps_scripts, calendar, classroom, cros, docs, gmail, gplus, device_management, meet, and sites. + * // A parameters query string is in the CSV form of app_name1:param_name1, app_name2:param_name2. + * // Note: The API doesn't accept multiple values of a parameter. + * // If a particular parameter is supplied more than once in the API request, the API only accepts the last value of that request parameter. In addition, if an invalid request parameter is supplied in the API request, the API ignores that request parameter and returns the response corresponding to the remaining valid request parameters. + * // + * // An example of an invalid request parameter is one that does not belong to the application. If no parameters are requested, all parameters are returned. + * parameters: + * '(((accounts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)):[^,]+,)*(((accounts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)):[^,]+)', + * // Represents the profile ID or the user email for which the data should be filtered. Can be all for all information, or userKey for a user's unique G Suite profile ID or their primary email address. + * userKey: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "usageReports": [], + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reports.userUsageReport.get * @memberOf! () * diff --git a/src/apis/admob/v1.ts b/src/apis/admob/v1.ts index c2cca8eac04..c9ed1ceb2e8 100644 --- a/src/apis/admob/v1.ts +++ b/src/apis/admob/v1.ts @@ -487,6 +487,50 @@ export namespace admob_v1 { /** * admob.accounts.get * @desc Gets information about the specified AdMob publisher account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admob.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 admob = google.admob('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: [], + * }); + * + * // 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 admob.accounts.get({ + * // Resource name of the publisher account to retrieve. + * // Example: accounts/pub-9876543210987654 + * name: 'accounts/my-account', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "currencyCode": "my_currencyCode", + * // "name": "my_name", + * // "publisherId": "my_publisherId", + * // "reportingTimeZone": "my_reportingTimeZone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias admob.accounts.get * @memberOf! () * @@ -557,6 +601,51 @@ export namespace admob_v1 { /** * admob.accounts.list * @desc Lists the AdMob publisher account accessible with the client credential. Currently, all credentials have access to at most one AdMob account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admob.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 admob = google.admob('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: [], + * }); + * + * // 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 admob.accounts.list({ + * // Maximum number of accounts to return. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListPublisherAccountsResponse`; indicates + * // that this is a continuation of a prior `ListPublisherAccounts` call, and + * // that the system should return the next page of data. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "account": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias admob.accounts.list * @memberOf! () * @@ -671,6 +760,57 @@ export namespace admob_v1 { /** * admob.accounts.mediationReport.generate * @desc Generates an AdMob Mediation report based on the provided report specification. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admob.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 admob = google.admob('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: [], + * }); + * + * // 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 admob.accounts.mediationReport.generate({ + * // Resource name of the account to generate the report for. + * // Example: accounts/pub-9876543210987654 + * parent: 'accounts/my-account', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "reportSpec": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "footer": {}, + * // "header": {}, + * // "row": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias admob.accounts.mediationReport.generate * @memberOf! () * @@ -780,6 +920,57 @@ export namespace admob_v1 { /** * admob.accounts.networkReport.generate * @desc Generates an AdMob Network report based on the provided report specification. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/admob.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 admob = google.admob('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: [], + * }); + * + * // 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 admob.accounts.networkReport.generate({ + * // Resource name of the account to generate the report for. + * // Example: accounts/pub-9876543210987654 + * parent: 'accounts/my-account', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "reportSpec": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "footer": {}, + * // "header": {}, + * // "row": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias admob.accounts.networkReport.generate * @memberOf! () * diff --git a/src/apis/adsense/v1.4.ts b/src/apis/adsense/v1.4.ts index a3a9fefd711..c2671723578 100644 --- a/src/apis/adsense/v1.4.ts +++ b/src/apis/adsense/v1.4.ts @@ -630,6 +630,57 @@ export namespace adsense_v1_4 { /** * adsense.accounts.get * @desc Get information about the selected AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.accounts.get({ + * // Account to get information about. + * accountId: 'placeholder-value', + * // Whether the tree of sub accounts should be returned. + * tree: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creation_time": "my_creation_time", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "premium": false, + * // "subAccounts": [], + * // "timezone": "my_timezone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.accounts.get * @memberOf! () * @@ -702,6 +753,54 @@ export namespace adsense_v1_4 { /** * adsense.accounts.list * @desc List all accounts available to this AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.accounts.list({ + * // The maximum number of accounts to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.accounts.list * @memberOf! () * @@ -812,6 +911,54 @@ export namespace adsense_v1_4 { /** * adsense.accounts.adclients.getAdCode * @desc Get Auto ad code for a given ad client. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.accounts.adclients.getAdCode({ + * // Account which contains the ad client. + * accountId: 'placeholder-value', + * // Ad client to get the code for. + * adClientId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adCode": "my_adCode", + * // "ampBody": "my_ampBody", + * // "ampHead": "my_ampHead", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.accounts.adclients.getAdCode * @memberOf! () * @@ -885,6 +1032,56 @@ export namespace adsense_v1_4 { /** * adsense.accounts.adclients.list * @desc List all ad clients in the specified account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.accounts.adclients.list({ + * // Account for which to list ad clients. + * accountId: 'placeholder-value', + * // The maximum number of ad clients to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.accounts.adclients.list * @memberOf! () * @@ -1008,6 +1205,62 @@ export namespace adsense_v1_4 { /** * adsense.accounts.adunits.get * @desc Gets the specified ad unit in the specified ad client for the specified account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.accounts.adunits.get({ + * // Account to which the ad client belongs. + * accountId: 'placeholder-value', + * // Ad client for which to get the ad unit. + * adClientId: 'placeholder-value', + * // Ad unit to retrieve. + * adUnitId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": "my_code", + * // "contentAdsSettings": {}, + * // "customStyle": {}, + * // "feedAdsSettings": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mobileContentAdsSettings": {}, + * // "name": "my_name", + * // "savedStyleId": "my_savedStyleId", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.accounts.adunits.get * @memberOf! () * @@ -1082,6 +1335,56 @@ export namespace adsense_v1_4 { /** * adsense.accounts.adunits.getAdCode * @desc Get ad code for the specified ad unit. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.accounts.adunits.getAdCode({ + * // Account which contains the ad client. + * accountId: 'placeholder-value', + * // Ad client with contains the ad unit. + * adClientId: 'placeholder-value', + * // Ad unit to get the code for. + * adUnitId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adCode": "my_adCode", + * // "ampBody": "my_ampBody", + * // "ampHead": "my_ampHead", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.accounts.adunits.getAdCode * @memberOf! () * @@ -1156,6 +1459,60 @@ export namespace adsense_v1_4 { /** * adsense.accounts.adunits.list * @desc List all ad units in the specified ad client for the specified account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.accounts.adunits.list({ + * // Account to which the ad client belongs. + * accountId: 'placeholder-value', + * // Ad client for which to list ad units. + * adClientId: 'placeholder-value', + * // Whether to include inactive ad units. Default: true. + * includeInactive: 'placeholder-value', + * // The maximum number of ad units to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.accounts.adunits.list * @memberOf! () * @@ -1308,6 +1665,60 @@ export namespace adsense_v1_4 { /** * adsense.accounts.adunits.customchannels.list * @desc List all custom channels which the specified ad unit belongs to. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.accounts.adunits.customchannels.list({ + * // Account to which the ad client belongs. + * accountId: 'placeholder-value', + * // Ad client which contains the ad unit. + * adClientId: 'placeholder-value', + * // Ad unit for which to list custom channels. + * adUnitId: 'placeholder-value', + * // The maximum number of custom channels to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.accounts.adunits.customchannels.list * @memberOf! () * @@ -1422,6 +1833,43 @@ export namespace adsense_v1_4 { /** * adsense.accounts.alerts.delete * @desc Dismiss (delete) the specified alert from the specified publisher AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense'], + * }); + * + * // 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 adsense.accounts.alerts.delete({ + * // Account which contains the ad unit. + * accountId: 'placeholder-value', + * // Alert to delete. + * alertId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.accounts.alerts.delete * @memberOf! () * @@ -1494,6 +1942,52 @@ export namespace adsense_v1_4 { /** * adsense.accounts.alerts.list * @desc List the alerts for the specified AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.accounts.alerts.list({ + * // Account for which to retrieve the alerts. + * accountId: 'placeholder-value', + * // The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported. + * locale: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.accounts.alerts.list * @memberOf! () * @@ -1608,6 +2102,57 @@ export namespace adsense_v1_4 { /** * adsense.accounts.customchannels.get * @desc Get the specified custom channel from the specified ad client for the specified account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.accounts.customchannels.get({ + * // Account to which the ad client belongs. + * accountId: 'placeholder-value', + * // Ad client which contains the custom channel. + * adClientId: 'placeholder-value', + * // Custom channel to retrieve. + * customChannelId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": "my_code", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "targetingInfo": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.accounts.customchannels.get * @memberOf! () * @@ -1684,6 +2229,58 @@ export namespace adsense_v1_4 { /** * adsense.accounts.customchannels.list * @desc List all custom channels in the specified ad client for the specified account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.accounts.customchannels.list({ + * // Account to which the ad client belongs. + * accountId: 'placeholder-value', + * // Ad client for which to list custom channels. + * adClientId: 'placeholder-value', + * // The maximum number of custom channels to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.accounts.customchannels.list * @memberOf! () * @@ -1813,6 +2410,62 @@ export namespace adsense_v1_4 { /** * adsense.accounts.customchannels.adunits.list * @desc List all ad units in the specified custom channel. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.accounts.customchannels.adunits.list({ + * // Account to which the ad client belongs. + * accountId: 'placeholder-value', + * // Ad client which contains the custom channel. + * adClientId: 'placeholder-value', + * // Custom channel for which to list ad units. + * customChannelId: 'placeholder-value', + * // Whether to include inactive ad units. Default: true. + * includeInactive: 'placeholder-value', + * // The maximum number of ad units to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.accounts.customchannels.adunits.list * @memberOf! () * @@ -1930,6 +2583,50 @@ export namespace adsense_v1_4 { /** * adsense.accounts.payments.list * @desc List the payments for the specified AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.accounts.payments.list({ + * // Account for which to retrieve the payments. + * accountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.accounts.payments.list * @memberOf! () * @@ -2023,6 +2720,81 @@ export namespace adsense_v1_4 { /** * adsense.accounts.reports.generate * @desc Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.accounts.reports.generate({ + * // Account upon which to report. + * accountId: 'placeholder-value', + * // Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set. + * currency: '[a-zA-Z]+', + * // Dimensions to base the report on. + * dimension: '[a-zA-Z_]+', + * // End of the date range to report on in "YYYY-MM-DD" format, inclusive. + * endDate: + * 'd{4}-d{2}-d{2}|(today|startOfMonth|startOfYear)(([-+]d+[dwmy]){0,3}?)|(latest-(d{2})-(d{2})(-d+y)?)|(latest-latest-(d{2})(-d+m)?)', + * // Filters to be run on the report. + * filter: '[a-zA-Z_]+(==|=@).+', + * // Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. + * locale: '[a-zA-Z_]+', + * // The maximum number of rows of report data to return. + * maxResults: 'placeholder-value', + * // Numeric columns to include in the report. + * metric: '[a-zA-Z_]+', + * // The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending. + * sort: '(+|-)?[a-zA-Z_]+', + * // Start of the date range to report on in "YYYY-MM-DD" format, inclusive. + * startDate: + * 'd{4}-d{2}-d{2}|(today|startOfMonth|startOfYear)(([-+]d+[dwmy]){0,3}?)|(latest-(d{2})-(d{2})(-d+y)?)|(latest-latest-(d{2})(-d+m)?)', + * // Index of the first row of report data to return. + * startIndex: 'placeholder-value', + * // Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used. + * useTimezoneReporting: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "averages": [], + * // "endDate": "my_endDate", + * // "headers": [], + * // "kind": "my_kind", + * // "rows": [], + * // "startDate": "my_startDate", + * // "totalMatchedRows": "my_totalMatchedRows", + * // "totals": [], + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.accounts.reports.generate * @memberOf! () * @@ -2180,6 +2952,65 @@ export namespace adsense_v1_4 { /** * adsense.accounts.reports.saved.generate * @desc Generate an AdSense report based on the saved report ID sent in the query parameters. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.accounts.reports.saved.generate({ + * // Account to which the saved reports belong. + * accountId: 'placeholder-value', + * // Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. + * locale: '[a-zA-Z_]+', + * // The maximum number of rows of report data to return. + * maxResults: 'placeholder-value', + * // The saved report to retrieve. + * savedReportId: 'placeholder-value', + * // Index of the first row of report data to return. + * startIndex: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "averages": [], + * // "endDate": "my_endDate", + * // "headers": [], + * // "kind": "my_kind", + * // "rows": [], + * // "startDate": "my_startDate", + * // "totalMatchedRows": "my_totalMatchedRows", + * // "totals": [], + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.accounts.reports.saved.generate * @memberOf! () * @@ -2267,6 +3098,56 @@ export namespace adsense_v1_4 { /** * adsense.accounts.reports.saved.list * @desc List all saved reports in the specified AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.accounts.reports.saved.list({ + * // Account to which the saved reports belong. + * accountId: 'placeholder-value', + * // The maximum number of saved reports to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.accounts.reports.saved.list * @memberOf! () * @@ -2398,6 +3279,54 @@ export namespace adsense_v1_4 { /** * adsense.accounts.savedadstyles.get * @desc List a specific saved ad style for the specified account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.accounts.savedadstyles.get({ + * // Account for which to get the saved ad style. + * accountId: 'placeholder-value', + * // Saved ad style to retrieve. + * savedAdStyleId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adStyle": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.accounts.savedadstyles.get * @memberOf! () * @@ -2473,6 +3402,56 @@ export namespace adsense_v1_4 { /** * adsense.accounts.savedadstyles.list * @desc List all saved ad styles in the specified account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.accounts.savedadstyles.list({ + * // Account for which to list saved ad styles. + * accountId: 'placeholder-value', + * // The maximum number of saved ad styles to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.accounts.savedadstyles.list * @memberOf! () * @@ -2592,6 +3571,58 @@ export namespace adsense_v1_4 { /** * adsense.accounts.urlchannels.list * @desc List all URL channels in the specified ad client for the specified account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.accounts.urlchannels.list({ + * // Account to which the ad client belongs. + * accountId: 'placeholder-value', + * // Ad client for which to list URL channels. + * adClientId: 'placeholder-value', + * // The maximum number of URL channels to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.accounts.urlchannels.list * @memberOf! () * @@ -2701,6 +3732,54 @@ export namespace adsense_v1_4 { /** * adsense.adclients.list * @desc List all ad clients in this AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.adclients.list({ + * // The maximum number of ad clients to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.adclients.list * @memberOf! () * @@ -2800,6 +3879,60 @@ export namespace adsense_v1_4 { /** * adsense.adunits.get * @desc Gets the specified ad unit in the specified ad client. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.adunits.get({ + * // Ad client for which to get the ad unit. + * adClientId: 'placeholder-value', + * // Ad unit to retrieve. + * adUnitId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": "my_code", + * // "contentAdsSettings": {}, + * // "customStyle": {}, + * // "feedAdsSettings": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mobileContentAdsSettings": {}, + * // "name": "my_name", + * // "savedStyleId": "my_savedStyleId", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.adunits.get * @memberOf! () * @@ -2872,6 +4005,54 @@ export namespace adsense_v1_4 { /** * adsense.adunits.getAdCode * @desc Get ad code for the specified ad unit. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.adunits.getAdCode({ + * // Ad client with contains the ad unit. + * adClientId: 'placeholder-value', + * // Ad unit to get the code for. + * adUnitId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adCode": "my_adCode", + * // "ampBody": "my_ampBody", + * // "ampHead": "my_ampHead", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.adunits.getAdCode * @memberOf! () * @@ -2945,6 +4126,58 @@ export namespace adsense_v1_4 { /** * adsense.adunits.list * @desc List all ad units in the specified ad client for this AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.adunits.list({ + * // Ad client for which to list ad units. + * adClientId: 'placeholder-value', + * // Whether to include inactive ad units. Default: true. + * includeInactive: 'placeholder-value', + * // The maximum number of ad units to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.adunits.list * @memberOf! () * @@ -3080,6 +4313,58 @@ export namespace adsense_v1_4 { /** * adsense.adunits.customchannels.list * @desc List all custom channels which the specified ad unit belongs to. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.adunits.customchannels.list({ + * // Ad client which contains the ad unit. + * adClientId: 'placeholder-value', + * // Ad unit for which to list custom channels. + * adUnitId: 'placeholder-value', + * // The maximum number of custom channels to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.adunits.customchannels.list * @memberOf! () * @@ -3189,6 +4474,41 @@ export namespace adsense_v1_4 { /** * adsense.alerts.delete * @desc Dismiss (delete) the specified alert from the publisher's AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense'], + * }); + * + * // 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 adsense.alerts.delete({ + * // Alert to delete. + * alertId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.alerts.delete * @memberOf! () * @@ -3260,6 +4580,50 @@ export namespace adsense_v1_4 { /** * adsense.alerts.list * @desc List the alerts for this AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.alerts.list({ + * // The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported. + * locale: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.alerts.list * @memberOf! () * @@ -3363,6 +4727,55 @@ export namespace adsense_v1_4 { /** * adsense.customchannels.get * @desc Get the specified custom channel from the specified ad client. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.customchannels.get({ + * // Ad client which contains the custom channel. + * adClientId: 'placeholder-value', + * // Custom channel to retrieve. + * customChannelId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": "my_code", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "targetingInfo": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.customchannels.get * @memberOf! () * @@ -3438,6 +4851,56 @@ export namespace adsense_v1_4 { /** * adsense.customchannels.list * @desc List all custom channels in the specified ad client for this AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.customchannels.list({ + * // Ad client for which to list custom channels. + * adClientId: 'placeholder-value', + * // The maximum number of custom channels to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.customchannels.list * @memberOf! () * @@ -3557,6 +5020,60 @@ export namespace adsense_v1_4 { /** * adsense.customchannels.adunits.list * @desc List all ad units in the specified custom channel. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.customchannels.adunits.list({ + * // Ad client which contains the custom channel. + * adClientId: 'placeholder-value', + * // Custom channel for which to list ad units. + * customChannelId: 'placeholder-value', + * // Whether to include inactive ad units. Default: true. + * includeInactive: 'placeholder-value', + * // The maximum number of ad units to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.customchannels.adunits.list * @memberOf! () * @@ -3680,6 +5197,47 @@ export namespace adsense_v1_4 { /** * adsense.metadata.dimensions.list * @desc List the metadata for the dimensions available to this AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.metadata.dimensions.list({}); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.metadata.dimensions.list * @memberOf! () * @@ -3766,6 +5324,47 @@ export namespace adsense_v1_4 { /** * adsense.metadata.metrics.list * @desc List the metadata for the metrics available to this AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.metadata.metrics.list({}); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.metadata.metrics.list * @memberOf! () * @@ -3852,6 +5451,47 @@ export namespace adsense_v1_4 { /** * adsense.payments.list * @desc List the payments for this AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.payments.list({}); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.payments.list * @memberOf! () * @@ -3938,6 +5578,81 @@ export namespace adsense_v1_4 { /** * adsense.reports.generate * @desc Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.reports.generate({ + * // Accounts upon which to report. + * accountId: 'placeholder-value', + * // Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set. + * currency: '[a-zA-Z]+', + * // Dimensions to base the report on. + * dimension: '[a-zA-Z_]+', + * // End of the date range to report on in "YYYY-MM-DD" format, inclusive. + * endDate: + * 'd{4}-d{2}-d{2}|(today|startOfMonth|startOfYear)(([-+]d+[dwmy]){0,3}?)|(latest-(d{2})-(d{2})(-d+y)?)|(latest-latest-(d{2})(-d+m)?)', + * // Filters to be run on the report. + * filter: '[a-zA-Z_]+(==|=@).+', + * // Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. + * locale: '[a-zA-Z_]+', + * // The maximum number of rows of report data to return. + * maxResults: 'placeholder-value', + * // Numeric columns to include in the report. + * metric: '[a-zA-Z_]+', + * // The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending. + * sort: '(+|-)?[a-zA-Z_]+', + * // Start of the date range to report on in "YYYY-MM-DD" format, inclusive. + * startDate: + * 'd{4}-d{2}-d{2}|(today|startOfMonth|startOfYear)(([-+]d+[dwmy]){0,3}?)|(latest-(d{2})-(d{2})(-d+y)?)|(latest-latest-(d{2})(-d+m)?)', + * // Index of the first row of report data to return. + * startIndex: 'placeholder-value', + * // Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used. + * useTimezoneReporting: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "averages": [], + * // "endDate": "my_endDate", + * // "headers": [], + * // "kind": "my_kind", + * // "rows": [], + * // "startDate": "my_startDate", + * // "totalMatchedRows": "my_totalMatchedRows", + * // "totals": [], + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.reports.generate * @memberOf! () * @@ -4094,6 +5809,63 @@ export namespace adsense_v1_4 { /** * adsense.reports.saved.generate * @desc Generate an AdSense report based on the saved report ID sent in the query parameters. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.reports.saved.generate({ + * // Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. + * locale: '[a-zA-Z_]+', + * // The maximum number of rows of report data to return. + * maxResults: 'placeholder-value', + * // The saved report to retrieve. + * savedReportId: 'placeholder-value', + * // Index of the first row of report data to return. + * startIndex: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "averages": [], + * // "endDate": "my_endDate", + * // "headers": [], + * // "kind": "my_kind", + * // "rows": [], + * // "startDate": "my_startDate", + * // "totalMatchedRows": "my_totalMatchedRows", + * // "totals": [], + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.reports.saved.generate * @memberOf! () * @@ -4180,6 +5952,54 @@ export namespace adsense_v1_4 { /** * adsense.reports.saved.list * @desc List all saved reports in this AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.reports.saved.list({ + * // The maximum number of saved reports to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.reports.saved.list * @memberOf! () * @@ -4303,6 +6123,52 @@ export namespace adsense_v1_4 { /** * adsense.savedadstyles.get * @desc Get a specific saved ad style from the user's account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.savedadstyles.get({ + * // Saved ad style to retrieve. + * savedAdStyleId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adStyle": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.savedadstyles.get * @memberOf! () * @@ -4376,6 +6242,54 @@ export namespace adsense_v1_4 { /** * adsense.savedadstyles.list * @desc List all saved ad styles in the user's account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.savedadstyles.list({ + * // The maximum number of saved ad styles to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.savedadstyles.list * @memberOf! () * @@ -4487,6 +6401,56 @@ export namespace adsense_v1_4 { /** * adsense.urlchannels.list * @desc List all URL channels in the specified ad client for this AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsense.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 adsense = google.adsense('v1.4'); + * + * 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/adsense', + * 'https://www.googleapis.com/auth/adsense.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 adsense.urlchannels.list({ + * // Ad client for which to list URL channels. + * adClientId: 'placeholder-value', + * // The maximum number of URL channels to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsense.urlchannels.list * @memberOf! () * diff --git a/src/apis/adsensehost/v4.1.ts b/src/apis/adsensehost/v4.1.ts index 30c9b1f6330..e3c187f071f 100644 --- a/src/apis/adsensehost/v4.1.ts +++ b/src/apis/adsensehost/v4.1.ts @@ -426,6 +426,49 @@ export namespace adsensehost_v4_1 { /** * adsensehost.accounts.get * @desc Get information about the selected associated AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.accounts.get({ + * // Account to get information about. + * accountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.accounts.get * @memberOf! () * @@ -497,6 +540,48 @@ export namespace adsensehost_v4_1 { /** * adsensehost.accounts.list * @desc List hosted accounts associated with this AdSense account by ad client id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.accounts.list({ + * // Ad clients to list accounts for. + * filterAdClientId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.accounts.list * @memberOf! () * @@ -598,6 +683,52 @@ export namespace adsensehost_v4_1 { /** * adsensehost.accounts.adclients.get * @desc Get information about one of the ad clients in the specified publisher's AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.accounts.adclients.get({ + * // Account which contains the ad client. + * accountId: 'placeholder-value', + * // Ad client to get. + * adClientId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "arcOptIn": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "productCode": "my_productCode", + * // "supportsReporting": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.accounts.adclients.get * @memberOf! () * @@ -671,6 +802,53 @@ export namespace adsensehost_v4_1 { /** * adsensehost.accounts.adclients.list * @desc List all hosted ad clients in the specified hosted account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.accounts.adclients.list({ + * // Account for which to list ad clients. + * accountId: 'placeholder-value', + * // The maximum number of ad clients to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.accounts.adclients.list * @memberOf! () * @@ -790,6 +968,57 @@ export namespace adsensehost_v4_1 { /** * adsensehost.accounts.adunits.delete * @desc Delete the specified ad unit from the specified publisher AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.accounts.adunits.delete({ + * // Account which contains the ad unit. + * accountId: 'placeholder-value', + * // Ad client for which to get ad unit. + * adClientId: 'placeholder-value', + * // Ad unit to delete. + * adUnitId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": "my_code", + * // "contentAdsSettings": {}, + * // "customStyle": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mobileContentAdsSettings": {}, + * // "name": "my_name", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.accounts.adunits.delete * @memberOf! () * @@ -864,6 +1093,57 @@ export namespace adsensehost_v4_1 { /** * adsensehost.accounts.adunits.get * @desc Get the specified host ad unit in this AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.accounts.adunits.get({ + * // Account which contains the ad unit. + * accountId: 'placeholder-value', + * // Ad client for which to get ad unit. + * adClientId: 'placeholder-value', + * // Ad unit to get. + * adUnitId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": "my_code", + * // "contentAdsSettings": {}, + * // "customStyle": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mobileContentAdsSettings": {}, + * // "name": "my_name", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.accounts.adunits.get * @memberOf! () * @@ -938,6 +1218,53 @@ export namespace adsensehost_v4_1 { /** * adsensehost.accounts.adunits.getAdCode * @desc Get ad code for the specified ad unit, attaching the specified host custom channels. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.accounts.adunits.getAdCode({ + * // Account which contains the ad client. + * accountId: 'placeholder-value', + * // Ad client with contains the ad unit. + * adClientId: 'placeholder-value', + * // Ad unit to get the code for. + * adUnitId: 'placeholder-value', + * // Host custom channel to attach to the ad code. + * hostCustomChannelId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adCode": "my_adCode", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.accounts.adunits.getAdCode * @memberOf! () * @@ -1013,6 +1340,70 @@ export namespace adsensehost_v4_1 { /** * adsensehost.accounts.adunits.insert * @desc Insert the supplied ad unit into the specified publisher AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.accounts.adunits.insert({ + * // Account which will contain the ad unit. + * accountId: 'placeholder-value', + * // Ad client into which to insert the ad unit. + * adClientId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "code": "my_code", + * // "contentAdsSettings": {}, + * // "customStyle": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mobileContentAdsSettings": {}, + * // "name": "my_name", + * // "status": "my_status" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": "my_code", + * // "contentAdsSettings": {}, + * // "customStyle": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mobileContentAdsSettings": {}, + * // "name": "my_name", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.accounts.adunits.insert * @memberOf! () * @@ -1087,6 +1478,57 @@ export namespace adsensehost_v4_1 { /** * adsensehost.accounts.adunits.list * @desc List all ad units in the specified publisher's AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.accounts.adunits.list({ + * // Account which contains the ad client. + * accountId: 'placeholder-value', + * // Ad client for which to list ad units. + * adClientId: 'placeholder-value', + * // Whether to include inactive ad units. Default: true. + * includeInactive: 'placeholder-value', + * // The maximum number of ad units to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.accounts.adunits.list * @memberOf! () * @@ -1163,6 +1605,72 @@ export namespace adsensehost_v4_1 { /** * adsensehost.accounts.adunits.patch * @desc Update the supplied ad unit in the specified publisher AdSense account. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.accounts.adunits.patch({ + * // Account which contains the ad client. + * accountId: 'placeholder-value', + * // Ad client which contains the ad unit. + * adClientId: 'placeholder-value', + * // Ad unit to get. + * adUnitId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "code": "my_code", + * // "contentAdsSettings": {}, + * // "customStyle": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mobileContentAdsSettings": {}, + * // "name": "my_name", + * // "status": "my_status" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": "my_code", + * // "contentAdsSettings": {}, + * // "customStyle": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mobileContentAdsSettings": {}, + * // "name": "my_name", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.accounts.adunits.patch * @memberOf! () * @@ -1238,6 +1746,70 @@ export namespace adsensehost_v4_1 { /** * adsensehost.accounts.adunits.update * @desc Update the supplied ad unit in the specified publisher AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.accounts.adunits.update({ + * // Account which contains the ad client. + * accountId: 'placeholder-value', + * // Ad client which contains the ad unit. + * adClientId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "code": "my_code", + * // "contentAdsSettings": {}, + * // "customStyle": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mobileContentAdsSettings": {}, + * // "name": "my_name", + * // "status": "my_status" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": "my_code", + * // "contentAdsSettings": {}, + * // "customStyle": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mobileContentAdsSettings": {}, + * // "name": "my_name", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.accounts.adunits.update * @memberOf! () * @@ -1479,6 +2051,72 @@ export namespace adsensehost_v4_1 { /** * adsensehost.accounts.reports.generate * @desc Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.accounts.reports.generate({ + * // Hosted account upon which to report. + * accountId: 'placeholder-value', + * // Dimensions to base the report on. + * dimension: '[a-zA-Z_]+', + * // End of the date range to report on in "YYYY-MM-DD" format, inclusive. + * endDate: + * 'd{4}-d{2}-d{2}|(today|startOfMonth|startOfYear)(([-+]d+[dwmy]){0,3}?)', + * // Filters to be run on the report. + * filter: '[a-zA-Z_]+(==|=@).+', + * // Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. + * locale: '[a-zA-Z_]+', + * // The maximum number of rows of report data to return. + * maxResults: 'placeholder-value', + * // Numeric columns to include in the report. + * metric: '[a-zA-Z_]+', + * // The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending. + * sort: '(+|-)?[a-zA-Z_]+', + * // Start of the date range to report on in "YYYY-MM-DD" format, inclusive. + * startDate: + * 'd{4}-d{2}-d{2}|(today|startOfMonth|startOfYear)(([-+]d+[dwmy]){0,3}?)', + * // Index of the first row of report data to return. + * startIndex: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "averages": [], + * // "headers": [], + * // "kind": "my_kind", + * // "rows": [], + * // "totalMatchedRows": "my_totalMatchedRows", + * // "totals": [], + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.accounts.reports.generate * @memberOf! () * @@ -1615,6 +2253,50 @@ export namespace adsensehost_v4_1 { /** * adsensehost.adclients.get * @desc Get information about one of the ad clients in the Host AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.adclients.get({ + * // Ad client to get. + * adClientId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "arcOptIn": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "productCode": "my_productCode", + * // "supportsReporting": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.adclients.get * @memberOf! () * @@ -1686,6 +2368,51 @@ export namespace adsensehost_v4_1 { /** * adsensehost.adclients.list * @desc List all host ad clients in this AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.adclients.list({ + * // The maximum number of ad clients to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.adclients.list * @memberOf! () * @@ -1794,6 +2521,62 @@ export namespace adsensehost_v4_1 { /** * adsensehost.associationsessions.start * @desc Create an association session for initiating an association with an AdSense user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.associationsessions.start({ + * // The URL to redirect the user to once association is completed. It receives a token parameter that can then be used to retrieve the associated account. + * callbackUrl: 'placeholder-value', + * // Products to associate with the user. + * productCode: 'placeholder-value', + * // The preferred locale of the user. + * userLocale: 'placeholder-value', + * // The locale of the user's hosted website. + * websiteLocale: 'placeholder-value', + * // The URL of the user's hosted website. + * websiteUrl: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "productCodes": [], + * // "redirectUrl": "my_redirectUrl", + * // "status": "my_status", + * // "userLocale": "my_userLocale", + * // "websiteLocale": "my_websiteLocale", + * // "websiteUrl": "my_websiteUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.associationsessions.start * @memberOf! () * @@ -1871,6 +2654,54 @@ export namespace adsensehost_v4_1 { /** * adsensehost.associationsessions.verify * @desc Verify an association session after the association callback returns from AdSense signup. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.associationsessions.verify({ + * // The token returned to the association callback URL. + * token: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "productCodes": [], + * // "redirectUrl": "my_redirectUrl", + * // "status": "my_status", + * // "userLocale": "my_userLocale", + * // "websiteLocale": "my_websiteLocale", + * // "websiteUrl": "my_websiteUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.associationsessions.verify * @memberOf! () * @@ -1992,6 +2823,51 @@ export namespace adsensehost_v4_1 { /** * adsensehost.customchannels.delete * @desc Delete a specific custom channel from the host AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.customchannels.delete({ + * // Ad client from which to delete the custom channel. + * adClientId: 'placeholder-value', + * // Custom channel to delete. + * customChannelId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": "my_code", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.customchannels.delete * @memberOf! () * @@ -2067,6 +2943,51 @@ export namespace adsensehost_v4_1 { /** * adsensehost.customchannels.get * @desc Get a specific custom channel from the host AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.customchannels.get({ + * // Ad client from which to get the custom channel. + * adClientId: 'placeholder-value', + * // Custom channel to get. + * customChannelId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": "my_code", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.customchannels.get * @memberOf! () * @@ -2142,6 +3063,60 @@ export namespace adsensehost_v4_1 { /** * adsensehost.customchannels.insert * @desc Add a new custom channel to the host AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.customchannels.insert({ + * // Ad client to which the new custom channel will be added. + * adClientId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "code": "my_code", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": "my_code", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.customchannels.insert * @memberOf! () * @@ -2217,6 +3192,53 @@ export namespace adsensehost_v4_1 { /** * adsensehost.customchannels.list * @desc List all host custom channels in this AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.customchannels.list({ + * // Ad client for which to list custom channels. + * adClientId: 'placeholder-value', + * // The maximum number of custom channels to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.customchannels.list * @memberOf! () * @@ -2293,6 +3315,62 @@ export namespace adsensehost_v4_1 { /** * adsensehost.customchannels.patch * @desc Update a custom channel in the host AdSense account. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.customchannels.patch({ + * // Ad client in which the custom channel will be updated. + * adClientId: 'placeholder-value', + * // Custom channel to get. + * customChannelId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "code": "my_code", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": "my_code", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.customchannels.patch * @memberOf! () * @@ -2369,6 +3447,60 @@ export namespace adsensehost_v4_1 { /** * adsensehost.customchannels.update * @desc Update a custom channel in the host AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.customchannels.update({ + * // Ad client in which the custom channel will be updated. + * adClientId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "code": "my_code", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": "my_code", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.customchannels.update * @memberOf! () * @@ -2559,6 +3691,70 @@ export namespace adsensehost_v4_1 { /** * adsensehost.reports.generate * @desc Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.reports.generate({ + * // Dimensions to base the report on. + * dimension: '[a-zA-Z_]+', + * // End of the date range to report on in "YYYY-MM-DD" format, inclusive. + * endDate: + * 'd{4}-d{2}-d{2}|(today|startOfMonth|startOfYear)(([-+]d+[dwmy]){0,3}?)', + * // Filters to be run on the report. + * filter: '[a-zA-Z_]+(==|=@).+', + * // Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. + * locale: '[a-zA-Z_]+', + * // The maximum number of rows of report data to return. + * maxResults: 'placeholder-value', + * // Numeric columns to include in the report. + * metric: '[a-zA-Z_]+', + * // The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending. + * sort: '(+|-)?[a-zA-Z_]+', + * // Start of the date range to report on in "YYYY-MM-DD" format, inclusive. + * startDate: + * 'd{4}-d{2}-d{2}|(today|startOfMonth|startOfYear)(([-+]d+[dwmy]){0,3}?)', + * // Index of the first row of report data to return. + * startIndex: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "averages": [], + * // "headers": [], + * // "kind": "my_kind", + * // "rows": [], + * // "totalMatchedRows": "my_totalMatchedRows", + * // "totals": [], + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.reports.generate * @memberOf! () * @@ -2689,6 +3885,50 @@ export namespace adsensehost_v4_1 { /** * adsensehost.urlchannels.delete * @desc Delete a URL channel from the host AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.urlchannels.delete({ + * // Ad client from which to delete the URL channel. + * adClientId: 'placeholder-value', + * // URL channel to delete. + * urlChannelId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "urlPattern": "my_urlPattern" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.urlchannels.delete * @memberOf! () * @@ -2764,6 +4004,58 @@ export namespace adsensehost_v4_1 { /** * adsensehost.urlchannels.insert * @desc Add a new URL channel to the host AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.urlchannels.insert({ + * // Ad client to which the new URL channel will be added. + * adClientId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "urlPattern": "my_urlPattern" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "urlPattern": "my_urlPattern" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.urlchannels.insert * @memberOf! () * @@ -2838,6 +4130,53 @@ export namespace adsensehost_v4_1 { /** * adsensehost.urlchannels.list * @desc List all host URL channels in the host AdSense account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/adsensehost.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 adsensehost = google.adsensehost('v4.1'); + * + * 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/adsensehost'], + * }); + * + * // 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 adsensehost.urlchannels.list({ + * // Ad client for which to list URL channels. + * adClientId: 'placeholder-value', + * // The maximum number of URL channels to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias adsensehost.urlchannels.list * @memberOf! () * diff --git a/src/apis/alertcenter/v1beta1.ts b/src/apis/alertcenter/v1beta1.ts index 8bfdca5ea00..f07c9589a3a 100644 --- a/src/apis/alertcenter/v1beta1.ts +++ b/src/apis/alertcenter/v1beta1.ts @@ -914,6 +914,53 @@ export namespace alertcenter_v1beta1 { /** * alertcenter.alerts.batchDelete * @desc Performs batch delete operation on alerts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/alertcenter.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 alertcenter = google.alertcenter('v1beta1'); + * + * 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/apps.alerts'], + * }); + * + * // 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 alertcenter.alerts.batchDelete({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alertId": [], + * // "customerId": "my_customerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "failedAlertStatus": {}, + * // "successAlertIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias alertcenter.alerts.batchDelete * @memberOf! () * @@ -995,6 +1042,53 @@ export namespace alertcenter_v1beta1 { /** * alertcenter.alerts.batchUndelete * @desc Performs batch undelete operation on alerts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/alertcenter.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 alertcenter = google.alertcenter('v1beta1'); + * + * 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/apps.alerts'], + * }); + * + * // 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 alertcenter.alerts.batchUndelete({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alertId": [], + * // "customerId": "my_customerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "failedAlertStatus": {}, + * // "successAlertIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias alertcenter.alerts.batchUndelete * @memberOf! () * @@ -1076,6 +1170,48 @@ export namespace alertcenter_v1beta1 { /** * alertcenter.alerts.delete * @desc Marks the specified alert for deletion. An alert that has been marked for deletion is removed from Alert Center after 30 days. Marking an alert for deletion has no effect on an alert which has already been marked for deletion. Attempting to mark a nonexistent alert for deletion results in a `NOT_FOUND` error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/alertcenter.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 alertcenter = google.alertcenter('v1beta1'); + * + * 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/apps.alerts'], + * }); + * + * // 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 alertcenter.alerts.delete({ + * // Required. The identifier of the alert to delete. + * alertId: 'placeholder-value', + * // Optional. The unique identifier of the G Suite organization account of the + * // customer the alert is associated with. + * // Inferred from the caller identity if not provided. + * customerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias alertcenter.alerts.delete * @memberOf! () * @@ -1148,6 +1284,62 @@ export namespace alertcenter_v1beta1 { /** * alertcenter.alerts.get * @desc Gets the specified alert. Attempting to get a nonexistent alert returns `NOT_FOUND` error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/alertcenter.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 alertcenter = google.alertcenter('v1beta1'); + * + * 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/apps.alerts'], + * }); + * + * // 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 alertcenter.alerts.get({ + * // Required. The identifier of the alert to retrieve. + * alertId: 'placeholder-value', + * // Optional. The unique identifier of the G Suite organization account of the + * // customer the alert is associated with. + * // Inferred from the caller identity if not provided. + * customerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alertId": "my_alertId", + * // "createTime": "my_createTime", + * // "customerId": "my_customerId", + * // "data": {}, + * // "deleted": false, + * // "endTime": "my_endTime", + * // "etag": "my_etag", + * // "metadata": {}, + * // "securityInvestigationToolLink": "my_securityInvestigationToolLink", + * // "source": "my_source", + * // "startTime": "my_startTime", + * // "type": "my_type", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias alertcenter.alerts.get * @memberOf! () * @@ -1220,6 +1412,56 @@ export namespace alertcenter_v1beta1 { /** * alertcenter.alerts.getMetadata * @desc Returns the metadata of an alert. Attempting to get metadata for a non-existent alert returns `NOT_FOUND` error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/alertcenter.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 alertcenter = google.alertcenter('v1beta1'); + * + * 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/apps.alerts'], + * }); + * + * // 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 alertcenter.alerts.getMetadata({ + * // Required. The identifier of the alert this metadata belongs to. + * alertId: 'placeholder-value', + * // Optional. The unique identifier of the G Suite organization account of the + * // customer the alert metadata is associated with. + * // Inferred from the caller identity if not provided. + * customerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alertId": "my_alertId", + * // "assignee": "my_assignee", + * // "customerId": "my_customerId", + * // "etag": "my_etag", + * // "severity": "my_severity", + * // "status": "my_status", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias alertcenter.alerts.getMetadata * @memberOf! () * @@ -1295,6 +1537,70 @@ export namespace alertcenter_v1beta1 { /** * alertcenter.alerts.list * @desc Lists the alerts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/alertcenter.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 alertcenter = google.alertcenter('v1beta1'); + * + * 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/apps.alerts'], + * }); + * + * // 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 alertcenter.alerts.list({ + * // Optional. The unique identifier of the G Suite organization account of the + * // customer the alerts are associated with. + * // Inferred from the caller identity if not provided. + * customerId: 'placeholder-value', + * // Optional. A query string for filtering alert results. + * // For more details, see [Query + * // filters](/admin-sdk/alertcenter/guides/query-filters) and [Supported + * // query filter + * // fields](/admin-sdk/alertcenter/reference/filter-fields#alerts.list). + * filter: 'placeholder-value', + * // Optional. The sort order of the list results. + * // If not specified results may be returned in arbitrary order. + * // You can sort the results in descending order based on the creation + * // timestamp using `order_by="create_time desc"`. + * // Currently, supported sorting are `create_time asc`, `create_time desc`, + * // `update_time desc` + * orderBy: 'placeholder-value', + * // Optional. The requested page size. Server may return fewer items than + * // requested. If unspecified, server picks an appropriate default. + * pageSize: 'placeholder-value', + * // Optional. A token identifying a page of results the server should return. + * // If empty, a new iteration is started. To continue an iteration, pass in + * // the value from the previous ListAlertsResponse's + * // next_page_token field. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alerts": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias alertcenter.alerts.list * @memberOf! () * @@ -1369,6 +1675,66 @@ export namespace alertcenter_v1beta1 { /** * alertcenter.alerts.undelete * @desc Restores, or "undeletes", an alert that was marked for deletion within the past 30 days. Attempting to undelete an alert which was marked for deletion over 30 days ago (which has been removed from the Alert Center database) or a nonexistent alert returns a `NOT_FOUND` error. Attempting to undelete an alert which has not been marked for deletion has no effect. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/alertcenter.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 alertcenter = google.alertcenter('v1beta1'); + * + * 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/apps.alerts'], + * }); + * + * // 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 alertcenter.alerts.undelete({ + * // Required. The identifier of the alert to undelete. + * alertId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "customerId": "my_customerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alertId": "my_alertId", + * // "createTime": "my_createTime", + * // "customerId": "my_customerId", + * // "data": {}, + * // "deleted": false, + * // "endTime": "my_endTime", + * // "etag": "my_etag", + * // "metadata": {}, + * // "securityInvestigationToolLink": "my_securityInvestigationToolLink", + * // "source": "my_source", + * // "startTime": "my_startTime", + * // "type": "my_type", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias alertcenter.alerts.undelete * @memberOf! () * @@ -1562,6 +1928,68 @@ export namespace alertcenter_v1beta1 { /** * alertcenter.alerts.feedback.create * @desc Creates new feedback for an alert. Attempting to create a feedback for a non-existent alert returns `NOT_FOUND` error. Attempting to create a feedback for an alert that is marked for deletion returns `FAILED_PRECONDITION' error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/alertcenter.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 alertcenter = google.alertcenter('v1beta1'); + * + * 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/apps.alerts'], + * }); + * + * // 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 alertcenter.alerts.feedback.create({ + * // Required. The identifier of the alert this feedback belongs to. + * alertId: 'placeholder-value', + * // Optional. The unique identifier of the G Suite organization account of the + * // customer the alert is associated with. + * // Inferred from the caller identity if not provided. + * customerId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alertId": "my_alertId", + * // "createTime": "my_createTime", + * // "customerId": "my_customerId", + * // "email": "my_email", + * // "feedbackId": "my_feedbackId", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alertId": "my_alertId", + * // "createTime": "my_createTime", + * // "customerId": "my_customerId", + * // "email": "my_email", + * // "feedbackId": "my_feedbackId", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias alertcenter.alerts.feedback.create * @memberOf! () * @@ -1638,6 +2066,57 @@ export namespace alertcenter_v1beta1 { /** * alertcenter.alerts.feedback.list * @desc Lists all the feedback for an alert. Attempting to list feedbacks for a non-existent alert returns `NOT_FOUND` error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/alertcenter.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 alertcenter = google.alertcenter('v1beta1'); + * + * 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/apps.alerts'], + * }); + * + * // 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 alertcenter.alerts.feedback.list({ + * // Required. The alert identifier. + * // The "-" wildcard could be used to represent all alerts. + * alertId: 'placeholder-value', + * // Optional. The unique identifier of the G Suite organization account of the + * // customer the alert feedback are associated with. + * // Inferred from the caller identity if not provided. + * customerId: 'placeholder-value', + * // Optional. A query string for filtering alert feedback results. + * // For more details, see [Query + * // filters](/admin-sdk/alertcenter/guides/query-filters) and [Supported + * // query filter + * // fields](/admin-sdk/alertcenter/reference/filter-fields#alerts.feedback.list). + * filter: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "feedback": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias alertcenter.alerts.feedback.list * @memberOf! () * @@ -1770,6 +2249,48 @@ export namespace alertcenter_v1beta1 { /** * alertcenter.getSettings * @desc Returns customer-level settings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/alertcenter.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 alertcenter = google.alertcenter('v1beta1'); + * + * 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/apps.alerts'], + * }); + * + * // 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 alertcenter.getSettings({ + * // Optional. The unique identifier of the G Suite organization account of the + * // customer the alert settings are associated with. + * // Inferred from the caller identity if not provided. + * customerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "notifications": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias alertcenter.getSettings * @memberOf! () * @@ -1839,6 +2360,56 @@ export namespace alertcenter_v1beta1 { /** * alertcenter.updateSettings * @desc Updates the customer-level settings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/alertcenter.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 alertcenter = google.alertcenter('v1beta1'); + * + * 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/apps.alerts'], + * }); + * + * // 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 alertcenter.updateSettings({ + * // Optional. The unique identifier of the G Suite organization account of the + * // customer the alert settings are associated with. + * // Inferred from the caller identity if not provided. + * customerId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "notifications": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "notifications": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias alertcenter.updateSettings * @memberOf! () * diff --git a/src/apis/analytics/v3.ts b/src/apis/analytics/v3.ts index 6af438dff23..4f703459ce9 100644 --- a/src/apis/analytics/v3.ts +++ b/src/apis/analytics/v3.ts @@ -2514,6 +2514,89 @@ export namespace analytics_v3 { /** * analytics.data.ga.get * @desc Returns Analytics data for a view (profile). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.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 analytics.data.ga.get({ + * // A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'. + * dimensions: '(ga:.+)?', + * // End date for fetching Analytics data. Request can should specify an end date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is yesterday. + * 'end-date': '[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)', + * // A comma-separated list of dimension or metric filters to be applied to Analytics data. + * filters: 'ga:.+', + * // Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. + * ids: 'ga:[0-9]+', + * // The response will include empty rows if this parameter is set to true, the default is true + * 'include-empty-rows': 'placeholder-value', + * // The maximum number of entries to include in this feed. + * 'max-results': 'placeholder-value', + * // A comma-separated list of Analytics metrics. E.g., 'ga:sessions,ga:pageviews'. At least one metric must be specified. + * metrics: 'ga:.+', + * // The selected format for the response. Default format is JSON. + * output: 'placeholder-value', + * // The desired sampling level. + * samplingLevel: 'placeholder-value', + * // An Analytics segment to be applied to data. + * segment: 'placeholder-value', + * // A comma-separated list of dimensions or metrics that determine the sort order for Analytics data. + * sort: '(-)?ga:.+', + * // Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo. + * 'start-date': '[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)', + * // An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "columnHeaders": [], + * // "containsSampledData": false, + * // "dataLastRefreshed": "my_dataLastRefreshed", + * // "dataTable": {}, + * // "id": "my_id", + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "profileInfo": {}, + * // "query": {}, + * // "rows": [], + * // "sampleSize": "my_sampleSize", + * // "sampleSpace": "my_sampleSpace", + * // "selfLink": "my_selfLink", + * // "totalResults": 0, + * // "totalsForAllResults": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.data.ga.get * @memberOf! () * @@ -2664,6 +2747,81 @@ export namespace analytics_v3 { /** * analytics.data.mcf.get * @desc Returns Analytics Multi-Channel Funnels data for a view (profile). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.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 analytics.data.mcf.get({ + * // A comma-separated list of Multi-Channel Funnels dimensions. E.g., 'mcf:source,mcf:medium'. + * dimensions: '(mcf:.+)?', + * // End date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo. + * 'end-date': '[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)', + * // A comma-separated list of dimension or metric filters to be applied to the Analytics data. + * filters: 'mcf:.+', + * // Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. + * ids: 'ga:[0-9]+', + * // The maximum number of entries to include in this feed. + * 'max-results': 'placeholder-value', + * // A comma-separated list of Multi-Channel Funnels metrics. E.g., 'mcf:totalConversions,mcf:totalConversionValue'. At least one metric must be specified. + * metrics: 'mcf:.+', + * // The desired sampling level. + * samplingLevel: 'placeholder-value', + * // A comma-separated list of dimensions or metrics that determine the sort order for the Analytics data. + * sort: '(-)?mcf:.+', + * // Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo. + * 'start-date': '[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)', + * // An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "columnHeaders": [], + * // "containsSampledData": false, + * // "id": "my_id", + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "profileInfo": {}, + * // "query": {}, + * // "rows": [], + * // "sampleSize": "my_sampleSize", + * // "sampleSpace": "my_sampleSpace", + * // "selfLink": "my_selfLink", + * // "totalResults": 0, + * // "totalsForAllResults": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.data.mcf.get * @memberOf! () * @@ -2799,6 +2957,67 @@ export namespace analytics_v3 { /** * analytics.data.realtime.get * @desc Returns real time data for a view (profile). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.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 analytics.data.realtime.get({ + * // A comma-separated list of real time dimensions. E.g., 'rt:medium,rt:city'. + * dimensions: '(ga:.+)|(rt:.+)', + * // A comma-separated list of dimension or metric filters to be applied to real time data. + * filters: '(ga:.+)|(rt:.+)', + * // Unique table ID for retrieving real time data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. + * ids: 'ga:[0-9]+', + * // The maximum number of entries to include in this feed. + * 'max-results': 'placeholder-value', + * // A comma-separated list of real time metrics. E.g., 'rt:activeUsers'. At least one metric must be specified. + * metrics: '(ga:.+)|(rt:.+)', + * // A comma-separated list of dimensions or metrics that determine the sort order for real time data. + * sort: '(-)?((ga:.+)|(rt:.+))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "columnHeaders": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "profileInfo": {}, + * // "query": {}, + * // "rows": [], + * // "selfLink": "my_selfLink", + * // "totalResults": 0, + * // "totalsForAllResults": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.data.realtime.get * @memberOf! () * @@ -2985,6 +3204,59 @@ export namespace analytics_v3 { /** * analytics.management.accounts.list * @desc Lists all accounts to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.accounts.list({ + * // The maximum number of accounts to include in this response. + * 'max-results': 'placeholder-value', + * // An index of the first account to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "startIndex": 0, + * // "totalResults": 0, + * // "username": "my_username" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.accounts.list * @memberOf! () * @@ -3082,6 +3354,58 @@ export namespace analytics_v3 { /** * analytics.management.accountSummaries.list * @desc Lists account summaries (lightweight tree comprised of accounts/properties/profiles) to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.accountSummaries.list({ + * // The maximum number of account summaries to include in this response, where the largest acceptable value is 1000. + * 'max-results': 'placeholder-value', + * // An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "startIndex": 0, + * // "totalResults": 0, + * // "username": "my_username" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.accountSummaries.list * @memberOf! () * @@ -3180,6 +3504,43 @@ export namespace analytics_v3 { /** * analytics.management.accountUserLinks.delete * @desc Removes a user from the given account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.manage.users'], + * }); + * + * // 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 analytics.management.accountUserLinks.delete({ + * // Account ID to delete the user link for. + * accountId: 'placeholder-value', + * // Link ID to delete the user link for. + * linkId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.accountUserLinks.delete * @memberOf! () * @@ -3253,6 +3614,64 @@ export namespace analytics_v3 { /** * analytics.management.accountUserLinks.insert * @desc Adds a new user to the given account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.manage.users'], + * }); + * + * // 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 analytics.management.accountUserLinks.insert({ + * // Account ID to create the user link for. + * accountId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entity": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "permissions": {}, + * // "selfLink": "my_selfLink", + * // "userRef": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entity": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "permissions": {}, + * // "selfLink": "my_selfLink", + * // "userRef": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.accountUserLinks.insert * @memberOf! () * @@ -3328,6 +3747,59 @@ export namespace analytics_v3 { /** * analytics.management.accountUserLinks.list * @desc Lists account-user links for a given account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.manage.users', + * 'https://www.googleapis.com/auth/analytics.manage.users.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 analytics.management.accountUserLinks.list({ + * // Account ID to retrieve the user links for. + * accountId: 'placeholder-value', + * // The maximum number of account-user links to include in this response. + * 'max-results': 'placeholder-value', + * // An index of the first account-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "startIndex": 0, + * // "totalResults": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.accountUserLinks.list * @memberOf! () * @@ -3404,6 +3876,66 @@ export namespace analytics_v3 { /** * analytics.management.accountUserLinks.update * @desc Updates permissions for an existing user on the given account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.manage.users'], + * }); + * + * // 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 analytics.management.accountUserLinks.update({ + * // Account ID to update the account-user link for. + * accountId: 'placeholder-value', + * // Link ID to update the account-user link for. + * linkId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entity": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "permissions": {}, + * // "selfLink": "my_selfLink", + * // "userRef": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entity": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "permissions": {}, + * // "selfLink": "my_selfLink", + * // "userRef": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.accountUserLinks.update * @memberOf! () * @@ -3562,6 +4094,59 @@ export namespace analytics_v3 { /** * analytics.management.clientId.hashClientId * @desc Hashes the given Client ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.clientId.hashClientId({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clientId": "my_clientId", + * // "kind": "my_kind", + * // "webPropertyId": "my_webPropertyId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientId": "my_clientId", + * // "hashedClientId": "my_hashedClientId", + * // "kind": "my_kind", + * // "webPropertyId": "my_webPropertyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.clientId.hashClientId * @memberOf! () * @@ -3659,6 +4244,63 @@ export namespace analytics_v3 { /** * analytics.management.customDataSources.list * @desc List custom data sources to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.customDataSources.list({ + * // Account Id for the custom data sources to retrieve. + * accountId: 'd+', + * // The maximum number of custom data sources to include in this response. + * 'max-results': 'placeholder-value', + * // A 1-based index of the first custom data source to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * // Web property Id for the custom data sources to retrieve. + * webPropertyId: 'UA-(d+)-(d+)', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "startIndex": 0, + * // "totalResults": 0, + * // "username": "my_username" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.customDataSources.list * @memberOf! () * @@ -3768,6 +4410,64 @@ export namespace analytics_v3 { /** * analytics.management.customDimensions.get * @desc Get a custom dimension to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.customDimensions.get({ + * // Account ID for the custom dimension to retrieve. + * accountId: 'placeholder-value', + * // The ID of the custom dimension to retrieve. + * customDimensionId: 'placeholder-value', + * // Web property ID for the custom dimension to retrieve. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "id": "my_id", + * // "index": 0, + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "scope": "my_scope", + * // "selfLink": "my_selfLink", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.customDimensions.get * @memberOf! () * @@ -3844,6 +4544,78 @@ export namespace analytics_v3 { /** * analytics.management.customDimensions.insert * @desc Create a new custom dimension. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.customDimensions.insert({ + * // Account ID for the custom dimension to create. + * accountId: 'placeholder-value', + * // Web property ID for the custom dimension to create. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "id": "my_id", + * // "index": 0, + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "scope": "my_scope", + * // "selfLink": "my_selfLink", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "id": "my_id", + * // "index": 0, + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "scope": "my_scope", + * // "selfLink": "my_selfLink", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.customDimensions.insert * @memberOf! () * @@ -3920,6 +4692,62 @@ export namespace analytics_v3 { /** * analytics.management.customDimensions.list * @desc Lists custom dimensions to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.customDimensions.list({ + * // Account ID for the custom dimensions to retrieve. + * accountId: 'placeholder-value', + * // The maximum number of custom dimensions to include in this response. + * 'max-results': 'placeholder-value', + * // An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * // Web property ID for the custom dimensions to retrieve. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "startIndex": 0, + * // "totalResults": 0, + * // "username": "my_username" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.customDimensions.list * @memberOf! () * @@ -3997,6 +4825,82 @@ export namespace analytics_v3 { /** * analytics.management.customDimensions.patch * @desc Updates an existing custom dimension. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.customDimensions.patch({ + * // Account ID for the custom dimension to update. + * accountId: 'placeholder-value', + * // Custom dimension ID for the custom dimension to update. + * customDimensionId: 'placeholder-value', + * // Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set. + * ignoreCustomDataSourceLinks: 'placeholder-value', + * // Web property ID for the custom dimension to update. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "id": "my_id", + * // "index": 0, + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "scope": "my_scope", + * // "selfLink": "my_selfLink", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "id": "my_id", + * // "index": 0, + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "scope": "my_scope", + * // "selfLink": "my_selfLink", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.customDimensions.patch * @memberOf! () * @@ -4075,6 +4979,82 @@ export namespace analytics_v3 { /** * analytics.management.customDimensions.update * @desc Updates an existing custom dimension. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.customDimensions.update({ + * // Account ID for the custom dimension to update. + * accountId: 'placeholder-value', + * // Custom dimension ID for the custom dimension to update. + * customDimensionId: 'placeholder-value', + * // Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set. + * ignoreCustomDataSourceLinks: 'placeholder-value', + * // Web property ID for the custom dimension to update. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "id": "my_id", + * // "index": 0, + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "scope": "my_scope", + * // "selfLink": "my_selfLink", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "id": "my_id", + * // "index": 0, + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "scope": "my_scope", + * // "selfLink": "my_selfLink", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.customDimensions.update * @memberOf! () * @@ -4284,6 +5264,67 @@ export namespace analytics_v3 { /** * analytics.management.customMetrics.get * @desc Get a custom metric to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.customMetrics.get({ + * // Account ID for the custom metric to retrieve. + * accountId: 'placeholder-value', + * // The ID of the custom metric to retrieve. + * customMetricId: 'placeholder-value', + * // Web property ID for the custom metric to retrieve. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "id": "my_id", + * // "index": 0, + * // "kind": "my_kind", + * // "max_value": "my_max_value", + * // "min_value": "my_min_value", + * // "name": "my_name", + * // "parentLink": {}, + * // "scope": "my_scope", + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.customMetrics.get * @memberOf! () * @@ -4360,6 +5401,84 @@ export namespace analytics_v3 { /** * analytics.management.customMetrics.insert * @desc Create a new custom metric. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.customMetrics.insert({ + * // Account ID for the custom metric to create. + * accountId: 'placeholder-value', + * // Web property ID for the custom dimension to create. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "id": "my_id", + * // "index": 0, + * // "kind": "my_kind", + * // "max_value": "my_max_value", + * // "min_value": "my_min_value", + * // "name": "my_name", + * // "parentLink": {}, + * // "scope": "my_scope", + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "id": "my_id", + * // "index": 0, + * // "kind": "my_kind", + * // "max_value": "my_max_value", + * // "min_value": "my_min_value", + * // "name": "my_name", + * // "parentLink": {}, + * // "scope": "my_scope", + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.customMetrics.insert * @memberOf! () * @@ -4436,6 +5555,62 @@ export namespace analytics_v3 { /** * analytics.management.customMetrics.list * @desc Lists custom metrics to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.customMetrics.list({ + * // Account ID for the custom metrics to retrieve. + * accountId: 'placeholder-value', + * // The maximum number of custom metrics to include in this response. + * 'max-results': 'placeholder-value', + * // An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * // Web property ID for the custom metrics to retrieve. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "startIndex": 0, + * // "totalResults": 0, + * // "username": "my_username" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.customMetrics.list * @memberOf! () * @@ -4513,6 +5688,88 @@ export namespace analytics_v3 { /** * analytics.management.customMetrics.patch * @desc Updates an existing custom metric. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.customMetrics.patch({ + * // Account ID for the custom metric to update. + * accountId: 'placeholder-value', + * // Custom metric ID for the custom metric to update. + * customMetricId: 'placeholder-value', + * // Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set. + * ignoreCustomDataSourceLinks: 'placeholder-value', + * // Web property ID for the custom metric to update. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "id": "my_id", + * // "index": 0, + * // "kind": "my_kind", + * // "max_value": "my_max_value", + * // "min_value": "my_min_value", + * // "name": "my_name", + * // "parentLink": {}, + * // "scope": "my_scope", + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "id": "my_id", + * // "index": 0, + * // "kind": "my_kind", + * // "max_value": "my_max_value", + * // "min_value": "my_min_value", + * // "name": "my_name", + * // "parentLink": {}, + * // "scope": "my_scope", + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.customMetrics.patch * @memberOf! () * @@ -4591,6 +5848,88 @@ export namespace analytics_v3 { /** * analytics.management.customMetrics.update * @desc Updates an existing custom metric. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.customMetrics.update({ + * // Account ID for the custom metric to update. + * accountId: 'placeholder-value', + * // Custom metric ID for the custom metric to update. + * customMetricId: 'placeholder-value', + * // Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set. + * ignoreCustomDataSourceLinks: 'placeholder-value', + * // Web property ID for the custom metric to update. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "id": "my_id", + * // "index": 0, + * // "kind": "my_kind", + * // "max_value": "my_max_value", + * // "min_value": "my_min_value", + * // "name": "my_name", + * // "parentLink": {}, + * // "scope": "my_scope", + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "id": "my_id", + * // "index": 0, + * // "kind": "my_kind", + * // "max_value": "my_max_value", + * // "min_value": "my_min_value", + * // "name": "my_name", + * // "parentLink": {}, + * // "scope": "my_scope", + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.customMetrics.update * @memberOf! () * @@ -4800,6 +6139,50 @@ export namespace analytics_v3 { /** * analytics.management.experiments.delete * @desc Delete an experiment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.edit', + * ], + * }); + * + * // 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 analytics.management.experiments.delete({ + * // Account ID to which the experiment belongs + * accountId: 'placeholder-value', + * // ID of the experiment to delete + * experimentId: 'placeholder-value', + * // View (Profile) ID to which the experiment belongs + * profileId: 'placeholder-value', + * // Web property ID to which the experiment belongs + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.experiments.delete * @memberOf! () * @@ -4880,6 +6263,83 @@ export namespace analytics_v3 { /** * analytics.management.experiments.get * @desc Returns an experiment to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.experiments.get({ + * // Account ID to retrieve the experiment for. + * accountId: 'placeholder-value', + * // Experiment ID to retrieve the experiment for. + * experimentId: 'placeholder-value', + * // View (Profile) ID to retrieve the experiment for. + * profileId: 'placeholder-value', + * // Web property ID to retrieve the experiment for. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "created": "my_created", + * // "description": "my_description", + * // "editableInGaUi": false, + * // "endTime": "my_endTime", + * // "equalWeighting": false, + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "minimumExperimentLengthInDays": 0, + * // "name": "my_name", + * // "objectiveMetric": "my_objectiveMetric", + * // "optimizationType": "my_optimizationType", + * // "parentLink": {}, + * // "profileId": "my_profileId", + * // "reasonExperimentEnded": "my_reasonExperimentEnded", + * // "rewriteVariationUrlsAsOriginal": false, + * // "selfLink": "my_selfLink", + * // "servingFramework": "my_servingFramework", + * // "snippet": "my_snippet", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "trafficCoverage": {}, + * // "updated": "my_updated", + * // "variations": [], + * // "webPropertyId": "my_webPropertyId", + * // "winnerConfidenceLevel": {}, + * // "winnerFound": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.experiments.get * @memberOf! () * @@ -4962,6 +6422,115 @@ export namespace analytics_v3 { /** * analytics.management.experiments.insert * @desc Create a new experiment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.edit', + * ], + * }); + * + * // 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 analytics.management.experiments.insert({ + * // Account ID to create the experiment for. + * accountId: 'placeholder-value', + * // View (Profile) ID to create the experiment for. + * profileId: 'placeholder-value', + * // Web property ID to create the experiment for. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "created": "my_created", + * // "description": "my_description", + * // "editableInGaUi": false, + * // "endTime": "my_endTime", + * // "equalWeighting": false, + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "minimumExperimentLengthInDays": 0, + * // "name": "my_name", + * // "objectiveMetric": "my_objectiveMetric", + * // "optimizationType": "my_optimizationType", + * // "parentLink": {}, + * // "profileId": "my_profileId", + * // "reasonExperimentEnded": "my_reasonExperimentEnded", + * // "rewriteVariationUrlsAsOriginal": false, + * // "selfLink": "my_selfLink", + * // "servingFramework": "my_servingFramework", + * // "snippet": "my_snippet", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "trafficCoverage": {}, + * // "updated": "my_updated", + * // "variations": [], + * // "webPropertyId": "my_webPropertyId", + * // "winnerConfidenceLevel": {}, + * // "winnerFound": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "created": "my_created", + * // "description": "my_description", + * // "editableInGaUi": false, + * // "endTime": "my_endTime", + * // "equalWeighting": false, + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "minimumExperimentLengthInDays": 0, + * // "name": "my_name", + * // "objectiveMetric": "my_objectiveMetric", + * // "optimizationType": "my_optimizationType", + * // "parentLink": {}, + * // "profileId": "my_profileId", + * // "reasonExperimentEnded": "my_reasonExperimentEnded", + * // "rewriteVariationUrlsAsOriginal": false, + * // "selfLink": "my_selfLink", + * // "servingFramework": "my_servingFramework", + * // "snippet": "my_snippet", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "trafficCoverage": {}, + * // "updated": "my_updated", + * // "variations": [], + * // "webPropertyId": "my_webPropertyId", + * // "winnerConfidenceLevel": {}, + * // "winnerFound": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.experiments.insert * @memberOf! () * @@ -5039,6 +6608,65 @@ export namespace analytics_v3 { /** * analytics.management.experiments.list * @desc Lists experiments to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.experiments.list({ + * // Account ID to retrieve experiments for. + * accountId: 'd+', + * // The maximum number of experiments to include in this response. + * 'max-results': 'placeholder-value', + * // View (Profile) ID to retrieve experiments for. + * profileId: 'd+', + * // An index of the first experiment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * // Web property ID to retrieve experiments for. + * webPropertyId: 'UA-(d+)-(d+)', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "startIndex": 0, + * // "totalResults": 0, + * // "username": "my_username" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.experiments.list * @memberOf! () * @@ -5117,6 +6745,117 @@ export namespace analytics_v3 { /** * analytics.management.experiments.patch * @desc Update an existing experiment. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.edit', + * ], + * }); + * + * // 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 analytics.management.experiments.patch({ + * // Account ID of the experiment to update. + * accountId: 'placeholder-value', + * // Experiment ID of the experiment to update. + * experimentId: 'placeholder-value', + * // View (Profile) ID of the experiment to update. + * profileId: 'placeholder-value', + * // Web property ID of the experiment to update. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "created": "my_created", + * // "description": "my_description", + * // "editableInGaUi": false, + * // "endTime": "my_endTime", + * // "equalWeighting": false, + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "minimumExperimentLengthInDays": 0, + * // "name": "my_name", + * // "objectiveMetric": "my_objectiveMetric", + * // "optimizationType": "my_optimizationType", + * // "parentLink": {}, + * // "profileId": "my_profileId", + * // "reasonExperimentEnded": "my_reasonExperimentEnded", + * // "rewriteVariationUrlsAsOriginal": false, + * // "selfLink": "my_selfLink", + * // "servingFramework": "my_servingFramework", + * // "snippet": "my_snippet", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "trafficCoverage": {}, + * // "updated": "my_updated", + * // "variations": [], + * // "webPropertyId": "my_webPropertyId", + * // "winnerConfidenceLevel": {}, + * // "winnerFound": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "created": "my_created", + * // "description": "my_description", + * // "editableInGaUi": false, + * // "endTime": "my_endTime", + * // "equalWeighting": false, + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "minimumExperimentLengthInDays": 0, + * // "name": "my_name", + * // "objectiveMetric": "my_objectiveMetric", + * // "optimizationType": "my_optimizationType", + * // "parentLink": {}, + * // "profileId": "my_profileId", + * // "reasonExperimentEnded": "my_reasonExperimentEnded", + * // "rewriteVariationUrlsAsOriginal": false, + * // "selfLink": "my_selfLink", + * // "servingFramework": "my_servingFramework", + * // "snippet": "my_snippet", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "trafficCoverage": {}, + * // "updated": "my_updated", + * // "variations": [], + * // "webPropertyId": "my_webPropertyId", + * // "winnerConfidenceLevel": {}, + * // "winnerFound": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.experiments.patch * @memberOf! () * @@ -5200,6 +6939,117 @@ export namespace analytics_v3 { /** * analytics.management.experiments.update * @desc Update an existing experiment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.edit', + * ], + * }); + * + * // 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 analytics.management.experiments.update({ + * // Account ID of the experiment to update. + * accountId: 'placeholder-value', + * // Experiment ID of the experiment to update. + * experimentId: 'placeholder-value', + * // View (Profile) ID of the experiment to update. + * profileId: 'placeholder-value', + * // Web property ID of the experiment to update. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "created": "my_created", + * // "description": "my_description", + * // "editableInGaUi": false, + * // "endTime": "my_endTime", + * // "equalWeighting": false, + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "minimumExperimentLengthInDays": 0, + * // "name": "my_name", + * // "objectiveMetric": "my_objectiveMetric", + * // "optimizationType": "my_optimizationType", + * // "parentLink": {}, + * // "profileId": "my_profileId", + * // "reasonExperimentEnded": "my_reasonExperimentEnded", + * // "rewriteVariationUrlsAsOriginal": false, + * // "selfLink": "my_selfLink", + * // "servingFramework": "my_servingFramework", + * // "snippet": "my_snippet", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "trafficCoverage": {}, + * // "updated": "my_updated", + * // "variations": [], + * // "webPropertyId": "my_webPropertyId", + * // "winnerConfidenceLevel": {}, + * // "winnerFound": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "created": "my_created", + * // "description": "my_description", + * // "editableInGaUi": false, + * // "endTime": "my_endTime", + * // "equalWeighting": false, + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "minimumExperimentLengthInDays": 0, + * // "name": "my_name", + * // "objectiveMetric": "my_objectiveMetric", + * // "optimizationType": "my_optimizationType", + * // "parentLink": {}, + * // "profileId": "my_profileId", + * // "reasonExperimentEnded": "my_reasonExperimentEnded", + * // "rewriteVariationUrlsAsOriginal": false, + * // "selfLink": "my_selfLink", + * // "servingFramework": "my_servingFramework", + * // "snippet": "my_snippet", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "trafficCoverage": {}, + * // "updated": "my_updated", + * // "variations": [], + * // "webPropertyId": "my_webPropertyId", + * // "winnerConfidenceLevel": {}, + * // "winnerFound": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.experiments.update * @memberOf! () * @@ -5450,6 +7300,62 @@ export namespace analytics_v3 { /** * analytics.management.filters.delete * @desc Delete a filter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.filters.delete({ + * // Account ID to delete the filter for. + * accountId: 'placeholder-value', + * // ID of the filter to be deleted. + * filterId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advancedDetails": {}, + * // "created": "my_created", + * // "excludeDetails": {}, + * // "id": "my_id", + * // "includeDetails": {}, + * // "kind": "my_kind", + * // "lowercaseDetails": {}, + * // "name": "my_name", + * // "parentLink": {}, + * // "searchAndReplaceDetails": {}, + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "uppercaseDetails": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.filters.delete * @memberOf! () * @@ -5523,6 +7429,65 @@ export namespace analytics_v3 { /** * analytics.management.filters.get * @desc Returns filters to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.filters.get({ + * // Account ID to retrieve filters for. + * accountId: 'placeholder-value', + * // Filter ID to retrieve filters for. + * filterId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advancedDetails": {}, + * // "created": "my_created", + * // "excludeDetails": {}, + * // "id": "my_id", + * // "includeDetails": {}, + * // "kind": "my_kind", + * // "lowercaseDetails": {}, + * // "name": "my_name", + * // "parentLink": {}, + * // "searchAndReplaceDetails": {}, + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "uppercaseDetails": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.filters.get * @memberOf! () * @@ -5596,6 +7561,82 @@ export namespace analytics_v3 { /** * analytics.management.filters.insert * @desc Create a new filter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.filters.insert({ + * // Account ID to create filter for. + * accountId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advancedDetails": {}, + * // "created": "my_created", + * // "excludeDetails": {}, + * // "id": "my_id", + * // "includeDetails": {}, + * // "kind": "my_kind", + * // "lowercaseDetails": {}, + * // "name": "my_name", + * // "parentLink": {}, + * // "searchAndReplaceDetails": {}, + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "uppercaseDetails": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advancedDetails": {}, + * // "created": "my_created", + * // "excludeDetails": {}, + * // "id": "my_id", + * // "includeDetails": {}, + * // "kind": "my_kind", + * // "lowercaseDetails": {}, + * // "name": "my_name", + * // "parentLink": {}, + * // "searchAndReplaceDetails": {}, + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "uppercaseDetails": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.filters.insert * @memberOf! () * @@ -5668,6 +7709,60 @@ export namespace analytics_v3 { /** * analytics.management.filters.list * @desc Lists all filters for an account + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.filters.list({ + * // Account ID to retrieve filters for. + * accountId: 'd+', + * // The maximum number of filters to include in this response. + * 'max-results': 'placeholder-value', + * // An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "startIndex": 0, + * // "totalResults": 0, + * // "username": "my_username" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.filters.list * @memberOf! () * @@ -5741,6 +7836,84 @@ export namespace analytics_v3 { /** * analytics.management.filters.patch * @desc Updates an existing filter. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.filters.patch({ + * // Account ID to which the filter belongs. + * accountId: 'placeholder-value', + * // ID of the filter to be updated. + * filterId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advancedDetails": {}, + * // "created": "my_created", + * // "excludeDetails": {}, + * // "id": "my_id", + * // "includeDetails": {}, + * // "kind": "my_kind", + * // "lowercaseDetails": {}, + * // "name": "my_name", + * // "parentLink": {}, + * // "searchAndReplaceDetails": {}, + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "uppercaseDetails": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advancedDetails": {}, + * // "created": "my_created", + * // "excludeDetails": {}, + * // "id": "my_id", + * // "includeDetails": {}, + * // "kind": "my_kind", + * // "lowercaseDetails": {}, + * // "name": "my_name", + * // "parentLink": {}, + * // "searchAndReplaceDetails": {}, + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "uppercaseDetails": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.filters.patch * @memberOf! () * @@ -5815,6 +7988,84 @@ export namespace analytics_v3 { /** * analytics.management.filters.update * @desc Updates an existing filter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.filters.update({ + * // Account ID to which the filter belongs. + * accountId: 'placeholder-value', + * // ID of the filter to be updated. + * filterId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advancedDetails": {}, + * // "created": "my_created", + * // "excludeDetails": {}, + * // "id": "my_id", + * // "includeDetails": {}, + * // "kind": "my_kind", + * // "lowercaseDetails": {}, + * // "name": "my_name", + * // "parentLink": {}, + * // "searchAndReplaceDetails": {}, + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "uppercaseDetails": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advancedDetails": {}, + * // "created": "my_created", + * // "excludeDetails": {}, + * // "id": "my_id", + * // "includeDetails": {}, + * // "kind": "my_kind", + * // "lowercaseDetails": {}, + * // "name": "my_name", + * // "parentLink": {}, + * // "searchAndReplaceDetails": {}, + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "uppercaseDetails": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.filters.update * @memberOf! () * @@ -6008,6 +8259,72 @@ export namespace analytics_v3 { /** * analytics.management.goals.get * @desc Gets a goal to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.goals.get({ + * // Account ID to retrieve the goal for. + * accountId: 'placeholder-value', + * // Goal ID to retrieve the goal for. + * goalId: 'placeholder-value', + * // View (Profile) ID to retrieve the goal for. + * profileId: 'placeholder-value', + * // Web property ID to retrieve the goal for. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "eventDetails": {}, + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "profileId": "my_profileId", + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "urlDestinationDetails": {}, + * // "value": {}, + * // "visitNumPagesDetails": {}, + * // "visitTimeOnSiteDetails": {}, + * // "webPropertyId": "my_webPropertyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.goals.get * @memberOf! () * @@ -6083,6 +8400,92 @@ export namespace analytics_v3 { /** * analytics.management.goals.insert * @desc Create a new goal. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.goals.insert({ + * // Account ID to create the goal for. + * accountId: 'placeholder-value', + * // View (Profile) ID to create the goal for. + * profileId: 'placeholder-value', + * // Web property ID to create the goal for. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "eventDetails": {}, + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "profileId": "my_profileId", + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "urlDestinationDetails": {}, + * // "value": {}, + * // "visitNumPagesDetails": {}, + * // "visitTimeOnSiteDetails": {}, + * // "webPropertyId": "my_webPropertyId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "eventDetails": {}, + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "profileId": "my_profileId", + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "urlDestinationDetails": {}, + * // "value": {}, + * // "visitNumPagesDetails": {}, + * // "visitTimeOnSiteDetails": {}, + * // "webPropertyId": "my_webPropertyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.goals.insert * @memberOf! () * @@ -6158,6 +8561,65 @@ export namespace analytics_v3 { /** * analytics.management.goals.list * @desc Lists goals to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.goals.list({ + * // Account ID to retrieve goals for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to. + * accountId: 'placeholder-value', + * // The maximum number of goals to include in this response. + * 'max-results': 'placeholder-value', + * // View (Profile) ID to retrieve goals for. Can either be a specific view (profile) ID or '~all', which refers to all the views (profiles) that user has access to. + * profileId: 'placeholder-value', + * // An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * // Web property ID to retrieve goals for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "startIndex": 0, + * // "totalResults": 0, + * // "username": "my_username" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.goals.list * @memberOf! () * @@ -6234,6 +8696,94 @@ export namespace analytics_v3 { /** * analytics.management.goals.patch * @desc Updates an existing goal. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.goals.patch({ + * // Account ID to update the goal. + * accountId: 'placeholder-value', + * // Index of the goal to be updated. + * goalId: 'placeholder-value', + * // View (Profile) ID to update the goal. + * profileId: 'placeholder-value', + * // Web property ID to update the goal. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "eventDetails": {}, + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "profileId": "my_profileId", + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "urlDestinationDetails": {}, + * // "value": {}, + * // "visitNumPagesDetails": {}, + * // "visitTimeOnSiteDetails": {}, + * // "webPropertyId": "my_webPropertyId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "eventDetails": {}, + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "profileId": "my_profileId", + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "urlDestinationDetails": {}, + * // "value": {}, + * // "visitNumPagesDetails": {}, + * // "visitTimeOnSiteDetails": {}, + * // "webPropertyId": "my_webPropertyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.goals.patch * @memberOf! () * @@ -6310,6 +8860,94 @@ export namespace analytics_v3 { /** * analytics.management.goals.update * @desc Updates an existing goal. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.goals.update({ + * // Account ID to update the goal. + * accountId: 'placeholder-value', + * // Index of the goal to be updated. + * goalId: 'placeholder-value', + * // View (Profile) ID to update the goal. + * profileId: 'placeholder-value', + * // Web property ID to update the goal. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "eventDetails": {}, + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "profileId": "my_profileId", + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "urlDestinationDetails": {}, + * // "value": {}, + * // "visitNumPagesDetails": {}, + * // "visitTimeOnSiteDetails": {}, + * // "webPropertyId": "my_webPropertyId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "created": "my_created", + * // "eventDetails": {}, + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "profileId": "my_profileId", + * // "selfLink": "my_selfLink", + * // "type": "my_type", + * // "updated": "my_updated", + * // "urlDestinationDetails": {}, + * // "value": {}, + * // "visitNumPagesDetails": {}, + * // "visitTimeOnSiteDetails": {}, + * // "webPropertyId": "my_webPropertyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.goals.update * @memberOf! () * @@ -6529,6 +9167,47 @@ export namespace analytics_v3 { /** * analytics.management.profileFilterLinks.delete * @desc Delete a profile filter link. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.profileFilterLinks.delete({ + * // Account ID to which the profile filter link belongs. + * accountId: 'd+', + * // ID of the profile filter link to delete. + * linkId: 'd+:d+', + * // Profile ID to which the filter link belongs. + * profileId: 'd+', + * // Web property Id to which the profile filter link belongs. + * webPropertyId: 'UA-(d+)-(d+)', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.profileFilterLinks.delete * @memberOf! () * @@ -6604,6 +9283,60 @@ export namespace analytics_v3 { /** * analytics.management.profileFilterLinks.get * @desc Returns a single profile filter link. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.profileFilterLinks.get({ + * // Account ID to retrieve profile filter link for. + * accountId: 'd+', + * // ID of the profile filter link. + * linkId: 'd+:d+', + * // Profile ID to retrieve filter link for. + * profileId: 'd+', + * // Web property Id to retrieve profile filter link for. + * webPropertyId: 'UA-(d+)-(d+)', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "filterRef": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "profileRef": {}, + * // "rank": 0, + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.profileFilterLinks.get * @memberOf! () * @@ -6681,6 +9414,68 @@ export namespace analytics_v3 { /** * analytics.management.profileFilterLinks.insert * @desc Create a new profile filter link. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.profileFilterLinks.insert({ + * // Account ID to create profile filter link for. + * accountId: 'd+', + * // Profile ID to create filter link for. + * profileId: 'd+', + * // Web property Id to create profile filter link for. + * webPropertyId: 'UA-(d+)-(d+)', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "filterRef": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "profileRef": {}, + * // "rank": 0, + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "filterRef": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "profileRef": {}, + * // "rank": 0, + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.profileFilterLinks.insert * @memberOf! () * @@ -6758,6 +9553,64 @@ export namespace analytics_v3 { /** * analytics.management.profileFilterLinks.list * @desc Lists all profile filter links for a profile. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.profileFilterLinks.list({ + * // Account ID to retrieve profile filter links for. + * accountId: 'd+', + * // The maximum number of profile filter links to include in this response. + * 'max-results': 'placeholder-value', + * // Profile ID to retrieve filter links for. Can either be a specific profile ID or '~all', which refers to all the profiles that user has access to. + * profileId: 'placeholder-value', + * // An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * // Web property Id for profile filter links for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "startIndex": 0, + * // "totalResults": 0, + * // "username": "my_username" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.profileFilterLinks.list * @memberOf! () * @@ -6836,6 +9689,70 @@ export namespace analytics_v3 { /** * analytics.management.profileFilterLinks.patch * @desc Update an existing profile filter link. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.profileFilterLinks.patch({ + * // Account ID to which profile filter link belongs. + * accountId: 'd+', + * // ID of the profile filter link to be updated. + * linkId: 'd+:d+', + * // Profile ID to which filter link belongs + * profileId: 'd+', + * // Web property Id to which profile filter link belongs + * webPropertyId: 'UA-(d+)-(d+)', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "filterRef": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "profileRef": {}, + * // "rank": 0, + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "filterRef": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "profileRef": {}, + * // "rank": 0, + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.profileFilterLinks.patch * @memberOf! () * @@ -6914,6 +9831,70 @@ export namespace analytics_v3 { /** * analytics.management.profileFilterLinks.update * @desc Update an existing profile filter link. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.profileFilterLinks.update({ + * // Account ID to which profile filter link belongs. + * accountId: 'd+', + * // ID of the profile filter link to be updated. + * linkId: 'd+:d+', + * // Profile ID to which filter link belongs + * profileId: 'd+', + * // Web property Id to which profile filter link belongs + * webPropertyId: 'UA-(d+)-(d+)', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "filterRef": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "profileRef": {}, + * // "rank": 0, + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "filterRef": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "profileRef": {}, + * // "rank": 0, + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.profileFilterLinks.update * @memberOf! () * @@ -7159,6 +10140,45 @@ export namespace analytics_v3 { /** * analytics.management.profiles.delete * @desc Deletes a view (profile). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.profiles.delete({ + * // Account ID to delete the view (profile) for. + * accountId: 'placeholder-value', + * // ID of the view (profile) to be deleted. + * profileId: 'placeholder-value', + * // Web property ID to delete the view (profile) for. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.profiles.delete * @memberOf! () * @@ -7233,6 +10253,78 @@ export namespace analytics_v3 { /** * analytics.management.profiles.get * @desc Gets a view (profile) to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.profiles.get({ + * // Account ID to retrieve the view (profile) for. + * accountId: '[0-9]+', + * // View (Profile) ID to retrieve the view (profile) for. + * profileId: '[0-9]+', + * // Web property ID to retrieve the view (profile) for. + * webPropertyId: 'UA-[0-9]+-[0-9]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "botFilteringEnabled": false, + * // "childLink": {}, + * // "created": "my_created", + * // "currency": "my_currency", + * // "defaultPage": "my_defaultPage", + * // "eCommerceTracking": false, + * // "enhancedECommerceTracking": false, + * // "excludeQueryParameters": "my_excludeQueryParameters", + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "permissions": {}, + * // "selfLink": "my_selfLink", + * // "siteSearchCategoryParameters": "my_siteSearchCategoryParameters", + * // "siteSearchQueryParameters": "my_siteSearchQueryParameters", + * // "starred": false, + * // "stripSiteSearchCategoryParameters": false, + * // "stripSiteSearchQueryParameters": false, + * // "timezone": "my_timezone", + * // "type": "my_type", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId", + * // "websiteUrl": "my_websiteUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.profiles.get * @memberOf! () * @@ -7307,6 +10399,106 @@ export namespace analytics_v3 { /** * analytics.management.profiles.insert * @desc Create a new view (profile). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.profiles.insert({ + * // Account ID to create the view (profile) for. + * accountId: 'placeholder-value', + * // Web property ID to create the view (profile) for. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "botFilteringEnabled": false, + * // "childLink": {}, + * // "created": "my_created", + * // "currency": "my_currency", + * // "defaultPage": "my_defaultPage", + * // "eCommerceTracking": false, + * // "enhancedECommerceTracking": false, + * // "excludeQueryParameters": "my_excludeQueryParameters", + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "permissions": {}, + * // "selfLink": "my_selfLink", + * // "siteSearchCategoryParameters": "my_siteSearchCategoryParameters", + * // "siteSearchQueryParameters": "my_siteSearchQueryParameters", + * // "starred": false, + * // "stripSiteSearchCategoryParameters": false, + * // "stripSiteSearchQueryParameters": false, + * // "timezone": "my_timezone", + * // "type": "my_type", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId", + * // "websiteUrl": "my_websiteUrl" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "botFilteringEnabled": false, + * // "childLink": {}, + * // "created": "my_created", + * // "currency": "my_currency", + * // "defaultPage": "my_defaultPage", + * // "eCommerceTracking": false, + * // "enhancedECommerceTracking": false, + * // "excludeQueryParameters": "my_excludeQueryParameters", + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "permissions": {}, + * // "selfLink": "my_selfLink", + * // "siteSearchCategoryParameters": "my_siteSearchCategoryParameters", + * // "siteSearchQueryParameters": "my_siteSearchQueryParameters", + * // "starred": false, + * // "stripSiteSearchCategoryParameters": false, + * // "stripSiteSearchQueryParameters": false, + * // "timezone": "my_timezone", + * // "type": "my_type", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId", + * // "websiteUrl": "my_websiteUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.profiles.insert * @memberOf! () * @@ -7381,6 +10573,63 @@ export namespace analytics_v3 { /** * analytics.management.profiles.list * @desc Lists views (profiles) to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.profiles.list({ + * // Account ID for the view (profiles) to retrieve. Can either be a specific account ID or '~all', which refers to all the accounts to which the user has access. + * accountId: 'placeholder-value', + * // The maximum number of views (profiles) to include in this response. + * 'max-results': 'placeholder-value', + * // An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * // Web property ID for the views (profiles) to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties to which the user has access. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "startIndex": 0, + * // "totalResults": 0, + * // "username": "my_username" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.profiles.list * @memberOf! () * @@ -7456,6 +10705,108 @@ export namespace analytics_v3 { /** * analytics.management.profiles.patch * @desc Updates an existing view (profile). This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.profiles.patch({ + * // Account ID to which the view (profile) belongs + * accountId: 'placeholder-value', + * // ID of the view (profile) to be updated. + * profileId: 'placeholder-value', + * // Web property ID to which the view (profile) belongs + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "botFilteringEnabled": false, + * // "childLink": {}, + * // "created": "my_created", + * // "currency": "my_currency", + * // "defaultPage": "my_defaultPage", + * // "eCommerceTracking": false, + * // "enhancedECommerceTracking": false, + * // "excludeQueryParameters": "my_excludeQueryParameters", + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "permissions": {}, + * // "selfLink": "my_selfLink", + * // "siteSearchCategoryParameters": "my_siteSearchCategoryParameters", + * // "siteSearchQueryParameters": "my_siteSearchQueryParameters", + * // "starred": false, + * // "stripSiteSearchCategoryParameters": false, + * // "stripSiteSearchQueryParameters": false, + * // "timezone": "my_timezone", + * // "type": "my_type", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId", + * // "websiteUrl": "my_websiteUrl" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "botFilteringEnabled": false, + * // "childLink": {}, + * // "created": "my_created", + * // "currency": "my_currency", + * // "defaultPage": "my_defaultPage", + * // "eCommerceTracking": false, + * // "enhancedECommerceTracking": false, + * // "excludeQueryParameters": "my_excludeQueryParameters", + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "permissions": {}, + * // "selfLink": "my_selfLink", + * // "siteSearchCategoryParameters": "my_siteSearchCategoryParameters", + * // "siteSearchQueryParameters": "my_siteSearchQueryParameters", + * // "starred": false, + * // "stripSiteSearchCategoryParameters": false, + * // "stripSiteSearchQueryParameters": false, + * // "timezone": "my_timezone", + * // "type": "my_type", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId", + * // "websiteUrl": "my_websiteUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.profiles.patch * @memberOf! () * @@ -7531,6 +10882,108 @@ export namespace analytics_v3 { /** * analytics.management.profiles.update * @desc Updates an existing view (profile). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.profiles.update({ + * // Account ID to which the view (profile) belongs + * accountId: 'placeholder-value', + * // ID of the view (profile) to be updated. + * profileId: 'placeholder-value', + * // Web property ID to which the view (profile) belongs + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "botFilteringEnabled": false, + * // "childLink": {}, + * // "created": "my_created", + * // "currency": "my_currency", + * // "defaultPage": "my_defaultPage", + * // "eCommerceTracking": false, + * // "enhancedECommerceTracking": false, + * // "excludeQueryParameters": "my_excludeQueryParameters", + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "permissions": {}, + * // "selfLink": "my_selfLink", + * // "siteSearchCategoryParameters": "my_siteSearchCategoryParameters", + * // "siteSearchQueryParameters": "my_siteSearchQueryParameters", + * // "starred": false, + * // "stripSiteSearchCategoryParameters": false, + * // "stripSiteSearchQueryParameters": false, + * // "timezone": "my_timezone", + * // "type": "my_type", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId", + * // "websiteUrl": "my_websiteUrl" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "botFilteringEnabled": false, + * // "childLink": {}, + * // "created": "my_created", + * // "currency": "my_currency", + * // "defaultPage": "my_defaultPage", + * // "eCommerceTracking": false, + * // "enhancedECommerceTracking": false, + * // "excludeQueryParameters": "my_excludeQueryParameters", + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentLink": {}, + * // "permissions": {}, + * // "selfLink": "my_selfLink", + * // "siteSearchCategoryParameters": "my_siteSearchCategoryParameters", + * // "siteSearchQueryParameters": "my_siteSearchQueryParameters", + * // "starred": false, + * // "stripSiteSearchCategoryParameters": false, + * // "stripSiteSearchQueryParameters": false, + * // "timezone": "my_timezone", + * // "type": "my_type", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId", + * // "websiteUrl": "my_websiteUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.profiles.update * @memberOf! () * @@ -7749,6 +11202,47 @@ export namespace analytics_v3 { /** * analytics.management.profileUserLinks.delete * @desc Removes a user from the given view (profile). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.manage.users'], + * }); + * + * // 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 analytics.management.profileUserLinks.delete({ + * // Account ID to delete the user link for. + * accountId: 'placeholder-value', + * // Link ID to delete the user link for. + * linkId: 'placeholder-value', + * // View (Profile) ID to delete the user link for. + * profileId: 'placeholder-value', + * // Web Property ID to delete the user link for. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.profileUserLinks.delete * @memberOf! () * @@ -7824,6 +11318,68 @@ export namespace analytics_v3 { /** * analytics.management.profileUserLinks.insert * @desc Adds a new user to the given view (profile). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.manage.users'], + * }); + * + * // 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 analytics.management.profileUserLinks.insert({ + * // Account ID to create the user link for. + * accountId: 'placeholder-value', + * // View (Profile) ID to create the user link for. + * profileId: 'placeholder-value', + * // Web Property ID to create the user link for. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entity": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "permissions": {}, + * // "selfLink": "my_selfLink", + * // "userRef": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entity": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "permissions": {}, + * // "selfLink": "my_selfLink", + * // "userRef": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.profileUserLinks.insert * @memberOf! () * @@ -7901,6 +11457,63 @@ export namespace analytics_v3 { /** * analytics.management.profileUserLinks.list * @desc Lists profile-user links for a given view (profile). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.manage.users', + * 'https://www.googleapis.com/auth/analytics.manage.users.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 analytics.management.profileUserLinks.list({ + * // Account ID which the given view (profile) belongs to. + * accountId: 'placeholder-value', + * // The maximum number of profile-user links to include in this response. + * 'max-results': 'placeholder-value', + * // View (Profile) ID to retrieve the profile-user links for. Can either be a specific profile ID or '~all', which refers to all the profiles that user has access to. + * profileId: 'placeholder-value', + * // An index of the first profile-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * // Web Property ID which the given view (profile) belongs to. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "startIndex": 0, + * // "totalResults": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.profileUserLinks.list * @memberOf! () * @@ -7979,6 +11592,70 @@ export namespace analytics_v3 { /** * analytics.management.profileUserLinks.update * @desc Updates permissions for an existing user on the given view (profile). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.manage.users'], + * }); + * + * // 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 analytics.management.profileUserLinks.update({ + * // Account ID to update the user link for. + * accountId: 'placeholder-value', + * // Link ID to update the user link for. + * linkId: 'placeholder-value', + * // View (Profile ID) to update the user link for. + * profileId: 'placeholder-value', + * // Web Property ID to update the user link for. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entity": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "permissions": {}, + * // "selfLink": "my_selfLink", + * // "userRef": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entity": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "permissions": {}, + * // "selfLink": "my_selfLink", + * // "userRef": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.profileUserLinks.update * @memberOf! () * @@ -8171,6 +11848,45 @@ export namespace analytics_v3 { /** * analytics.management.remarketingAudience.delete * @desc Delete a remarketing audience. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.remarketingAudience.delete({ + * // Account ID to which the remarketing audience belongs. + * accountId: 'placeholder-value', + * // The ID of the remarketing audience to delete. + * remarketingAudienceId: 'placeholder-value', + * // Web property ID to which the remarketing audience belongs. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.remarketingAudience.delete * @memberOf! () * @@ -8245,6 +11961,66 @@ export namespace analytics_v3 { /** * analytics.management.remarketingAudience.get * @desc Gets a remarketing audience to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.remarketingAudience.get({ + * // The account ID of the remarketing audience to retrieve. + * accountId: 'placeholder-value', + * // The ID of the remarketing audience to retrieve. + * remarketingAudienceId: 'placeholder-value', + * // The web property ID of the remarketing audience to retrieve. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "audienceDefinition": {}, + * // "audienceType": "my_audienceType", + * // "created": "my_created", + * // "description": "my_description", + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "linkedAdAccounts": [], + * // "linkedViews": [], + * // "name": "my_name", + * // "stateBasedAudienceDefinition": {}, + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.remarketingAudience.get * @memberOf! () * @@ -8321,6 +12097,82 @@ export namespace analytics_v3 { /** * analytics.management.remarketingAudience.insert * @desc Creates a new remarketing audience. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.remarketingAudience.insert({ + * // The account ID for which to create the remarketing audience. + * accountId: 'placeholder-value', + * // Web property ID for which to create the remarketing audience. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "audienceDefinition": {}, + * // "audienceType": "my_audienceType", + * // "created": "my_created", + * // "description": "my_description", + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "linkedAdAccounts": [], + * // "linkedViews": [], + * // "name": "my_name", + * // "stateBasedAudienceDefinition": {}, + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "audienceDefinition": {}, + * // "audienceType": "my_audienceType", + * // "created": "my_created", + * // "description": "my_description", + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "linkedAdAccounts": [], + * // "linkedViews": [], + * // "name": "my_name", + * // "stateBasedAudienceDefinition": {}, + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.remarketingAudience.insert * @memberOf! () * @@ -8397,6 +12249,64 @@ export namespace analytics_v3 { /** * analytics.management.remarketingAudience.list * @desc Lists remarketing audiences to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.remarketingAudience.list({ + * // The account ID of the remarketing audiences to retrieve. + * accountId: 'placeholder-value', + * // The maximum number of remarketing audiences to include in this response. + * 'max-results': 'placeholder-value', + * // An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * + * type: 'placeholder-value', + * // The web property ID of the remarketing audiences to retrieve. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "startIndex": 0, + * // "totalResults": 0, + * // "username": "my_username" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.remarketingAudience.list * @memberOf! () * @@ -8477,6 +12387,84 @@ export namespace analytics_v3 { /** * analytics.management.remarketingAudience.patch * @desc Updates an existing remarketing audience. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.remarketingAudience.patch({ + * // The account ID of the remarketing audience to update. + * accountId: 'placeholder-value', + * // The ID of the remarketing audience to update. + * remarketingAudienceId: 'placeholder-value', + * // The web property ID of the remarketing audience to update. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "audienceDefinition": {}, + * // "audienceType": "my_audienceType", + * // "created": "my_created", + * // "description": "my_description", + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "linkedAdAccounts": [], + * // "linkedViews": [], + * // "name": "my_name", + * // "stateBasedAudienceDefinition": {}, + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "audienceDefinition": {}, + * // "audienceType": "my_audienceType", + * // "created": "my_created", + * // "description": "my_description", + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "linkedAdAccounts": [], + * // "linkedViews": [], + * // "name": "my_name", + * // "stateBasedAudienceDefinition": {}, + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.remarketingAudience.patch * @memberOf! () * @@ -8554,6 +12542,84 @@ export namespace analytics_v3 { /** * analytics.management.remarketingAudience.update * @desc Updates an existing remarketing audience. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.remarketingAudience.update({ + * // The account ID of the remarketing audience to update. + * accountId: 'placeholder-value', + * // The ID of the remarketing audience to update. + * remarketingAudienceId: 'placeholder-value', + * // The web property ID of the remarketing audience to update. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "audienceDefinition": {}, + * // "audienceType": "my_audienceType", + * // "created": "my_created", + * // "description": "my_description", + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "linkedAdAccounts": [], + * // "linkedViews": [], + * // "name": "my_name", + * // "stateBasedAudienceDefinition": {}, + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "audienceDefinition": {}, + * // "audienceType": "my_audienceType", + * // "created": "my_created", + * // "description": "my_description", + * // "id": "my_id", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "linkedAdAccounts": [], + * // "linkedViews": [], + * // "name": "my_name", + * // "stateBasedAudienceDefinition": {}, + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.remarketingAudience.update * @memberOf! () * @@ -8778,6 +12844,59 @@ export namespace analytics_v3 { /** * analytics.management.segments.list * @desc Lists segments to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.segments.list({ + * // The maximum number of segments to include in this response. + * 'max-results': 'placeholder-value', + * // An index of the first segment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "startIndex": 0, + * // "totalResults": 0, + * // "username": "my_username" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.segments.list * @memberOf! () * @@ -8875,6 +12994,47 @@ export namespace analytics_v3 { /** * analytics.management.unsampledReports.delete * @desc Deletes an unsampled report. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.unsampledReports.delete({ + * // Account ID to delete the unsampled report for. + * accountId: 'placeholder-value', + * // View (Profile) ID to delete the unsampled report for. + * profileId: 'placeholder-value', + * // ID of the unsampled report to be deleted. + * unsampledReportId: 'placeholder-value', + * // Web property ID to delete the unsampled reports for. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.unsampledReports.delete * @memberOf! () * @@ -8960,6 +13120,74 @@ export namespace analytics_v3 { /** * analytics.management.unsampledReports.get * @desc Returns a single unsampled report. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.unsampledReports.get({ + * // Account ID to retrieve unsampled report for. + * accountId: 'placeholder-value', + * // View (Profile) ID to retrieve unsampled report for. + * profileId: 'placeholder-value', + * // ID of the unsampled report to retrieve. + * unsampledReportId: 'placeholder-value', + * // Web property ID to retrieve unsampled reports for. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "cloudStorageDownloadDetails": {}, + * // "created": "my_created", + * // "dimensions": "my_dimensions", + * // "downloadType": "my_downloadType", + * // "driveDownloadDetails": {}, + * // "end-date": "my_end-date", + * // "filters": "my_filters", + * // "id": "my_id", + * // "kind": "my_kind", + * // "metrics": "my_metrics", + * // "profileId": "my_profileId", + * // "segment": "my_segment", + * // "selfLink": "my_selfLink", + * // "start-date": "my_start-date", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.unsampledReports.get * @memberOf! () * @@ -9047,6 +13275,97 @@ export namespace analytics_v3 { /** * analytics.management.unsampledReports.insert * @desc Create a new unsampled report. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.edit', + * ], + * }); + * + * // 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 analytics.management.unsampledReports.insert({ + * // Account ID to create the unsampled report for. + * accountId: 'placeholder-value', + * // View (Profile) ID to create the unsampled report for. + * profileId: 'placeholder-value', + * // Web property ID to create the unsampled report for. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "cloudStorageDownloadDetails": {}, + * // "created": "my_created", + * // "dimensions": "my_dimensions", + * // "downloadType": "my_downloadType", + * // "driveDownloadDetails": {}, + * // "end-date": "my_end-date", + * // "filters": "my_filters", + * // "id": "my_id", + * // "kind": "my_kind", + * // "metrics": "my_metrics", + * // "profileId": "my_profileId", + * // "segment": "my_segment", + * // "selfLink": "my_selfLink", + * // "start-date": "my_start-date", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "cloudStorageDownloadDetails": {}, + * // "created": "my_created", + * // "dimensions": "my_dimensions", + * // "downloadType": "my_downloadType", + * // "driveDownloadDetails": {}, + * // "end-date": "my_end-date", + * // "filters": "my_filters", + * // "id": "my_id", + * // "kind": "my_kind", + * // "metrics": "my_metrics", + * // "profileId": "my_profileId", + * // "segment": "my_segment", + * // "selfLink": "my_selfLink", + * // "start-date": "my_start-date", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated", + * // "webPropertyId": "my_webPropertyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.unsampledReports.insert * @memberOf! () * @@ -9124,6 +13443,65 @@ export namespace analytics_v3 { /** * analytics.management.unsampledReports.list * @desc Lists unsampled reports to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.unsampledReports.list({ + * // Account ID to retrieve unsampled reports for. Must be a specific account ID, ~all is not supported. + * accountId: 'placeholder-value', + * // The maximum number of unsampled reports to include in this response. + * 'max-results': 'placeholder-value', + * // View (Profile) ID to retrieve unsampled reports for. Must be a specific view (profile) ID, ~all is not supported. + * profileId: 'placeholder-value', + * // An index of the first unsampled report to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * // Web property ID to retrieve unsampled reports for. Must be a specific web property ID, ~all is not supported. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "startIndex": 0, + * // "totalResults": 0, + * // "username": "my_username" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.unsampledReports.list * @memberOf! () * @@ -9311,6 +13689,56 @@ export namespace analytics_v3 { /** * analytics.management.uploads.deleteUploadData * @desc Delete data associated with a previous upload. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.edit', + * ], + * }); + * + * // 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 analytics.management.uploads.deleteUploadData({ + * // Account Id for the uploads to be deleted. + * accountId: 'd+', + * // Custom data source Id for the uploads to be deleted. + * customDataSourceId: '.{22}', + * // Web property Id for the uploads to be deleted. + * webPropertyId: 'UA-(d+)-(d+)', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "customDataImportUids": [] + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.uploads.deleteUploadData * @memberOf! () * @@ -9386,6 +13814,62 @@ export namespace analytics_v3 { /** * analytics.management.uploads.get * @desc List uploads to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.uploads.get({ + * // Account Id for the upload to retrieve. + * accountId: 'd+', + * // Custom data source Id for upload to retrieve. + * customDataSourceId: '.{22}', + * // Upload Id to retrieve. + * uploadId: '.{22}', + * // Web property Id for the upload to retrieve. + * webPropertyId: 'UA-(d+)-(d+)', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "customDataSourceId": "my_customDataSourceId", + * // "errors": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "status": "my_status", + * // "uploadTime": "my_uploadTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.uploads.get * @memberOf! () * @@ -9471,6 +13955,64 @@ export namespace analytics_v3 { /** * analytics.management.uploads.list * @desc List uploads to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.uploads.list({ + * // Account Id for the uploads to retrieve. + * accountId: 'd+', + * // Custom data source Id for uploads to retrieve. + * customDataSourceId: '.{22}', + * // The maximum number of uploads to include in this response. + * 'max-results': 'placeholder-value', + * // A 1-based index of the first upload to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * // Web property Id for the uploads to retrieve. + * webPropertyId: 'UA-(d+)-(d+)', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "startIndex": 0, + * // "totalResults": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.uploads.list * @memberOf! () * @@ -9547,6 +14089,67 @@ export namespace analytics_v3 { /** * analytics.management.uploads.uploadData * @desc Upload data for a custom data source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.edit', + * ], + * }); + * + * // 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 analytics.management.uploads.uploadData({ + * // Account Id associated with the upload. + * accountId: 'd+', + * // Custom data source Id to which the data being uploaded belongs. + * customDataSourceId: 'placeholder-value', + * // Web property UA-string associated with the upload. + * webPropertyId: 'UA-d+-d+', + * + * requestBody: { + * // request body parameters + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "customDataSourceId": "my_customDataSourceId", + * // "errors": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "status": "my_status", + * // "uploadTime": "my_uploadTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.uploads.uploadData * @memberOf! () * @@ -9753,6 +14356,69 @@ export namespace analytics_v3 { /** * analytics.management.webproperties.get * @desc Gets a web property to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.webproperties.get({ + * // Account ID to retrieve the web property for. + * accountId: '[0-9]+', + * // ID to retrieve the web property for. + * webPropertyId: 'UA-[0-9]+-[0-9]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "childLink": {}, + * // "created": "my_created", + * // "dataRetentionResetOnNewActivity": false, + * // "dataRetentionTtl": "my_dataRetentionTtl", + * // "defaultProfileId": "my_defaultProfileId", + * // "id": "my_id", + * // "industryVertical": "my_industryVertical", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "level": "my_level", + * // "name": "my_name", + * // "parentLink": {}, + * // "permissions": {}, + * // "profileCount": 0, + * // "selfLink": "my_selfLink", + * // "starred": false, + * // "updated": "my_updated", + * // "websiteUrl": "my_websiteUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.webproperties.get * @memberOf! () * @@ -9828,6 +14494,90 @@ export namespace analytics_v3 { /** * analytics.management.webproperties.insert * @desc Create a new property if the account has fewer than 20 properties. Web properties are visible in the Google Analytics interface only if they have at least one profile. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.webproperties.insert({ + * // Account ID to create the web property for. + * accountId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "childLink": {}, + * // "created": "my_created", + * // "dataRetentionResetOnNewActivity": false, + * // "dataRetentionTtl": "my_dataRetentionTtl", + * // "defaultProfileId": "my_defaultProfileId", + * // "id": "my_id", + * // "industryVertical": "my_industryVertical", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "level": "my_level", + * // "name": "my_name", + * // "parentLink": {}, + * // "permissions": {}, + * // "profileCount": 0, + * // "selfLink": "my_selfLink", + * // "starred": false, + * // "updated": "my_updated", + * // "websiteUrl": "my_websiteUrl" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "childLink": {}, + * // "created": "my_created", + * // "dataRetentionResetOnNewActivity": false, + * // "dataRetentionTtl": "my_dataRetentionTtl", + * // "defaultProfileId": "my_defaultProfileId", + * // "id": "my_id", + * // "industryVertical": "my_industryVertical", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "level": "my_level", + * // "name": "my_name", + * // "parentLink": {}, + * // "permissions": {}, + * // "profileCount": 0, + * // "selfLink": "my_selfLink", + * // "starred": false, + * // "updated": "my_updated", + * // "websiteUrl": "my_websiteUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.webproperties.insert * @memberOf! () * @@ -9903,6 +14653,61 @@ export namespace analytics_v3 { /** * analytics.management.webproperties.list * @desc Lists web properties to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.webproperties.list({ + * // Account ID to retrieve web properties for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to. + * accountId: 'placeholder-value', + * // The maximum number of web properties to include in this response. + * 'max-results': 'placeholder-value', + * // An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "startIndex": 0, + * // "totalResults": 0, + * // "username": "my_username" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.webproperties.list * @memberOf! () * @@ -9979,6 +14784,92 @@ export namespace analytics_v3 { /** * analytics.management.webproperties.patch * @desc Updates an existing web property. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.webproperties.patch({ + * // Account ID to which the web property belongs + * accountId: 'placeholder-value', + * // Web property ID + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "childLink": {}, + * // "created": "my_created", + * // "dataRetentionResetOnNewActivity": false, + * // "dataRetentionTtl": "my_dataRetentionTtl", + * // "defaultProfileId": "my_defaultProfileId", + * // "id": "my_id", + * // "industryVertical": "my_industryVertical", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "level": "my_level", + * // "name": "my_name", + * // "parentLink": {}, + * // "permissions": {}, + * // "profileCount": 0, + * // "selfLink": "my_selfLink", + * // "starred": false, + * // "updated": "my_updated", + * // "websiteUrl": "my_websiteUrl" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "childLink": {}, + * // "created": "my_created", + * // "dataRetentionResetOnNewActivity": false, + * // "dataRetentionTtl": "my_dataRetentionTtl", + * // "defaultProfileId": "my_defaultProfileId", + * // "id": "my_id", + * // "industryVertical": "my_industryVertical", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "level": "my_level", + * // "name": "my_name", + * // "parentLink": {}, + * // "permissions": {}, + * // "profileCount": 0, + * // "selfLink": "my_selfLink", + * // "starred": false, + * // "updated": "my_updated", + * // "websiteUrl": "my_websiteUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.webproperties.patch * @memberOf! () * @@ -10055,6 +14946,92 @@ export namespace analytics_v3 { /** * analytics.management.webproperties.update * @desc Updates an existing web property. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.webproperties.update({ + * // Account ID to which the web property belongs + * accountId: 'placeholder-value', + * // Web property ID + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "childLink": {}, + * // "created": "my_created", + * // "dataRetentionResetOnNewActivity": false, + * // "dataRetentionTtl": "my_dataRetentionTtl", + * // "defaultProfileId": "my_defaultProfileId", + * // "id": "my_id", + * // "industryVertical": "my_industryVertical", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "level": "my_level", + * // "name": "my_name", + * // "parentLink": {}, + * // "permissions": {}, + * // "profileCount": 0, + * // "selfLink": "my_selfLink", + * // "starred": false, + * // "updated": "my_updated", + * // "websiteUrl": "my_websiteUrl" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "childLink": {}, + * // "created": "my_created", + * // "dataRetentionResetOnNewActivity": false, + * // "dataRetentionTtl": "my_dataRetentionTtl", + * // "defaultProfileId": "my_defaultProfileId", + * // "id": "my_id", + * // "industryVertical": "my_industryVertical", + * // "internalWebPropertyId": "my_internalWebPropertyId", + * // "kind": "my_kind", + * // "level": "my_level", + * // "name": "my_name", + * // "parentLink": {}, + * // "permissions": {}, + * // "profileCount": 0, + * // "selfLink": "my_selfLink", + * // "starred": false, + * // "updated": "my_updated", + * // "websiteUrl": "my_websiteUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.webproperties.update * @memberOf! () * @@ -10234,6 +15211,45 @@ export namespace analytics_v3 { /** * analytics.management.webPropertyAdWordsLinks.delete * @desc Deletes a web property-Google Ads link. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.webPropertyAdWordsLinks.delete({ + * // ID of the account which the given web property belongs to. + * accountId: 'placeholder-value', + * // Web property Google Ads link ID. + * webPropertyAdWordsLinkId: 'placeholder-value', + * // Web property ID to delete the Google Ads link for. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.webPropertyAdWordsLinks.delete * @memberOf! () * @@ -10312,6 +15328,59 @@ export namespace analytics_v3 { /** * analytics.management.webPropertyAdWordsLinks.get * @desc Returns a web property-Google Ads link to which the user has access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.webPropertyAdWordsLinks.get({ + * // ID of the account which the given web property belongs to. + * accountId: 'placeholder-value', + * // Web property-Google Ads link ID. + * webPropertyAdWordsLinkId: 'placeholder-value', + * // Web property ID to retrieve the Google Ads link for. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adWordsAccounts": [], + * // "entity": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "profileIds": [], + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.webPropertyAdWordsLinks.get * @memberOf! () * @@ -10392,6 +15461,68 @@ export namespace analytics_v3 { /** * analytics.management.webPropertyAdWordsLinks.insert * @desc Creates a webProperty-Google Ads link. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.webPropertyAdWordsLinks.insert({ + * // ID of the Google Analytics account to create the link for. + * accountId: 'placeholder-value', + * // Web property ID to create the link for. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adWordsAccounts": [], + * // "entity": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "profileIds": [], + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adWordsAccounts": [], + * // "entity": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "profileIds": [], + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.webPropertyAdWordsLinks.insert * @memberOf! () * @@ -10468,6 +15599,61 @@ export namespace analytics_v3 { /** * analytics.management.webPropertyAdWordsLinks.list * @desc Lists webProperty-Google Ads links for a given web property. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.management.webPropertyAdWordsLinks.list({ + * // ID of the account which the given web property belongs to. + * accountId: 'd+', + * // The maximum number of webProperty-Google Ads links to include in this response. + * 'max-results': 'placeholder-value', + * // An index of the first webProperty-Google Ads link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * // Web property ID to retrieve the Google Ads links for. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "startIndex": 0, + * // "totalResults": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.webPropertyAdWordsLinks.list * @memberOf! () * @@ -10545,6 +15731,70 @@ export namespace analytics_v3 { /** * analytics.management.webPropertyAdWordsLinks.patch * @desc Updates an existing webProperty-Google Ads link. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.webPropertyAdWordsLinks.patch({ + * // ID of the account which the given web property belongs to. + * accountId: 'placeholder-value', + * // Web property-Google Ads link ID. + * webPropertyAdWordsLinkId: 'placeholder-value', + * // Web property ID to retrieve the Google Ads link for. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adWordsAccounts": [], + * // "entity": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "profileIds": [], + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adWordsAccounts": [], + * // "entity": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "profileIds": [], + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.webPropertyAdWordsLinks.patch * @memberOf! () * @@ -10626,6 +15876,70 @@ export namespace analytics_v3 { /** * analytics.management.webPropertyAdWordsLinks.update * @desc Updates an existing webProperty-Google Ads link. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.edit'], + * }); + * + * // 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 analytics.management.webPropertyAdWordsLinks.update({ + * // ID of the account which the given web property belongs to. + * accountId: 'placeholder-value', + * // Web property-Google Ads link ID. + * webPropertyAdWordsLinkId: 'placeholder-value', + * // Web property ID to retrieve the Google Ads link for. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adWordsAccounts": [], + * // "entity": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "profileIds": [], + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adWordsAccounts": [], + * // "entity": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "profileIds": [], + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.webPropertyAdWordsLinks.update * @memberOf! () * @@ -10850,6 +16164,45 @@ export namespace analytics_v3 { /** * analytics.management.webpropertyUserLinks.delete * @desc Removes a user from the given web property. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.manage.users'], + * }); + * + * // 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 analytics.management.webpropertyUserLinks.delete({ + * // Account ID to delete the user link for. + * accountId: 'placeholder-value', + * // Link ID to delete the user link for. + * linkId: 'placeholder-value', + * // Web Property ID to delete the user link for. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.webpropertyUserLinks.delete * @memberOf! () * @@ -10924,6 +16277,66 @@ export namespace analytics_v3 { /** * analytics.management.webpropertyUserLinks.insert * @desc Adds a new user to the given web property. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.manage.users'], + * }); + * + * // 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 analytics.management.webpropertyUserLinks.insert({ + * // Account ID to create the user link for. + * accountId: 'placeholder-value', + * // Web Property ID to create the user link for. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entity": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "permissions": {}, + * // "selfLink": "my_selfLink", + * // "userRef": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entity": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "permissions": {}, + * // "selfLink": "my_selfLink", + * // "userRef": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.webpropertyUserLinks.insert * @memberOf! () * @@ -11000,6 +16413,61 @@ export namespace analytics_v3 { /** * analytics.management.webpropertyUserLinks.list * @desc Lists webProperty-user links for a given web property. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.manage.users', + * 'https://www.googleapis.com/auth/analytics.manage.users.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 analytics.management.webpropertyUserLinks.list({ + * // Account ID which the given web property belongs to. + * accountId: 'placeholder-value', + * // The maximum number of webProperty-user Links to include in this response. + * 'max-results': 'placeholder-value', + * // An index of the first webProperty-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * 'start-index': 'placeholder-value', + * // Web Property ID for the webProperty-user links to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to. + * webPropertyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "itemsPerPage": 0, + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "previousLink": "my_previousLink", + * // "startIndex": 0, + * // "totalResults": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.webpropertyUserLinks.list * @memberOf! () * @@ -11077,6 +16545,68 @@ export namespace analytics_v3 { /** * analytics.management.webpropertyUserLinks.update * @desc Updates permissions for an existing user on the given web property. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.manage.users'], + * }); + * + * // 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 analytics.management.webpropertyUserLinks.update({ + * // Account ID to update the account-user link for. + * accountId: 'placeholder-value', + * // Link ID to update the account-user link for. + * linkId: 'placeholder-value', + * // Web property ID to update the account-user link for. + * webPropertyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entity": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "permissions": {}, + * // "selfLink": "my_selfLink", + * // "userRef": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entity": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "permissions": {}, + * // "selfLink": "my_selfLink", + * // "userRef": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.management.webpropertyUserLinks.update * @memberOf! () * @@ -11261,6 +16791,54 @@ export namespace analytics_v3 { /** * analytics.metadata.columns.list * @desc Lists all columns for a report type + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.edit', + * 'https://www.googleapis.com/auth/analytics.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 analytics.metadata.columns.list({ + * // Report type. Allowed Values: 'ga'. Where 'ga' corresponds to the Core Reporting API + * reportType: 'ga', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attributeNames": [], + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "totalResults": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.metadata.columns.list * @memberOf! () * @@ -11352,6 +16930,61 @@ export namespace analytics_v3 { /** * analytics.provisioning.createAccountTicket * @desc Creates an account ticket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.provision'], + * }); + * + * // 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 analytics.provisioning.createAccountTicket({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "account": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "profile": {}, + * // "redirectUri": "my_redirectUri", + * // "webproperty": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "account": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "profile": {}, + * // "redirectUri": "my_redirectUri", + * // "webproperty": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.provisioning.createAccountTicket * @memberOf! () * @@ -11427,6 +17060,59 @@ export namespace analytics_v3 { /** * analytics.provisioning.createAccountTree * @desc Provision account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.provision'], + * }); + * + * // 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 analytics.provisioning.createAccountTree({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountName": "my_accountName", + * // "kind": "my_kind", + * // "profileName": "my_profileName", + * // "timezone": "my_timezone", + * // "webpropertyName": "my_webpropertyName", + * // "websiteUrl": "my_websiteUrl" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "account": {}, + * // "kind": "my_kind", + * // "profile": {}, + * // "webproperty": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.provisioning.createAccountTree * @memberOf! () * @@ -11545,6 +17231,61 @@ export namespace analytics_v3 { /** * analytics.userDeletion.userDeletionRequest.upsert * @desc Insert or update a user deletion requests. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analytics.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 analytics = google.analytics('v3'); + * + * 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/analytics.user.deletion'], + * }); + * + * // 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 analytics.userDeletion.userDeletionRequest.upsert({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deletionRequestTime": "my_deletionRequestTime", + * // "firebaseProjectId": "my_firebaseProjectId", + * // "id": {}, + * // "kind": "my_kind", + * // "propertyId": "my_propertyId", + * // "webPropertyId": "my_webPropertyId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deletionRequestTime": "my_deletionRequestTime", + * // "firebaseProjectId": "my_firebaseProjectId", + * // "id": {}, + * // "kind": "my_kind", + * // "propertyId": "my_propertyId", + * // "webPropertyId": "my_webPropertyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analytics.userDeletion.userDeletionRequest.upsert * @memberOf! () * diff --git a/src/apis/analyticsreporting/v4.ts b/src/apis/analyticsreporting/v4.ts index 7e9efb78f43..a7daaa808e2 100644 --- a/src/apis/analyticsreporting/v4.ts +++ b/src/apis/analyticsreporting/v4.ts @@ -1096,6 +1096,57 @@ export namespace analyticsreporting_v4 { /** * analyticsreporting.reports.batchGet * @desc Returns the Analytics data. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analyticsreporting.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 analyticsreporting = google.analyticsreporting('v4'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.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 analyticsreporting.reports.batchGet({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "reportRequests": [], + * // "useResourceQuotas": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "queryCost": 0, + * // "reports": [], + * // "resourceQuotasRemaining": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analyticsreporting.reports.batchGet * @memberOf! () * @@ -1189,6 +1240,62 @@ export namespace analyticsreporting_v4 { /** * analyticsreporting.userActivity.search * @desc Returns User Activity data. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/analyticsreporting.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 analyticsreporting = google.analyticsreporting('v4'); + * + * 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/analytics', + * 'https://www.googleapis.com/auth/analytics.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 analyticsreporting.userActivity.search({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "activityTypes": [], + * // "dateRange": {}, + * // "pageSize": 0, + * // "pageToken": "my_pageToken", + * // "user": {}, + * // "viewId": "my_viewId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "sampleRate": {}, + * // "sessions": [], + * // "totalRows": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias analyticsreporting.userActivity.search * @memberOf! () * diff --git a/src/apis/androiddeviceprovisioning/v1.ts b/src/apis/androiddeviceprovisioning/v1.ts index beba95bafaa..e19730f7ead 100644 --- a/src/apis/androiddeviceprovisioning/v1.ts +++ b/src/apis/androiddeviceprovisioning/v1.ts @@ -808,6 +808,50 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.customers.list * @desc Lists the user's customer accounts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.customers.list({ + * // The maximum number of customers to show in a page of results. + * // A number between 1 and 100 (inclusive). + * pageSize: 'placeholder-value', + * // A token specifying which result page to return. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "customers": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.customers.list * @memberOf! () * @@ -912,6 +956,73 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.customers.configurations.create * @desc Creates a new configuration. Once created, a customer can apply the configuration to devices. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.customers.configurations.create({ + * // Required. The customer that manages the configuration. An API resource name + * // in the format `customers/[CUSTOMER_ID]`. + * parent: 'customers/my-customer', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "companyName": "my_companyName", + * // "configurationId": "my_configurationId", + * // "configurationName": "my_configurationName", + * // "contactEmail": "my_contactEmail", + * // "contactPhone": "my_contactPhone", + * // "customMessage": "my_customMessage", + * // "dpcExtras": "my_dpcExtras", + * // "dpcResourcePath": "my_dpcResourcePath", + * // "isDefault": false, + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "companyName": "my_companyName", + * // "configurationId": "my_configurationId", + * // "configurationName": "my_configurationName", + * // "contactEmail": "my_contactEmail", + * // "contactPhone": "my_contactPhone", + * // "customMessage": "my_customMessage", + * // "dpcExtras": "my_dpcExtras", + * // "dpcResourcePath": "my_dpcResourcePath", + * // "isDefault": false, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.customers.configurations.create * @memberOf! () * @@ -988,6 +1099,46 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.customers.configurations.delete * @desc Deletes an unused configuration. The API call fails if the customer has devices with the configuration applied. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.customers.configurations.delete({ + * // Required. The configuration to delete. An API resource name in the format + * // `customers/[CUSTOMER_ID]/configurations/[CONFIGURATION_ID]`. If the + * // configuration is applied to any devices, the API call fails. + * name: 'customers/my-customer/configurations/my-configuration', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.customers.configurations.delete * @memberOf! () * @@ -1058,6 +1209,56 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.customers.configurations.get * @desc Gets the details of a configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.customers.configurations.get({ + * // Required. The configuration to get. An API resource name in the format + * // `customers/[CUSTOMER_ID]/configurations/[CONFIGURATION_ID]`. + * name: 'customers/my-customer/configurations/my-configuration', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "companyName": "my_companyName", + * // "configurationId": "my_configurationId", + * // "configurationName": "my_configurationName", + * // "contactEmail": "my_contactEmail", + * // "contactPhone": "my_contactPhone", + * // "customMessage": "my_customMessage", + * // "dpcExtras": "my_dpcExtras", + * // "dpcResourcePath": "my_dpcResourcePath", + * // "isDefault": false, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.customers.configurations.get * @memberOf! () * @@ -1130,6 +1331,47 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.customers.configurations.list * @desc Lists a customer's configurations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.customers.configurations.list({ + * // Required. The customer that manages the listed configurations. An API + * // resource name in the format `customers/[CUSTOMER_ID]`. + * parent: 'customers/my-customer', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "configurations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.customers.configurations.list * @memberOf! () * @@ -1214,6 +1456,79 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.customers.configurations.patch * @desc Updates a configuration's field values. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.customers.configurations.patch({ + * // Output only. The API resource name in the format + * // `customers/[CUSTOMER_ID]/configurations/[CONFIGURATION_ID]`. Assigned by + * // the server. + * name: 'customers/my-customer/configurations/my-configuration', + * // Required. The field mask applied to the target `Configuration` before + * // updating the fields. To learn more about using field masks, read + * // [FieldMask](/protocol-buffers/docs/reference/google.protobuf#fieldmask) in + * // the Protocol Buffers documentation. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "companyName": "my_companyName", + * // "configurationId": "my_configurationId", + * // "configurationName": "my_configurationName", + * // "contactEmail": "my_contactEmail", + * // "contactPhone": "my_contactPhone", + * // "customMessage": "my_customMessage", + * // "dpcExtras": "my_dpcExtras", + * // "dpcResourcePath": "my_dpcResourcePath", + * // "isDefault": false, + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "companyName": "my_companyName", + * // "configurationId": "my_configurationId", + * // "configurationName": "my_configurationName", + * // "contactEmail": "my_contactEmail", + * // "contactPhone": "my_contactPhone", + * // "customMessage": "my_customMessage", + * // "dpcExtras": "my_dpcExtras", + * // "dpcResourcePath": "my_dpcResourcePath", + * // "isDefault": false, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.customers.configurations.patch * @memberOf! () * @@ -1370,6 +1685,56 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.customers.devices.applyConfiguration * @desc 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 boot, or next factory reset. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.customers.devices.applyConfiguration( + * { + * // Required. The customer managing the device. An API resource name in the + * // format `customers/[CUSTOMER_ID]`. + * parent: 'customers/my-customer', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "configuration": "my_configuration", + * // "device": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.customers.devices.applyConfiguration * @memberOf! () * @@ -1444,6 +1809,52 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.customers.devices.get * @desc Gets the details of a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.customers.devices.get({ + * // Required. The device to get. An API resource name in the format + * // `customers/[CUSTOMER_ID]/devices/[DEVICE_ID]`. + * name: 'customers/my-customer/devices/my-device', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "claims": [], + * // "configuration": "my_configuration", + * // "deviceId": "my_deviceId", + * // "deviceIdentifier": {}, + * // "deviceMetadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.customers.devices.get * @memberOf! () * @@ -1514,6 +1925,53 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.customers.devices.list * @desc Lists a customer's devices. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.customers.devices.list({ + * // The maximum number of devices to show in a page of results. + * // Must be between 1 and 100 inclusive. + * pageSize: 'placeholder-value', + * // A token specifying which result page to return. + * pageToken: 'placeholder-value', + * // Required. The customer managing the devices. An API resource name in the + * // format `customers/[CUSTOMER_ID]`. + * parent: 'customers/my-customer', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "devices": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.customers.devices.list * @memberOf! () * @@ -1598,6 +2056,55 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.customers.devices.removeConfiguration * @desc Removes a configuration from device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.customers.devices.removeConfiguration( + * { + * // Required. The customer managing the device in the format + * // `customers/[CUSTOMER_ID]`. + * parent: 'customers/my-customer', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "device": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.customers.devices.removeConfiguration * @memberOf! () * @@ -1671,6 +2178,53 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.customers.devices.unclaim * @desc 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 enrollment again. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.customers.devices.unclaim({ + * // Required. The customer managing the device. An API resource name in the + * // format `customers/[CUSTOMER_ID]`. + * parent: 'customers/my-customer', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "device": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.customers.devices.unclaim * @memberOf! () * @@ -1836,6 +2390,47 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.customers.dpcs.list * @desc Lists the DPCs (device policy controllers) that support zero-touch enrollment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.customers.dpcs.list({ + * // Required. The customer that can use the DPCs in configurations. An API + * // resource name in the format `customers/[CUSTOMER_ID]`. + * parent: 'customers/my-customer', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dpcs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.customers.dpcs.list * @memberOf! () * @@ -1930,6 +2525,50 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.operations.get({ + * // The name of the operation resource. + * name: 'operations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.operations.get * @memberOf! () * @@ -2033,6 +2672,60 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.partners.customers.create * @desc 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 zero-touch enrollment portal. The customer receives an email that welcomes them to zero-touch enrollment and explains how to sign into the portal. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.partners.customers.create({ + * // Required. The parent resource ID in the format `partners/[PARTNER_ID]` that + * // identifies the reseller. + * parent: 'partners/my-partner', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "customer": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adminEmails": [], + * // "companyId": "my_companyId", + * // "companyName": "my_companyName", + * // "name": "my_name", + * // "ownerEmails": [], + * // "termsStatus": "my_termsStatus" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.partners.customers.create * @memberOf! () * @@ -2107,6 +2800,53 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.partners.customers.list * @desc 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 themselves using the portal. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.partners.customers.list({ + * // The maximum number of results to be returned. If not specified or 0, all + * // the records are returned. + * pageSize: 'placeholder-value', + * // A token identifying a page of results returned by the server. + * pageToken: 'placeholder-value', + * // Required. The ID of the reseller partner. + * partnerId: '[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "customers": [], + * // "nextPageToken": "my_nextPageToken", + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.partners.customers.list * @memberOf! () * @@ -2231,6 +2971,58 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.partners.devices.claim * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.partners.devices.claim({ + * // Required. The ID of the reseller partner. + * partnerId: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "customerId": "my_customerId", + * // "deviceIdentifier": {}, + * // "deviceMetadata": {}, + * // "sectionType": "my_sectionType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deviceId": "my_deviceId", + * // "deviceName": "my_deviceName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.partners.devices.claim * @memberOf! () * @@ -2307,6 +3099,58 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.partners.devices.claimAsync * @desc Claims a batch of devices for a customer asynchronously. Adds the devices to zero-touch enrollment. To learn more, read [Long‑running batch operations](/zero-touch/guides/how-it-works#operations). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.partners.devices.claimAsync({ + * // Required. The ID of the reseller partner. + * partnerId: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "claims": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.partners.devices.claimAsync * @memberOf! () * @@ -2382,6 +3226,60 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.partners.devices.findByIdentifier * @desc Finds devices by hardware identifiers, such as IMEI. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.partners.devices.findByIdentifier( + * { + * // Required. The ID of the reseller partner. + * partnerId: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deviceIdentifier": {}, + * // "limit": "my_limit", + * // "pageToken": "my_pageToken" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "devices": [], + * // "nextPageToken": "my_nextPageToken", + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.partners.devices.findByIdentifier * @memberOf! () * @@ -2474,6 +3372,59 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.partners.devices.findByOwner * @desc 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 other resellers don't appear in the results. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.partners.devices.findByOwner({ + * // Required. The ID of the reseller partner. + * partnerId: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "customerId": [], + * // "limit": "my_limit", + * // "pageToken": "my_pageToken", + * // "sectionType": "my_sectionType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "devices": [], + * // "nextPageToken": "my_nextPageToken", + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.partners.devices.findByOwner * @memberOf! () * @@ -2556,6 +3507,52 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.partners.devices.get * @desc Gets a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.partners.devices.get({ + * // Required. The device API resource name in the format + * // `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. + * name: 'partners/my-partner/devices/my-device', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "claims": [], + * // "configuration": "my_configuration", + * // "deviceId": "my_deviceId", + * // "deviceIdentifier": {}, + * // "deviceMetadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.partners.devices.get * @memberOf! () * @@ -2626,6 +3623,56 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.partners.devices.metadata * @desc Updates reseller metadata associated with the device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.partners.devices.metadata({ + * // Required. The ID of the device. + * deviceId: '[^/]+', + * // Required. The owner of the newly set metadata. Set this to the partner ID. + * metadataOwnerId: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deviceMetadata": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.partners.devices.metadata * @memberOf! () * @@ -2703,6 +3750,56 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.partners.devices.unclaim * @desc Unclaims a device from a customer and removes it from zero-touch enrollment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.partners.devices.unclaim({ + * // Required. The ID of the reseller partner. + * partnerId: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deviceId": "my_deviceId", + * // "deviceIdentifier": {}, + * // "sectionType": "my_sectionType", + * // "vacationModeDays": 0, + * // "vacationModeExpireTime": "my_vacationModeExpireTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.partners.devices.unclaim * @memberOf! () * @@ -2776,6 +3873,58 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.partners.devices.unclaimAsync * @desc Unclaims a batch of devices for a customer asynchronously. Removes the devices from zero-touch enrollment. To learn more, read [Long‑running batch operations](/zero-touch/guides/how-it-works#operations). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.partners.devices.unclaimAsync({ + * // Required. The reseller partner ID. + * partnerId: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "unclaims": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.partners.devices.unclaimAsync * @memberOf! () * @@ -2851,6 +4000,60 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.partners.devices.updateMetadataAsync * @desc 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 [Long‑running batch operations](/zero-touch/guides/how-it-works#operations). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.partners.devices.updateMetadataAsync( + * { + * // Required. The reseller partner ID. + * partnerId: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "updates": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.partners.devices.updateMetadataAsync * @memberOf! () * @@ -3088,6 +4291,52 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.partners.vendors.list * @desc Lists the vendors of the partner. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.partners.vendors.list({ + * // The maximum number of results to be returned. + * pageSize: 'placeholder-value', + * // A token identifying a page of results returned by the server. + * pageToken: 'placeholder-value', + * // Required. The resource name in the format `partners/[PARTNER_ID]`. + * parent: 'partners/my-partner', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "totalSize": 0, + * // "vendors": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.partners.vendors.list * @memberOf! () * @@ -3193,6 +4442,53 @@ export namespace androiddeviceprovisioning_v1 { /** * androiddeviceprovisioning.partners.vendors.customers.list * @desc Lists the customers of the vendor. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androiddeviceprovisioning.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 androiddeviceprovisioning = google.androiddeviceprovisioning('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: [], + * }); + * + * // 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 androiddeviceprovisioning.partners.vendors.customers.list({ + * // The maximum number of results to be returned. + * pageSize: 'placeholder-value', + * // A token identifying a page of results returned by the server. + * pageToken: 'placeholder-value', + * // Required. The resource name in the format + * // `partners/[PARTNER_ID]/vendors/[VENDOR_ID]`. + * parent: 'partners/my-partner/vendors/my-vendor', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "customers": [], + * // "nextPageToken": "my_nextPageToken", + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androiddeviceprovisioning.partners.vendors.customers.list * @memberOf! () * diff --git a/src/apis/androidenterprise/v1.ts b/src/apis/androidenterprise/v1.ts index 28548174d08..00c13316b10 100644 --- a/src/apis/androidenterprise/v1.ts +++ b/src/apis/androidenterprise/v1.ts @@ -1563,6 +1563,45 @@ export namespace androidenterprise_v1 { /** * androidenterprise.devices.forceReportUpload * @desc Uploads a report containing any changes in app states on the device since the last report was generated. You can call this method up to 3 times every 24 hours for a given device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.devices.forceReportUpload({ + * // The ID of the device. + * deviceId: 'placeholder-value', + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.devices.forceReportUpload * @memberOf! () * @@ -1637,6 +1676,54 @@ export namespace androidenterprise_v1 { /** * androidenterprise.devices.get * @desc Retrieves the details of a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.devices.get({ + * // The ID of the device. + * deviceId: 'placeholder-value', + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "androidId": "my_androidId", + * // "kind": "my_kind", + * // "managementType": "my_managementType", + * // "policy": {}, + * // "report": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.devices.get * @memberOf! () * @@ -1710,6 +1797,51 @@ export namespace androidenterprise_v1 { /** * androidenterprise.devices.getState * @desc Retrieves whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.devices.getState({ + * // The ID of the device. + * deviceId: 'placeholder-value', + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountState": "my_accountState", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.devices.getState * @memberOf! () * @@ -1785,6 +1917,49 @@ export namespace androidenterprise_v1 { /** * androidenterprise.devices.list * @desc Retrieves the IDs of all of a user's devices. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.devices.list({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "device": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.devices.list * @memberOf! () * @@ -1859,6 +2034,60 @@ export namespace androidenterprise_v1 { /** * androidenterprise.devices.setState * @desc Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.devices.setState({ + * // The ID of the device. + * deviceId: 'placeholder-value', + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountState": "my_accountState", + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountState": "my_accountState", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.devices.setState * @memberOf! () * @@ -1935,6 +2164,70 @@ export namespace androidenterprise_v1 { /** * androidenterprise.devices.update * @desc Updates the device policy + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.devices.update({ + * // The ID of the device. + * deviceId: 'placeholder-value', + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // Mask that identifies which fields to update. If not set, all modifiable fields will be modified. + * // + * // When set in a query parameter, this field should be specified as updateMask=,,... + * updateMask: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "androidId": "my_androidId", + * // "kind": "my_kind", + * // "managementType": "my_managementType", + * // "policy": {}, + * // "report": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "androidId": "my_androidId", + * // "kind": "my_kind", + * // "managementType": "my_managementType", + * // "policy": {}, + * // "report": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.devices.update * @memberOf! () * @@ -2143,6 +2436,41 @@ export namespace androidenterprise_v1 { /** * androidenterprise.enterprises.acknowledgeNotificationSet * @desc Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.enterprises.acknowledgeNotificationSet({ + * // The notification set ID as returned by Enterprises.PullNotificationSet. This must be provided. + * notificationSetId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.enterprises.acknowledgeNotificationSet * @memberOf! () * @@ -2215,6 +2543,52 @@ export namespace androidenterprise_v1 { /** * androidenterprise.enterprises.completeSignup * @desc Completes the signup flow, by specifying the Completion token and Enterprise token. This request must not be called multiple times for a given Enterprise Token. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.enterprises.completeSignup({ + * // The Completion token initially returned by GenerateSignupUrl. + * completionToken: 'placeholder-value', + * // The Enterprise token appended to the Callback URL. + * enterpriseToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "administrator": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "primaryDomain": "my_primaryDomain" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.enterprises.completeSignup * @memberOf! () * @@ -2289,6 +2663,62 @@ export namespace androidenterprise_v1 { /** * androidenterprise.enterprises.createWebToken * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.enterprises.createWebToken({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "managedConfigurations": {}, + * // "parent": "my_parent", + * // "permission": [], + * // "playSearch": {}, + * // "privateApps": {}, + * // "storeBuilder": {}, + * // "webApps": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "token": "my_token" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.enterprises.createWebToken * @memberOf! () * @@ -2368,6 +2798,62 @@ export namespace androidenterprise_v1 { /** * androidenterprise.enterprises.enroll * @desc Enrolls an enterprise with the calling EMM. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.enterprises.enroll({ + * // The token provided by the enterprise to register the EMM. + * token: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "administrator": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "primaryDomain": "my_primaryDomain" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "administrator": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "primaryDomain": "my_primaryDomain" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.enterprises.enroll * @memberOf! () * @@ -2443,6 +2929,49 @@ export namespace androidenterprise_v1 { /** * androidenterprise.enterprises.generateSignupUrl * @desc Generates a sign-up URL. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.enterprises.generateSignupUrl({ + * // The callback URL to which the Admin will be redirected after successfully creating an enterprise. Before redirecting there the system will add a single query parameter to this URL named "enterpriseToken" which will contain an opaque token to be used for the CompleteSignup request. + * // Beware that this means that the URL will be parsed, the parameter added and then a new URL formatted, i.e. there may be some minor formatting changes and, more importantly, the URL must be well-formed so that it can be parsed. + * callbackUrl: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "completionToken": "my_completionToken", + * // "kind": "my_kind", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.enterprises.generateSignupUrl * @memberOf! () * @@ -2516,6 +3045,50 @@ export namespace androidenterprise_v1 { /** * androidenterprise.enterprises.get * @desc Retrieves the name and domain of an enterprise. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.enterprises.get({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "administrator": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "primaryDomain": "my_primaryDomain" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.enterprises.get * @memberOf! () * @@ -2588,6 +3161,50 @@ export namespace androidenterprise_v1 { /** * androidenterprise.enterprises.getServiceAccount * @desc Returns a service account and credentials. The service account can be bound to the enterprise by calling setAccount. The service account is unique to this enterprise and EMM, and will be deleted if the enterprise is unbound. The credentials contain private key data and are not stored server-side. This method can only be called after calling Enterprises.Enroll or Enterprises.CompleteSignup, and before Enterprises.SetAccount; at other times it will return an error. Subsequent calls after the first will generate a new, unique set of credentials, and invalidate the previously generated credentials. Once the service account is bound to the enterprise, it can be managed using the serviceAccountKeys resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.enterprises.getServiceAccount({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The type of credential to return with the service account. Required. + * keyType: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "key": {}, + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.enterprises.getServiceAccount * @memberOf! () * @@ -2665,6 +3282,48 @@ export namespace androidenterprise_v1 { /** * androidenterprise.enterprises.getStoreLayout * @desc Returns the store layout for the enterprise. If the store layout has not been set, returns "basic" as the store layout type and no homepage. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.enterprises.getStoreLayout({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "homepageId": "my_homepageId", + * // "kind": "my_kind", + * // "storeLayoutType": "my_storeLayoutType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.enterprises.getStoreLayout * @memberOf! () * @@ -2739,6 +3398,47 @@ export namespace androidenterprise_v1 { /** * androidenterprise.enterprises.list * @desc Looks up an enterprise by domain name. This is only supported for enterprises created via the Google-initiated creation flow. Lookup of the id is not needed for enterprises created via the EMM-initiated flow since the EMM learns the enterprise ID in the callback specified in the Enterprises.generateSignupUrl call. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.enterprises.list({ + * // The exact primary domain name of the enterprise to look up. + * domain: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "enterprise": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.enterprises.list * @memberOf! () * @@ -2814,6 +3514,51 @@ export namespace androidenterprise_v1 { /** * androidenterprise.enterprises.pullNotificationSet * @desc Pulls and returns a notification set for the enterprises associated with the service account authenticated for the request. The notification set may be empty if no notification are pending. A notification set returned needs to be acknowledged within 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless the notification set is empty. Notifications that are not acknowledged within the 20 seconds will eventually be included again in the response to another PullNotificationSet request, and those that are never acknowledged will ultimately be deleted according to the Google Cloud Platform Pub/Sub system policy. Multiple requests might be performed concurrently to retrieve notifications, in which case the pending notifications (if any) will be split among each caller, if any are pending. If no notifications are present, an empty notification list is returned. Subsequent requests may return more notifications once they become available. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.enterprises.pullNotificationSet({ + * // 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. + * requestMode: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "notification": [], + * // "notificationSetId": "my_notificationSetId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.enterprises.pullNotificationSet * @memberOf! () * @@ -2889,6 +3634,47 @@ export namespace androidenterprise_v1 { /** * androidenterprise.enterprises.sendTestPushNotification * @desc Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.enterprises.sendTestPushNotification({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "messageId": "my_messageId", + * // "topicName": "my_topicName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.enterprises.sendTestPushNotification * @memberOf! () * @@ -2988,6 +3774,56 @@ export namespace androidenterprise_v1 { /** * androidenterprise.enterprises.setAccount * @desc Sets the account that will be used to authenticate to the API as the enterprise. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.enterprises.setAccount({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountEmail": "my_accountEmail", + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountEmail": "my_accountEmail", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.enterprises.setAccount * @memberOf! () * @@ -3063,6 +3899,58 @@ export namespace androidenterprise_v1 { /** * androidenterprise.enterprises.setStoreLayout * @desc Sets the store layout for the enterprise. By default, storeLayoutType is set to "basic" and the basic store layout is enabled. The basic layout only contains apps approved by the admin, and that have been added to the available product set for a user (using the setAvailableProductSet call). Apps on the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = "custom" and setting a homepage), the basic store layout is disabled. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.enterprises.setStoreLayout({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "homepageId": "my_homepageId", + * // "kind": "my_kind", + * // "storeLayoutType": "my_storeLayoutType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "homepageId": "my_homepageId", + * // "kind": "my_kind", + * // "storeLayoutType": "my_storeLayoutType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.enterprises.setStoreLayout * @memberOf! () * @@ -3138,6 +4026,41 @@ export namespace androidenterprise_v1 { /** * androidenterprise.enterprises.unenroll * @desc Unenrolls an enterprise from the calling EMM. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.enterprises.unenroll({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.enterprises.unenroll * @memberOf! () * @@ -3412,6 +4335,45 @@ export namespace androidenterprise_v1 { /** * androidenterprise.entitlements.delete * @desc Removes an entitlement to an app for a user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.entitlements.delete({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". + * entitlementId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.entitlements.delete * @memberOf! () * @@ -3486,6 +4448,52 @@ export namespace androidenterprise_v1 { /** * androidenterprise.entitlements.get * @desc Retrieves details of an entitlement. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.entitlements.get({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". + * entitlementId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "productId": "my_productId", + * // "reason": "my_reason" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.entitlements.get * @memberOf! () * @@ -3561,6 +4569,49 @@ export namespace androidenterprise_v1 { /** * androidenterprise.entitlements.list * @desc Lists all entitlements for the specified user. Only the ID is set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.entitlements.list({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entitlement": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.entitlements.list * @memberOf! () * @@ -3638,6 +4689,64 @@ export namespace androidenterprise_v1 { /** * androidenterprise.entitlements.update * @desc Adds or updates an entitlement to an app for a user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.entitlements.update({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". + * entitlementId: 'placeholder-value', + * // Set to true to also install the product on all the user's devices where possible. Failure to install on one or more devices will not prevent this operation from returning successfully, as long as the entitlement was successfully assigned to the user. + * install: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "productId": "my_productId", + * // "reason": "my_reason" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "productId": "my_productId", + * // "reason": "my_reason" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.entitlements.update * @memberOf! () * @@ -3808,6 +4917,54 @@ export namespace androidenterprise_v1 { /** * androidenterprise.grouplicenses.get * @desc Retrieves details of an enterprise's group license for a product. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.grouplicenses.get({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the product the group license is for, e.g. "app:com.google.android.gm". + * groupLicenseId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acquisitionKind": "my_acquisitionKind", + * // "approval": "my_approval", + * // "kind": "my_kind", + * // "numProvisioned": 0, + * // "numPurchased": 0, + * // "permissions": "my_permissions", + * // "productId": "my_productId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.grouplicenses.get * @memberOf! () * @@ -3883,6 +5040,47 @@ export namespace androidenterprise_v1 { /** * androidenterprise.grouplicenses.list * @desc Retrieves IDs of all products for which the enterprise has a group license. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.grouplicenses.list({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "groupLicense": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.grouplicenses.list * @memberOf! () * @@ -4000,6 +5198,49 @@ export namespace androidenterprise_v1 { /** * androidenterprise.grouplicenseusers.list * @desc Retrieves the IDs of the users who have been granted entitlements under the license. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.grouplicenseusers.list({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the product the group license is for, e.g. "app:com.google.android.gm". + * groupLicenseId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "user": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.grouplicenseusers.list * @memberOf! () * @@ -4108,6 +5349,47 @@ export namespace androidenterprise_v1 { /** * androidenterprise.installs.delete * @desc Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.installs.delete({ + * // The Android ID of the device. + * deviceId: 'placeholder-value', + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the product represented by the install, e.g. "app:com.google.android.gm". + * installId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.installs.delete * @memberOf! () * @@ -4182,6 +5464,55 @@ export namespace androidenterprise_v1 { /** * androidenterprise.installs.get * @desc Retrieves details of an installation of an app on a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.installs.get({ + * // The Android ID of the device. + * deviceId: 'placeholder-value', + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the product represented by the install, e.g. "app:com.google.android.gm". + * installId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "installState": "my_installState", + * // "kind": "my_kind", + * // "productId": "my_productId", + * // "versionCode": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.installs.get * @memberOf! () * @@ -4256,6 +5587,51 @@ export namespace androidenterprise_v1 { /** * androidenterprise.installs.list * @desc Retrieves the details of all apps installed on the specified device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.installs.list({ + * // The Android ID of the device. + * deviceId: 'placeholder-value', + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "install": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.installs.list * @memberOf! () * @@ -4333,6 +5709,66 @@ export namespace androidenterprise_v1 { /** * androidenterprise.installs.update * @desc Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.installs.update({ + * // The Android ID of the device. + * deviceId: 'placeholder-value', + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the product represented by the install, e.g. "app:com.google.android.gm". + * installId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "installState": "my_installState", + * // "kind": "my_kind", + * // "productId": "my_productId", + * // "versionCode": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "installState": "my_installState", + * // "kind": "my_kind", + * // "productId": "my_productId", + * // "versionCode": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.installs.update * @memberOf! () * @@ -4509,6 +5945,47 @@ export namespace androidenterprise_v1 { /** * androidenterprise.managedconfigurationsfordevice.delete * @desc Removes a per-device managed configuration for an app for the specified device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.managedconfigurationsfordevice.delete({ + * // The Android ID of the device. + * deviceId: 'placeholder-value', + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". + * managedConfigurationForDeviceId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.managedconfigurationsfordevice.delete * @memberOf! () * @@ -4594,6 +6071,55 @@ export namespace androidenterprise_v1 { /** * androidenterprise.managedconfigurationsfordevice.get * @desc Retrieves details of a per-device managed configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.managedconfigurationsfordevice.get({ + * // The Android ID of the device. + * deviceId: 'placeholder-value', + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". + * managedConfigurationForDeviceId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "configurationVariables": {}, + * // "kind": "my_kind", + * // "managedProperty": [], + * // "productId": "my_productId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.managedconfigurationsfordevice.get * @memberOf! () * @@ -4683,6 +6209,51 @@ export namespace androidenterprise_v1 { /** * androidenterprise.managedconfigurationsfordevice.list * @desc Lists all the per-device managed configurations for the specified device. Only the ID is set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.managedconfigurationsfordevice.list({ + * // The Android ID of the device. + * deviceId: 'placeholder-value', + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "managedConfigurationForDevice": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.managedconfigurationsfordevice.list * @memberOf! () * @@ -4782,6 +6353,66 @@ export namespace androidenterprise_v1 { /** * androidenterprise.managedconfigurationsfordevice.update * @desc Adds or updates a per-device managed configuration for an app for the specified device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.managedconfigurationsfordevice.update({ + * // The Android ID of the device. + * deviceId: 'placeholder-value', + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". + * managedConfigurationForDeviceId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "configurationVariables": {}, + * // "kind": "my_kind", + * // "managedProperty": [], + * // "productId": "my_productId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "configurationVariables": {}, + * // "kind": "my_kind", + * // "managedProperty": [], + * // "productId": "my_productId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.managedconfigurationsfordevice.update * @memberOf! () * @@ -4977,6 +6608,45 @@ export namespace androidenterprise_v1 { /** * androidenterprise.managedconfigurationsforuser.delete * @desc Removes a per-user managed configuration for an app for the specified user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.managedconfigurationsforuser.delete({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". + * managedConfigurationForUserId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.managedconfigurationsforuser.delete * @memberOf! () * @@ -5055,8 +6725,55 @@ export namespace androidenterprise_v1 { /** * androidenterprise.managedconfigurationsforuser.get * @desc Retrieves details of a per-user managed configuration for an app for the specified user. - * @alias androidenterprise.managedconfigurationsforuser.get - * @memberOf! () + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.managedconfigurationsforuser.get({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". + * managedConfigurationForUserId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "configurationVariables": {}, + * // "kind": "my_kind", + * // "managedProperty": [], + * // "productId": "my_productId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias androidenterprise.managedconfigurationsforuser.get + * @memberOf! () * * @param {object} params Parameters for request * @param {string} params.enterpriseId The ID of the enterprise. @@ -5137,6 +6854,49 @@ export namespace androidenterprise_v1 { /** * androidenterprise.managedconfigurationsforuser.list * @desc Lists all the per-user managed configurations for the specified user. Only the ID is set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.managedconfigurationsforuser.list({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "managedConfigurationForUser": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.managedconfigurationsforuser.list * @memberOf! () * @@ -5229,6 +6989,64 @@ export namespace androidenterprise_v1 { /** * androidenterprise.managedconfigurationsforuser.update * @desc Adds or updates the managed configuration settings for an app for the specified user. If you support the Managed configurations iframe, you can apply managed configurations to a user by specifying an mcmId and its associated configuration variables (if any) in the request. Alternatively, all EMMs can apply managed configurations by passing a list of managed properties. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.managedconfigurationsforuser.update({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". + * managedConfigurationForUserId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "configurationVariables": {}, + * // "kind": "my_kind", + * // "managedProperty": [], + * // "productId": "my_productId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "configurationVariables": {}, + * // "kind": "my_kind", + * // "managedProperty": [], + * // "productId": "my_productId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.managedconfigurationsforuser.update * @memberOf! () * @@ -5401,6 +7219,49 @@ export namespace androidenterprise_v1 { /** * androidenterprise.managedconfigurationssettings.list * @desc Lists all the managed configurations settings for the specified app. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.managedconfigurationssettings.list({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the product for which the managed configurations settings applies to. + * productId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "managedConfigurationsSettings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.managedconfigurationssettings.list * @memberOf! () * @@ -5523,6 +7384,51 @@ export namespace androidenterprise_v1 { /** * androidenterprise.permissions.get * @desc Retrieves details of an Android app permission for display to an enterprise admin. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.permissions.get({ + * // The BCP47 tag for the user's preferred language (e.g. "en-US", "de") + * language: 'placeholder-value', + * // The ID of the permission. + * permissionId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "kind": "my_kind", + * // "name": "my_name", + * // "permissionId": "my_permissionId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.permissions.get * @memberOf! () * @@ -5619,6 +7525,52 @@ export namespace androidenterprise_v1 { /** * androidenterprise.products.approve * @desc Approves the specified product and the relevant app permissions, if any. The maximum number of products that you can approve per enterprise customer is 1,000. To learn how to use managed Google Play to design and create a store layout to display approved products to your users, see Store Layout Design. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.products.approve({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the product. + * productId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "approvalUrlInfo": {}, + * // "approvedPermissions": "my_approvedPermissions" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.products.approve * @memberOf! () * @@ -5692,6 +7644,50 @@ export namespace androidenterprise_v1 { /** * androidenterprise.products.generateApprovalUrl * @desc Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product. Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.products.generateApprovalUrl({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance "en-US". + * languageCode: 'placeholder-value', + * // The ID of the product. + * productId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.products.generateApprovalUrl * @memberOf! () * @@ -5779,6 +7775,74 @@ export namespace androidenterprise_v1 { /** * androidenterprise.products.get * @desc Retrieves details of a product for display to an enterprise admin. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.products.get({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). + * language: 'placeholder-value', + * // The ID of the product, e.g. "app:com.google.android.gm". + * productId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appTracks": [], + * // "appVersion": [], + * // "authorName": "my_authorName", + * // "availableCountries": [], + * // "availableTracks": [], + * // "category": "my_category", + * // "contentRating": "my_contentRating", + * // "description": "my_description", + * // "detailsUrl": "my_detailsUrl", + * // "distributionChannel": "my_distributionChannel", + * // "features": [], + * // "iconUrl": "my_iconUrl", + * // "kind": "my_kind", + * // "lastUpdatedTimestampMillis": "my_lastUpdatedTimestampMillis", + * // "minAndroidSdkVersion": 0, + * // "permissions": [], + * // "productId": "my_productId", + * // "productPricing": "my_productPricing", + * // "recentChanges": "my_recentChanges", + * // "requiresContainerApp": false, + * // "screenshotUrls": [], + * // "signingCertificate": {}, + * // "smallIconUrl": "my_smallIconUrl", + * // "title": "my_title", + * // "workDetailsUrl": "my_workDetailsUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.products.get * @memberOf! () * @@ -5852,6 +7916,51 @@ export namespace androidenterprise_v1 { /** * androidenterprise.products.getAppRestrictionsSchema * @desc Retrieves the schema that defines the configurable properties for this product. All products have a schema, but this schema may be empty if no managed configurations have been defined. This schema can be used to populate a UI that allows an admin to configure the product. To apply a managed configuration based on the schema obtained using this API, see Managed Configurations through Play. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.products.getAppRestrictionsSchema({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). + * language: 'placeholder-value', + * // The ID of the product. + * productId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "restrictions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.products.getAppRestrictionsSchema * @memberOf! () * @@ -5932,6 +8041,50 @@ export namespace androidenterprise_v1 { /** * androidenterprise.products.getPermissions * @desc Retrieves the Android app permissions required by this app. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.products.getPermissions({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the product. + * productId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "permission": [], + * // "productId": "my_productId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.products.getPermissions * @memberOf! () * @@ -6009,6 +8162,59 @@ export namespace androidenterprise_v1 { /** * androidenterprise.products.list * @desc Finds approved products that match a query, or all approved products if there is no query. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.products.list({ + * // Specifies whether to search among all products (false) or among only products that have been approved (true). Only "true" is supported, and should be specified. + * approved: 'placeholder-value', + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). Results are returned in the language best matching the preferred language. + * language: 'placeholder-value', + * // Specifies the maximum number of products that can be returned per request. If not specified, uses a default value of 100, which is also the maximum retrievable within a single response. + * maxResults: 'placeholder-value', + * // The search query as typed in the Google Play store search box. If omitted, all approved apps will be returned (using the pagination parameters), including apps that are not available in the store (e.g. unpublished apps). + * query: 'placeholder-value', + * // A pagination token is contained in a request's response when there are more products. The token can be used in a subsequent request to obtain more products, and so forth. This parameter cannot be used in the initial request. + * token: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "pageInfo": {}, + * // "product": [], + * // "tokenPagination": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.products.list * @memberOf! () * @@ -6089,6 +8295,43 @@ export namespace androidenterprise_v1 { /** * androidenterprise.products.unapprove * @desc Unapproves the specified product (and the relevant app permissions, if any) + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.products.unapprove({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the product. + * productId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.products.unapprove * @memberOf! () * @@ -6312,6 +8555,43 @@ export namespace androidenterprise_v1 { /** * androidenterprise.serviceaccountkeys.delete * @desc Removes and invalidates the specified credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.serviceaccountkeys.delete({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the key. + * keyId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.serviceaccountkeys.delete * @memberOf! () * @@ -6385,6 +8665,62 @@ export namespace androidenterprise_v1 { /** * androidenterprise.serviceaccountkeys.insert * @desc Generates new credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. Only the type of the key should be populated in the resource to be inserted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.serviceaccountkeys.insert({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "data": "my_data", + * // "id": "my_id", + * // "kind": "my_kind", + * // "publicData": "my_publicData", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "data": "my_data", + * // "id": "my_id", + * // "kind": "my_kind", + * // "publicData": "my_publicData", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.serviceaccountkeys.insert * @memberOf! () * @@ -6460,6 +8796,46 @@ export namespace androidenterprise_v1 { /** * androidenterprise.serviceaccountkeys.list * @desc Lists all active credentials for the service account associated with this enterprise. Only the ID and key type are returned. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.serviceaccountkeys.list({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "serviceAccountKey": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.serviceaccountkeys.list * @memberOf! () * @@ -6596,6 +8972,45 @@ export namespace androidenterprise_v1 { /** * androidenterprise.storelayoutclusters.delete * @desc Deletes a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.storelayoutclusters.delete({ + * // The ID of the cluster. + * clusterId: 'placeholder-value', + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the page. + * pageId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.storelayoutclusters.delete * @memberOf! () * @@ -6670,6 +9085,54 @@ export namespace androidenterprise_v1 { /** * androidenterprise.storelayoutclusters.get * @desc Retrieves details of a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.storelayoutclusters.get({ + * // The ID of the cluster. + * clusterId: 'placeholder-value', + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the page. + * pageId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": [], + * // "orderInPage": "my_orderInPage", + * // "productId": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.storelayoutclusters.get * @memberOf! () * @@ -6746,6 +9209,64 @@ export namespace androidenterprise_v1 { /** * androidenterprise.storelayoutclusters.insert * @desc Inserts a new cluster in a page. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.storelayoutclusters.insert({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the page. + * pageId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": [], + * // "orderInPage": "my_orderInPage", + * // "productId": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": [], + * // "orderInPage": "my_orderInPage", + * // "productId": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.storelayoutclusters.insert * @memberOf! () * @@ -6822,6 +9343,49 @@ export namespace androidenterprise_v1 { /** * androidenterprise.storelayoutclusters.list * @desc Retrieves the details of all clusters on the specified page. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.storelayoutclusters.list({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the page. + * pageId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cluster": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.storelayoutclusters.list * @memberOf! () * @@ -6906,6 +9470,66 @@ export namespace androidenterprise_v1 { /** * androidenterprise.storelayoutclusters.update * @desc Updates a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.storelayoutclusters.update({ + * // The ID of the cluster. + * clusterId: 'placeholder-value', + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the page. + * pageId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": [], + * // "orderInPage": "my_orderInPage", + * // "productId": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": [], + * // "orderInPage": "my_orderInPage", + * // "productId": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.storelayoutclusters.update * @memberOf! () * @@ -7093,6 +9717,43 @@ export namespace androidenterprise_v1 { /** * androidenterprise.storelayoutpages.delete * @desc Deletes a store page. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.storelayoutpages.delete({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the page. + * pageId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.storelayoutpages.delete * @memberOf! () * @@ -7166,6 +9827,51 @@ export namespace androidenterprise_v1 { /** * androidenterprise.storelayoutpages.get * @desc Retrieves details of a store page. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.storelayoutpages.get({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the page. + * pageId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "link": [], + * // "name": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.storelayoutpages.get * @memberOf! () * @@ -7241,6 +9947,60 @@ export namespace androidenterprise_v1 { /** * androidenterprise.storelayoutpages.insert * @desc Inserts a new store page. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.storelayoutpages.insert({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "link": [], + * // "name": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "link": [], + * // "name": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.storelayoutpages.insert * @memberOf! () * @@ -7316,6 +10076,47 @@ export namespace androidenterprise_v1 { /** * androidenterprise.storelayoutpages.list * @desc Retrieves the details of all pages in the store. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.storelayoutpages.list({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "page": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.storelayoutpages.list * @memberOf! () * @@ -7399,6 +10200,62 @@ export namespace androidenterprise_v1 { /** * androidenterprise.storelayoutpages.update * @desc Updates the content of a store page. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.storelayoutpages.update({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the page. + * pageId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "link": [], + * // "name": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "link": [], + * // "name": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.storelayoutpages.update * @memberOf! () * @@ -7565,6 +10422,43 @@ export namespace androidenterprise_v1 { /** * androidenterprise.users.delete * @desc Deleted an EMM-managed user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.users.delete({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.users.delete * @memberOf! () * @@ -7637,6 +10531,49 @@ export namespace androidenterprise_v1 { /** * androidenterprise.users.generateAuthenticationToken * @desc Generates an authentication token which the device policy client can use to provision the given EMM-managed user account on a device. The generated token is single-use and expires after a few minutes. You can provision a maximum of 10 devices per user. This call only works with EMM-managed accounts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.users.generateAuthenticationToken({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "token": "my_token" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.users.generateAuthenticationToken * @memberOf! () * @@ -7714,6 +10651,50 @@ export namespace androidenterprise_v1 { /** * androidenterprise.users.generateToken * @desc Generates a token (activation code) to allow this user to configure their managed account in the Android Setup Wizard. Revokes any previously generated token. This call only works with Google managed accounts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.users.generateToken({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "token": "my_token", + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.users.generateToken * @memberOf! () * @@ -7789,6 +10770,54 @@ export namespace androidenterprise_v1 { /** * androidenterprise.users.get * @desc Retrieves a user's details. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.users.get({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountIdentifier": "my_accountIdentifier", + * // "accountType": "my_accountType", + * // "displayName": "my_displayName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "managementType": "my_managementType", + * // "primaryEmail": "my_primaryEmail" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.users.get * @memberOf! () * @@ -7861,6 +10890,51 @@ export namespace androidenterprise_v1 { /** * androidenterprise.users.getAvailableProductSet * @desc Retrieves the set of products a user is entitled to access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.users.getAvailableProductSet({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "productId": [], + * // "productSetBehavior": "my_productSetBehavior", + * // "productVisibility": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.users.getAvailableProductSet * @memberOf! () * @@ -7938,6 +11012,66 @@ export namespace androidenterprise_v1 { /** * androidenterprise.users.insert * @desc Creates a new EMM-managed user. The Users resource passed in the body of the request should include an accountIdentifier and an accountType. If a corresponding user already exists with the same account identifier, the user will be updated with the resource. In this case only the displayName field can be changed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.users.insert({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountIdentifier": "my_accountIdentifier", + * // "accountType": "my_accountType", + * // "displayName": "my_displayName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "managementType": "my_managementType", + * // "primaryEmail": "my_primaryEmail" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountIdentifier": "my_accountIdentifier", + * // "accountType": "my_accountType", + * // "displayName": "my_displayName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "managementType": "my_managementType", + * // "primaryEmail": "my_primaryEmail" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.users.insert * @memberOf! () * @@ -8009,6 +11143,49 @@ export namespace androidenterprise_v1 { /** * androidenterprise.users.list * @desc Looks up a user by primary email address. This is only supported for Google-managed users. Lookup of the id is not needed for EMM-managed users because the id is already returned in the result of the Users.insert call. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.users.list({ + * // The exact primary email address of the user to look up. + * email: 'placeholder-value', + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "user": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.users.list * @memberOf! () * @@ -8082,6 +11259,43 @@ export namespace androidenterprise_v1 { /** * androidenterprise.users.revokeDeviceAccess * @desc Revokes access to all devices currently provisioned to the user. The user will no longer be able to use the managed Play store on any of their managed devices. This call only works with EMM-managed accounts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.users.revokeDeviceAccess({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.users.revokeDeviceAccess * @memberOf! () * @@ -8155,6 +11369,43 @@ export namespace androidenterprise_v1 { /** * androidenterprise.users.revokeToken * @desc Revokes a previously generated token (activation code) for the user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.users.revokeToken({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.users.revokeToken * @memberOf! () * @@ -8228,6 +11479,62 @@ export namespace androidenterprise_v1 { /** * androidenterprise.users.setAvailableProductSet * @desc Modifies the set of products that a user is entitled to access (referred to as whitelisted products). Only products that are approved or products that were previously approved (products with revoked approval) can be whitelisted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.users.setAvailableProductSet({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "productId": [], + * // "productSetBehavior": "my_productSetBehavior", + * // "productVisibility": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "productId": [], + * // "productSetBehavior": "my_productSetBehavior", + * // "productVisibility": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.users.setAvailableProductSet * @memberOf! () * @@ -8306,6 +11613,68 @@ export namespace androidenterprise_v1 { /** * androidenterprise.users.update * @desc Updates the details of an EMM-managed user. Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the displayName field can be changed. Other fields must either be unset or have the currently active value. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.users.update({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountIdentifier": "my_accountIdentifier", + * // "accountType": "my_accountType", + * // "displayName": "my_displayName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "managementType": "my_managementType", + * // "primaryEmail": "my_primaryEmail" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountIdentifier": "my_accountIdentifier", + * // "accountType": "my_accountType", + * // "displayName": "my_displayName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "managementType": "my_managementType", + * // "primaryEmail": "my_primaryEmail" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.users.update * @memberOf! () * @@ -8569,6 +11938,43 @@ export namespace androidenterprise_v1 { /** * androidenterprise.webapps.delete * @desc Deletes an existing web app. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.webapps.delete({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the web app. + * webAppId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.webapps.delete * @memberOf! () * @@ -8641,6 +12047,54 @@ export namespace androidenterprise_v1 { /** * androidenterprise.webapps.get * @desc Gets an existing web app. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.webapps.get({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the web app. + * webAppId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayMode": "my_displayMode", + * // "icons": [], + * // "isPublished": false, + * // "startUrl": "my_startUrl", + * // "title": "my_title", + * // "versionCode": "my_versionCode", + * // "webAppId": "my_webAppId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.webapps.get * @memberOf! () * @@ -8713,6 +12167,66 @@ export namespace androidenterprise_v1 { /** * androidenterprise.webapps.insert * @desc Creates a new web app for the enterprise. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.webapps.insert({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayMode": "my_displayMode", + * // "icons": [], + * // "isPublished": false, + * // "startUrl": "my_startUrl", + * // "title": "my_title", + * // "versionCode": "my_versionCode", + * // "webAppId": "my_webAppId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayMode": "my_displayMode", + * // "icons": [], + * // "isPublished": false, + * // "startUrl": "my_startUrl", + * // "title": "my_title", + * // "versionCode": "my_versionCode", + * // "webAppId": "my_webAppId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.webapps.insert * @memberOf! () * @@ -8785,6 +12299,47 @@ export namespace androidenterprise_v1 { /** * androidenterprise.webapps.list * @desc Retrieves the details of all web apps for a given enterprise. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.webapps.list({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "webApp": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.webapps.list * @memberOf! () * @@ -8858,6 +12413,68 @@ export namespace androidenterprise_v1 { /** * androidenterprise.webapps.update * @desc Updates an existing web app. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidenterprise.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 androidenterprise = google.androidenterprise('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/androidenterprise'], + * }); + * + * // 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 androidenterprise.webapps.update({ + * // The ID of the enterprise. + * enterpriseId: 'placeholder-value', + * // The ID of the web app. + * webAppId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayMode": "my_displayMode", + * // "icons": [], + * // "isPublished": false, + * // "startUrl": "my_startUrl", + * // "title": "my_title", + * // "versionCode": "my_versionCode", + * // "webAppId": "my_webAppId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayMode": "my_displayMode", + * // "icons": [], + * // "isPublished": false, + * // "startUrl": "my_startUrl", + * // "title": "my_title", + * // "versionCode": "my_versionCode", + * // "webAppId": "my_webAppId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidenterprise.webapps.update * @memberOf! () * diff --git a/src/apis/androidmanagement/v1.ts b/src/apis/androidmanagement/v1.ts index 823e509af6c..606e8696f16 100644 --- a/src/apis/androidmanagement/v1.ts +++ b/src/apis/androidmanagement/v1.ts @@ -1931,6 +1931,74 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.create * @desc Creates an enterprise. This is the last step in the enterprise signup flow. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.create({ + * // The enterprise token appended to the callback URL. + * enterpriseToken: 'placeholder-value', + * // The ID of the Google Cloud Platform project which will own the enterprise. + * projectId: 'placeholder-value', + * // The name of the SignupUrl used to sign up for the enterprise. + * signupUrlName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appAutoApprovalEnabled": false, + * // "enabledNotificationTypes": [], + * // "enterpriseDisplayName": "my_enterpriseDisplayName", + * // "logo": {}, + * // "name": "my_name", + * // "primaryColor": 0, + * // "pubsubTopic": "my_pubsubTopic", + * // "signinDetails": [], + * // "termsAndConditions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appAutoApprovalEnabled": false, + * // "enabledNotificationTypes": [], + * // "enterpriseDisplayName": "my_enterpriseDisplayName", + * // "logo": {}, + * // "name": "my_name", + * // "primaryColor": 0, + * // "pubsubTopic": "my_pubsubTopic", + * // "signinDetails": [], + * // "termsAndConditions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.create * @memberOf! () * @@ -2006,6 +2074,54 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.get * @desc Gets an enterprise. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.get({ + * // The name of the enterprise in the form enterprises/{enterpriseId}. + * name: 'enterprises/my-enterprise', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appAutoApprovalEnabled": false, + * // "enabledNotificationTypes": [], + * // "enterpriseDisplayName": "my_enterpriseDisplayName", + * // "logo": {}, + * // "name": "my_name", + * // "primaryColor": 0, + * // "pubsubTopic": "my_pubsubTopic", + * // "signinDetails": [], + * // "termsAndConditions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.get * @memberOf! () * @@ -2077,6 +2193,72 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.patch * @desc Updates an enterprise. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.patch({ + * // The name of the enterprise in the form enterprises/{enterpriseId}. + * name: 'enterprises/my-enterprise', + * // The field mask indicating the fields to update. If not set, all modifiable fields will be modified. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appAutoApprovalEnabled": false, + * // "enabledNotificationTypes": [], + * // "enterpriseDisplayName": "my_enterpriseDisplayName", + * // "logo": {}, + * // "name": "my_name", + * // "primaryColor": 0, + * // "pubsubTopic": "my_pubsubTopic", + * // "signinDetails": [], + * // "termsAndConditions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appAutoApprovalEnabled": false, + * // "enabledNotificationTypes": [], + * // "enterpriseDisplayName": "my_enterpriseDisplayName", + * // "logo": {}, + * // "name": "my_name", + * // "primaryColor": 0, + * // "pubsubTopic": "my_pubsubTopic", + * // "signinDetails": [], + * // "termsAndConditions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.patch * @memberOf! () * @@ -2216,6 +2398,52 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.applications.get * @desc Gets info about an application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.applications.get({ + * // The preferred language for localized application info, as a BCP47 tag (e.g. "en-US", "de"). If not specified the default language of the application will be used. + * languageCode: 'placeholder-value', + * // The name of the application in the form enterprises/{enterpriseId}/applications/{package_name}. + * name: 'enterprises/my-enterprise/applications/my-application', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appTracks": [], + * // "managedProperties": [], + * // "name": "my_name", + * // "permissions": [], + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.applications.get * @memberOf! () * @@ -2317,6 +2545,48 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.devices.delete * @desc Deletes a device. This operation wipes the device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.devices.delete({ + * // The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}. + * name: 'enterprises/my-enterprise/devices/my-device', + * // Optional flags that control the device wiping behavior. + * wipeDataFlags: 'placeholder-value', + * // Optional. A short message displayed to the user before wiping the work profile on personal devices. This has no effect on company owned devices. The maximum message length is 200 characters. + * wipeReasonMessage: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.devices.delete * @memberOf! () * @@ -2389,6 +2659,77 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.devices.get * @desc Gets a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.devices.get({ + * // The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}. + * name: 'enterprises/my-enterprise/devices/my-device', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiLevel": 0, + * // "applicationReports": [], + * // "appliedPolicyName": "my_appliedPolicyName", + * // "appliedPolicyVersion": "my_appliedPolicyVersion", + * // "appliedState": "my_appliedState", + * // "deviceSettings": {}, + * // "disabledReason": {}, + * // "displays": [], + * // "enrollmentTime": "my_enrollmentTime", + * // "enrollmentTokenData": "my_enrollmentTokenData", + * // "enrollmentTokenName": "my_enrollmentTokenName", + * // "hardwareInfo": {}, + * // "hardwareStatusSamples": [], + * // "lastPolicyComplianceReportTime": "my_lastPolicyComplianceReportTime", + * // "lastPolicySyncTime": "my_lastPolicySyncTime", + * // "lastStatusReportTime": "my_lastStatusReportTime", + * // "managementMode": "my_managementMode", + * // "memoryEvents": [], + * // "memoryInfo": {}, + * // "name": "my_name", + * // "networkInfo": {}, + * // "nonComplianceDetails": [], + * // "policyCompliant": false, + * // "policyName": "my_policyName", + * // "powerManagementEvents": [], + * // "previousDeviceNames": [], + * // "securityPosture": {}, + * // "softwareInfo": {}, + * // "state": "my_state", + * // "systemProperties": {}, + * // "user": {}, + * // "userName": "my_userName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.devices.get * @memberOf! () * @@ -2459,6 +2800,64 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.devices.issueCommand * @desc Issues a command to a device. The Operation resource returned contains a Command in its metadata field. Use the get operation method to get the status of the command. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.devices.issueCommand({ + * // The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}. + * name: 'enterprises/my-enterprise/devices/my-device', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "duration": "my_duration", + * // "errorCode": "my_errorCode", + * // "newPassword": "my_newPassword", + * // "resetPasswordFlags": [], + * // "type": "my_type", + * // "userName": "my_userName" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.devices.issueCommand * @memberOf! () * @@ -2535,6 +2934,51 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.devices.list * @desc Lists devices for a given enterprise. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.devices.list({ + * // The requested page size. The actual page size may be fixed to a min or max value. + * pageSize: 'placeholder-value', + * // A token identifying a page of results returned by the server. + * pageToken: 'placeholder-value', + * // The name of the enterprise in the form enterprises/{enterpriseId}. + * parent: 'enterprises/my-enterprise', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "devices": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.devices.list * @memberOf! () * @@ -2612,6 +3056,118 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.devices.patch * @desc Updates a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.devices.patch({ + * // The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}. + * name: 'enterprises/my-enterprise/devices/my-device', + * // The field mask indicating the fields to update. If not set, all modifiable fields will be modified. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiLevel": 0, + * // "applicationReports": [], + * // "appliedPolicyName": "my_appliedPolicyName", + * // "appliedPolicyVersion": "my_appliedPolicyVersion", + * // "appliedState": "my_appliedState", + * // "deviceSettings": {}, + * // "disabledReason": {}, + * // "displays": [], + * // "enrollmentTime": "my_enrollmentTime", + * // "enrollmentTokenData": "my_enrollmentTokenData", + * // "enrollmentTokenName": "my_enrollmentTokenName", + * // "hardwareInfo": {}, + * // "hardwareStatusSamples": [], + * // "lastPolicyComplianceReportTime": "my_lastPolicyComplianceReportTime", + * // "lastPolicySyncTime": "my_lastPolicySyncTime", + * // "lastStatusReportTime": "my_lastStatusReportTime", + * // "managementMode": "my_managementMode", + * // "memoryEvents": [], + * // "memoryInfo": {}, + * // "name": "my_name", + * // "networkInfo": {}, + * // "nonComplianceDetails": [], + * // "policyCompliant": false, + * // "policyName": "my_policyName", + * // "powerManagementEvents": [], + * // "previousDeviceNames": [], + * // "securityPosture": {}, + * // "softwareInfo": {}, + * // "state": "my_state", + * // "systemProperties": {}, + * // "user": {}, + * // "userName": "my_userName" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiLevel": 0, + * // "applicationReports": [], + * // "appliedPolicyName": "my_appliedPolicyName", + * // "appliedPolicyVersion": "my_appliedPolicyVersion", + * // "appliedState": "my_appliedState", + * // "deviceSettings": {}, + * // "disabledReason": {}, + * // "displays": [], + * // "enrollmentTime": "my_enrollmentTime", + * // "enrollmentTokenData": "my_enrollmentTokenData", + * // "enrollmentTokenName": "my_enrollmentTokenName", + * // "hardwareInfo": {}, + * // "hardwareStatusSamples": [], + * // "lastPolicyComplianceReportTime": "my_lastPolicyComplianceReportTime", + * // "lastPolicySyncTime": "my_lastPolicySyncTime", + * // "lastStatusReportTime": "my_lastStatusReportTime", + * // "managementMode": "my_managementMode", + * // "memoryEvents": [], + * // "memoryInfo": {}, + * // "name": "my_name", + * // "networkInfo": {}, + * // "nonComplianceDetails": [], + * // "policyCompliant": false, + * // "policyName": "my_policyName", + * // "powerManagementEvents": [], + * // "previousDeviceNames": [], + * // "securityPosture": {}, + * // "softwareInfo": {}, + * // "state": "my_state", + * // "systemProperties": {}, + * // "user": {}, + * // "userName": "my_userName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.devices.patch * @memberOf! () * @@ -2782,6 +3338,44 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.devices.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.devices.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'enterprises/my-enterprise/devices/my-device/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.devices.operations.cancel * @memberOf! () * @@ -2852,6 +3446,44 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.devices.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.devices.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'enterprises/my-enterprise/devices/my-device/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.devices.operations.delete * @memberOf! () * @@ -2922,6 +3554,50 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.devices.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.devices.operations.get({ + * // The name of the operation resource. + * name: 'enterprises/my-enterprise/devices/my-device/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.devices.operations.get * @memberOf! () * @@ -2994,6 +3670,53 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.devices.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/x/operations. To override the binding, API services can add a binding such as "/v1/{name=users/x}/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.devices.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'enterprises/my-enterprise/devices/my-device/operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.devices.operations.list * @memberOf! () * @@ -3139,6 +3862,70 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.enrollmentTokens.create * @desc Creates an enrollment token for a given enterprise. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.enrollmentTokens.create({ + * // The name of the enterprise in the form enterprises/{enterpriseId}. + * parent: 'enterprises/my-enterprise', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "additionalData": "my_additionalData", + * // "duration": "my_duration", + * // "expirationTimestamp": "my_expirationTimestamp", + * // "name": "my_name", + * // "oneTimeOnly": false, + * // "policyName": "my_policyName", + * // "qrCode": "my_qrCode", + * // "user": {}, + * // "value": "my_value" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "additionalData": "my_additionalData", + * // "duration": "my_duration", + * // "expirationTimestamp": "my_expirationTimestamp", + * // "name": "my_name", + * // "oneTimeOnly": false, + * // "policyName": "my_policyName", + * // "qrCode": "my_qrCode", + * // "user": {}, + * // "value": "my_value" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.enrollmentTokens.create * @memberOf! () * @@ -3215,6 +4002,44 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.enrollmentTokens.delete * @desc Deletes an enrollment token. This operation invalidates the token, preventing its future use. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.enrollmentTokens.delete({ + * // The name of the enrollment token in the form enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId}. + * name: 'enterprises/my-enterprise/enrollmentTokens/my-enrollmentToken', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.enrollmentTokens.delete * @memberOf! () * @@ -3322,6 +4147,44 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.policies.delete * @desc Deletes a policy. This operation is only permitted if no devices are currently referencing the policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.policies.delete({ + * // The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}. + * name: 'enterprises/my-enterprise/policies/my-policie', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.policies.delete * @memberOf! () * @@ -3392,6 +4255,125 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.policies.get * @desc Gets a policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.policies.get({ + * // The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}. + * name: 'enterprises/my-enterprise/policies/my-policie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountTypesWithManagementDisabled": [], + * // "addUserDisabled": false, + * // "adjustVolumeDisabled": false, + * // "advancedSecurityOverrides": {}, + * // "alwaysOnVpnPackage": {}, + * // "androidDevicePolicyTracks": [], + * // "appAutoUpdatePolicy": "my_appAutoUpdatePolicy", + * // "applications": [], + * // "autoTimeRequired": false, + * // "blockApplicationsEnabled": false, + * // "bluetoothConfigDisabled": false, + * // "bluetoothContactSharingDisabled": false, + * // "bluetoothDisabled": false, + * // "cameraDisabled": false, + * // "cellBroadcastsConfigDisabled": false, + * // "choosePrivateKeyRules": [], + * // "complianceRules": [], + * // "createWindowsDisabled": false, + * // "credentialsConfigDisabled": false, + * // "dataRoamingDisabled": false, + * // "debuggingFeaturesAllowed": false, + * // "defaultPermissionPolicy": "my_defaultPermissionPolicy", + * // "deviceOwnerLockScreenInfo": {}, + * // "encryptionPolicy": "my_encryptionPolicy", + * // "ensureVerifyAppsEnabled": false, + * // "factoryResetDisabled": false, + * // "frpAdminEmails": [], + * // "funDisabled": false, + * // "installAppsDisabled": false, + * // "installUnknownSourcesAllowed": false, + * // "keyguardDisabled": false, + * // "keyguardDisabledFeatures": [], + * // "kioskCustomLauncherEnabled": false, + * // "kioskCustomization": {}, + * // "locationMode": "my_locationMode", + * // "longSupportMessage": {}, + * // "maximumTimeToLock": "my_maximumTimeToLock", + * // "minimumApiLevel": 0, + * // "mobileNetworksConfigDisabled": false, + * // "modifyAccountsDisabled": false, + * // "mountPhysicalMediaDisabled": false, + * // "name": "my_name", + * // "networkEscapeHatchEnabled": false, + * // "networkResetDisabled": false, + * // "openNetworkConfiguration": {}, + * // "outgoingBeamDisabled": false, + * // "outgoingCallsDisabled": false, + * // "passwordPolicies": [], + * // "passwordRequirements": {}, + * // "permissionGrants": [], + * // "permittedAccessibilityServices": {}, + * // "permittedInputMethods": {}, + * // "persistentPreferredActivities": [], + * // "playStoreMode": "my_playStoreMode", + * // "policyEnforcementRules": [], + * // "privateKeySelectionEnabled": false, + * // "recommendedGlobalProxy": {}, + * // "removeUserDisabled": false, + * // "safeBootDisabled": false, + * // "screenCaptureDisabled": false, + * // "setUserIconDisabled": false, + * // "setWallpaperDisabled": false, + * // "setupActions": [], + * // "shareLocationDisabled": false, + * // "shortSupportMessage": {}, + * // "skipFirstUseHintsEnabled": false, + * // "smsDisabled": false, + * // "statusBarDisabled": false, + * // "statusReportingSettings": {}, + * // "stayOnPluggedModes": [], + * // "systemUpdate": {}, + * // "tetheringConfigDisabled": false, + * // "uninstallAppsDisabled": false, + * // "unmuteMicrophoneDisabled": false, + * // "usbFileTransferDisabled": false, + * // "usbMassStorageEnabled": false, + * // "version": "my_version", + * // "vpnConfigDisabled": false, + * // "wifiConfigDisabled": false, + * // "wifiConfigsLockdownEnabled": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.policies.get * @memberOf! () * @@ -3462,6 +4444,51 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.policies.list * @desc Lists policies for a given enterprise. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.policies.list({ + * // The requested page size. The actual page size may be fixed to a min or max value. + * pageSize: 'placeholder-value', + * // A token identifying a page of results returned by the server. + * pageToken: 'placeholder-value', + * // The name of the enterprise in the form enterprises/{enterpriseId}. + * parent: 'enterprises/my-enterprise', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "policies": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.policies.list * @memberOf! () * @@ -3541,6 +4568,214 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.policies.patch * @desc Updates or creates a policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.policies.patch({ + * // The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}. + * name: 'enterprises/my-enterprise/policies/my-policie', + * // The field mask indicating the fields to update. If not set, all modifiable fields will be modified. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountTypesWithManagementDisabled": [], + * // "addUserDisabled": false, + * // "adjustVolumeDisabled": false, + * // "advancedSecurityOverrides": {}, + * // "alwaysOnVpnPackage": {}, + * // "androidDevicePolicyTracks": [], + * // "appAutoUpdatePolicy": "my_appAutoUpdatePolicy", + * // "applications": [], + * // "autoTimeRequired": false, + * // "blockApplicationsEnabled": false, + * // "bluetoothConfigDisabled": false, + * // "bluetoothContactSharingDisabled": false, + * // "bluetoothDisabled": false, + * // "cameraDisabled": false, + * // "cellBroadcastsConfigDisabled": false, + * // "choosePrivateKeyRules": [], + * // "complianceRules": [], + * // "createWindowsDisabled": false, + * // "credentialsConfigDisabled": false, + * // "dataRoamingDisabled": false, + * // "debuggingFeaturesAllowed": false, + * // "defaultPermissionPolicy": "my_defaultPermissionPolicy", + * // "deviceOwnerLockScreenInfo": {}, + * // "encryptionPolicy": "my_encryptionPolicy", + * // "ensureVerifyAppsEnabled": false, + * // "factoryResetDisabled": false, + * // "frpAdminEmails": [], + * // "funDisabled": false, + * // "installAppsDisabled": false, + * // "installUnknownSourcesAllowed": false, + * // "keyguardDisabled": false, + * // "keyguardDisabledFeatures": [], + * // "kioskCustomLauncherEnabled": false, + * // "kioskCustomization": {}, + * // "locationMode": "my_locationMode", + * // "longSupportMessage": {}, + * // "maximumTimeToLock": "my_maximumTimeToLock", + * // "minimumApiLevel": 0, + * // "mobileNetworksConfigDisabled": false, + * // "modifyAccountsDisabled": false, + * // "mountPhysicalMediaDisabled": false, + * // "name": "my_name", + * // "networkEscapeHatchEnabled": false, + * // "networkResetDisabled": false, + * // "openNetworkConfiguration": {}, + * // "outgoingBeamDisabled": false, + * // "outgoingCallsDisabled": false, + * // "passwordPolicies": [], + * // "passwordRequirements": {}, + * // "permissionGrants": [], + * // "permittedAccessibilityServices": {}, + * // "permittedInputMethods": {}, + * // "persistentPreferredActivities": [], + * // "playStoreMode": "my_playStoreMode", + * // "policyEnforcementRules": [], + * // "privateKeySelectionEnabled": false, + * // "recommendedGlobalProxy": {}, + * // "removeUserDisabled": false, + * // "safeBootDisabled": false, + * // "screenCaptureDisabled": false, + * // "setUserIconDisabled": false, + * // "setWallpaperDisabled": false, + * // "setupActions": [], + * // "shareLocationDisabled": false, + * // "shortSupportMessage": {}, + * // "skipFirstUseHintsEnabled": false, + * // "smsDisabled": false, + * // "statusBarDisabled": false, + * // "statusReportingSettings": {}, + * // "stayOnPluggedModes": [], + * // "systemUpdate": {}, + * // "tetheringConfigDisabled": false, + * // "uninstallAppsDisabled": false, + * // "unmuteMicrophoneDisabled": false, + * // "usbFileTransferDisabled": false, + * // "usbMassStorageEnabled": false, + * // "version": "my_version", + * // "vpnConfigDisabled": false, + * // "wifiConfigDisabled": false, + * // "wifiConfigsLockdownEnabled": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountTypesWithManagementDisabled": [], + * // "addUserDisabled": false, + * // "adjustVolumeDisabled": false, + * // "advancedSecurityOverrides": {}, + * // "alwaysOnVpnPackage": {}, + * // "androidDevicePolicyTracks": [], + * // "appAutoUpdatePolicy": "my_appAutoUpdatePolicy", + * // "applications": [], + * // "autoTimeRequired": false, + * // "blockApplicationsEnabled": false, + * // "bluetoothConfigDisabled": false, + * // "bluetoothContactSharingDisabled": false, + * // "bluetoothDisabled": false, + * // "cameraDisabled": false, + * // "cellBroadcastsConfigDisabled": false, + * // "choosePrivateKeyRules": [], + * // "complianceRules": [], + * // "createWindowsDisabled": false, + * // "credentialsConfigDisabled": false, + * // "dataRoamingDisabled": false, + * // "debuggingFeaturesAllowed": false, + * // "defaultPermissionPolicy": "my_defaultPermissionPolicy", + * // "deviceOwnerLockScreenInfo": {}, + * // "encryptionPolicy": "my_encryptionPolicy", + * // "ensureVerifyAppsEnabled": false, + * // "factoryResetDisabled": false, + * // "frpAdminEmails": [], + * // "funDisabled": false, + * // "installAppsDisabled": false, + * // "installUnknownSourcesAllowed": false, + * // "keyguardDisabled": false, + * // "keyguardDisabledFeatures": [], + * // "kioskCustomLauncherEnabled": false, + * // "kioskCustomization": {}, + * // "locationMode": "my_locationMode", + * // "longSupportMessage": {}, + * // "maximumTimeToLock": "my_maximumTimeToLock", + * // "minimumApiLevel": 0, + * // "mobileNetworksConfigDisabled": false, + * // "modifyAccountsDisabled": false, + * // "mountPhysicalMediaDisabled": false, + * // "name": "my_name", + * // "networkEscapeHatchEnabled": false, + * // "networkResetDisabled": false, + * // "openNetworkConfiguration": {}, + * // "outgoingBeamDisabled": false, + * // "outgoingCallsDisabled": false, + * // "passwordPolicies": [], + * // "passwordRequirements": {}, + * // "permissionGrants": [], + * // "permittedAccessibilityServices": {}, + * // "permittedInputMethods": {}, + * // "persistentPreferredActivities": [], + * // "playStoreMode": "my_playStoreMode", + * // "policyEnforcementRules": [], + * // "privateKeySelectionEnabled": false, + * // "recommendedGlobalProxy": {}, + * // "removeUserDisabled": false, + * // "safeBootDisabled": false, + * // "screenCaptureDisabled": false, + * // "setUserIconDisabled": false, + * // "setWallpaperDisabled": false, + * // "setupActions": [], + * // "shareLocationDisabled": false, + * // "shortSupportMessage": {}, + * // "skipFirstUseHintsEnabled": false, + * // "smsDisabled": false, + * // "statusBarDisabled": false, + * // "statusReportingSettings": {}, + * // "stayOnPluggedModes": [], + * // "systemUpdate": {}, + * // "tetheringConfigDisabled": false, + * // "uninstallAppsDisabled": false, + * // "unmuteMicrophoneDisabled": false, + * // "usbFileTransferDisabled": false, + * // "usbMassStorageEnabled": false, + * // "version": "my_version", + * // "vpnConfigDisabled": false, + * // "wifiConfigDisabled": false, + * // "wifiConfigsLockdownEnabled": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.policies.patch * @memberOf! () * @@ -3686,6 +4921,64 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.webApps.create * @desc Creates a web app. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.webApps.create({ + * // The name of the enterprise in the form enterprises/{enterpriseId}. + * parent: 'enterprises/my-enterprise', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayMode": "my_displayMode", + * // "icons": [], + * // "name": "my_name", + * // "startUrl": "my_startUrl", + * // "title": "my_title", + * // "versionCode": "my_versionCode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayMode": "my_displayMode", + * // "icons": [], + * // "name": "my_name", + * // "startUrl": "my_startUrl", + * // "title": "my_title", + * // "versionCode": "my_versionCode" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.webApps.create * @memberOf! () * @@ -3760,6 +5053,44 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.webApps.delete * @desc Deletes a web app. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.webApps.delete({ + * // The name of the web app in the form enterprises/{enterpriseId}/webApps/{packageName}. + * name: 'enterprises/my-enterprise/webApps/my-webApp', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.webApps.delete * @memberOf! () * @@ -3830,6 +5161,51 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.webApps.get * @desc Gets a web app. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.webApps.get({ + * // The name of the web app in the form enterprises/{enterpriseId}/webApp/{packageName}. + * name: 'enterprises/my-enterprise/webApps/my-webApp', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayMode": "my_displayMode", + * // "icons": [], + * // "name": "my_name", + * // "startUrl": "my_startUrl", + * // "title": "my_title", + * // "versionCode": "my_versionCode" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.webApps.get * @memberOf! () * @@ -3900,6 +5276,51 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.webApps.list * @desc Lists web apps for a given enterprise. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.webApps.list({ + * // The requested page size. The actual page size may be fixed to a min or max value. + * pageSize: 'placeholder-value', + * // A token identifying a page of results returned by the server. + * pageToken: 'placeholder-value', + * // The name of the enterprise in the form enterprises/{enterpriseId}. + * parent: 'enterprises/my-enterprise', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "webApps": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.webApps.list * @memberOf! () * @@ -3977,6 +5398,66 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.webApps.patch * @desc Updates a web app. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.webApps.patch({ + * // The name of the web app in the form enterprises/{enterpriseId}/webApps/{packageName}. + * name: 'enterprises/my-enterprise/webApps/my-webApp', + * // The field mask indicating the fields to update. If not set, all modifiable fields will be modified. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayMode": "my_displayMode", + * // "icons": [], + * // "name": "my_name", + * // "startUrl": "my_startUrl", + * // "title": "my_title", + * // "versionCode": "my_versionCode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayMode": "my_displayMode", + * // "icons": [], + * // "name": "my_name", + * // "startUrl": "my_startUrl", + * // "title": "my_title", + * // "versionCode": "my_versionCode" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.webApps.patch * @memberOf! () * @@ -4139,6 +5620,62 @@ export namespace androidmanagement_v1 { /** * androidmanagement.enterprises.webTokens.create * @desc Creates a web token to access an embeddable managed Google Play web UI for a given enterprise. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.enterprises.webTokens.create({ + * // The name of the enterprise in the form enterprises/{enterpriseId}. + * parent: 'enterprises/my-enterprise', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "enabledFeatures": [], + * // "name": "my_name", + * // "parentFrameUrl": "my_parentFrameUrl", + * // "permissions": [], + * // "value": "my_value" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "enabledFeatures": [], + * // "name": "my_name", + * // "parentFrameUrl": "my_parentFrameUrl", + * // "permissions": [], + * // "value": "my_value" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.enterprises.webTokens.create * @memberOf! () * @@ -4238,6 +5775,49 @@ export namespace androidmanagement_v1 { /** * androidmanagement.signupUrls.create * @desc Creates an enterprise signup URL. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidmanagement.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 androidmanagement = google.androidmanagement('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/androidmanagement'], + * }); + * + * // 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 androidmanagement.signupUrls.create({ + * // The callback URL that the admin will be redirected to after successfully creating an enterprise. Before redirecting there the system will add a query parameter to this URL named enterpriseToken which will contain an opaque token to be used for the create enterprise request. The URL will be parsed then reformatted in order to add the enterpriseToken parameter, so there may be some minor formatting changes. + * callbackUrl: 'placeholder-value', + * // The ID of the Google Cloud Platform project which will own the enterprise. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidmanagement.signupUrls.create * @memberOf! () * diff --git a/src/apis/androidpublisher/v1.1.ts b/src/apis/androidpublisher/v1.1.ts index 43ac68eeb24..b8336b31909 100644 --- a/src/apis/androidpublisher/v1.1.ts +++ b/src/apis/androidpublisher/v1.1.ts @@ -140,6 +140,56 @@ export namespace androidpublisher_v1_1 { /** * androidpublisher.inapppurchases.get * @desc Checks the purchase and consumption status of an inapp item. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v1.1'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.inapppurchases.get({ + * // The package name of the application the inapp product was sold in (for example, 'com.some.thing'). + * packageName: 'placeholder-value', + * // The inapp product SKU (for example, 'com.some.thing.inapp1'). + * productId: 'placeholder-value', + * // The token provided to the user's device when the inapp product was purchased. + * token: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "consumptionState": 0, + * // "developerPayload": "my_developerPayload", + * // "kind": "my_kind", + * // "orderId": "my_orderId", + * // "purchaseState": 0, + * // "purchaseTime": "my_purchaseTime", + * // "purchaseType": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.inapppurchases.get * @memberOf! () * diff --git a/src/apis/androidpublisher/v2.ts b/src/apis/androidpublisher/v2.ts index f6c34cade0a..a8d14aa6db4 100644 --- a/src/apis/androidpublisher/v2.ts +++ b/src/apis/androidpublisher/v2.ts @@ -188,6 +188,56 @@ export namespace androidpublisher_v2 { /** * androidpublisher.purchases.products.get * @desc Checks the purchase and consumption status of an inapp item. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v2'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.purchases.products.get({ + * // The package name of the application the inapp product was sold in (for example, 'com.some.thing'). + * packageName: 'placeholder-value', + * // The inapp product SKU (for example, 'com.some.thing.inapp1'). + * productId: 'placeholder-value', + * // The token provided to the user's device when the inapp product was purchased. + * token: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "consumptionState": 0, + * // "developerPayload": "my_developerPayload", + * // "kind": "my_kind", + * // "orderId": "my_orderId", + * // "purchaseState": 0, + * // "purchaseTimeMillis": "my_purchaseTimeMillis", + * // "purchaseType": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.purchases.products.get * @memberOf! () * @@ -292,6 +342,58 @@ export namespace androidpublisher_v2 { /** * androidpublisher.purchases.voidedpurchases.list * @desc Lists the purchases that were canceled, refunded or charged-back. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v2'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.purchases.voidedpurchases.list({ + * // The time, in milliseconds since the Epoch, of the newest voided purchase that you want to see in the response. The value of this parameter cannot be greater than the current time and is ignored if a pagination token is set. Default value is current time. Note: This filter is applied on the time at which the record is seen as voided by our systems and not the actual voided time returned in the response. + * endTime: 'placeholder-value', + * + * maxResults: 'placeholder-value', + * // The package name of the application for which voided purchases need to be returned (for example, 'com.some.thing'). + * packageName: 'placeholder-value', + * + * startIndex: 'placeholder-value', + * // The time, in milliseconds since the Epoch, of the oldest voided purchase that you want to see in the response. The value of this parameter cannot be older than 30 days and is ignored if a pagination token is set. Default value is current time minus 30 days. Note: This filter is applied on the time at which the record is seen as voided by our systems and not the actual voided time returned in the response. + * startTime: 'placeholder-value', + * + * token: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "pageInfo": {}, + * // "tokenPagination": {}, + * // "voidedPurchases": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.purchases.voidedpurchases.list * @memberOf! () * diff --git a/src/apis/androidpublisher/v3.ts b/src/apis/androidpublisher/v3.ts index 90e7bbec3cd..80dbc640633 100644 --- a/src/apis/androidpublisher/v3.ts +++ b/src/apis/androidpublisher/v3.ts @@ -1056,6 +1056,49 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.commit * @desc Commits/applies the changes made in this edit back to the app. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.commit({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "expiryTimeSeconds": "my_expiryTimeSeconds", + * // "id": "my_id" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.commit * @memberOf! () * @@ -1128,6 +1171,43 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.delete * @desc Deletes an edit for an app. Creating a new edit will automatically delete any of your previous edits so this method need only be called if you want to preemptively abandon an edit. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.delete({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.delete * @memberOf! () * @@ -1200,6 +1280,49 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.get * @desc Returns information about the edit specified. Calls will fail if the edit is no long active (e.g. has been deleted, superseded or expired). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.get({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "expiryTimeSeconds": "my_expiryTimeSeconds", + * // "id": "my_id" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.get * @memberOf! () * @@ -1272,6 +1395,56 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.insert * @desc Creates a new edit for an app, populated with the app's current state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.insert({ + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "expiryTimeSeconds": "my_expiryTimeSeconds", + * // "id": "my_id" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "expiryTimeSeconds": "my_expiryTimeSeconds", + * // "id": "my_id" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.insert * @memberOf! () * @@ -1343,6 +1516,49 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.validate * @desc Checks that the edit can be successfully committed. The edit's changes are not applied to the live app. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.validate({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "expiryTimeSeconds": "my_expiryTimeSeconds", + * // "id": "my_id" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.validate * @memberOf! () * @@ -1499,6 +1715,56 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.apks.addexternallyhosted * @desc Creates a new APK without uploading the APK itself to Google Play, instead hosting the APK at a specified URL. This function is only available to enterprises using Google Play for Work whose application is configured to restrict distribution to the enterprise domain. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.apks.addexternallyhosted({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "externallyHostedApk": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "externallyHostedApk": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.apks.addexternallyhosted * @memberOf! () * @@ -1583,6 +1849,49 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.apks.list + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.apks.list({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apks": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.apks.list * @memberOf! () * @@ -1656,6 +1965,58 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.apks.upload + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.apks.upload({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * requestBody: { + * // request body parameters + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "binary": {}, + * // "testBinary": {}, + * // "versionCode": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.apks.upload * @memberOf! () * @@ -1815,6 +2176,49 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.bundles.list + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.bundles.list({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bundles": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.bundles.list * @memberOf! () * @@ -1890,6 +2294,60 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.bundles.upload * @desc Uploads a new Android App Bundle to this edit. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See: https://developers.google.com/api-client-library/java/google-api-java-client/errors for an example in java. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.bundles.upload({ + * // Must be set to true if the bundle installation may trigger a warning on user devices (for example, if installation size may be over a threshold, typically 100 MB). + * ackBundleInstallationWarning: 'placeholder-value', + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * requestBody: { + * // request body parameters + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "sha1": "my_sha1", + * // "sha256": "my_sha256", + * // "versionCode": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.bundles.upload * @memberOf! () * @@ -2035,6 +2493,60 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.deobfuscationfiles.upload * @desc Uploads the deobfuscation file of the specified APK. If a deobfuscation or symbolication file already exists, it will be replaced. See https://developer.android.com/studio/build/shrink-code to learn more about deobfuscation files. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.deobfuscationfiles.upload({ + * // The version code of the APK whose deobfuscation file is being uploaded. + * apkVersionCode: 'placeholder-value', + * + * deobfuscationFileType: 'placeholder-value', + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier of the Android app for which the deobfuscation files are being uploaded; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * requestBody: { + * // request body parameters + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deobfuscationFile": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.deobfuscationfiles.upload * @memberOf! () * @@ -2190,6 +2702,51 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.details.get * @desc Fetches app details for this edit. This includes the default language and developer support contact information. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.details.get({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contactEmail": "my_contactEmail", + * // "contactPhone": "my_contactPhone", + * // "contactWebsite": "my_contactWebsite", + * // "defaultLanguage": "my_defaultLanguage" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.details.get * @memberOf! () * @@ -2265,6 +2822,62 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.details.patch * @desc Updates app details for this edit. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.details.patch({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contactEmail": "my_contactEmail", + * // "contactPhone": "my_contactPhone", + * // "contactWebsite": "my_contactWebsite", + * // "defaultLanguage": "my_defaultLanguage" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contactEmail": "my_contactEmail", + * // "contactPhone": "my_contactPhone", + * // "contactWebsite": "my_contactWebsite", + * // "defaultLanguage": "my_defaultLanguage" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.details.patch * @memberOf! () * @@ -2341,6 +2954,62 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.details.update * @desc Updates app details for this edit. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.details.update({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contactEmail": "my_contactEmail", + * // "contactPhone": "my_contactPhone", + * // "contactWebsite": "my_contactWebsite", + * // "defaultLanguage": "my_defaultLanguage" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contactEmail": "my_contactEmail", + * // "contactPhone": "my_contactPhone", + * // "contactWebsite": "my_contactWebsite", + * // "defaultLanguage": "my_defaultLanguage" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.details.update * @memberOf! () * @@ -2483,6 +3152,53 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.expansionfiles.get * @desc Fetches the Expansion File configuration for the APK specified. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.expansionfiles.get({ + * // The version code of the APK whose Expansion File configuration is being read or modified. + * apkVersionCode: 'placeholder-value', + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * + * expansionFileType: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "fileSize": "my_fileSize", + * // "referencesVersion": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.expansionfiles.get * @memberOf! () * @@ -2570,6 +3286,62 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.expansionfiles.patch * @desc Updates the APK's Expansion File configuration to reference another APK's Expansion Files. To add a new Expansion File use the Upload method. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.expansionfiles.patch({ + * // The version code of the APK whose Expansion File configuration is being read or modified. + * apkVersionCode: 'placeholder-value', + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * + * expansionFileType: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fileSize": "my_fileSize", + * // "referencesVersion": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "fileSize": "my_fileSize", + * // "referencesVersion": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.expansionfiles.patch * @memberOf! () * @@ -2658,6 +3430,62 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.expansionfiles.update * @desc Updates the APK's Expansion File configuration to reference another APK's Expansion Files. To add a new Expansion File use the Upload method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.expansionfiles.update({ + * // The version code of the APK whose Expansion File configuration is being read or modified. + * apkVersionCode: 'placeholder-value', + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * + * expansionFileType: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fileSize": "my_fileSize", + * // "referencesVersion": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "fileSize": "my_fileSize", + * // "referencesVersion": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.expansionfiles.update * @memberOf! () * @@ -2746,6 +3574,60 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.expansionfiles.upload * @desc Uploads and attaches a new Expansion File to the APK specified. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.expansionfiles.upload({ + * // The version code of the APK whose Expansion File configuration is being read or modified. + * apkVersionCode: 'placeholder-value', + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * + * expansionFileType: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * requestBody: { + * // request body parameters + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "expansionFile": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.expansionfiles.upload * @memberOf! () * @@ -2983,6 +3865,49 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.images.delete * @desc Deletes the image (specified by id) from the edit. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.images.delete({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier an image within the set of images attached to this edit. + * imageId: 'placeholder-value', + * + * imageType: 'placeholder-value', + * // The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass "de-AT". + * language: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.images.delete * @memberOf! () * @@ -3071,6 +3996,52 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.images.deleteall * @desc Deletes all images for the specified language and image type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.images.deleteall({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * + * imageType: 'placeholder-value', + * // The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass "de-AT". + * language: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deleted": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.images.deleteall * @memberOf! () * @@ -3152,6 +4123,52 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.images.list * @desc Lists all images for the specified language and image type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.images.list({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * + * imageType: 'placeholder-value', + * // The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass "de-AT". + * language: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "images": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.images.list * @memberOf! () * @@ -3229,6 +4246,60 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.images.upload * @desc Uploads a new image and adds it to the list of images for the specified language and image type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.images.upload({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * + * imageType: 'placeholder-value', + * // The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass "de-AT". + * language: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * requestBody: { + * // request body parameters + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "image": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.images.upload * @memberOf! () * @@ -3443,6 +4514,45 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.listings.delete * @desc Deletes the specified localized store listing from an edit. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.listings.delete({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass "de-AT". + * language: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.listings.delete * @memberOf! () * @@ -3517,6 +4627,43 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.listings.deleteall * @desc Deletes all localized listings from an edit. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.listings.deleteall({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.listings.deleteall * @memberOf! () * @@ -3590,6 +4737,54 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.listings.get * @desc Fetches information about a localized store listing. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.listings.get({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass "de-AT". + * language: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "fullDescription": "my_fullDescription", + * // "language": "my_language", + * // "shortDescription": "my_shortDescription", + * // "title": "my_title", + * // "video": "my_video" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.listings.get * @memberOf! () * @@ -3664,6 +4859,49 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.listings.list * @desc Returns all of the localized store listings attached to this edit. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.listings.list({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "listings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.listings.list * @memberOf! () * @@ -3741,6 +4979,66 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.listings.patch * @desc Creates or updates a localized store listing. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.listings.patch({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass "de-AT". + * language: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fullDescription": "my_fullDescription", + * // "language": "my_language", + * // "shortDescription": "my_shortDescription", + * // "title": "my_title", + * // "video": "my_video" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "fullDescription": "my_fullDescription", + * // "language": "my_language", + * // "shortDescription": "my_shortDescription", + * // "title": "my_title", + * // "video": "my_video" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.listings.patch * @memberOf! () * @@ -3816,6 +5114,66 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.listings.update * @desc Creates or updates a localized store listing. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.listings.update({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass "de-AT". + * language: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fullDescription": "my_fullDescription", + * // "language": "my_language", + * // "shortDescription": "my_shortDescription", + * // "title": "my_title", + * // "video": "my_video" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "fullDescription": "my_fullDescription", + * // "language": "my_language", + * // "shortDescription": "my_shortDescription", + * // "title": "my_title", + * // "video": "my_video" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.listings.update * @memberOf! () * @@ -4020,6 +5378,53 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.testers.get + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.testers.get({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * // The track to read or modify. + * track: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoEnrolledAndroidGroups": [], + * // "autoEnrolledGoogleGroups": [], + * // "excludedGoogleGroups": [], + * // "googleGroups": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.testers.get * @memberOf! () * @@ -4093,6 +5498,64 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.testers.patch + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.testers.patch({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * // The track to read or modify. + * track: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoEnrolledAndroidGroups": [], + * // "autoEnrolledGoogleGroups": [], + * // "excludedGoogleGroups": [], + * // "googleGroups": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoEnrolledAndroidGroups": [], + * // "autoEnrolledGoogleGroups": [], + * // "excludedGoogleGroups": [], + * // "googleGroups": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.testers.patch * @memberOf! () * @@ -4167,6 +5630,64 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.testers.update + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.testers.update({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * // The track to read or modify. + * track: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoEnrolledAndroidGroups": [], + * // "autoEnrolledGoogleGroups": [], + * // "excludedGoogleGroups": [], + * // "googleGroups": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoEnrolledAndroidGroups": [], + * // "autoEnrolledGoogleGroups": [], + * // "excludedGoogleGroups": [], + * // "googleGroups": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.testers.update * @memberOf! () * @@ -4320,6 +5841,51 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.tracks.get * @desc Fetches the track configuration for the specified track type. Includes the APK version codes that are in this track. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.tracks.get({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * // The track to read or modify. + * track: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "releases": [], + * // "track": "my_track" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.tracks.get * @memberOf! () * @@ -4393,6 +5959,49 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.tracks.list * @desc Lists all the track configurations for this edit. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.tracks.list({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "tracks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.tracks.list * @memberOf! () * @@ -4468,6 +6077,60 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.tracks.patch * @desc Updates the track configuration for the specified track type. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.tracks.patch({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * // The track to read or modify. + * track: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "releases": [], + * // "track": "my_track" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "releases": [], + * // "track": "my_track" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.tracks.patch * @memberOf! () * @@ -4543,6 +6206,60 @@ export namespace androidpublisher_v3 { /** * androidpublisher.edits.tracks.update * @desc Updates the track configuration for the specified track type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.edits.tracks.update({ + * // Unique identifier for this edit. + * editId: 'placeholder-value', + * // Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * // The track to read or modify. + * track: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "releases": [], + * // "track": "my_track" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "releases": [], + * // "track": "my_track" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.edits.tracks.update * @memberOf! () * @@ -4711,6 +6428,43 @@ export namespace androidpublisher_v3 { /** * androidpublisher.inappproducts.delete * @desc Delete an in-app product for an app. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.inappproducts.delete({ + * // Unique identifier for the Android app with the in-app product; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * // Unique identifier for the in-app product. + * sku: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.inappproducts.delete * @memberOf! () * @@ -4784,6 +6538,57 @@ export namespace androidpublisher_v3 { /** * androidpublisher.inappproducts.get * @desc Returns information about the in-app product specified. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.inappproducts.get({ + * packageName: 'placeholder-value', + * // Unique identifier for the in-app product. + * sku: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "defaultLanguage": "my_defaultLanguage", + * // "defaultPrice": {}, + * // "gracePeriod": "my_gracePeriod", + * // "listings": {}, + * // "packageName": "my_packageName", + * // "prices": {}, + * // "purchaseType": "my_purchaseType", + * // "sku": "my_sku", + * // "status": "my_status", + * // "subscriptionPeriod": "my_subscriptionPeriod", + * // "trialPeriod": "my_trialPeriod" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.inappproducts.get * @memberOf! () * @@ -4859,6 +6664,76 @@ export namespace androidpublisher_v3 { /** * androidpublisher.inappproducts.insert * @desc Creates a new in-app product for an app. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.inappproducts.insert({ + * // If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false. + * autoConvertMissingPrices: 'placeholder-value', + * // Unique identifier for the Android app; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "defaultLanguage": "my_defaultLanguage", + * // "defaultPrice": {}, + * // "gracePeriod": "my_gracePeriod", + * // "listings": {}, + * // "packageName": "my_packageName", + * // "prices": {}, + * // "purchaseType": "my_purchaseType", + * // "sku": "my_sku", + * // "status": "my_status", + * // "subscriptionPeriod": "my_subscriptionPeriod", + * // "trialPeriod": "my_trialPeriod" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "defaultLanguage": "my_defaultLanguage", + * // "defaultPrice": {}, + * // "gracePeriod": "my_gracePeriod", + * // "listings": {}, + * // "packageName": "my_packageName", + * // "prices": {}, + * // "purchaseType": "my_purchaseType", + * // "sku": "my_sku", + * // "status": "my_status", + * // "subscriptionPeriod": "my_subscriptionPeriod", + * // "trialPeriod": "my_trialPeriod" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.inappproducts.insert * @memberOf! () * @@ -4935,6 +6810,54 @@ export namespace androidpublisher_v3 { /** * androidpublisher.inappproducts.list * @desc List all the in-app products for an Android app, both subscriptions and managed in-app products.. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.inappproducts.list({ + * maxResults: 'placeholder-value', + * // Unique identifier for the Android app with in-app products; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * startIndex: 'placeholder-value', + * + * token: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "inappproduct": [], + * // "kind": "my_kind", + * // "pageInfo": {}, + * // "tokenPagination": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.inappproducts.list * @memberOf! () * @@ -5019,6 +6942,78 @@ export namespace androidpublisher_v3 { /** * androidpublisher.inappproducts.patch * @desc Updates the details of an in-app product. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.inappproducts.patch({ + * // If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false. + * autoConvertMissingPrices: 'placeholder-value', + * // Unique identifier for the Android app with the in-app product; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * // Unique identifier for the in-app product. + * sku: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "defaultLanguage": "my_defaultLanguage", + * // "defaultPrice": {}, + * // "gracePeriod": "my_gracePeriod", + * // "listings": {}, + * // "packageName": "my_packageName", + * // "prices": {}, + * // "purchaseType": "my_purchaseType", + * // "sku": "my_sku", + * // "status": "my_status", + * // "subscriptionPeriod": "my_subscriptionPeriod", + * // "trialPeriod": "my_trialPeriod" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "defaultLanguage": "my_defaultLanguage", + * // "defaultPrice": {}, + * // "gracePeriod": "my_gracePeriod", + * // "listings": {}, + * // "packageName": "my_packageName", + * // "prices": {}, + * // "purchaseType": "my_purchaseType", + * // "sku": "my_sku", + * // "status": "my_status", + * // "subscriptionPeriod": "my_subscriptionPeriod", + * // "trialPeriod": "my_trialPeriod" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.inappproducts.patch * @memberOf! () * @@ -5096,6 +7091,78 @@ export namespace androidpublisher_v3 { /** * androidpublisher.inappproducts.update * @desc Updates the details of an in-app product. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.inappproducts.update({ + * // If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false. + * autoConvertMissingPrices: 'placeholder-value', + * // Unique identifier for the Android app with the in-app product; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * // Unique identifier for the in-app product. + * sku: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "defaultLanguage": "my_defaultLanguage", + * // "defaultPrice": {}, + * // "gracePeriod": "my_gracePeriod", + * // "listings": {}, + * // "packageName": "my_packageName", + * // "prices": {}, + * // "purchaseType": "my_purchaseType", + * // "sku": "my_sku", + * // "status": "my_status", + * // "subscriptionPeriod": "my_subscriptionPeriod", + * // "trialPeriod": "my_trialPeriod" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "defaultLanguage": "my_defaultLanguage", + * // "defaultPrice": {}, + * // "gracePeriod": "my_gracePeriod", + * // "listings": {}, + * // "packageName": "my_packageName", + * // "prices": {}, + * // "purchaseType": "my_purchaseType", + * // "sku": "my_sku", + * // "status": "my_status", + * // "subscriptionPeriod": "my_subscriptionPeriod", + * // "trialPeriod": "my_trialPeriod" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.inappproducts.update * @memberOf! () * @@ -5308,6 +7375,56 @@ export namespace androidpublisher_v3 { /** * androidpublisher.internalappsharingartifacts.uploadapk * @desc Uploads an APK to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See: https://developers.google.com/api-client-library/java/google-api-java-client/errors for an example in java. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.internalappsharingartifacts.uploadapk({ + * // Unique identifier for the Android app; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * requestBody: { + * // request body parameters + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificateFingerprint": "my_certificateFingerprint", + * // "downloadUrl": "my_downloadUrl", + * // "sha256": "my_sha256" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.internalappsharingartifacts.uploadapk * @memberOf! () * @@ -5396,6 +7513,56 @@ export namespace androidpublisher_v3 { /** * androidpublisher.internalappsharingartifacts.uploadbundle * @desc Uploads an app bundle to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See: https://developers.google.com/api-client-library/java/google-api-java-client/errors for an example in java. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.internalappsharingartifacts.uploadbundle({ + * // Unique identifier for the Android app; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * requestBody: { + * // request body parameters + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificateFingerprint": "my_certificateFingerprint", + * // "downloadUrl": "my_downloadUrl", + * // "sha256": "my_sha256" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.internalappsharingartifacts.uploadbundle * @memberOf! () * @@ -5556,6 +7723,45 @@ export namespace androidpublisher_v3 { /** * androidpublisher.orders.refund * @desc Refund a user's subscription or in-app purchase order. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.orders.refund({ + * // The order ID provided to the user when the subscription or in-app order was purchased. + * orderId: 'placeholder-value', + * // The package name of the application for which this subscription or in-app item was purchased (for example, 'com.some.thing'). + * packageName: 'placeholder-value', + * // Whether to revoke the purchased item. If set to true, access to the subscription or in-app item will be terminated immediately. If the item is a recurring subscription, all future payments will also be terminated. Consumed in-app items need to be handled by developer's app. (optional) + * revoke: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.orders.refund * @memberOf! () * @@ -5671,6 +7877,53 @@ export namespace androidpublisher_v3 { /** * androidpublisher.purchases.products.acknowledge * @desc Acknowledges a purchase of an inapp item. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.purchases.products.acknowledge({ + * // The package name of the application the inapp product was sold in (for example, 'com.some.thing'). + * packageName: 'placeholder-value', + * // The inapp product SKU (for example, 'com.some.thing.inapp1'). + * productId: 'placeholder-value', + * // The token provided to the user's device when the subscription was purchased. + * token: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "developerPayload": "my_developerPayload" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.purchases.products.acknowledge * @memberOf! () * @@ -5746,6 +7999,60 @@ export namespace androidpublisher_v3 { /** * androidpublisher.purchases.products.get * @desc Checks the purchase and consumption status of an inapp item. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.purchases.products.get({ + * // The package name of the application the inapp product was sold in (for example, 'com.some.thing'). + * packageName: 'placeholder-value', + * // The inapp product SKU (for example, 'com.some.thing.inapp1'). + * productId: 'placeholder-value', + * // The token provided to the user's device when the inapp product was purchased. + * token: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acknowledgementState": 0, + * // "consumptionState": 0, + * // "developerPayload": "my_developerPayload", + * // "kind": "my_kind", + * // "orderId": "my_orderId", + * // "productId": "my_productId", + * // "purchaseState": 0, + * // "purchaseTimeMillis": "my_purchaseTimeMillis", + * // "purchaseToken": "my_purchaseToken", + * // "purchaseType": 0, + * // "quantity": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.purchases.products.get * @memberOf! () * @@ -5875,6 +8182,53 @@ export namespace androidpublisher_v3 { /** * androidpublisher.purchases.subscriptions.acknowledge * @desc Acknowledges a subscription purchase. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.purchases.subscriptions.acknowledge({ + * // The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). + * packageName: 'placeholder-value', + * // The purchased subscription ID (for example, 'monthly001'). + * subscriptionId: 'placeholder-value', + * // The token provided to the user's device when the subscription was purchased. + * token: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "developerPayload": "my_developerPayload" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.purchases.subscriptions.acknowledge * @memberOf! () * @@ -5950,6 +8304,45 @@ export namespace androidpublisher_v3 { /** * androidpublisher.purchases.subscriptions.cancel * @desc Cancels a user's subscription purchase. The subscription remains valid until its expiration time. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.purchases.subscriptions.cancel({ + * // The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). + * packageName: 'placeholder-value', + * // The purchased subscription ID (for example, 'monthly001'). + * subscriptionId: 'placeholder-value', + * // The token provided to the user's device when the subscription was purchased. + * token: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.purchases.subscriptions.cancel * @memberOf! () * @@ -6024,6 +8417,58 @@ export namespace androidpublisher_v3 { /** * androidpublisher.purchases.subscriptions.defer * @desc Defers a user's subscription purchase until a specified future expiration time. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.purchases.subscriptions.defer({ + * // The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). + * packageName: 'placeholder-value', + * // The purchased subscription ID (for example, 'monthly001'). + * subscriptionId: 'placeholder-value', + * // The token provided to the user's device when the subscription was purchased. + * token: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deferralInfo": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "newExpiryTimeMillis": "my_newExpiryTimeMillis" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.purchases.subscriptions.defer * @memberOf! () * @@ -6110,6 +8555,76 @@ export namespace androidpublisher_v3 { /** * androidpublisher.purchases.subscriptions.get * @desc Checks whether a user's subscription purchase is valid and returns its expiry time. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.purchases.subscriptions.get({ + * // The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). + * packageName: 'placeholder-value', + * // The purchased subscription ID (for example, 'monthly001'). + * subscriptionId: 'placeholder-value', + * // The token provided to the user's device when the subscription was purchased. + * token: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acknowledgementState": 0, + * // "autoRenewing": false, + * // "autoResumeTimeMillis": "my_autoResumeTimeMillis", + * // "cancelReason": 0, + * // "cancelSurveyResult": {}, + * // "countryCode": "my_countryCode", + * // "developerPayload": "my_developerPayload", + * // "emailAddress": "my_emailAddress", + * // "expiryTimeMillis": "my_expiryTimeMillis", + * // "externalAccountId": "my_externalAccountId", + * // "familyName": "my_familyName", + * // "givenName": "my_givenName", + * // "introductoryPriceInfo": {}, + * // "kind": "my_kind", + * // "linkedPurchaseToken": "my_linkedPurchaseToken", + * // "orderId": "my_orderId", + * // "paymentState": 0, + * // "priceAmountMicros": "my_priceAmountMicros", + * // "priceChange": {}, + * // "priceCurrencyCode": "my_priceCurrencyCode", + * // "profileId": "my_profileId", + * // "profileName": "my_profileName", + * // "promotionCode": "my_promotionCode", + * // "promotionType": 0, + * // "purchaseType": 0, + * // "startTimeMillis": "my_startTimeMillis", + * // "userCancellationTimeMillis": "my_userCancellationTimeMillis" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.purchases.subscriptions.get * @memberOf! () * @@ -6188,6 +8703,45 @@ export namespace androidpublisher_v3 { /** * androidpublisher.purchases.subscriptions.refund * @desc Refunds a user's subscription purchase, but the subscription remains valid until its expiration time and it will continue to recur. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.purchases.subscriptions.refund({ + * // The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). + * packageName: 'placeholder-value', + * // The purchased subscription ID (for example, 'monthly001'). + * subscriptionId: 'placeholder-value', + * // The token provided to the user's device when the subscription was purchased. + * token: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.purchases.subscriptions.refund * @memberOf! () * @@ -6262,6 +8816,45 @@ export namespace androidpublisher_v3 { /** * androidpublisher.purchases.subscriptions.revoke * @desc Refunds and immediately revokes a user's subscription purchase. Access to the subscription will be terminated immediately and it will stop recurring. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.purchases.subscriptions.revoke({ + * // The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). + * packageName: 'placeholder-value', + * // The purchased subscription ID (for example, 'monthly001'). + * subscriptionId: 'placeholder-value', + * // The token provided to the user's device when the subscription was purchased. + * token: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.purchases.subscriptions.revoke * @memberOf! () * @@ -6474,6 +9067,62 @@ export namespace androidpublisher_v3 { /** * androidpublisher.purchases.voidedpurchases.list * @desc Lists the purchases that were canceled, refunded or charged-back. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.purchases.voidedpurchases.list({ + * // The time, in milliseconds since the Epoch, of the newest voided purchase that you want to see in the response. The value of this parameter cannot be greater than the current time and is ignored if a pagination token is set. Default value is current time. Note: This filter is applied on the time at which the record is seen as voided by our systems and not the actual voided time returned in the response. + * endTime: 'placeholder-value', + * + * maxResults: 'placeholder-value', + * // The package name of the application for which voided purchases need to be returned (for example, 'com.some.thing'). + * packageName: 'placeholder-value', + * + * startIndex: 'placeholder-value', + * // The time, in milliseconds since the Epoch, of the oldest voided purchase that you want to see in the response. The value of this parameter cannot be older than 30 days and is ignored if a pagination token is set. Default value is current time minus 30 days. Note: This filter is applied on the time at which the record is seen as voided by our systems and not the actual voided time returned in the response. + * startTime: 'placeholder-value', + * + * token: 'placeholder-value', + * // The type of voided purchases that you want to see in the response. Possible values are: + * // - 0: Only voided in-app product purchases will be returned in the response. This is the default value. + * // - 1: Both voided in-app purchases and voided subscription purchases will be returned in the response. Note: Before requesting to receive voided subscription purchases, you must switch to use orderId in the response which uniquely identifies one-time purchases and subscriptions. Otherwise, you will receive multiple subscription orders with the same PurchaseToken, because subscription renewal orders share the same PurchaseToken. + * type: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "pageInfo": {}, + * // "tokenPagination": {}, + * // "voidedPurchases": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.purchases.voidedpurchases.list * @memberOf! () * @@ -6605,6 +9254,52 @@ export namespace androidpublisher_v3 { /** * androidpublisher.reviews.get * @desc Returns a single review. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.reviews.get({ + * // Unique identifier for the Android app for which we want reviews; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * reviewId: 'placeholder-value', + * + * translationLanguage: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authorName": "my_authorName", + * // "comments": [], + * // "reviewId": "my_reviewId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.reviews.get * @memberOf! () * @@ -6678,6 +9373,55 @@ export namespace androidpublisher_v3 { /** * androidpublisher.reviews.list * @desc Returns a list of reviews. Only reviews from last week will be returned. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.reviews.list({ + * maxResults: 'placeholder-value', + * // Unique identifier for the Android app for which we want reviews; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * startIndex: 'placeholder-value', + * + * token: 'placeholder-value', + * + * translationLanguage: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "pageInfo": {}, + * // "reviews": [], + * // "tokenPagination": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.reviews.list * @memberOf! () * @@ -6755,6 +9499,56 @@ export namespace androidpublisher_v3 { /** * androidpublisher.reviews.reply * @desc Reply to a single review, or update an existing reply. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.reviews.reply({ + * // Unique identifier for the Android app for which we want reviews; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * reviewId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "replyText": "my_replyText" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "result": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.reviews.reply * @memberOf! () * @@ -6915,6 +9709,57 @@ export namespace androidpublisher_v3 { /** * androidpublisher.systemapks.variants.create * @desc Creates a new variant of APK which is suitable for inclusion in a system image. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.systemapks.variants.create({ + * // Unique identifier for the Android app; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * // The version code of the App Bundle. + * versionCode: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deviceSpec": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deviceSpec": {}, + * // "variantId": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.systemapks.variants.create * @memberOf! () * @@ -6989,6 +9834,45 @@ export namespace androidpublisher_v3 { /** * androidpublisher.systemapks.variants.download * @desc Download a previously created APK which is suitable for inclusion in a system image. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.systemapks.variants.download({ + * // Unique identifier for the Android app; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * + * variantId: 'placeholder-value', + * // The version code of the App Bundle. + * versionCode: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.systemapks.variants.download * @memberOf! () * @@ -7063,6 +9947,51 @@ export namespace androidpublisher_v3 { /** * androidpublisher.systemapks.variants.get * @desc Returns a previously created system APK variant. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.systemapks.variants.get({ + * // Unique identifier for the Android app; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * // Unique identifier for this variant. + * variantId: 'placeholder-value', + * // The version code of the App Bundle. + * versionCode: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deviceSpec": {}, + * // "variantId": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.systemapks.variants.get * @memberOf! () * @@ -7137,6 +10066,48 @@ export namespace androidpublisher_v3 { /** * androidpublisher.systemapks.variants.list * @desc Returns the list of previously created system APK variants. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/androidpublisher.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 androidpublisher = google.androidpublisher('v3'); + * + * 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/androidpublisher'], + * }); + * + * // 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 androidpublisher.systemapks.variants.list({ + * // Unique identifier for the Android app; for example, "com.spiffygame". + * packageName: 'placeholder-value', + * // The version code of the App Bundle. + * versionCode: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "variants": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias androidpublisher.systemapks.variants.list * @memberOf! () * diff --git a/src/apis/appengine/v1.ts b/src/apis/appengine/v1.ts index 7e7dcc52401..9d512d81bf1 100644 --- a/src/apis/appengine/v1.ts +++ b/src/apis/appengine/v1.ts @@ -1600,6 +1600,67 @@ export namespace appengine_v1 { /** * appengine.apps.create * @desc Creates an App Engine application for a Google Cloud Platform project. Required fields: id - The ID of the target Cloud Platform project. location - The region (https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located.For more information about App Engine applications, see Managing Projects, Applications, and Billing (https://cloud.google.com/appengine/docs/standard/python/console/). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/cloud-platform'], + * }); + * + * // 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 appengine.apps.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "authDomain": "my_authDomain", + * // "codeBucket": "my_codeBucket", + * // "defaultBucket": "my_defaultBucket", + * // "defaultCookieExpiration": "my_defaultCookieExpiration", + * // "defaultHostname": "my_defaultHostname", + * // "dispatchRules": [], + * // "featureSettings": {}, + * // "gcrDomain": "my_gcrDomain", + * // "iap": {}, + * // "id": "my_id", + * // "locationId": "my_locationId", + * // "name": "my_name", + * // "servingStatus": "my_servingStatus" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.create * @memberOf! () * @@ -1670,6 +1731,62 @@ export namespace appengine_v1 { /** * appengine.apps.get * @desc Gets information about an application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.get({ + * // Part of `name`. Name of the Application resource to get. Example: apps/myapp. + * appsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authDomain": "my_authDomain", + * // "codeBucket": "my_codeBucket", + * // "defaultBucket": "my_defaultBucket", + * // "defaultCookieExpiration": "my_defaultCookieExpiration", + * // "defaultHostname": "my_defaultHostname", + * // "dispatchRules": [], + * // "featureSettings": {}, + * // "gcrDomain": "my_gcrDomain", + * // "iap": {}, + * // "id": "my_id", + * // "locationId": "my_locationId", + * // "name": "my_name", + * // "servingStatus": "my_servingStatus" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.get * @memberOf! () * @@ -1740,6 +1857,72 @@ export namespace appengine_v1 { /** * appengine.apps.patch * @desc Updates the specified Application resource. You can update the following fields: auth_domain - Google authentication domain for controlling user access to the application. default_cookie_expiration - Cookie expiration policy for the application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/cloud-platform'], + * }); + * + * // 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 appengine.apps.patch({ + * // Part of `name`. Name of the Application resource to update. Example: apps/myapp. + * appsId: 'placeholder-value', + * // Standard field mask for the set of fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "authDomain": "my_authDomain", + * // "codeBucket": "my_codeBucket", + * // "defaultBucket": "my_defaultBucket", + * // "defaultCookieExpiration": "my_defaultCookieExpiration", + * // "defaultHostname": "my_defaultHostname", + * // "dispatchRules": [], + * // "featureSettings": {}, + * // "gcrDomain": "my_gcrDomain", + * // "iap": {}, + * // "id": "my_id", + * // "locationId": "my_locationId", + * // "name": "my_name", + * // "servingStatus": "my_servingStatus" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.patch * @memberOf! () * @@ -1812,6 +1995,56 @@ export namespace appengine_v1 { /** * appengine.apps.repair * @desc Recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account. Use this method if you receive an error message about a missing feature, for example, Error retrieving the App Engine service account. If you have deleted your App Engine service account, this will not be able to recreate it. Instead, you should attempt to use the IAM undelete API if possible at https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/undelete?apix_params=%7B"name"%3A"projects%2F-%2FserviceAccounts%2Funique_id"%2C"resource"%3A%7B%7D%7D . If the deletion was recent, the numeric ID can be found in the Cloud Console Activity Log. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/cloud-platform'], + * }); + * + * // 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 appengine.apps.repair({ + * // Part of `name`. Name of the application to repair. Example: apps/myapp + * appsId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.repair * @memberOf! () * @@ -1952,6 +2185,70 @@ export namespace appengine_v1 { /** * appengine.apps.authorizedCertificates.create * @desc Uploads the specified SSL certificate. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/cloud-platform'], + * }); + * + * // 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 appengine.apps.authorizedCertificates.create({ + * // Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * appsId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "certificateRawData": {}, + * // "displayName": "my_displayName", + * // "domainMappingsCount": 0, + * // "domainNames": [], + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "managedCertificate": {}, + * // "name": "my_name", + * // "visibleDomainMappings": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificateRawData": {}, + * // "displayName": "my_displayName", + * // "domainMappingsCount": 0, + * // "domainNames": [], + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "managedCertificate": {}, + * // "name": "my_name", + * // "visibleDomainMappings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.authorizedCertificates.create * @memberOf! () * @@ -2029,6 +2326,46 @@ export namespace appengine_v1 { /** * appengine.apps.authorizedCertificates.delete * @desc Deletes the specified SSL certificate. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/cloud-platform'], + * }); + * + * // 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 appengine.apps.authorizedCertificates.delete({ + * // Part of `name`. Name of the resource to delete. Example: apps/myapp/authorizedCertificates/12345. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * authorizedCertificatesId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.authorizedCertificates.delete * @memberOf! () * @@ -2102,6 +2439,62 @@ export namespace appengine_v1 { /** * appengine.apps.authorizedCertificates.get * @desc Gets the specified SSL certificate. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.authorizedCertificates.get({ + * // Part of `name`. Name of the resource requested. Example: apps/myapp/authorizedCertificates/12345. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * authorizedCertificatesId: 'placeholder-value', + * // Controls the set of fields returned in the GET response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificateRawData": {}, + * // "displayName": "my_displayName", + * // "domainMappingsCount": 0, + * // "domainNames": [], + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "managedCertificate": {}, + * // "name": "my_name", + * // "visibleDomainMappings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.authorizedCertificates.get * @memberOf! () * @@ -2180,6 +2573,57 @@ export namespace appengine_v1 { /** * appengine.apps.authorizedCertificates.list * @desc Lists all SSL certificates the user is authorized to administer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.authorizedCertificates.list({ + * // Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * appsId: 'placeholder-value', + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // Controls the set of fields returned in the LIST response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificates": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.authorizedCertificates.list * @memberOf! () * @@ -2266,6 +2710,74 @@ export namespace appengine_v1 { /** * appengine.apps.authorizedCertificates.patch * @desc Updates the specified SSL certificate. To renew a certificate and maintain its existing domain mappings, update certificate_data with a new certificate. The new certificate must be applicable to the same domains as the original certificate. The certificate display_name may also be updated. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/cloud-platform'], + * }); + * + * // 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 appengine.apps.authorizedCertificates.patch({ + * // Part of `name`. Name of the resource to update. Example: apps/myapp/authorizedCertificates/12345. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * authorizedCertificatesId: 'placeholder-value', + * // Standard field mask for the set of fields to be updated. Updates are only supported on the certificate_raw_data and display_name fields. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "certificateRawData": {}, + * // "displayName": "my_displayName", + * // "domainMappingsCount": 0, + * // "domainNames": [], + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "managedCertificate": {}, + * // "name": "my_name", + * // "visibleDomainMappings": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificateRawData": {}, + * // "displayName": "my_displayName", + * // "domainMappingsCount": 0, + * // "domainNames": [], + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "managedCertificate": {}, + * // "name": "my_name", + * // "visibleDomainMappings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.authorizedCertificates.patch * @memberOf! () * @@ -2455,6 +2967,55 @@ export namespace appengine_v1 { /** * appengine.apps.authorizedDomains.list * @desc Lists all domains the user is authorized to administer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.authorizedDomains.list({ + * // Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * appsId: 'placeholder-value', + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domains": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.authorizedDomains.list * @memberOf! () * @@ -2568,6 +3129,63 @@ export namespace appengine_v1 { /** * appengine.apps.domainMappings.create * @desc Maps a domain to an application. A user must be authorized to administer a domain in order to map it to an application. For a list of available authorized domains, see AuthorizedDomains.ListAuthorizedDomains. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/cloud-platform'], + * }); + * + * // 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 appengine.apps.domainMappings.create({ + * // Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * appsId: 'placeholder-value', + * // Whether the domain creation should override any existing mappings for this domain. By default, overrides are rejected. + * overrideStrategy: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "name": "my_name", + * // "resourceRecords": [], + * // "sslSettings": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.domainMappings.create * @memberOf! () * @@ -2644,6 +3262,52 @@ export namespace appengine_v1 { /** * appengine.apps.domainMappings.delete * @desc Deletes the specified domain mapping. A user must be authorized to administer the associated domain in order to delete a DomainMapping resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/cloud-platform'], + * }); + * + * // 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 appengine.apps.domainMappings.delete({ + * // Part of `name`. Name of the resource to delete. Example: apps/myapp/domainMappings/example.com. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * domainMappingsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.domainMappings.delete * @memberOf! () * @@ -2718,6 +3382,55 @@ export namespace appengine_v1 { /** * appengine.apps.domainMappings.get * @desc Gets the specified domain mapping. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.domainMappings.get({ + * // Part of `name`. Name of the resource requested. Example: apps/myapp/domainMappings/example.com. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * domainMappingsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "name": "my_name", + * // "resourceRecords": [], + * // "sslSettings": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.domainMappings.get * @memberOf! () * @@ -2792,6 +3505,55 @@ export namespace appengine_v1 { /** * appengine.apps.domainMappings.list * @desc Lists the domain mappings on an application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.domainMappings.list({ + * // Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * appsId: 'placeholder-value', + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domainMappings": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.domainMappings.list * @memberOf! () * @@ -2875,6 +3637,65 @@ export namespace appengine_v1 { /** * appengine.apps.domainMappings.patch * @desc Updates the specified domain mapping. To map an SSL certificate to a domain mapping, update certificate_id to point to an AuthorizedCertificate resource. A user must be authorized to administer the associated domain in order to update a DomainMapping resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/cloud-platform'], + * }); + * + * // 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 appengine.apps.domainMappings.patch({ + * // Part of `name`. Name of the resource to update. Example: apps/myapp/domainMappings/example.com. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * domainMappingsId: 'placeholder-value', + * // Standard field mask for the set of fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "name": "my_name", + * // "resourceRecords": [], + * // "sslSettings": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.domainMappings.patch * @memberOf! () * @@ -3066,6 +3887,54 @@ export namespace appengine_v1 { /** * appengine.apps.firewall.ingressRules.batchUpdate * @desc Replaces the entire firewall ruleset in one bulk operation. This overrides and replaces the rules of an existing firewall with the new rules.If the final rule does not match traffic with the '*' wildcard IP range, then an "allow all" rule is explicitly added to the end of the list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/cloud-platform'], + * }); + * + * // 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 appengine.apps.firewall.ingressRules.batchUpdate({ + * // Part of `name`. Name of the Firewall collection to set. Example: apps/myapp/firewall/ingressRules. + * appsId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ingressRules": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ingressRules": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.firewall.ingressRules.batchUpdate * @memberOf! () * @@ -3149,6 +4018,60 @@ export namespace appengine_v1 { /** * appengine.apps.firewall.ingressRules.create * @desc Creates a firewall rule for the application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/cloud-platform'], + * }); + * + * // 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 appengine.apps.firewall.ingressRules.create({ + * // Part of `parent`. Name of the parent Firewall collection in which to create a new rule. Example: apps/myapp/firewall/ingressRules. + * appsId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "priority": 0, + * // "sourceRange": "my_sourceRange" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "priority": 0, + * // "sourceRange": "my_sourceRange" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.firewall.ingressRules.create * @memberOf! () * @@ -3224,6 +4147,46 @@ export namespace appengine_v1 { /** * appengine.apps.firewall.ingressRules.delete * @desc Deletes the specified firewall rule. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/cloud-platform'], + * }); + * + * // 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 appengine.apps.firewall.ingressRules.delete({ + * // Part of `name`. Name of the Firewall resource to delete. Example: apps/myapp/firewall/ingressRules/100. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * ingressRulesId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.firewall.ingressRules.delete * @memberOf! () * @@ -3297,6 +4260,55 @@ export namespace appengine_v1 { /** * appengine.apps.firewall.ingressRules.get * @desc Gets the specified firewall rule. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.firewall.ingressRules.get({ + * // Part of `name`. Name of the Firewall resource to retrieve. Example: apps/myapp/firewall/ingressRules/100. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * ingressRulesId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "priority": 0, + * // "sourceRange": "my_sourceRange" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.firewall.ingressRules.get * @memberOf! () * @@ -3372,6 +4384,57 @@ export namespace appengine_v1 { /** * appengine.apps.firewall.ingressRules.list * @desc Lists the firewall rules of an application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.firewall.ingressRules.list({ + * // Part of `parent`. Name of the Firewall collection to retrieve. Example: apps/myapp/firewall/ingressRules. + * appsId: 'placeholder-value', + * // A valid IP Address. If set, only rules matching this address will be returned. The first returned rule will be the rule that fires on requests from this IP. + * matchingAddress: 'placeholder-value', + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ingressRules": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.firewall.ingressRules.list * @memberOf! () * @@ -3451,6 +4514,64 @@ export namespace appengine_v1 { /** * appengine.apps.firewall.ingressRules.patch * @desc Updates the specified firewall rule. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/cloud-platform'], + * }); + * + * // 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 appengine.apps.firewall.ingressRules.patch({ + * // Part of `name`. Name of the Firewall resource to update. Example: apps/myapp/firewall/ingressRules/100. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * ingressRulesId: 'placeholder-value', + * // Standard field mask for the set of fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "priority": 0, + * // "sourceRange": "my_sourceRange" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "priority": 0, + * // "sourceRange": "my_sourceRange" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.firewall.ingressRules.patch * @memberOf! () * @@ -3651,6 +4772,56 @@ export namespace appengine_v1 { /** * appengine.apps.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.locations.get({ + * // Part of `name`. Resource name for the location. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * locationsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.locations.get * @memberOf! () * @@ -3723,6 +4894,57 @@ export namespace appengine_v1 { /** * appengine.apps.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.locations.list({ + * // Part of `name`. The resource that owns the locations collection, if applicable. + * appsId: 'placeholder-value', + * // The standard list filter. + * filter: 'placeholder-value', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.locations.list * @memberOf! () * @@ -3850,6 +5072,56 @@ export namespace appengine_v1 { /** * appengine.apps.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.operations.get({ + * // Part of `name`. The name of the operation resource. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * operationsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.operations.get * @memberOf! () * @@ -3924,6 +5196,57 @@ export namespace appengine_v1 { /** * appengine.apps.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/x/operations. To override the binding, API services can add a binding such as "/v1/{name=users/x}/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.operations.list({ + * // Part of `name`. The name of the operation's parent resource. + * appsId: 'placeholder-value', + * // The standard list filter. + * filter: 'placeholder-value', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.operations.list * @memberOf! () * @@ -4053,6 +5376,52 @@ export namespace appengine_v1 { /** * appengine.apps.services.delete * @desc Deletes the specified service and all enclosed versions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/cloud-platform'], + * }); + * + * // 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 appengine.apps.services.delete({ + * // Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.delete * @memberOf! () * @@ -4128,6 +5497,54 @@ export namespace appengine_v1 { /** * appengine.apps.services.get * @desc Gets the current configuration of the specified service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.services.get({ + * // Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "name": "my_name", + * // "split": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.get * @memberOf! () * @@ -4201,6 +5618,55 @@ export namespace appengine_v1 { /** * appengine.apps.services.list * @desc Lists all the services in the application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.services.list({ + * // Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * appsId: 'placeholder-value', + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "services": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.list * @memberOf! () * @@ -4279,6 +5745,66 @@ export namespace appengine_v1 { /** * appengine.apps.services.patch * @desc Updates the configuration of the specified service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/cloud-platform'], + * }); + * + * // 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 appengine.apps.services.patch({ + * // Part of `name`. Name of the resource to update. Example: apps/myapp/services/default. + * appsId: 'placeholder-value', + * // Set to true to gradually shift traffic to one or more versions that you specify. By default, traffic is shifted immediately. For gradual traffic migration, the target versions must be located within instances that are configured for both warmup requests (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#InboundServiceType) and automatic scaling (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#AutomaticScaling). You must specify the shardBy (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#ShardBy) field in the Service resource. Gradual traffic migration is not supported in the App Engine flexible environment. For examples, see Migrating and Splitting Traffic (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic). + * migrateTraffic: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * // Standard field mask for the set of fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "name": "my_name", + * // "split": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.patch * @memberOf! () * @@ -4450,6 +5976,96 @@ export namespace appengine_v1 { /** * appengine.apps.services.versions.create * @desc Deploys code and resource files to a new version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/cloud-platform'], + * }); + * + * // 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 appengine.apps.services.versions.create({ + * // Part of `parent`. Name of the parent resource to create this version under. Example: apps/myapp/services/default. + * appsId: 'placeholder-value', + * // Part of `parent`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiConfig": {}, + * // "automaticScaling": {}, + * // "basicScaling": {}, + * // "betaSettings": {}, + * // "createTime": "my_createTime", + * // "createdBy": "my_createdBy", + * // "defaultExpiration": "my_defaultExpiration", + * // "deployment": {}, + * // "diskUsageBytes": "my_diskUsageBytes", + * // "endpointsApiService": {}, + * // "entrypoint": {}, + * // "env": "my_env", + * // "envVariables": {}, + * // "errorHandlers": [], + * // "handlers": [], + * // "healthCheck": {}, + * // "id": "my_id", + * // "inboundServices": [], + * // "instanceClass": "my_instanceClass", + * // "libraries": [], + * // "livenessCheck": {}, + * // "manualScaling": {}, + * // "name": "my_name", + * // "network": {}, + * // "nobuildFilesRegex": "my_nobuildFilesRegex", + * // "readinessCheck": {}, + * // "resources": {}, + * // "runtime": "my_runtime", + * // "runtimeApiVersion": "my_runtimeApiVersion", + * // "runtimeChannel": "my_runtimeChannel", + * // "runtimeMainExecutablePath": "my_runtimeMainExecutablePath", + * // "servingStatus": "my_servingStatus", + * // "threadsafe": false, + * // "versionUrl": "my_versionUrl", + * // "vm": false, + * // "vpcAccessConnector": {}, + * // "zones": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.versions.create * @memberOf! () * @@ -4525,6 +6141,54 @@ export namespace appengine_v1 { /** * appengine.apps.services.versions.delete * @desc Deletes an existing Version resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/cloud-platform'], + * }); + * + * // 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 appengine.apps.services.versions.delete({ + * // Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * versionsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.versions.delete * @memberOf! () * @@ -4601,6 +6265,92 @@ export namespace appengine_v1 { /** * appengine.apps.services.versions.get * @desc Gets the specified Version resource. By default, only a BASIC_VIEW will be returned. Specify the FULL_VIEW parameter to get the full resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.services.versions.get({ + * // Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * versionsId: 'placeholder-value', + * // Controls the set of fields returned in the Get response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiConfig": {}, + * // "automaticScaling": {}, + * // "basicScaling": {}, + * // "betaSettings": {}, + * // "createTime": "my_createTime", + * // "createdBy": "my_createdBy", + * // "defaultExpiration": "my_defaultExpiration", + * // "deployment": {}, + * // "diskUsageBytes": "my_diskUsageBytes", + * // "endpointsApiService": {}, + * // "entrypoint": {}, + * // "env": "my_env", + * // "envVariables": {}, + * // "errorHandlers": [], + * // "handlers": [], + * // "healthCheck": {}, + * // "id": "my_id", + * // "inboundServices": [], + * // "instanceClass": "my_instanceClass", + * // "libraries": [], + * // "livenessCheck": {}, + * // "manualScaling": {}, + * // "name": "my_name", + * // "network": {}, + * // "nobuildFilesRegex": "my_nobuildFilesRegex", + * // "readinessCheck": {}, + * // "resources": {}, + * // "runtime": "my_runtime", + * // "runtimeApiVersion": "my_runtimeApiVersion", + * // "runtimeChannel": "my_runtimeChannel", + * // "runtimeMainExecutablePath": "my_runtimeMainExecutablePath", + * // "servingStatus": "my_servingStatus", + * // "threadsafe": false, + * // "versionUrl": "my_versionUrl", + * // "vm": false, + * // "vpcAccessConnector": {}, + * // "zones": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.versions.get * @memberOf! () * @@ -4676,6 +6426,59 @@ export namespace appengine_v1 { /** * appengine.apps.services.versions.list * @desc Lists the versions of a service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.services.versions.list({ + * // Part of `parent`. Name of the parent Service resource. Example: apps/myapp/services/default. + * appsId: 'placeholder-value', + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // Part of `parent`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * // Controls the set of fields returned in the List response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "versions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.versions.list * @memberOf! () * @@ -4755,6 +6558,100 @@ export namespace appengine_v1 { /** * appengine.apps.services.versions.patch * @desc Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses:Standard environment instance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class)automatic scaling in the standard environment: automatic_scaling.min_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) automatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) automaticScaling.standard_scheduler_settings.max_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) automaticScaling.standard_scheduler_settings.min_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) automaticScaling.standard_scheduler_settings.target_cpu_utilization (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) automaticScaling.standard_scheduler_settings.target_throughput_utilization (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)basic scaling or manual scaling in the standard environment: serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status)Flexible environment serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status)automatic scaling in the flexible environment: automatic_scaling.min_total_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) automatic_scaling.max_total_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) automatic_scaling.cool_down_period_sec (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) automatic_scaling.cpu_utilization.target_utilization (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling) + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/cloud-platform'], + * }); + * + * // 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 appengine.apps.services.versions.patch({ + * // Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * // Standard field mask for the set of fields to be updated. + * updateMask: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * versionsId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiConfig": {}, + * // "automaticScaling": {}, + * // "basicScaling": {}, + * // "betaSettings": {}, + * // "createTime": "my_createTime", + * // "createdBy": "my_createdBy", + * // "defaultExpiration": "my_defaultExpiration", + * // "deployment": {}, + * // "diskUsageBytes": "my_diskUsageBytes", + * // "endpointsApiService": {}, + * // "entrypoint": {}, + * // "env": "my_env", + * // "envVariables": {}, + * // "errorHandlers": [], + * // "handlers": [], + * // "healthCheck": {}, + * // "id": "my_id", + * // "inboundServices": [], + * // "instanceClass": "my_instanceClass", + * // "libraries": [], + * // "livenessCheck": {}, + * // "manualScaling": {}, + * // "name": "my_name", + * // "network": {}, + * // "nobuildFilesRegex": "my_nobuildFilesRegex", + * // "readinessCheck": {}, + * // "resources": {}, + * // "runtime": "my_runtime", + * // "runtimeApiVersion": "my_runtimeApiVersion", + * // "runtimeChannel": "my_runtimeChannel", + * // "runtimeMainExecutablePath": "my_runtimeMainExecutablePath", + * // "servingStatus": "my_servingStatus", + * // "threadsafe": false, + * // "versionUrl": "my_versionUrl", + * // "vm": false, + * // "vpcAccessConnector": {}, + * // "zones": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.versions.patch * @memberOf! () * @@ -4963,6 +6860,64 @@ export namespace appengine_v1 { /** * appengine.apps.services.versions.instances.debug * @desc Enables debugging on a VM instance. This allows you to use the SSH command to connect to the virtual machine where the instance lives. While in "debug mode", the instance continues to serve live traffic. You should delete the instance when you are done debugging and then allow the system to take over and determine if another instance should be started.Only applicable for instances in App Engine flexible environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/cloud-platform'], + * }); + * + * // 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 appengine.apps.services.versions.instances.debug({ + * // Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * instancesId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * versionsId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sshKey": "my_sshKey" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.versions.instances.debug * @memberOf! () * @@ -5041,6 +6996,56 @@ export namespace appengine_v1 { /** * appengine.apps.services.versions.instances.delete * @desc Stops a running instance.The instance might be automatically recreated based on the scaling settings of the version. For more information, see "How Instances are Managed" (standard environment (https://cloud.google.com/appengine/docs/standard/python/how-instances-are-managed) | flexible environment (https://cloud.google.com/appengine/docs/flexible/python/how-instances-are-managed)).To ensure that instances are not re-created and avoid getting billed, you can stop all instances within the target version by changing the serving status of the version to STOPPED with the apps.services.versions.patch (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions/patch) method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/cloud-platform'], + * }); + * + * // 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 appengine.apps.services.versions.instances.delete({ + * // Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * instancesId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * versionsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.versions.instances.delete * @memberOf! () * @@ -5118,6 +7123,71 @@ export namespace appengine_v1 { /** * appengine.apps.services.versions.instances.get * @desc Gets instance information. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.services.versions.instances.get({ + * // Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * instancesId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * versionsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineRelease": "my_appEngineRelease", + * // "availability": "my_availability", + * // "averageLatency": 0, + * // "errors": 0, + * // "id": "my_id", + * // "memoryUsage": "my_memoryUsage", + * // "name": "my_name", + * // "qps": {}, + * // "requests": 0, + * // "startTime": "my_startTime", + * // "vmDebugEnabled": false, + * // "vmId": "my_vmId", + * // "vmIp": "my_vmIp", + * // "vmName": "my_vmName", + * // "vmStatus": "my_vmStatus", + * // "vmZoneName": "my_vmZoneName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.versions.instances.get * @memberOf! () * @@ -5193,6 +7263,59 @@ export namespace appengine_v1 { /** * appengine.apps.services.versions.instances.list * @desc Lists the instances of a version.Tip: To aggregate details about instances over time, see the Stackdriver Monitoring API (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.services.versions.instances.list({ + * // Part of `parent`. Name of the parent Version resource. Example: apps/myapp/services/default/versions/v1. + * appsId: 'placeholder-value', + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // Part of `parent`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * // Part of `parent`. See documentation of `appsId`. + * versionsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "instances": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.versions.instances.list * @memberOf! () * diff --git a/src/apis/appengine/v1alpha.ts b/src/apis/appengine/v1alpha.ts index 7bfbca0ff61..9dc78c530f4 100644 --- a/src/apis/appengine/v1alpha.ts +++ b/src/apis/appengine/v1alpha.ts @@ -553,6 +553,70 @@ export namespace appengine_v1alpha { /** * appengine.apps.authorizedCertificates.create * @desc Uploads the specified SSL certificate. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.authorizedCertificates.create({ + * // Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * appsId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "certificateRawData": {}, + * // "displayName": "my_displayName", + * // "domainMappingsCount": 0, + * // "domainNames": [], + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "managedCertificate": {}, + * // "name": "my_name", + * // "visibleDomainMappings": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificateRawData": {}, + * // "displayName": "my_displayName", + * // "domainMappingsCount": 0, + * // "domainNames": [], + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "managedCertificate": {}, + * // "name": "my_name", + * // "visibleDomainMappings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.authorizedCertificates.create * @memberOf! () * @@ -629,6 +693,46 @@ export namespace appengine_v1alpha { /** * appengine.apps.authorizedCertificates.delete * @desc Deletes the specified SSL certificate. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.authorizedCertificates.delete({ + * // Part of `name`. Name of the resource to delete. Example: apps/myapp/authorizedCertificates/12345. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * authorizedCertificatesId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.authorizedCertificates.delete * @memberOf! () * @@ -702,6 +806,62 @@ export namespace appengine_v1alpha { /** * appengine.apps.authorizedCertificates.get * @desc Gets the specified SSL certificate. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1alpha'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.authorizedCertificates.get({ + * // Part of `name`. Name of the resource requested. Example: apps/myapp/authorizedCertificates/12345. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * authorizedCertificatesId: 'placeholder-value', + * // Controls the set of fields returned in the GET response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificateRawData": {}, + * // "displayName": "my_displayName", + * // "domainMappingsCount": 0, + * // "domainNames": [], + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "managedCertificate": {}, + * // "name": "my_name", + * // "visibleDomainMappings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.authorizedCertificates.get * @memberOf! () * @@ -780,6 +940,57 @@ export namespace appengine_v1alpha { /** * appengine.apps.authorizedCertificates.list * @desc Lists all SSL certificates the user is authorized to administer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1alpha'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.authorizedCertificates.list({ + * // Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * appsId: 'placeholder-value', + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // Controls the set of fields returned in the LIST response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificates": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.authorizedCertificates.list * @memberOf! () * @@ -865,6 +1076,74 @@ export namespace appengine_v1alpha { /** * appengine.apps.authorizedCertificates.patch * @desc Updates the specified SSL certificate. To renew a certificate and maintain its existing domain mappings, update certificate_data with a new certificate. The new certificate must be applicable to the same domains as the original certificate. The certificate display_name may also be updated. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.authorizedCertificates.patch({ + * // Part of `name`. Name of the resource to update. Example: apps/myapp/authorizedCertificates/12345. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * authorizedCertificatesId: 'placeholder-value', + * // Standard field mask for the set of fields to be updated. Updates are only supported on the certificate_raw_data and display_name fields. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "certificateRawData": {}, + * // "displayName": "my_displayName", + * // "domainMappingsCount": 0, + * // "domainNames": [], + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "managedCertificate": {}, + * // "name": "my_name", + * // "visibleDomainMappings": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificateRawData": {}, + * // "displayName": "my_displayName", + * // "domainMappingsCount": 0, + * // "domainNames": [], + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "managedCertificate": {}, + * // "name": "my_name", + * // "visibleDomainMappings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.authorizedCertificates.patch * @memberOf! () * @@ -1054,6 +1333,55 @@ export namespace appengine_v1alpha { /** * appengine.apps.authorizedDomains.list * @desc Lists all domains the user is authorized to administer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1alpha'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.authorizedDomains.list({ + * // Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * appsId: 'placeholder-value', + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domains": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.authorizedDomains.list * @memberOf! () * @@ -1167,6 +1495,65 @@ export namespace appengine_v1alpha { /** * appengine.apps.domainMappings.create * @desc Maps a domain to an application. A user must be authorized to administer a domain in order to map it to an application. For a list of available authorized domains, see AuthorizedDomains.ListAuthorizedDomains. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.domainMappings.create({ + * // Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * appsId: 'placeholder-value', + * // Whether a managed certificate should be provided by App Engine. If true, a certificate ID must be manaually set in the DomainMapping resource to configure SSL for this domain. If false, a managed certificate will be provisioned and a certificate ID will be automatically populated. + * noManagedCertificate: 'placeholder-value', + * // Whether the domain creation should override any existing mappings for this domain. By default, overrides are rejected. + * overrideStrategy: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "name": "my_name", + * // "resourceRecords": [], + * // "sslSettings": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.domainMappings.create * @memberOf! () * @@ -1244,6 +1631,52 @@ export namespace appengine_v1alpha { /** * appengine.apps.domainMappings.delete * @desc Deletes the specified domain mapping. A user must be authorized to administer the associated domain in order to delete a DomainMapping resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.domainMappings.delete({ + * // Part of `name`. Name of the resource to delete. Example: apps/myapp/domainMappings/example.com. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * domainMappingsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.domainMappings.delete * @memberOf! () * @@ -1319,6 +1752,55 @@ export namespace appengine_v1alpha { /** * appengine.apps.domainMappings.get * @desc Gets the specified domain mapping. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1alpha'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.domainMappings.get({ + * // Part of `name`. Name of the resource requested. Example: apps/myapp/domainMappings/example.com. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * domainMappingsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "name": "my_name", + * // "resourceRecords": [], + * // "sslSettings": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.domainMappings.get * @memberOf! () * @@ -1394,6 +1876,55 @@ export namespace appengine_v1alpha { /** * appengine.apps.domainMappings.list * @desc Lists the domain mappings on an application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1alpha'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.domainMappings.list({ + * // Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * appsId: 'placeholder-value', + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domainMappings": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.domainMappings.list * @memberOf! () * @@ -1477,6 +2008,67 @@ export namespace appengine_v1alpha { /** * appengine.apps.domainMappings.patch * @desc Updates the specified domain mapping. To map an SSL certificate to a domain mapping, update certificate_id to point to an AuthorizedCertificate resource. A user must be authorized to administer the associated domain in order to update a DomainMapping resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.domainMappings.patch({ + * // Part of `name`. Name of the resource to update. Example: apps/myapp/domainMappings/example.com. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * domainMappingsId: 'placeholder-value', + * // Whether a managed certificate should be provided by App Engine. If true, a certificate ID must be manually set in the DomainMapping resource to configure SSL for this domain. If false, a managed certificate will be provisioned and a certificate ID will be automatically populated. Only applicable if ssl_settings.certificate_id is specified in the update mask. + * noManagedCertificate: 'placeholder-value', + * // Standard field mask for the set of fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "name": "my_name", + * // "resourceRecords": [], + * // "sslSettings": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.domainMappings.patch * @memberOf! () * @@ -1669,6 +2261,56 @@ export namespace appengine_v1alpha { /** * appengine.apps.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1alpha'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.locations.get({ + * // Part of `name`. Resource name for the location. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * locationsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.locations.get * @memberOf! () * @@ -1741,6 +2383,57 @@ export namespace appengine_v1alpha { /** * appengine.apps.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1alpha'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.locations.list({ + * // Part of `name`. The resource that owns the locations collection, if applicable. + * appsId: 'placeholder-value', + * // The standard list filter. + * filter: 'placeholder-value', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.locations.list * @memberOf! () * @@ -1868,6 +2561,56 @@ export namespace appengine_v1alpha { /** * appengine.apps.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1alpha'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.operations.get({ + * // Part of `name`. The name of the operation resource. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * operationsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.operations.get * @memberOf! () * @@ -1942,6 +2685,57 @@ export namespace appengine_v1alpha { /** * appengine.apps.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/x/operations. To override the binding, API services can add a binding such as "/v1/{name=users/x}/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1alpha'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.operations.list({ + * // Part of `name`. The name of the operation's parent resource. + * appsId: 'placeholder-value', + * // The standard list filter. + * filter: 'placeholder-value', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.operations.list * @memberOf! () * diff --git a/src/apis/appengine/v1beta.ts b/src/apis/appengine/v1beta.ts index dbdecd672d6..d20ee220778 100644 --- a/src/apis/appengine/v1beta.ts +++ b/src/apis/appengine/v1beta.ts @@ -1642,6 +1642,67 @@ export namespace appengine_v1beta { /** * appengine.apps.create * @desc Creates an App Engine application for a Google Cloud Platform project. Required fields: id - The ID of the target Cloud Platform project. location - The region (https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located.For more information about App Engine applications, see Managing Projects, Applications, and Billing (https://cloud.google.com/appengine/docs/standard/python/console/). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "authDomain": "my_authDomain", + * // "codeBucket": "my_codeBucket", + * // "defaultBucket": "my_defaultBucket", + * // "defaultCookieExpiration": "my_defaultCookieExpiration", + * // "defaultHostname": "my_defaultHostname", + * // "dispatchRules": [], + * // "featureSettings": {}, + * // "gcrDomain": "my_gcrDomain", + * // "iap": {}, + * // "id": "my_id", + * // "locationId": "my_locationId", + * // "name": "my_name", + * // "servingStatus": "my_servingStatus" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.create * @memberOf! () * @@ -1712,6 +1773,62 @@ export namespace appengine_v1beta { /** * appengine.apps.get * @desc Gets information about an application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.get({ + * // Part of `name`. Name of the Application resource to get. Example: apps/myapp. + * appsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authDomain": "my_authDomain", + * // "codeBucket": "my_codeBucket", + * // "defaultBucket": "my_defaultBucket", + * // "defaultCookieExpiration": "my_defaultCookieExpiration", + * // "defaultHostname": "my_defaultHostname", + * // "dispatchRules": [], + * // "featureSettings": {}, + * // "gcrDomain": "my_gcrDomain", + * // "iap": {}, + * // "id": "my_id", + * // "locationId": "my_locationId", + * // "name": "my_name", + * // "servingStatus": "my_servingStatus" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.get * @memberOf! () * @@ -1785,6 +1902,72 @@ export namespace appengine_v1beta { /** * appengine.apps.patch * @desc Updates the specified Application resource. You can update the following fields: auth_domain - Google authentication domain for controlling user access to the application. default_cookie_expiration - Cookie expiration policy for the application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.patch({ + * // Part of `name`. Name of the Application resource to update. Example: apps/myapp. + * appsId: 'placeholder-value', + * // Standard field mask for the set of fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "authDomain": "my_authDomain", + * // "codeBucket": "my_codeBucket", + * // "defaultBucket": "my_defaultBucket", + * // "defaultCookieExpiration": "my_defaultCookieExpiration", + * // "defaultHostname": "my_defaultHostname", + * // "dispatchRules": [], + * // "featureSettings": {}, + * // "gcrDomain": "my_gcrDomain", + * // "iap": {}, + * // "id": "my_id", + * // "locationId": "my_locationId", + * // "name": "my_name", + * // "servingStatus": "my_servingStatus" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.patch * @memberOf! () * @@ -1860,6 +2043,56 @@ export namespace appengine_v1beta { /** * appengine.apps.repair * @desc Recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account. Use this method if you receive an error message about a missing feature, for example, Error retrieving the App Engine service account. If you have deleted your App Engine service account, this will not be able to recreate it. Instead, you should attempt to use the IAM undelete API if possible at https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/undelete?apix_params=%7B"name"%3A"projects%2F-%2FserviceAccounts%2Funique_id"%2C"resource"%3A%7B%7D%7D . If the deletion was recent, the numeric ID can be found in the Cloud Console Activity Log. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.repair({ + * // Part of `name`. Name of the application to repair. Example: apps/myapp + * appsId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.repair * @memberOf! () * @@ -2000,6 +2233,70 @@ export namespace appengine_v1beta { /** * appengine.apps.authorizedCertificates.create * @desc Uploads the specified SSL certificate. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.authorizedCertificates.create({ + * // Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * appsId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "certificateRawData": {}, + * // "displayName": "my_displayName", + * // "domainMappingsCount": 0, + * // "domainNames": [], + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "managedCertificate": {}, + * // "name": "my_name", + * // "visibleDomainMappings": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificateRawData": {}, + * // "displayName": "my_displayName", + * // "domainMappingsCount": 0, + * // "domainNames": [], + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "managedCertificate": {}, + * // "name": "my_name", + * // "visibleDomainMappings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.authorizedCertificates.create * @memberOf! () * @@ -2076,6 +2373,46 @@ export namespace appengine_v1beta { /** * appengine.apps.authorizedCertificates.delete * @desc Deletes the specified SSL certificate. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.authorizedCertificates.delete({ + * // Part of `name`. Name of the resource to delete. Example: apps/myapp/authorizedCertificates/12345. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * authorizedCertificatesId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.authorizedCertificates.delete * @memberOf! () * @@ -2149,6 +2486,62 @@ export namespace appengine_v1beta { /** * appengine.apps.authorizedCertificates.get * @desc Gets the specified SSL certificate. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.authorizedCertificates.get({ + * // Part of `name`. Name of the resource requested. Example: apps/myapp/authorizedCertificates/12345. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * authorizedCertificatesId: 'placeholder-value', + * // Controls the set of fields returned in the GET response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificateRawData": {}, + * // "displayName": "my_displayName", + * // "domainMappingsCount": 0, + * // "domainNames": [], + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "managedCertificate": {}, + * // "name": "my_name", + * // "visibleDomainMappings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.authorizedCertificates.get * @memberOf! () * @@ -2227,6 +2620,57 @@ export namespace appengine_v1beta { /** * appengine.apps.authorizedCertificates.list * @desc Lists all SSL certificates the user is authorized to administer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.authorizedCertificates.list({ + * // Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * appsId: 'placeholder-value', + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // Controls the set of fields returned in the LIST response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificates": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.authorizedCertificates.list * @memberOf! () * @@ -2312,6 +2756,74 @@ export namespace appengine_v1beta { /** * appengine.apps.authorizedCertificates.patch * @desc Updates the specified SSL certificate. To renew a certificate and maintain its existing domain mappings, update certificate_data with a new certificate. The new certificate must be applicable to the same domains as the original certificate. The certificate display_name may also be updated. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.authorizedCertificates.patch({ + * // Part of `name`. Name of the resource to update. Example: apps/myapp/authorizedCertificates/12345. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * authorizedCertificatesId: 'placeholder-value', + * // Standard field mask for the set of fields to be updated. Updates are only supported on the certificate_raw_data and display_name fields. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "certificateRawData": {}, + * // "displayName": "my_displayName", + * // "domainMappingsCount": 0, + * // "domainNames": [], + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "managedCertificate": {}, + * // "name": "my_name", + * // "visibleDomainMappings": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificateRawData": {}, + * // "displayName": "my_displayName", + * // "domainMappingsCount": 0, + * // "domainNames": [], + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "managedCertificate": {}, + * // "name": "my_name", + * // "visibleDomainMappings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.authorizedCertificates.patch * @memberOf! () * @@ -2501,6 +3013,55 @@ export namespace appengine_v1beta { /** * appengine.apps.authorizedDomains.list * @desc Lists all domains the user is authorized to administer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.authorizedDomains.list({ + * // Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * appsId: 'placeholder-value', + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domains": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.authorizedDomains.list * @memberOf! () * @@ -2614,6 +3175,63 @@ export namespace appengine_v1beta { /** * appengine.apps.domainMappings.create * @desc Maps a domain to an application. A user must be authorized to administer a domain in order to map it to an application. For a list of available authorized domains, see AuthorizedDomains.ListAuthorizedDomains. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.domainMappings.create({ + * // Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * appsId: 'placeholder-value', + * // Whether the domain creation should override any existing mappings for this domain. By default, overrides are rejected. + * overrideStrategy: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "name": "my_name", + * // "resourceRecords": [], + * // "sslSettings": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.domainMappings.create * @memberOf! () * @@ -2690,6 +3308,52 @@ export namespace appengine_v1beta { /** * appengine.apps.domainMappings.delete * @desc Deletes the specified domain mapping. A user must be authorized to administer the associated domain in order to delete a DomainMapping resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.domainMappings.delete({ + * // Part of `name`. Name of the resource to delete. Example: apps/myapp/domainMappings/example.com. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * domainMappingsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.domainMappings.delete * @memberOf! () * @@ -2765,6 +3429,55 @@ export namespace appengine_v1beta { /** * appengine.apps.domainMappings.get * @desc Gets the specified domain mapping. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.domainMappings.get({ + * // Part of `name`. Name of the resource requested. Example: apps/myapp/domainMappings/example.com. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * domainMappingsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "name": "my_name", + * // "resourceRecords": [], + * // "sslSettings": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.domainMappings.get * @memberOf! () * @@ -2840,6 +3553,55 @@ export namespace appengine_v1beta { /** * appengine.apps.domainMappings.list * @desc Lists the domain mappings on an application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.domainMappings.list({ + * // Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * appsId: 'placeholder-value', + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domainMappings": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.domainMappings.list * @memberOf! () * @@ -2923,6 +3685,65 @@ export namespace appengine_v1beta { /** * appengine.apps.domainMappings.patch * @desc Updates the specified domain mapping. To map an SSL certificate to a domain mapping, update certificate_id to point to an AuthorizedCertificate resource. A user must be authorized to administer the associated domain in order to update a DomainMapping resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.domainMappings.patch({ + * // Part of `name`. Name of the resource to update. Example: apps/myapp/domainMappings/example.com. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * domainMappingsId: 'placeholder-value', + * // Standard field mask for the set of fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "name": "my_name", + * // "resourceRecords": [], + * // "sslSettings": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.domainMappings.patch * @memberOf! () * @@ -3115,6 +3936,54 @@ export namespace appengine_v1beta { /** * appengine.apps.firewall.ingressRules.batchUpdate * @desc Replaces the entire firewall ruleset in one bulk operation. This overrides and replaces the rules of an existing firewall with the new rules.If the final rule does not match traffic with the '*' wildcard IP range, then an "allow all" rule is explicitly added to the end of the list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.firewall.ingressRules.batchUpdate({ + * // Part of `name`. Name of the Firewall collection to set. Example: apps/myapp/firewall/ingressRules. + * appsId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ingressRules": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ingressRules": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.firewall.ingressRules.batchUpdate * @memberOf! () * @@ -3199,6 +4068,60 @@ export namespace appengine_v1beta { /** * appengine.apps.firewall.ingressRules.create * @desc Creates a firewall rule for the application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.firewall.ingressRules.create({ + * // Part of `parent`. Name of the parent Firewall collection in which to create a new rule. Example: apps/myapp/firewall/ingressRules. + * appsId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "priority": 0, + * // "sourceRange": "my_sourceRange" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "priority": 0, + * // "sourceRange": "my_sourceRange" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.firewall.ingressRules.create * @memberOf! () * @@ -3273,6 +4196,46 @@ export namespace appengine_v1beta { /** * appengine.apps.firewall.ingressRules.delete * @desc Deletes the specified firewall rule. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.firewall.ingressRules.delete({ + * // Part of `name`. Name of the Firewall resource to delete. Example: apps/myapp/firewall/ingressRules/100. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * ingressRulesId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.firewall.ingressRules.delete * @memberOf! () * @@ -3346,6 +4309,55 @@ export namespace appengine_v1beta { /** * appengine.apps.firewall.ingressRules.get * @desc Gets the specified firewall rule. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.firewall.ingressRules.get({ + * // Part of `name`. Name of the Firewall resource to retrieve. Example: apps/myapp/firewall/ingressRules/100. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * ingressRulesId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "priority": 0, + * // "sourceRange": "my_sourceRange" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.firewall.ingressRules.get * @memberOf! () * @@ -3421,6 +4433,57 @@ export namespace appengine_v1beta { /** * appengine.apps.firewall.ingressRules.list * @desc Lists the firewall rules of an application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.firewall.ingressRules.list({ + * // Part of `parent`. Name of the Firewall collection to retrieve. Example: apps/myapp/firewall/ingressRules. + * appsId: 'placeholder-value', + * // A valid IP Address. If set, only rules matching this address will be returned. The first returned rule will be the rule that fires on requests from this IP. + * matchingAddress: 'placeholder-value', + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ingressRules": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.firewall.ingressRules.list * @memberOf! () * @@ -3499,6 +4562,64 @@ export namespace appengine_v1beta { /** * appengine.apps.firewall.ingressRules.patch * @desc Updates the specified firewall rule. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.firewall.ingressRules.patch({ + * // Part of `name`. Name of the Firewall resource to update. Example: apps/myapp/firewall/ingressRules/100. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * ingressRulesId: 'placeholder-value', + * // Standard field mask for the set of fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "priority": 0, + * // "sourceRange": "my_sourceRange" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "priority": 0, + * // "sourceRange": "my_sourceRange" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.firewall.ingressRules.patch * @memberOf! () * @@ -3699,6 +4820,56 @@ export namespace appengine_v1beta { /** * appengine.apps.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.locations.get({ + * // Part of `name`. Resource name for the location. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * locationsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.locations.get * @memberOf! () * @@ -3771,6 +4942,57 @@ export namespace appengine_v1beta { /** * appengine.apps.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.locations.list({ + * // Part of `name`. The resource that owns the locations collection, if applicable. + * appsId: 'placeholder-value', + * // The standard list filter. + * filter: 'placeholder-value', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.locations.list * @memberOf! () * @@ -3898,6 +5120,56 @@ export namespace appengine_v1beta { /** * appengine.apps.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.operations.get({ + * // Part of `name`. The name of the operation resource. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * operationsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.operations.get * @memberOf! () * @@ -3972,6 +5244,57 @@ export namespace appengine_v1beta { /** * appengine.apps.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/x/operations. To override the binding, API services can add a binding such as "/v1/{name=users/x}/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.operations.list({ + * // Part of `name`. The name of the operation's parent resource. + * appsId: 'placeholder-value', + * // The standard list filter. + * filter: 'placeholder-value', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.operations.list * @memberOf! () * @@ -4101,6 +5424,52 @@ export namespace appengine_v1beta { /** * appengine.apps.services.delete * @desc Deletes the specified service and all enclosed versions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.services.delete({ + * // Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.delete * @memberOf! () * @@ -4175,6 +5544,54 @@ export namespace appengine_v1beta { /** * appengine.apps.services.get * @desc Gets the current configuration of the specified service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.services.get({ + * // Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "name": "my_name", + * // "split": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.get * @memberOf! () * @@ -4247,6 +5664,55 @@ export namespace appengine_v1beta { /** * appengine.apps.services.list * @desc Lists all the services in the application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.services.list({ + * // Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * appsId: 'placeholder-value', + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "services": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.list * @memberOf! () * @@ -4325,6 +5791,66 @@ export namespace appengine_v1beta { /** * appengine.apps.services.patch * @desc Updates the configuration of the specified service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.services.patch({ + * // Part of `name`. Name of the resource to update. Example: apps/myapp/services/default. + * appsId: 'placeholder-value', + * // Set to true to gradually shift traffic to one or more versions that you specify. By default, traffic is shifted immediately. For gradual traffic migration, the target versions must be located within instances that are configured for both warmup requests (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#InboundServiceType) and automatic scaling (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#AutomaticScaling). You must specify the shardBy (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services#ShardBy) field in the Service resource. Gradual traffic migration is not supported in the App Engine flexible environment. For examples, see Migrating and Splitting Traffic (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic). + * migrateTraffic: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * // Standard field mask for the set of fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "name": "my_name", + * // "split": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.patch * @memberOf! () * @@ -4495,6 +6021,96 @@ export namespace appengine_v1beta { /** * appengine.apps.services.versions.create * @desc Deploys code and resource files to a new version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.services.versions.create({ + * // Part of `parent`. Name of the parent resource to create this version under. Example: apps/myapp/services/default. + * appsId: 'placeholder-value', + * // Part of `parent`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiConfig": {}, + * // "automaticScaling": {}, + * // "basicScaling": {}, + * // "betaSettings": {}, + * // "createTime": "my_createTime", + * // "createdBy": "my_createdBy", + * // "defaultExpiration": "my_defaultExpiration", + * // "deployment": {}, + * // "diskUsageBytes": "my_diskUsageBytes", + * // "endpointsApiService": {}, + * // "entrypoint": {}, + * // "env": "my_env", + * // "envVariables": {}, + * // "errorHandlers": [], + * // "handlers": [], + * // "healthCheck": {}, + * // "id": "my_id", + * // "inboundServices": [], + * // "instanceClass": "my_instanceClass", + * // "libraries": [], + * // "livenessCheck": {}, + * // "manualScaling": {}, + * // "name": "my_name", + * // "network": {}, + * // "nobuildFilesRegex": "my_nobuildFilesRegex", + * // "readinessCheck": {}, + * // "resources": {}, + * // "runtime": "my_runtime", + * // "runtimeApiVersion": "my_runtimeApiVersion", + * // "runtimeChannel": "my_runtimeChannel", + * // "runtimeMainExecutablePath": "my_runtimeMainExecutablePath", + * // "servingStatus": "my_servingStatus", + * // "threadsafe": false, + * // "versionUrl": "my_versionUrl", + * // "vm": false, + * // "vpcAccessConnector": {}, + * // "zones": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.versions.create * @memberOf! () * @@ -4570,6 +6186,54 @@ export namespace appengine_v1beta { /** * appengine.apps.services.versions.delete * @desc Deletes an existing Version resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.services.versions.delete({ + * // Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * versionsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.versions.delete * @memberOf! () * @@ -4646,6 +6310,92 @@ export namespace appengine_v1beta { /** * appengine.apps.services.versions.get * @desc Gets the specified Version resource. By default, only a BASIC_VIEW will be returned. Specify the FULL_VIEW parameter to get the full resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.services.versions.get({ + * // Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * versionsId: 'placeholder-value', + * // Controls the set of fields returned in the Get response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiConfig": {}, + * // "automaticScaling": {}, + * // "basicScaling": {}, + * // "betaSettings": {}, + * // "createTime": "my_createTime", + * // "createdBy": "my_createdBy", + * // "defaultExpiration": "my_defaultExpiration", + * // "deployment": {}, + * // "diskUsageBytes": "my_diskUsageBytes", + * // "endpointsApiService": {}, + * // "entrypoint": {}, + * // "env": "my_env", + * // "envVariables": {}, + * // "errorHandlers": [], + * // "handlers": [], + * // "healthCheck": {}, + * // "id": "my_id", + * // "inboundServices": [], + * // "instanceClass": "my_instanceClass", + * // "libraries": [], + * // "livenessCheck": {}, + * // "manualScaling": {}, + * // "name": "my_name", + * // "network": {}, + * // "nobuildFilesRegex": "my_nobuildFilesRegex", + * // "readinessCheck": {}, + * // "resources": {}, + * // "runtime": "my_runtime", + * // "runtimeApiVersion": "my_runtimeApiVersion", + * // "runtimeChannel": "my_runtimeChannel", + * // "runtimeMainExecutablePath": "my_runtimeMainExecutablePath", + * // "servingStatus": "my_servingStatus", + * // "threadsafe": false, + * // "versionUrl": "my_versionUrl", + * // "vm": false, + * // "vpcAccessConnector": {}, + * // "zones": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.versions.get * @memberOf! () * @@ -4721,6 +6471,59 @@ export namespace appengine_v1beta { /** * appengine.apps.services.versions.list * @desc Lists the versions of a service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.services.versions.list({ + * // Part of `parent`. Name of the parent Service resource. Example: apps/myapp/services/default. + * appsId: 'placeholder-value', + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // Part of `parent`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * // Controls the set of fields returned in the List response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "versions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.versions.list * @memberOf! () * @@ -4800,6 +6603,100 @@ export namespace appengine_v1beta { /** * appengine.apps.services.versions.patch * @desc Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses:Standard environment instance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.instance_class)automatic scaling in the standard environment: automatic_scaling.min_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling) automatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling) automaticScaling.standard_scheduler_settings.max_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#StandardSchedulerSettings) automaticScaling.standard_scheduler_settings.min_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#StandardSchedulerSettings) automaticScaling.standard_scheduler_settings.target_cpu_utilization (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#StandardSchedulerSettings) automaticScaling.standard_scheduler_settings.target_throughput_utilization (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#StandardSchedulerSettings)basic scaling or manual scaling in the standard environment: serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.serving_status)Flexible environment serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.serving_status)automatic scaling in the flexible environment: automatic_scaling.min_total_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling) automatic_scaling.max_total_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling) automatic_scaling.cool_down_period_sec (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling) automatic_scaling.cpu_utilization.target_utilization (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling) + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.services.versions.patch({ + * // Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * // Standard field mask for the set of fields to be updated. + * updateMask: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * versionsId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiConfig": {}, + * // "automaticScaling": {}, + * // "basicScaling": {}, + * // "betaSettings": {}, + * // "createTime": "my_createTime", + * // "createdBy": "my_createdBy", + * // "defaultExpiration": "my_defaultExpiration", + * // "deployment": {}, + * // "diskUsageBytes": "my_diskUsageBytes", + * // "endpointsApiService": {}, + * // "entrypoint": {}, + * // "env": "my_env", + * // "envVariables": {}, + * // "errorHandlers": [], + * // "handlers": [], + * // "healthCheck": {}, + * // "id": "my_id", + * // "inboundServices": [], + * // "instanceClass": "my_instanceClass", + * // "libraries": [], + * // "livenessCheck": {}, + * // "manualScaling": {}, + * // "name": "my_name", + * // "network": {}, + * // "nobuildFilesRegex": "my_nobuildFilesRegex", + * // "readinessCheck": {}, + * // "resources": {}, + * // "runtime": "my_runtime", + * // "runtimeApiVersion": "my_runtimeApiVersion", + * // "runtimeChannel": "my_runtimeChannel", + * // "runtimeMainExecutablePath": "my_runtimeMainExecutablePath", + * // "servingStatus": "my_servingStatus", + * // "threadsafe": false, + * // "versionUrl": "my_versionUrl", + * // "vm": false, + * // "vpcAccessConnector": {}, + * // "zones": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.versions.patch * @memberOf! () * @@ -5008,6 +6905,64 @@ export namespace appengine_v1beta { /** * appengine.apps.services.versions.instances.debug * @desc Enables debugging on a VM instance. This allows you to use the SSH command to connect to the virtual machine where the instance lives. While in "debug mode", the instance continues to serve live traffic. You should delete the instance when you are done debugging and then allow the system to take over and determine if another instance should be started.Only applicable for instances in App Engine flexible environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.services.versions.instances.debug({ + * // Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * instancesId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * versionsId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sshKey": "my_sshKey" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.versions.instances.debug * @memberOf! () * @@ -5086,6 +7041,56 @@ export namespace appengine_v1beta { /** * appengine.apps.services.versions.instances.delete * @desc Stops a running instance.The instance might be automatically recreated based on the scaling settings of the version. For more information, see "How Instances are Managed" (standard environment (https://cloud.google.com/appengine/docs/standard/python/how-instances-are-managed) | flexible environment (https://cloud.google.com/appengine/docs/flexible/python/how-instances-are-managed)).To ensure that instances are not re-created and avoid getting billed, you can stop all instances within the target version by changing the serving status of the version to STOPPED with the apps.services.versions.patch (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions/patch) method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 appengine.apps.services.versions.instances.delete({ + * // Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * instancesId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * versionsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.versions.instances.delete * @memberOf! () * @@ -5163,6 +7168,71 @@ export namespace appengine_v1beta { /** * appengine.apps.services.versions.instances.get * @desc Gets instance information. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.services.versions.instances.get({ + * // Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. + * appsId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * instancesId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * // Part of `name`. See documentation of `appsId`. + * versionsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineRelease": "my_appEngineRelease", + * // "availability": "my_availability", + * // "averageLatency": 0, + * // "errors": 0, + * // "id": "my_id", + * // "memoryUsage": "my_memoryUsage", + * // "name": "my_name", + * // "qps": {}, + * // "requests": 0, + * // "startTime": "my_startTime", + * // "vmDebugEnabled": false, + * // "vmId": "my_vmId", + * // "vmIp": "my_vmIp", + * // "vmName": "my_vmName", + * // "vmStatus": "my_vmStatus", + * // "vmZoneName": "my_vmZoneName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.versions.instances.get * @memberOf! () * @@ -5238,6 +7308,59 @@ export namespace appengine_v1beta { /** * appengine.apps.services.versions.instances.list * @desc Lists the instances of a version.Tip: To aggregate details about instances over time, see the Stackdriver Monitoring API (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appengine.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 appengine = google.appengine('v1beta'); + * + * 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/appengine.admin', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 appengine.apps.services.versions.instances.list({ + * // Part of `parent`. Name of the parent Version resource. Example: apps/myapp/services/default/versions/v1. + * appsId: 'placeholder-value', + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // Part of `parent`. See documentation of `appsId`. + * servicesId: 'placeholder-value', + * // Part of `parent`. See documentation of `appsId`. + * versionsId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "instances": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appengine.apps.services.versions.instances.list * @memberOf! () * diff --git a/src/apis/appsactivity/v1.ts b/src/apis/appsactivity/v1.ts index 93b4bbd599d..152f297d7aa 100644 --- a/src/apis/appsactivity/v1.ts +++ b/src/apis/appsactivity/v1.ts @@ -310,6 +310,60 @@ export namespace appsactivity_v1 { /** * appsactivity.activities.list * @desc Returns a list of activities visible to the current logged in user. Visible activities are determined by the visibility settings of the object that was acted on, e.g. Drive files a user can see. An activity is a record of past events. Multiple events may be merged if they are similar. A request is scoped to activities from a given Google service using the source parameter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/appsactivity.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 appsactivity = google.appsactivity('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/activity'], + * }); + * + * // 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 appsactivity.activities.list({ + * // Identifies the Drive folder containing the items for which to return activities. + * 'drive.ancestorId': 'placeholder-value', + * // Identifies the Drive item to return activities for. + * 'drive.fileId': 'placeholder-value', + * // Indicates the strategy to use when grouping singleEvents items in the associated combinedEvent object. + * groupingStrategy: 'placeholder-value', + * // The maximum number of events to return on a page. The response includes a continuation token if there are more events. + * pageSize: 'placeholder-value', + * // A token to retrieve a specific page of results. + * pageToken: 'placeholder-value', + * // The Google service from which to return activities. Possible values of source are: + * // - drive.google.com + * source: 'placeholder-value', + * // The ID used for ACL checks (does not filter the resulting event list by the assigned value). Use the special value me to indicate the currently authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activities": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias appsactivity.activities.list * @memberOf! () * diff --git a/src/apis/bigquery/v2.ts b/src/apis/bigquery/v2.ts index 77019ec249f..fa4e98c0700 100644 --- a/src/apis/bigquery/v2.ts +++ b/src/apis/bigquery/v2.ts @@ -2723,51 +2723,47 @@ export namespace bigquery_v2 { * bigquery.datasets.delete * @desc Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID of the dataset being deleted - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // 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 bigquery.datasets.delete({ * // Dataset ID of dataset being deleted - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * bigquery.datasets.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * datasetId: 'placeholder-value', + * // If True, delete all the tables in the dataset. If False and the dataset contains tables, the request will fail. Default is False + * deleteContents: 'placeholder-value', + * // Project ID of the dataset being deleted + * projectId: 'placeholder-value', * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias bigquery.datasets.delete * @memberOf! () * @@ -2841,54 +2837,66 @@ export namespace bigquery_v2 { * bigquery.datasets.get * @desc Returns the dataset specified by datasetID. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID of the requested dataset - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // 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 bigquery.datasets.get({ * // Dataset ID of the requested dataset - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * bigquery.datasets.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * datasetId: 'placeholder-value', + * // Project ID of the requested dataset + * projectId: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "access": [], + * // "creationTime": "my_creationTime", + * // "datasetReference": {}, + * // "defaultEncryptionConfiguration": {}, + * // "defaultPartitionExpirationMs": "my_defaultPartitionExpirationMs", + * // "defaultTableExpirationMs": "my_defaultTableExpirationMs", + * // "description": "my_description", + * // "etag": "my_etag", + * // "friendlyName": "my_friendlyName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "location": "my_location", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias bigquery.datasets.get * @memberOf! () * @@ -2961,55 +2969,84 @@ export namespace bigquery_v2 { * bigquery.datasets.insert * @desc Creates a new empty dataset. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID of the new dataset - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await bigquery.datasets.insert({ + * // Project ID of the new dataset + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "access": [], + * // "creationTime": "my_creationTime", + * // "datasetReference": {}, + * // "defaultEncryptionConfiguration": {}, + * // "defaultPartitionExpirationMs": "my_defaultPartitionExpirationMs", + * // "defaultTableExpirationMs": "my_defaultTableExpirationMs", + * // "description": "my_description", + * // "etag": "my_etag", + * // "friendlyName": "my_friendlyName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "location": "my_location", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * bigquery.datasets.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "access": [], + * // "creationTime": "my_creationTime", + * // "datasetReference": {}, + * // "defaultEncryptionConfiguration": {}, + * // "defaultPartitionExpirationMs": "my_defaultPartitionExpirationMs", + * // "defaultTableExpirationMs": "my_defaultTableExpirationMs", + * // "description": "my_description", + * // "etag": "my_etag", + * // "friendlyName": "my_friendlyName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "location": "my_location", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias bigquery.datasets.insert * @memberOf! () * @@ -3082,64 +3119,61 @@ export namespace bigquery_v2 { * bigquery.datasets.list * @desc Lists all datasets in the specified project to which you have been granted the READER dataset role. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 bigquery.datasets.list({ + * // Whether to list all datasets, including hidden ones + * all: 'placeholder-value', + * // An expression for filtering the results of the request by label. The syntax is "labels.[:]". Multiple filters can be ANDed together by connecting with a space. Example: "labels.department:receiving labels.active". See Filtering datasets using labels for details. + * filter: 'placeholder-value', + * // The maximum number of results to return + * maxResults: 'placeholder-value', + * // Page token, returned by a previous call, to request the next page of results + * pageToken: 'placeholder-value', * // Project ID of the datasets to be listed - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var datasetsPage = response['datasets']; - * if (!datasetsPage) { - * return; - * } - * for (var i = 0; i < datasetsPage.length; i++) { - * // TODO: Change code below to process each resource in `datasetsPage`: - * console.log(JSON.stringify(datasetsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * bigquery.datasets.list(request, handlePage); - * } - * }; - * - * bigquery.datasets.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * projectId: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "datasets": [], + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquery.datasets.list * @memberOf! () * @@ -3217,59 +3251,86 @@ export namespace bigquery_v2 { * bigquery.datasets.patch * @desc Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. This method supports patch semantics. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID of the dataset being updated - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // 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 bigquery.datasets.patch({ * // Dataset ID of the dataset being updated - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * datasetId: 'placeholder-value', + * // Project ID of the dataset being updated + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "access": [], + * // "creationTime": "my_creationTime", + * // "datasetReference": {}, + * // "defaultEncryptionConfiguration": {}, + * // "defaultPartitionExpirationMs": "my_defaultPartitionExpirationMs", + * // "defaultTableExpirationMs": "my_defaultTableExpirationMs", + * // "description": "my_description", + * // "etag": "my_etag", + * // "friendlyName": "my_friendlyName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "location": "my_location", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * bigquery.datasets.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "access": [], + * // "creationTime": "my_creationTime", + * // "datasetReference": {}, + * // "defaultEncryptionConfiguration": {}, + * // "defaultPartitionExpirationMs": "my_defaultPartitionExpirationMs", + * // "defaultTableExpirationMs": "my_defaultTableExpirationMs", + * // "description": "my_description", + * // "etag": "my_etag", + * // "friendlyName": "my_friendlyName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "location": "my_location", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias bigquery.datasets.patch * @memberOf! () * @@ -3343,59 +3404,86 @@ export namespace bigquery_v2 { * bigquery.datasets.update * @desc Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID of the dataset being updated - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // 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 bigquery.datasets.update({ * // Dataset ID of the dataset being updated - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * datasetId: 'placeholder-value', + * // Project ID of the dataset being updated + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "access": [], + * // "creationTime": "my_creationTime", + * // "datasetReference": {}, + * // "defaultEncryptionConfiguration": {}, + * // "defaultPartitionExpirationMs": "my_defaultPartitionExpirationMs", + * // "defaultTableExpirationMs": "my_defaultTableExpirationMs", + * // "description": "my_description", + * // "etag": "my_etag", + * // "friendlyName": "my_friendlyName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "location": "my_location", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * bigquery.datasets.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "access": [], + * // "creationTime": "my_creationTime", + * // "datasetReference": {}, + * // "defaultEncryptionConfiguration": {}, + * // "defaultPartitionExpirationMs": "my_defaultPartitionExpirationMs", + * // "defaultTableExpirationMs": "my_defaultTableExpirationMs", + * // "description": "my_description", + * // "etag": "my_etag", + * // "friendlyName": "my_friendlyName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "location": "my_location", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias bigquery.datasets.update * @memberOf! () * @@ -3594,54 +3682,53 @@ export namespace bigquery_v2 { * bigquery.jobs.cancel * @desc Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // [Required] Project ID of the job to cancel - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // 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 bigquery.jobs.cancel({ * // [Required] Job ID of the job to cancel - * jobId: 'my-job-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * jobId: 'placeholder-value', + * // The geographic location of the job. Required except for US and EU. See details at https://cloud.google.com/bigquery/docs/locations#specifying_your_location. + * location: 'placeholder-value', + * // [Required] Project ID of the job to cancel + * projectId: 'placeholder-value', + * }); + * console.log(res.data); * - * bigquery.jobs.cancel(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "job": {}, + * // "kind": "my_kind" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias bigquery.jobs.cancel * @memberOf! () * @@ -3717,54 +3804,62 @@ export namespace bigquery_v2 { * bigquery.jobs.get * @desc Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // [Required] Project ID of the requested job - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // 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 bigquery.jobs.get({ * // [Required] Job ID of the requested job - * jobId: 'my-job-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * bigquery.jobs.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * jobId: 'placeholder-value', + * // The geographic location of the job. Required except for US and EU. See details at https://cloud.google.com/bigquery/docs/locations#specifying_your_location. + * location: 'placeholder-value', + * // [Required] Project ID of the requested job + * projectId: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "configuration": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "jobReference": {}, + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "statistics": {}, + * // "status": {}, + * // "user_email": "my_user_email" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias bigquery.jobs.get * @memberOf! () * @@ -3838,67 +3933,73 @@ export namespace bigquery_v2 { * bigquery.jobs.getQueryResults * @desc Retrieves the results of a query job. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // [Required] Project ID of the query job - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // 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 bigquery.jobs.getQueryResults({ * // [Required] Job ID of the query job - * jobId: 'my-job-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var errorsPage = response['errors']; - * if (!errorsPage) { - * return; - * } - * for (var i = 0; i < errorsPage.length; i++) { - * // TODO: Change code below to process each resource in `errorsPage`: - * console.log(JSON.stringify(errorsPage[i], null, 2)); - * } - * - * if (response.pageToken) { - * request.pageToken = response.pageToken; - * bigquery.jobs.getQueryResults(request, handlePage); - * } - * }; - * - * bigquery.jobs.getQueryResults(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * jobId: 'placeholder-value', + * // The geographic location where the job should run. Required except for US and EU. See details at https://cloud.google.com/bigquery/docs/locations#specifying_your_location. + * location: 'placeholder-value', + * // Maximum number of results to read + * maxResults: 'placeholder-value', + * // Page token, returned by a previous call, to request the next page of results + * pageToken: 'placeholder-value', + * // [Required] Project ID of the query job + * projectId: 'placeholder-value', + * // Zero-based index of the starting row + * startIndex: 'placeholder-value', + * // How long to wait for the query to complete, in milliseconds, before returning. Default is 10 seconds. If the timeout passes before the job completes, the 'jobComplete' field in the response will be false + * timeoutMs: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cacheHit": false, + * // "errors": [], + * // "etag": "my_etag", + * // "jobComplete": false, + * // "jobReference": {}, + * // "kind": "my_kind", + * // "numDmlAffectedRows": "my_numDmlAffectedRows", + * // "pageToken": "my_pageToken", + * // "rows": [], + * // "schema": {}, + * // "totalBytesProcessed": "my_totalBytesProcessed", + * // "totalRows": "my_totalRows" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquery.jobs.getQueryResults * @memberOf! () * @@ -3983,62 +4084,79 @@ export namespace bigquery_v2 { * bigquery.jobs.insert * @desc Starts a new asynchronous job. Requires the Can View project role. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID of the project that will be billed for the job - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await bigquery.jobs.insert({ + * // Project ID of the project that will be billed for the job + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "configuration": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "jobReference": {}, + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "statistics": {}, + * // "status": {}, + * // "user_email": "my_user_email" + * // } * }, - * * media: { - * // TODO: Add desired media content for upload. See - * // https://github.com/google/google-api-nodejs-client#media-uploads - * mimeType: '', // See https://www.w3.org/Protocols/rfc1341/4_Content-Type.html - * body: '', + * mimeType: 'placeholder-value', + * body: 'placeholder-value', * }, - * - * auth: authClient, - * }; - * - * bigquery.jobs.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "configuration": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "jobReference": {}, + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "statistics": {}, + * // "status": {}, + * // "user_email": "my_user_email" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias bigquery.jobs.insert * @memberOf! () * @@ -4118,64 +4236,69 @@ export namespace bigquery_v2 { * bigquery.jobs.list * @desc Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 bigquery.jobs.list({ + * // Whether to display jobs owned by all users in the project. Default false + * allUsers: 'placeholder-value', + * // Max value for job creation time, in milliseconds since the POSIX epoch. If set, only jobs created before or at this timestamp are returned + * maxCreationTime: 'placeholder-value', + * // Maximum number of results to return + * maxResults: 'placeholder-value', + * // Min value for job creation time, in milliseconds since the POSIX epoch. If set, only jobs created after or at this timestamp are returned + * minCreationTime: 'placeholder-value', + * // Page token, returned by a previous call, to request the next page of results + * pageToken: 'placeholder-value', + * // If set, retrieves only jobs whose parent is this job. Otherwise, retrieves only jobs which have no parent + * parentJobId: 'placeholder-value', * // Project ID of the jobs to list - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var jobsPage = response['jobs']; - * if (!jobsPage) { - * return; - * } - * for (var i = 0; i < jobsPage.length; i++) { - * // TODO: Change code below to process each resource in `jobsPage`: - * console.log(JSON.stringify(jobsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * bigquery.jobs.list(request, handlePage); - * } - * }; - * - * bigquery.jobs.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * projectId: 'placeholder-value', + * // Restrict information returned to a set of selected fields + * projection: 'placeholder-value', + * // Filter for job state + * stateFilter: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "jobs": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquery.jobs.list * @memberOf! () * @@ -4256,55 +4379,80 @@ export namespace bigquery_v2 { * bigquery.jobs.query * @desc Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID of the project billed for the query - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await bigquery.jobs.query({ + * // Project ID of the project billed for the query + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "connectionProperties": [], + * // "defaultDataset": {}, + * // "dryRun": false, + * // "kind": "my_kind", + * // "location": "my_location", + * // "maxResults": 0, + * // "parameterMode": "my_parameterMode", + * // "preserveNulls": false, + * // "query": "my_query", + * // "queryParameters": [], + * // "timeoutMs": 0, + * // "useLegacySql": false, + * // "useQueryCache": false + * // } * }, - * - * auth: authClient, - * }; - * - * bigquery.jobs.query(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cacheHit": false, + * // "errors": [], + * // "jobComplete": false, + * // "jobReference": {}, + * // "kind": "my_kind", + * // "numDmlAffectedRows": "my_numDmlAffectedRows", + * // "pageToken": "my_pageToken", + * // "rows": [], + * // "schema": {}, + * // "totalBytesProcessed": "my_totalBytesProcessed", + * // "totalRows": "my_totalRows" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias bigquery.jobs.query * @memberOf! () * @@ -4551,54 +4699,47 @@ export namespace bigquery_v2 { * bigquery.models.delete * @desc Deletes the model specified by modelId from the dataset. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the model to delete. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Dataset ID of the model to delete. - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * // Model ID of the model to delete. - * modelId: 'my-model-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * bigquery.models.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 bigquery.models.delete({ + * // Required. Dataset ID of the model to delete. + * datasetId: '[^/]+', + * // Required. Model ID of the model to delete. + * modelId: '[^/]+', + * // Required. Project ID of the model to delete. + * projectId: '[^/]+', * }); + * console.log(res.data); * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquery.models.delete * @memberOf! () * @@ -4673,57 +4814,67 @@ export namespace bigquery_v2 { * bigquery.models.get * @desc Gets the specified model resource by model ID. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the requested model. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Dataset ID of the requested model. - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * // Model ID of the requested model. - * modelId: 'my-model-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * bigquery.models.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 bigquery.models.get({ + * // Required. Dataset ID of the requested model. + * datasetId: '[^/]+', + * // Required. Model ID of the requested model. + * modelId: '[^/]+', + * // Required. Project ID of the requested model. + * projectId: '[^/]+', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "encryptionConfiguration": {}, + * // "etag": "my_etag", + * // "expirationTime": "my_expirationTime", + * // "featureColumns": [], + * // "friendlyName": "my_friendlyName", + * // "labelColumns": [], + * // "labels": {}, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "location": "my_location", + * // "modelReference": {}, + * // "modelType": "my_modelType", + * // "trainingRuns": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquery.models.get * @memberOf! () * @@ -4798,67 +4949,59 @@ export namespace bigquery_v2 { * bigquery.models.list * @desc Lists all models in the specified dataset. Requires the READER dataset role. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the models to list. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Dataset ID of the models to list. - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var modelsPage = response['models']; - * if (!modelsPage) { - * return; - * } - * for (var i = 0; i < modelsPage.length; i++) { - * // TODO: Change code below to process each resource in `modelsPage`: - * console.log(JSON.stringify(modelsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * bigquery.models.list(request, handlePage); - * } - * }; - * - * bigquery.models.list(request, handlePage); - * }); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 bigquery.models.list({ + * // Required. Dataset ID of the models to list. + * datasetId: '[^/]+', + * // The maximum number of results to return in a single response page. + * // Leverage the page tokens to iterate through the entire collection. + * maxResults: 'placeholder-value', + * // Page token, returned by a previous call to request the next page of + * // results + * pageToken: 'placeholder-value', + * // Required. Project ID of the models to list. + * projectId: '[^/]+', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "models": [], + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquery.models.list * @memberOf! () * @@ -4936,62 +5079,86 @@ export namespace bigquery_v2 { * bigquery.models.patch * @desc Patch specific fields in the specified model. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the model to patch. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Dataset ID of the model to patch. - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * // Model ID of the model to patch. - * modelId: 'my-model-id', // TODO: Update placeholder value. + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * // 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 bigquery.models.patch({ + * // Required. Dataset ID of the model to patch. + * datasetId: '[^/]+', + * // Required. Model ID of the model to patch. + * modelId: '[^/]+', + * // Required. Project ID of the model to patch. + * projectId: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "encryptionConfiguration": {}, + * // "etag": "my_etag", + * // "expirationTime": "my_expirationTime", + * // "featureColumns": [], + * // "friendlyName": "my_friendlyName", + * // "labelColumns": [], + * // "labels": {}, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "location": "my_location", + * // "modelReference": {}, + * // "modelType": "my_modelType", + * // "trainingRuns": [] + * // } * }, - * - * auth: authClient, - * }; - * - * bigquery.models.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "encryptionConfiguration": {}, + * // "etag": "my_etag", + * // "expirationTime": "my_expirationTime", + * // "featureColumns": [], + * // "friendlyName": "my_friendlyName", + * // "labelColumns": [], + * // "labels": {}, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "location": "my_location", + * // "modelReference": {}, + * // "modelType": "my_modelType", + * // "trainingRuns": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias bigquery.models.patch * @memberOf! () * @@ -5160,51 +5327,51 @@ export namespace bigquery_v2 { * bigquery.projects.getServiceAccount * @desc Returns the email address of the service account for your project used for interactions with Google Cloud KMS. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID for which the service account is requested. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * auth: authClient, - * }; + * // Do the magic + * const res = await bigquery.projects.getServiceAccount({ + * // Project ID for which the service account is requested. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); * - * bigquery.projects.getServiceAccount(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "email": "my_email", + * // "kind": "my_kind" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias bigquery.projects.getServiceAccount * @memberOf! () * @@ -5286,61 +5453,56 @@ export namespace bigquery_v2 { * bigquery.projects.list * @desc Lists all projects to which you have been granted any project role. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var projectsPage = response['projects']; - * if (!projectsPage) { - * return; - * } - * for (var i = 0; i < projectsPage.length; i++) { - * // TODO: Change code below to process each resource in `projectsPage`: - * console.log(JSON.stringify(projectsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * bigquery.projects.list(request, handlePage); - * } - * }; - * - * bigquery.projects.list(request, handlePage); - * }); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // Do the magic + * const res = await bigquery.projects.list({ + * // Maximum number of results to return + * maxResults: 'placeholder-value', + * // Page token, returned by a previous call, to request the next page of results + * pageToken: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "projects": [], + * // "totalItems": 0 + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquery.projects.list * @memberOf! () * @@ -5451,54 +5613,47 @@ export namespace bigquery_v2 { * bigquery.routines.delete * @desc Deletes the routine specified by routineId from the dataset. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the routine to delete - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Dataset ID of the routine to delete - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * // Routine ID of the routine to delete - * routineId: 'my-routine-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * bigquery.routines.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 bigquery.routines.delete({ + * // Required. Dataset ID of the routine to delete + * datasetId: '[^/]+', + * // Required. Project ID of the routine to delete + * projectId: '[^/]+', + * // Required. Routine ID of the routine to delete + * routineId: '[^/]+', * }); + * console.log(res.data); * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquery.routines.delete * @memberOf! () * @@ -5573,57 +5728,67 @@ export namespace bigquery_v2 { * bigquery.routines.get * @desc Gets the specified routine resource by routine ID. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the requested routine - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Dataset ID of the requested routine - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * // Routine ID of the requested routine - * routineId: 'my-routine-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * bigquery.routines.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 bigquery.routines.get({ + * // Required. Dataset ID of the requested routine + * datasetId: '[^/]+', + * // Required. Project ID of the requested routine + * projectId: '[^/]+', + * // If set, only the Routine fields in the field mask are returned in the + * // response. If unset, all Routine fields are returned. + * readMask: 'placeholder-value', + * // Required. Routine ID of the requested routine + * routineId: '[^/]+', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "arguments": [], + * // "creationTime": "my_creationTime", + * // "definitionBody": "my_definitionBody", + * // "description": "my_description", + * // "etag": "my_etag", + * // "importedLibraries": [], + * // "language": "my_language", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "returnType": {}, + * // "routineReference": {}, + * // "routineType": "my_routineType" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquery.routines.get * @memberOf! () * @@ -5699,58 +5864,78 @@ export namespace bigquery_v2 { * bigquery.routines.insert * @desc Creates a new routine in the dataset. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the new routine - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Dataset ID of the new routine - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 bigquery.routines.insert({ + * // Required. Dataset ID of the new routine + * datasetId: '[^/]+', + * // Required. Project ID of the new routine + * projectId: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "arguments": [], + * // "creationTime": "my_creationTime", + * // "definitionBody": "my_definitionBody", + * // "description": "my_description", + * // "etag": "my_etag", + * // "importedLibraries": [], + * // "language": "my_language", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "returnType": {}, + * // "routineReference": {}, + * // "routineType": "my_routineType" + * // } * }, - * - * auth: authClient, - * }; - * - * bigquery.routines.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "arguments": [], + * // "creationTime": "my_creationTime", + * // "definitionBody": "my_definitionBody", + * // "description": "my_description", + * // "etag": "my_etag", + * // "importedLibraries": [], + * // "language": "my_language", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "returnType": {}, + * // "routineReference": {}, + * // "routineType": "my_routineType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias bigquery.routines.insert * @memberOf! () * @@ -5825,67 +6010,70 @@ export namespace bigquery_v2 { * bigquery.routines.list * @desc Lists all routines in the specified dataset. Requires the READER dataset role. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the routines to list - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Dataset ID of the routines to list - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var routinesPage = response['routines']; - * if (!routinesPage) { - * return; - * } - * for (var i = 0; i < routinesPage.length; i++) { - * // TODO: Change code below to process each resource in `routinesPage`: - * console.log(JSON.stringify(routinesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * bigquery.routines.list(request, handlePage); - * } - * }; - * - * bigquery.routines.list(request, handlePage); - * }); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 bigquery.routines.list({ + * // Required. Dataset ID of the routines to list + * datasetId: '[^/]+', + * // If set, then only the Routines matching this filter are returned. + * // The current supported form is either "routine_type:" or + * // "routineType:", where is a RoutineType enum. + * // Example: "routineType:SCALAR_FUNCTION". + * filter: 'placeholder-value', + * // The maximum number of results to return in a single response page. + * // Leverage the page tokens to iterate through the entire collection. + * maxResults: 'placeholder-value', + * // Page token, returned by a previous call, to request the next page of + * // results + * pageToken: 'placeholder-value', + * // Required. Project ID of the routines to list + * projectId: '[^/]+', + * // If set, then only the Routine fields in the field mask, as well as + * // project_id, dataset_id and routine_id, are returned in the response. + * // If unset, then the following Routine fields are returned: + * // etag, project_id, dataset_id, routine_id, routine_type, creation_time, + * // last_modified_time, and language. + * readMask: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "routines": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquery.routines.list * @memberOf! () * @@ -5967,62 +6155,80 @@ export namespace bigquery_v2 { * bigquery.routines.update * @desc Updates information in an existing routine. The update method replaces the entire Routine resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the routine to update - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Dataset ID of the routine to update - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * // Routine ID of the routine to update - * routineId: 'my-routine-id', // TODO: Update placeholder value. + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * // 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 bigquery.routines.update({ + * // Required. Dataset ID of the routine to update + * datasetId: '[^/]+', + * // Required. Project ID of the routine to update + * projectId: '[^/]+', + * // Required. Routine ID of the routine to update + * routineId: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "arguments": [], + * // "creationTime": "my_creationTime", + * // "definitionBody": "my_definitionBody", + * // "description": "my_description", + * // "etag": "my_etag", + * // "importedLibraries": [], + * // "language": "my_language", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "returnType": {}, + * // "routineReference": {}, + * // "routineType": "my_routineType" + * // } * }, - * - * auth: authClient, - * }; - * - * bigquery.routines.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "arguments": [], + * // "creationTime": "my_creationTime", + * // "definitionBody": "my_definitionBody", + * // "description": "my_description", + * // "etag": "my_etag", + * // "importedLibraries": [], + * // "language": "my_language", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "returnType": {}, + * // "routineReference": {}, + * // "routineType": "my_routineType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias bigquery.routines.update * @memberOf! () * @@ -6223,61 +6429,66 @@ export namespace bigquery_v2 { * bigquery.tabledata.insertAll * @desc Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.insertdata', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID of the destination table. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // 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 bigquery.tabledata.insertAll({ * // Dataset ID of the destination table. - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * + * datasetId: 'placeholder-value', + * // Project ID of the destination table. + * projectId: 'placeholder-value', * // Table ID of the destination table. - * tableId: 'my-table-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * tableId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ignoreUnknownValues": false, + * // "kind": "my_kind", + * // "rows": [], + * // "skipInvalidRows": false, + * // "templateSuffix": "my_templateSuffix" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * bigquery.tabledata.insertAll(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "insertErrors": [], + * // "kind": "my_kind" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias bigquery.tabledata.insertAll * @memberOf! () * @@ -6363,70 +6574,66 @@ export namespace bigquery_v2 { * bigquery.tabledata.list * @desc Retrieves table data from a specified set of rows. Requires the READER dataset role. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID of the table to read - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // 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 bigquery.tabledata.list({ * // Dataset ID of the table to read - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * + * datasetId: 'placeholder-value', + * // Maximum number of results to return + * maxResults: 'placeholder-value', + * // Page token, returned by a previous call, identifying the result set + * pageToken: 'placeholder-value', + * // Project ID of the table to read + * projectId: 'placeholder-value', + * // List of fields to return (comma-separated). If unspecified, all fields are returned + * selectedFields: 'placeholder-value', + * // Zero-based index of the starting row to read + * startIndex: 'placeholder-value', * // Table ID of the table to read - * tableId: 'my-table-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var rowsPage = response['rows']; - * if (!rowsPage) { - * return; - * } - * for (var i = 0; i < rowsPage.length; i++) { - * // TODO: Change code below to process each resource in `rowsPage`: - * console.log(JSON.stringify(rowsPage[i], null, 2)); - * } - * - * if (response.pageToken) { - * request.pageToken = response.pageToken; - * bigquery.tabledata.list(request, handlePage); - * } - * }; - * - * bigquery.tabledata.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * tableId: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "pageToken": "my_pageToken", + * // "rows": [], + * // "totalRows": "my_totalRows" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquery.tabledata.list * @memberOf! () * @@ -6575,54 +6782,47 @@ export namespace bigquery_v2 { * bigquery.tables.delete * @desc Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID of the table to delete - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // 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 bigquery.tables.delete({ * // Dataset ID of the table to delete - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * + * datasetId: 'placeholder-value', + * // Project ID of the table to delete + * projectId: 'placeholder-value', * // Table ID of the table to delete - * tableId: 'my-table-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * bigquery.tables.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * tableId: 'placeholder-value', * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias bigquery.tables.delete * @memberOf! () * @@ -6697,57 +6897,83 @@ export namespace bigquery_v2 { * bigquery.tables.get * @desc Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID of the requested table - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // 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 bigquery.tables.get({ * // Dataset ID of the requested table - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * + * datasetId: 'placeholder-value', + * // Project ID of the requested table + * projectId: 'placeholder-value', + * // List of fields to return (comma-separated). If unspecified, all fields are returned + * selectedFields: 'placeholder-value', * // Table ID of the requested table - * tableId: 'my-table-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * bigquery.tables.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * tableId: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clustering": {}, + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "encryptionConfiguration": {}, + * // "etag": "my_etag", + * // "expirationTime": "my_expirationTime", + * // "externalDataConfiguration": {}, + * // "friendlyName": "my_friendlyName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "location": "my_location", + * // "materializedView": {}, + * // "model": {}, + * // "numBytes": "my_numBytes", + * // "numLongTermBytes": "my_numLongTermBytes", + * // "numPhysicalBytes": "my_numPhysicalBytes", + * // "numRows": "my_numRows", + * // "rangePartitioning": {}, + * // "requirePartitionFilter": false, + * // "schema": {}, + * // "selfLink": "my_selfLink", + * // "streamingBuffer": {}, + * // "tableReference": {}, + * // "timePartitioning": {}, + * // "type": "my_type", + * // "view": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias bigquery.tables.get * @memberOf! () * @@ -6823,58 +7049,112 @@ export namespace bigquery_v2 { * bigquery.tables.insert * @desc Creates a new, empty table in the dataset. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID of the new table - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // 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 bigquery.tables.insert({ * // Dataset ID of the new table - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * datasetId: 'placeholder-value', + * // Project ID of the new table + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clustering": {}, + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "encryptionConfiguration": {}, + * // "etag": "my_etag", + * // "expirationTime": "my_expirationTime", + * // "externalDataConfiguration": {}, + * // "friendlyName": "my_friendlyName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "location": "my_location", + * // "materializedView": {}, + * // "model": {}, + * // "numBytes": "my_numBytes", + * // "numLongTermBytes": "my_numLongTermBytes", + * // "numPhysicalBytes": "my_numPhysicalBytes", + * // "numRows": "my_numRows", + * // "rangePartitioning": {}, + * // "requirePartitionFilter": false, + * // "schema": {}, + * // "selfLink": "my_selfLink", + * // "streamingBuffer": {}, + * // "tableReference": {}, + * // "timePartitioning": {}, + * // "type": "my_type", + * // "view": {} + * // } * }, - * - * auth: authClient, - * }; - * - * bigquery.tables.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clustering": {}, + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "encryptionConfiguration": {}, + * // "etag": "my_etag", + * // "expirationTime": "my_expirationTime", + * // "externalDataConfiguration": {}, + * // "friendlyName": "my_friendlyName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "location": "my_location", + * // "materializedView": {}, + * // "model": {}, + * // "numBytes": "my_numBytes", + * // "numLongTermBytes": "my_numLongTermBytes", + * // "numPhysicalBytes": "my_numPhysicalBytes", + * // "numRows": "my_numRows", + * // "rangePartitioning": {}, + * // "requirePartitionFilter": false, + * // "schema": {}, + * // "selfLink": "my_selfLink", + * // "streamingBuffer": {}, + * // "tableReference": {}, + * // "timePartitioning": {}, + * // "type": "my_type", + * // "view": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias bigquery.tables.insert * @memberOf! () * @@ -6949,67 +7229,60 @@ export namespace bigquery_v2 { * bigquery.tables.list * @desc Lists all tables in the specified dataset. Requires the READER dataset role. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID of the tables to list - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // 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 bigquery.tables.list({ * // Dataset ID of the tables to list - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var tablesPage = response['tables']; - * if (!tablesPage) { - * return; - * } - * for (var i = 0; i < tablesPage.length; i++) { - * // TODO: Change code below to process each resource in `tablesPage`: - * console.log(JSON.stringify(tablesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * bigquery.tables.list(request, handlePage); - * } - * }; - * - * bigquery.tables.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * datasetId: 'placeholder-value', + * // Maximum number of results to return + * maxResults: 'placeholder-value', + * // Page token, returned by a previous call, to request the next page of results + * pageToken: 'placeholder-value', + * // Project ID of the tables to list + * projectId: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "tables": [], + * // "totalItems": 0 + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquery.tables.list * @memberOf! () * @@ -7087,62 +7360,114 @@ export namespace bigquery_v2 { * bigquery.tables.patch * @desc Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports patch semantics. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID of the table to update - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // 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 bigquery.tables.patch({ * // Dataset ID of the table to update - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * + * datasetId: 'placeholder-value', + * // Project ID of the table to update + * projectId: 'placeholder-value', * // Table ID of the table to update - * tableId: 'my-table-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * tableId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clustering": {}, + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "encryptionConfiguration": {}, + * // "etag": "my_etag", + * // "expirationTime": "my_expirationTime", + * // "externalDataConfiguration": {}, + * // "friendlyName": "my_friendlyName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "location": "my_location", + * // "materializedView": {}, + * // "model": {}, + * // "numBytes": "my_numBytes", + * // "numLongTermBytes": "my_numLongTermBytes", + * // "numPhysicalBytes": "my_numPhysicalBytes", + * // "numRows": "my_numRows", + * // "rangePartitioning": {}, + * // "requirePartitionFilter": false, + * // "schema": {}, + * // "selfLink": "my_selfLink", + * // "streamingBuffer": {}, + * // "tableReference": {}, + * // "timePartitioning": {}, + * // "type": "my_type", + * // "view": {} + * // } * }, - * - * auth: authClient, - * }; - * - * bigquery.tables.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clustering": {}, + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "encryptionConfiguration": {}, + * // "etag": "my_etag", + * // "expirationTime": "my_expirationTime", + * // "externalDataConfiguration": {}, + * // "friendlyName": "my_friendlyName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "location": "my_location", + * // "materializedView": {}, + * // "model": {}, + * // "numBytes": "my_numBytes", + * // "numLongTermBytes": "my_numLongTermBytes", + * // "numPhysicalBytes": "my_numPhysicalBytes", + * // "numRows": "my_numRows", + * // "rangePartitioning": {}, + * // "requirePartitionFilter": false, + * // "schema": {}, + * // "selfLink": "my_selfLink", + * // "streamingBuffer": {}, + * // "tableReference": {}, + * // "timePartitioning": {}, + * // "type": "my_type", + * // "view": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias bigquery.tables.patch * @memberOf! () * @@ -7218,62 +7543,114 @@ export namespace bigquery_v2 { * bigquery.tables.update * @desc Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquery.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'); - * var bigquery = google.bigquery('v2'); + * const bigquery = google.bigquery('v2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID of the table to update - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // 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 bigquery.tables.update({ * // Dataset ID of the table to update - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * + * datasetId: 'placeholder-value', + * // Project ID of the table to update + * projectId: 'placeholder-value', * // Table ID of the table to update - * tableId: 'my-table-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * tableId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clustering": {}, + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "encryptionConfiguration": {}, + * // "etag": "my_etag", + * // "expirationTime": "my_expirationTime", + * // "externalDataConfiguration": {}, + * // "friendlyName": "my_friendlyName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "location": "my_location", + * // "materializedView": {}, + * // "model": {}, + * // "numBytes": "my_numBytes", + * // "numLongTermBytes": "my_numLongTermBytes", + * // "numPhysicalBytes": "my_numPhysicalBytes", + * // "numRows": "my_numRows", + * // "rangePartitioning": {}, + * // "requirePartitionFilter": false, + * // "schema": {}, + * // "selfLink": "my_selfLink", + * // "streamingBuffer": {}, + * // "tableReference": {}, + * // "timePartitioning": {}, + * // "type": "my_type", + * // "view": {} + * // } * }, - * - * auth: authClient, - * }; - * - * bigquery.tables.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clustering": {}, + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "encryptionConfiguration": {}, + * // "etag": "my_etag", + * // "expirationTime": "my_expirationTime", + * // "externalDataConfiguration": {}, + * // "friendlyName": "my_friendlyName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "location": "my_location", + * // "materializedView": {}, + * // "model": {}, + * // "numBytes": "my_numBytes", + * // "numLongTermBytes": "my_numLongTermBytes", + * // "numPhysicalBytes": "my_numPhysicalBytes", + * // "numRows": "my_numRows", + * // "rangePartitioning": {}, + * // "requirePartitionFilter": false, + * // "schema": {}, + * // "selfLink": "my_selfLink", + * // "streamingBuffer": {}, + * // "tableReference": {}, + * // "timePartitioning": {}, + * // "type": "my_type", + * // "view": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias bigquery.tables.update * @memberOf! () * diff --git a/src/apis/bigqueryconnection/v1beta1.ts b/src/apis/bigqueryconnection/v1beta1.ts index 6bd72ed7cb0..9b6b684988c 100644 --- a/src/apis/bigqueryconnection/v1beta1.ts +++ b/src/apis/bigqueryconnection/v1beta1.ts @@ -370,6 +370,72 @@ export namespace bigqueryconnection_v1beta1 { /** * bigqueryconnection.projects.locations.connections.create * @desc Creates a new connection. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryconnection.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 bigqueryconnection = google.bigqueryconnection('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryconnection.projects.locations.connections.create({ + * // Optional. Connection id that should be assigned to the created connection. + * connectionId: 'placeholder-value', + * // Required. Parent resource name. + * // Must be in the format `projects/{project_id}/locations/{location_id}` + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "cloudSql": {}, + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "friendlyName": "my_friendlyName", + * // "hasCredential": false, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cloudSql": {}, + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "friendlyName": "my_friendlyName", + * // "hasCredential": false, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryconnection.projects.locations.connections.create * @memberOf! () * @@ -447,6 +513,48 @@ export namespace bigqueryconnection_v1beta1 { /** * bigqueryconnection.projects.locations.connections.delete * @desc Deletes connection and associated credential. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryconnection.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 bigqueryconnection = google.bigqueryconnection('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryconnection.projects.locations.connections.delete({ + * // Required. Name of the deleted connection, for example: + * // `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * name: 'projects/my-project/locations/my-location/connections/my-connection', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryconnection.projects.locations.connections.delete * @memberOf! () * @@ -517,6 +625,56 @@ export namespace bigqueryconnection_v1beta1 { /** * bigqueryconnection.projects.locations.connections.get * @desc Returns specified connection. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryconnection.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 bigqueryconnection = google.bigqueryconnection('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryconnection.projects.locations.connections.get({ + * // Required. Name of the requested connection, for example: + * // `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * name: 'projects/my-project/locations/my-location/connections/my-connection', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cloudSql": {}, + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "friendlyName": "my_friendlyName", + * // "hasCredential": false, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryconnection.projects.locations.connections.get * @memberOf! () * @@ -589,6 +747,64 @@ export namespace bigqueryconnection_v1beta1 { /** * bigqueryconnection.projects.locations.connections.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryconnection.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 bigqueryconnection = google.bigqueryconnection('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryconnection.projects.locations.connections.getIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/connections/my-connection', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryconnection.projects.locations.connections.getIamPolicy * @memberOf! () * @@ -663,6 +879,55 @@ export namespace bigqueryconnection_v1beta1 { /** * bigqueryconnection.projects.locations.connections.list * @desc Returns a list of connections in the given project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryconnection.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 bigqueryconnection = google.bigqueryconnection('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryconnection.projects.locations.connections.list({ + * // Required. Maximum number of results per page. + * maxResults: 'placeholder-value', + * // Page token. + * pageToken: 'placeholder-value', + * // Required. Parent resource name. + * // Must be in the form: `projects/{project_id}/locations/{location_id}` + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "connections": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryconnection.projects.locations.connections.list * @memberOf! () * @@ -742,6 +1007,72 @@ export namespace bigqueryconnection_v1beta1 { /** * bigqueryconnection.projects.locations.connections.patch * @desc Updates the specified connection. For security reasons, also resets credential if connection properties are in the update field mask. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryconnection.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 bigqueryconnection = google.bigqueryconnection('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryconnection.projects.locations.connections.patch({ + * // Required. Name of the connection to update, for example: + * // `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * name: 'projects/my-project/locations/my-location/connections/my-connection', + * // Required. Update mask for the connection fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "cloudSql": {}, + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "friendlyName": "my_friendlyName", + * // "hasCredential": false, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cloudSql": {}, + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "friendlyName": "my_friendlyName", + * // "hasCredential": false, + * // "lastModifiedTime": "my_lastModifiedTime", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryconnection.projects.locations.connections.patch * @memberOf! () * @@ -816,6 +1147,65 @@ export namespace bigqueryconnection_v1beta1 { /** * bigqueryconnection.projects.locations.connections.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryconnection.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 bigqueryconnection = google.bigqueryconnection('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryconnection.projects.locations.connections.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/connections/my-connection', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryconnection.projects.locations.connections.setIamPolicy * @memberOf! () * @@ -890,6 +1280,61 @@ export namespace bigqueryconnection_v1beta1 { /** * bigqueryconnection.projects.locations.connections.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryconnection.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 bigqueryconnection = google.bigqueryconnection('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryconnection.projects.locations.connections.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/connections/my-connection', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryconnection.projects.locations.connections.testIamPermissions * @memberOf! () * @@ -973,6 +1418,59 @@ export namespace bigqueryconnection_v1beta1 { /** * bigqueryconnection.projects.locations.connections.updateCredential * @desc Sets the credential for the specified connection. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryconnection.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 bigqueryconnection = google.bigqueryconnection('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryconnection.projects.locations.connections.updateCredential( + * { + * // Required. Name of the connection, for example: + * // `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential` + * name: + * 'projects/my-project/locations/my-location/connections/my-connection/credential', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "cloudSql": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryconnection.projects.locations.connections.updateCredential * @memberOf! () * diff --git a/src/apis/bigquerydatatransfer/v1.ts b/src/apis/bigquerydatatransfer/v1.ts index 48b30ff273e..a77723f0fa0 100644 --- a/src/apis/bigquerydatatransfer/v1.ts +++ b/src/apis/bigquerydatatransfer/v1.ts @@ -642,6 +642,59 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.dataSources.checkValidCreds * @desc Returns true if valid credentials exist for the given data source and requesting user. Some data sources doesn't support service account, so we need to talk to them on behalf of the end user. This API just checks whether we have OAuth token for the particular user, which is a pre-requisite before user can create a transfer config. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.dataSources.checkValidCreds({ + * // Required. The data source in the form: + * // `projects/{project_id}/dataSources/{data_source_id}` or + * // `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`. + * name: 'projects/my-project/dataSources/my-dataSource', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "hasValidCreds": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.dataSources.checkValidCreds * @memberOf! () * @@ -722,6 +775,70 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.dataSources.get * @desc Retrieves a supported data source and returns its settings, which can be used for UI rendering. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.dataSources.get({ + * // Required. The field will contain name of the resource requested, for example: + * // `projects/{project_id}/dataSources/{data_source_id}` or + * // `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}` + * name: 'projects/my-project/dataSources/my-dataSource', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authorizationType": "my_authorizationType", + * // "clientId": "my_clientId", + * // "dataRefreshType": "my_dataRefreshType", + * // "dataSourceId": "my_dataSourceId", + * // "defaultDataRefreshWindowDays": 0, + * // "defaultSchedule": "my_defaultSchedule", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "helpUrl": "my_helpUrl", + * // "manualRunsDisabled": false, + * // "minimumScheduleInterval": "my_minimumScheduleInterval", + * // "name": "my_name", + * // "parameters": [], + * // "scopes": [], + * // "supportsCustomSchedule": false, + * // "supportsMultipleTransfers": false, + * // "transferType": "my_transferType", + * // "updateDeadlineSeconds": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.dataSources.get * @memberOf! () * @@ -794,6 +911,62 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.dataSources.list * @desc Lists supported data sources and returns their settings, which can be used for UI rendering. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.dataSources.list({ + * // Page size. The default page size is the maximum value of 1000 results. + * pageSize: 'placeholder-value', + * // Pagination token, which can be used to request a specific page + * // of `ListDataSourcesRequest` list results. For multiple-page + * // results, `ListDataSourcesResponse` outputs + * // a `next_page` token, which can be used as the + * // `page_token` value to request the next page of list results. + * pageToken: 'placeholder-value', + * // Required. The BigQuery project id for which data sources should be returned. + * // Must be in the form: `projects/{project_id}` or + * // `projects/{project_id}/locations/{location_id} + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dataSources": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.dataSources.list * @memberOf! () * @@ -938,6 +1111,55 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.locations.get * @memberOf! () * @@ -1008,6 +1230,58 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.locations.list * @memberOf! () * @@ -1132,6 +1406,62 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.locations.dataSources.checkValidCreds * @desc Returns true if valid credentials exist for the given data source and requesting user. Some data sources doesn't support service account, so we need to talk to them on behalf of the end user. This API just checks whether we have OAuth token for the particular user, which is a pre-requisite before user can create a transfer config. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.locations.dataSources.checkValidCreds( + * { + * // Required. The data source in the form: + * // `projects/{project_id}/dataSources/{data_source_id}` or + * // `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`. + * name: + * 'projects/my-project/locations/my-location/dataSources/my-dataSource', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "hasValidCreds": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.locations.dataSources.checkValidCreds * @memberOf! () * @@ -1212,6 +1542,70 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.locations.dataSources.get * @desc Retrieves a supported data source and returns its settings, which can be used for UI rendering. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.locations.dataSources.get({ + * // Required. The field will contain name of the resource requested, for example: + * // `projects/{project_id}/dataSources/{data_source_id}` or + * // `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}` + * name: 'projects/my-project/locations/my-location/dataSources/my-dataSource', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authorizationType": "my_authorizationType", + * // "clientId": "my_clientId", + * // "dataRefreshType": "my_dataRefreshType", + * // "dataSourceId": "my_dataSourceId", + * // "defaultDataRefreshWindowDays": 0, + * // "defaultSchedule": "my_defaultSchedule", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "helpUrl": "my_helpUrl", + * // "manualRunsDisabled": false, + * // "minimumScheduleInterval": "my_minimumScheduleInterval", + * // "name": "my_name", + * // "parameters": [], + * // "scopes": [], + * // "supportsCustomSchedule": false, + * // "supportsMultipleTransfers": false, + * // "transferType": "my_transferType", + * // "updateDeadlineSeconds": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.locations.dataSources.get * @memberOf! () * @@ -1284,6 +1678,62 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.locations.dataSources.list * @desc Lists supported data sources and returns their settings, which can be used for UI rendering. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.locations.dataSources.list({ + * // Page size. The default page size is the maximum value of 1000 results. + * pageSize: 'placeholder-value', + * // Pagination token, which can be used to request a specific page + * // of `ListDataSourcesRequest` list results. For multiple-page + * // results, `ListDataSourcesResponse` outputs + * // a `next_page` token, which can be used as the + * // `page_token` value to request the next page of list results. + * pageToken: 'placeholder-value', + * // Required. The BigQuery project id for which data sources should be returned. + * // Must be in the form: `projects/{project_id}` or + * // `projects/{project_id}/locations/{location_id} + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dataSources": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.locations.dataSources.list * @memberOf! () * @@ -1424,6 +1874,118 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.locations.transferConfigs.create * @desc Creates a new data transfer configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/cloud-platform'], + * }); + * + * // 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 bigquerydatatransfer.projects.locations.transferConfigs.create( + * { + * // Optional OAuth2 authorization code to use with this transfer configuration. + * // This is required if new credentials are needed, as indicated by + * // `CheckValidCreds`. + * // In order to obtain authorization_code, please make a + * // request to + * // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + * // + * // * client_id should be OAuth client_id of BigQuery DTS API for the given + * // data source returned by ListDataSources method. + * // * data_source_scopes are the scopes returned by ListDataSources method. + * // * redirect_uri is an optional parameter. If not specified, then + * // authorization code is posted to the opener of authorization flow window. + * // Otherwise it will be sent to the redirect uri. A special value of + * // urn:ietf:wg:oauth:2.0:oob means that authorization code should be + * // returned in the title bar of the browser, with the page text prompting + * // the user to copy the code and paste it in the application. + * authorizationCode: 'placeholder-value', + * // Required. The BigQuery project id where the transfer configuration should be created. + * // Must be in the format projects/{project_id}/locations/{location_id} or + * // projects/{project_id}. If specified location and location of the + * // destination bigquery dataset do not match - the request will fail. + * parent: 'projects/my-project/locations/my-location', + * // Optional service account name. If this field is set, transfer config will + * // be created with this service account credentials. It requires that + * // requesting user calling this API has permissions to act as this service + * // account. + * serviceAccountName: 'placeholder-value', + * // Optional version info. If users want to find a very recent access token, + * // that is, immediately after approving access, users have to set the + * // version_info claim in the token request. To obtain the version_info, users + * // must use the "none+gsession" response type. which be return a + * // version_info back in the authorization response which be be put in a JWT + * // claim in the token request. + * versionInfo: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dataRefreshWindowDays": 0, + * // "dataSourceId": "my_dataSourceId", + * // "datasetRegion": "my_datasetRegion", + * // "destinationDatasetId": "my_destinationDatasetId", + * // "disabled": false, + * // "displayName": "my_displayName", + * // "emailPreferences": {}, + * // "name": "my_name", + * // "nextRunTime": "my_nextRunTime", + * // "notificationPubsubTopic": "my_notificationPubsubTopic", + * // "params": {}, + * // "schedule": "my_schedule", + * // "scheduleOptions": {}, + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "userId": "my_userId" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "dataRefreshWindowDays": 0, + * // "dataSourceId": "my_dataSourceId", + * // "datasetRegion": "my_datasetRegion", + * // "destinationDatasetId": "my_destinationDatasetId", + * // "disabled": false, + * // "displayName": "my_displayName", + * // "emailPreferences": {}, + * // "name": "my_name", + * // "nextRunTime": "my_nextRunTime", + * // "notificationPubsubTopic": "my_notificationPubsubTopic", + * // "params": {}, + * // "schedule": "my_schedule", + * // "scheduleOptions": {}, + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.locations.transferConfigs.create * @memberOf! () * @@ -1503,6 +2065,52 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.locations.transferConfigs.delete * @desc Deletes a data transfer configuration, including any associated transfer runs and logs. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.locations.transferConfigs.delete( + * { + * // Required. The field will contain name of the resource requested, for example: + * // `projects/{project_id}/transferConfigs/{config_id}` or + * // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + * name: + * 'projects/my-project/locations/my-location/transferConfigs/my-transferConfig', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.locations.transferConfigs.delete * @memberOf! () * @@ -1573,6 +2181,71 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.locations.transferConfigs.get * @desc Returns information about a data transfer config. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.locations.transferConfigs.get( + * { + * // Required. The field will contain name of the resource requested, for example: + * // `projects/{project_id}/transferConfigs/{config_id}` or + * // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + * name: + * 'projects/my-project/locations/my-location/transferConfigs/my-transferConfig', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "dataRefreshWindowDays": 0, + * // "dataSourceId": "my_dataSourceId", + * // "datasetRegion": "my_datasetRegion", + * // "destinationDatasetId": "my_destinationDatasetId", + * // "disabled": false, + * // "displayName": "my_displayName", + * // "emailPreferences": {}, + * // "name": "my_name", + * // "nextRunTime": "my_nextRunTime", + * // "notificationPubsubTopic": "my_notificationPubsubTopic", + * // "params": {}, + * // "schedule": "my_schedule", + * // "scheduleOptions": {}, + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.locations.transferConfigs.get * @memberOf! () * @@ -1645,6 +2318,66 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.locations.transferConfigs.list * @desc Returns information about all data transfers in the project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.locations.transferConfigs.list( + * { + * // When specified, only configurations of requested data sources are returned. + * dataSourceIds: 'placeholder-value', + * // Page size. The default page size is the maximum value of 1000 results. + * pageSize: 'placeholder-value', + * // Pagination token, which can be used to request a specific page + * // of `ListTransfersRequest` list results. For multiple-page + * // results, `ListTransfersResponse` outputs + * // a `next_page` token, which can be used as the + * // `page_token` value to request the next page of list results. + * pageToken: 'placeholder-value', + * // Required. The BigQuery project id for which data sources + * // should be returned: `projects/{project_id}` or + * // `projects/{project_id}/locations/{location_id}` + * parent: 'projects/my-project/locations/my-location', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "transferConfigs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.locations.transferConfigs.list * @memberOf! () * @@ -1730,6 +2463,125 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.locations.transferConfigs.patch * @desc Updates a data transfer configuration. All fields must be set, even if they are not updated. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/cloud-platform'], + * }); + * + * // 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 bigquerydatatransfer.projects.locations.transferConfigs.patch( + * { + * // Optional OAuth2 authorization code to use with this transfer configuration. + * // If it is provided, the transfer configuration will be associated with the + * // authorizing user. + * // In order to obtain authorization_code, please make a + * // request to + * // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + * // + * // * client_id should be OAuth client_id of BigQuery DTS API for the given + * // data source returned by ListDataSources method. + * // * data_source_scopes are the scopes returned by ListDataSources method. + * // * redirect_uri is an optional parameter. If not specified, then + * // authorization code is posted to the opener of authorization flow window. + * // Otherwise it will be sent to the redirect uri. A special value of + * // urn:ietf:wg:oauth:2.0:oob means that authorization code should be + * // returned in the title bar of the browser, with the page text prompting + * // the user to copy the code and paste it in the application. + * authorizationCode: 'placeholder-value', + * // The resource name of the transfer config. + * // Transfer config names have the form of + * // `projects/{project_id}/locations/{region}/transferConfigs/{config_id}`. + * // The name is automatically generated based on the config_id specified in + * // CreateTransferConfigRequest along with project_id and region. If config_id + * // is not provided, usually a uuid, even though it is not guaranteed or + * // required, will be generated for config_id. + * name: + * 'projects/my-project/locations/my-location/transferConfigs/my-transferConfig', + * // Optional service account name. If this field is set and + * // "service_account_name" is set in update_mask, transfer config will be + * // updated to use this service account credentials. It requires that + * // requesting user calling this API has permissions to act as this service + * // account. + * serviceAccountName: 'placeholder-value', + * // Required. Required list of fields to be updated in this request. + * updateMask: 'placeholder-value', + * // Optional version info. If users want to find a very recent access token, + * // that is, immediately after approving access, users have to set the + * // version_info claim in the token request. To obtain the version_info, users + * // must use the "none+gsession" response type. which be return a + * // version_info back in the authorization response which be be put in a JWT + * // claim in the token request. + * versionInfo: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dataRefreshWindowDays": 0, + * // "dataSourceId": "my_dataSourceId", + * // "datasetRegion": "my_datasetRegion", + * // "destinationDatasetId": "my_destinationDatasetId", + * // "disabled": false, + * // "displayName": "my_displayName", + * // "emailPreferences": {}, + * // "name": "my_name", + * // "nextRunTime": "my_nextRunTime", + * // "notificationPubsubTopic": "my_notificationPubsubTopic", + * // "params": {}, + * // "schedule": "my_schedule", + * // "scheduleOptions": {}, + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "userId": "my_userId" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "dataRefreshWindowDays": 0, + * // "dataSourceId": "my_dataSourceId", + * // "datasetRegion": "my_datasetRegion", + * // "destinationDatasetId": "my_destinationDatasetId", + * // "disabled": false, + * // "displayName": "my_displayName", + * // "emailPreferences": {}, + * // "name": "my_name", + * // "nextRunTime": "my_nextRunTime", + * // "notificationPubsubTopic": "my_notificationPubsubTopic", + * // "params": {}, + * // "schedule": "my_schedule", + * // "scheduleOptions": {}, + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.locations.transferConfigs.patch * @memberOf! () * @@ -1807,6 +2659,63 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.locations.transferConfigs.scheduleRuns * @desc Creates transfer runs for a time range [start_time, end_time]. For each date - or whatever granularity the data source supports - in the range, one transfer run is created. Note that runs are created per UTC time in the time range. DEPRECATED: use StartManualTransferRuns instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.locations.transferConfigs.scheduleRuns( + * { + * // Required. Transfer configuration name in the form: + * // `projects/{project_id}/transferConfigs/{config_id}` or + * // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * parent: + * 'projects/my-project/locations/my-location/transferConfigs/my-transferConfig', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "endTime": "my_endTime", + * // "startTime": "my_startTime" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "runs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.locations.transferConfigs.scheduleRuns * @memberOf! () * @@ -1892,6 +2801,63 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.locations.transferConfigs.startManualRuns * @desc Start manual transfer runs to be executed now with schedule_time equal to current time. The transfer runs can be created for a time range where the run_time is between start_time (inclusive) and end_time (exclusive), or for a specific run_time. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.locations.transferConfigs.startManualRuns( + * { + * // Transfer configuration name in the form: + * // `projects/{project_id}/transferConfigs/{config_id}` or + * // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * parent: + * 'projects/my-project/locations/my-location/transferConfigs/my-transferConfig', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "requestedRunTime": "my_requestedRunTime", + * // "requestedTimeRange": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "runs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.locations.transferConfigs.startManualRuns * @memberOf! () * @@ -2133,6 +3099,52 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.locations.transferConfigs.runs.delete * @desc Deletes the specified transfer run. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.locations.transferConfigs.runs.delete( + * { + * // Required. The field will contain name of the resource requested, for example: + * // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * name: + * 'projects/my-project/locations/my-location/transferConfigs/my-transferConfig/runs/my-run', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.locations.transferConfigs.runs.delete * @memberOf! () * @@ -2203,6 +3215,70 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.locations.transferConfigs.runs.get * @desc Returns information about the particular transfer run. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.locations.transferConfigs.runs.get( + * { + * // Required. The field will contain name of the resource requested, for example: + * // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * name: + * 'projects/my-project/locations/my-location/transferConfigs/my-transferConfig/runs/my-run', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "dataSourceId": "my_dataSourceId", + * // "destinationDatasetId": "my_destinationDatasetId", + * // "emailPreferences": {}, + * // "endTime": "my_endTime", + * // "errorStatus": {}, + * // "name": "my_name", + * // "notificationPubsubTopic": "my_notificationPubsubTopic", + * // "params": {}, + * // "runTime": "my_runTime", + * // "schedule": "my_schedule", + * // "scheduleTime": "my_scheduleTime", + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.locations.transferConfigs.runs.get * @memberOf! () * @@ -2275,6 +3351,70 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.locations.transferConfigs.runs.list * @desc Returns information about running and completed jobs. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.locations.transferConfigs.runs.list( + * { + * // Page size. The default page size is the maximum value of 1000 results. + * pageSize: 'placeholder-value', + * // Pagination token, which can be used to request a specific page + * // of `ListTransferRunsRequest` list results. For multiple-page + * // results, `ListTransferRunsResponse` outputs + * // a `next_page` token, which can be used as the + * // `page_token` value to request the next page of list results. + * pageToken: 'placeholder-value', + * // Required. Name of transfer configuration for which transfer runs should be retrieved. + * // Format of transfer configuration resource name is: + * // `projects/{project_id}/transferConfigs/{config_id}` or + * // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * parent: + * 'projects/my-project/locations/my-location/transferConfigs/my-transferConfig', + * // Indicates how run attempts are to be pulled. + * runAttempt: 'placeholder-value', + * // When specified, only transfer runs with requested states are returned. + * states: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "transferRuns": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.locations.transferConfigs.runs.list * @memberOf! () * @@ -2413,6 +3553,68 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.locations.transferConfigs.runs.transferLogs.list * @desc Returns user facing log messages for the data transfer run. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.locations.transferConfigs.runs.transferLogs.list( + * { + * // Message types to return. If not populated - INFO, WARNING and ERROR + * // messages are returned. + * messageTypes: 'placeholder-value', + * // Page size. The default page size is the maximum value of 1000 results. + * pageSize: 'placeholder-value', + * // Pagination token, which can be used to request a specific page + * // of `ListTransferLogsRequest` list results. For multiple-page + * // results, `ListTransferLogsResponse` outputs + * // a `next_page` token, which can be used as the + * // `page_token` value to request the next page of list results. + * pageToken: 'placeholder-value', + * // Required. Transfer run name in the form: + * // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * parent: + * 'projects/my-project/locations/my-location/transferConfigs/my-transferConfig/runs/my-run', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "transferMessages": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.locations.transferConfigs.runs.transferLogs.list * @memberOf! () * @@ -2527,6 +3729,116 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.transferConfigs.create * @desc Creates a new data transfer configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/cloud-platform'], + * }); + * + * // 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 bigquerydatatransfer.projects.transferConfigs.create({ + * // Optional OAuth2 authorization code to use with this transfer configuration. + * // This is required if new credentials are needed, as indicated by + * // `CheckValidCreds`. + * // In order to obtain authorization_code, please make a + * // request to + * // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + * // + * // * client_id should be OAuth client_id of BigQuery DTS API for the given + * // data source returned by ListDataSources method. + * // * data_source_scopes are the scopes returned by ListDataSources method. + * // * redirect_uri is an optional parameter. If not specified, then + * // authorization code is posted to the opener of authorization flow window. + * // Otherwise it will be sent to the redirect uri. A special value of + * // urn:ietf:wg:oauth:2.0:oob means that authorization code should be + * // returned in the title bar of the browser, with the page text prompting + * // the user to copy the code and paste it in the application. + * authorizationCode: 'placeholder-value', + * // Required. The BigQuery project id where the transfer configuration should be created. + * // Must be in the format projects/{project_id}/locations/{location_id} or + * // projects/{project_id}. If specified location and location of the + * // destination bigquery dataset do not match - the request will fail. + * parent: 'projects/my-project', + * // Optional service account name. If this field is set, transfer config will + * // be created with this service account credentials. It requires that + * // requesting user calling this API has permissions to act as this service + * // account. + * serviceAccountName: 'placeholder-value', + * // Optional version info. If users want to find a very recent access token, + * // that is, immediately after approving access, users have to set the + * // version_info claim in the token request. To obtain the version_info, users + * // must use the "none+gsession" response type. which be return a + * // version_info back in the authorization response which be be put in a JWT + * // claim in the token request. + * versionInfo: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dataRefreshWindowDays": 0, + * // "dataSourceId": "my_dataSourceId", + * // "datasetRegion": "my_datasetRegion", + * // "destinationDatasetId": "my_destinationDatasetId", + * // "disabled": false, + * // "displayName": "my_displayName", + * // "emailPreferences": {}, + * // "name": "my_name", + * // "nextRunTime": "my_nextRunTime", + * // "notificationPubsubTopic": "my_notificationPubsubTopic", + * // "params": {}, + * // "schedule": "my_schedule", + * // "scheduleOptions": {}, + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "userId": "my_userId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dataRefreshWindowDays": 0, + * // "dataSourceId": "my_dataSourceId", + * // "datasetRegion": "my_datasetRegion", + * // "destinationDatasetId": "my_destinationDatasetId", + * // "disabled": false, + * // "displayName": "my_displayName", + * // "emailPreferences": {}, + * // "name": "my_name", + * // "nextRunTime": "my_nextRunTime", + * // "notificationPubsubTopic": "my_notificationPubsubTopic", + * // "params": {}, + * // "schedule": "my_schedule", + * // "scheduleOptions": {}, + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.transferConfigs.create * @memberOf! () * @@ -2606,6 +3918,49 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.transferConfigs.delete * @desc Deletes a data transfer configuration, including any associated transfer runs and logs. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.transferConfigs.delete({ + * // Required. The field will contain name of the resource requested, for example: + * // `projects/{project_id}/transferConfigs/{config_id}` or + * // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + * name: 'projects/my-project/transferConfigs/my-transferConfig', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.transferConfigs.delete * @memberOf! () * @@ -2676,6 +4031,68 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.transferConfigs.get * @desc Returns information about a data transfer config. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.transferConfigs.get({ + * // Required. The field will contain name of the resource requested, for example: + * // `projects/{project_id}/transferConfigs/{config_id}` or + * // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + * name: 'projects/my-project/transferConfigs/my-transferConfig', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dataRefreshWindowDays": 0, + * // "dataSourceId": "my_dataSourceId", + * // "datasetRegion": "my_datasetRegion", + * // "destinationDatasetId": "my_destinationDatasetId", + * // "disabled": false, + * // "displayName": "my_displayName", + * // "emailPreferences": {}, + * // "name": "my_name", + * // "nextRunTime": "my_nextRunTime", + * // "notificationPubsubTopic": "my_notificationPubsubTopic", + * // "params": {}, + * // "schedule": "my_schedule", + * // "scheduleOptions": {}, + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.transferConfigs.get * @memberOf! () * @@ -2748,6 +4165,64 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.transferConfigs.list * @desc Returns information about all data transfers in the project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.transferConfigs.list({ + * // When specified, only configurations of requested data sources are returned. + * dataSourceIds: 'placeholder-value', + * // Page size. The default page size is the maximum value of 1000 results. + * pageSize: 'placeholder-value', + * // Pagination token, which can be used to request a specific page + * // of `ListTransfersRequest` list results. For multiple-page + * // results, `ListTransfersResponse` outputs + * // a `next_page` token, which can be used as the + * // `page_token` value to request the next page of list results. + * pageToken: 'placeholder-value', + * // Required. The BigQuery project id for which data sources + * // should be returned: `projects/{project_id}` or + * // `projects/{project_id}/locations/{location_id}` + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "transferConfigs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.transferConfigs.list * @memberOf! () * @@ -2833,6 +4308,122 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.transferConfigs.patch * @desc Updates a data transfer configuration. All fields must be set, even if they are not updated. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/cloud-platform'], + * }); + * + * // 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 bigquerydatatransfer.projects.transferConfigs.patch({ + * // Optional OAuth2 authorization code to use with this transfer configuration. + * // If it is provided, the transfer configuration will be associated with the + * // authorizing user. + * // In order to obtain authorization_code, please make a + * // request to + * // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + * // + * // * client_id should be OAuth client_id of BigQuery DTS API for the given + * // data source returned by ListDataSources method. + * // * data_source_scopes are the scopes returned by ListDataSources method. + * // * redirect_uri is an optional parameter. If not specified, then + * // authorization code is posted to the opener of authorization flow window. + * // Otherwise it will be sent to the redirect uri. A special value of + * // urn:ietf:wg:oauth:2.0:oob means that authorization code should be + * // returned in the title bar of the browser, with the page text prompting + * // the user to copy the code and paste it in the application. + * authorizationCode: 'placeholder-value', + * // The resource name of the transfer config. + * // Transfer config names have the form of + * // `projects/{project_id}/locations/{region}/transferConfigs/{config_id}`. + * // The name is automatically generated based on the config_id specified in + * // CreateTransferConfigRequest along with project_id and region. If config_id + * // is not provided, usually a uuid, even though it is not guaranteed or + * // required, will be generated for config_id. + * name: 'projects/my-project/transferConfigs/my-transferConfig', + * // Optional service account name. If this field is set and + * // "service_account_name" is set in update_mask, transfer config will be + * // updated to use this service account credentials. It requires that + * // requesting user calling this API has permissions to act as this service + * // account. + * serviceAccountName: 'placeholder-value', + * // Required. Required list of fields to be updated in this request. + * updateMask: 'placeholder-value', + * // Optional version info. If users want to find a very recent access token, + * // that is, immediately after approving access, users have to set the + * // version_info claim in the token request. To obtain the version_info, users + * // must use the "none+gsession" response type. which be return a + * // version_info back in the authorization response which be be put in a JWT + * // claim in the token request. + * versionInfo: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dataRefreshWindowDays": 0, + * // "dataSourceId": "my_dataSourceId", + * // "datasetRegion": "my_datasetRegion", + * // "destinationDatasetId": "my_destinationDatasetId", + * // "disabled": false, + * // "displayName": "my_displayName", + * // "emailPreferences": {}, + * // "name": "my_name", + * // "nextRunTime": "my_nextRunTime", + * // "notificationPubsubTopic": "my_notificationPubsubTopic", + * // "params": {}, + * // "schedule": "my_schedule", + * // "scheduleOptions": {}, + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "userId": "my_userId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dataRefreshWindowDays": 0, + * // "dataSourceId": "my_dataSourceId", + * // "datasetRegion": "my_datasetRegion", + * // "destinationDatasetId": "my_destinationDatasetId", + * // "disabled": false, + * // "displayName": "my_displayName", + * // "emailPreferences": {}, + * // "name": "my_name", + * // "nextRunTime": "my_nextRunTime", + * // "notificationPubsubTopic": "my_notificationPubsubTopic", + * // "params": {}, + * // "schedule": "my_schedule", + * // "scheduleOptions": {}, + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.transferConfigs.patch * @memberOf! () * @@ -2910,6 +4501,60 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.transferConfigs.scheduleRuns * @desc Creates transfer runs for a time range [start_time, end_time]. For each date - or whatever granularity the data source supports - in the range, one transfer run is created. Note that runs are created per UTC time in the time range. DEPRECATED: use StartManualTransferRuns instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.transferConfigs.scheduleRuns({ + * // Required. Transfer configuration name in the form: + * // `projects/{project_id}/transferConfigs/{config_id}` or + * // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * parent: 'projects/my-project/transferConfigs/my-transferConfig', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "endTime": "my_endTime", + * // "startTime": "my_startTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "runs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.transferConfigs.scheduleRuns * @memberOf! () * @@ -2995,6 +4640,62 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.transferConfigs.startManualRuns * @desc Start manual transfer runs to be executed now with schedule_time equal to current time. The transfer runs can be created for a time range where the run_time is between start_time (inclusive) and end_time (exclusive), or for a specific run_time. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.transferConfigs.startManualRuns( + * { + * // Transfer configuration name in the form: + * // `projects/{project_id}/transferConfigs/{config_id}` or + * // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * parent: 'projects/my-project/transferConfigs/my-transferConfig', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "requestedRunTime": "my_requestedRunTime", + * // "requestedTimeRange": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "runs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.transferConfigs.startManualRuns * @memberOf! () * @@ -3236,6 +4937,49 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.transferConfigs.runs.delete * @desc Deletes the specified transfer run. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.transferConfigs.runs.delete({ + * // Required. The field will contain name of the resource requested, for example: + * // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * name: 'projects/my-project/transferConfigs/my-transferConfig/runs/my-run', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.transferConfigs.runs.delete * @memberOf! () * @@ -3306,6 +5050,67 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.transferConfigs.runs.get * @desc Returns information about the particular transfer run. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.transferConfigs.runs.get({ + * // Required. The field will contain name of the resource requested, for example: + * // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * name: 'projects/my-project/transferConfigs/my-transferConfig/runs/my-run', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dataSourceId": "my_dataSourceId", + * // "destinationDatasetId": "my_destinationDatasetId", + * // "emailPreferences": {}, + * // "endTime": "my_endTime", + * // "errorStatus": {}, + * // "name": "my_name", + * // "notificationPubsubTopic": "my_notificationPubsubTopic", + * // "params": {}, + * // "runTime": "my_runTime", + * // "schedule": "my_schedule", + * // "scheduleTime": "my_scheduleTime", + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.transferConfigs.runs.get * @memberOf! () * @@ -3378,6 +5183,67 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.transferConfigs.runs.list * @desc Returns information about running and completed jobs. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.transferConfigs.runs.list({ + * // Page size. The default page size is the maximum value of 1000 results. + * pageSize: 'placeholder-value', + * // Pagination token, which can be used to request a specific page + * // of `ListTransferRunsRequest` list results. For multiple-page + * // results, `ListTransferRunsResponse` outputs + * // a `next_page` token, which can be used as the + * // `page_token` value to request the next page of list results. + * pageToken: 'placeholder-value', + * // Required. Name of transfer configuration for which transfer runs should be retrieved. + * // Format of transfer configuration resource name is: + * // `projects/{project_id}/transferConfigs/{config_id}` or + * // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * parent: 'projects/my-project/transferConfigs/my-transferConfig', + * // Indicates how run attempts are to be pulled. + * runAttempt: 'placeholder-value', + * // When specified, only transfer runs with requested states are returned. + * states: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "transferRuns": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.transferConfigs.runs.list * @memberOf! () * @@ -3516,6 +5382,68 @@ export namespace bigquerydatatransfer_v1 { /** * bigquerydatatransfer.projects.transferConfigs.runs.transferLogs.list * @desc Returns user facing log messages for the data transfer run. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigquerydatatransfer.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 bigquerydatatransfer = google.bigquerydatatransfer('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/bigquery', + * 'https://www.googleapis.com/auth/bigquery.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigquerydatatransfer.projects.transferConfigs.runs.transferLogs.list( + * { + * // Message types to return. If not populated - INFO, WARNING and ERROR + * // messages are returned. + * messageTypes: 'placeholder-value', + * // Page size. The default page size is the maximum value of 1000 results. + * pageSize: 'placeholder-value', + * // Pagination token, which can be used to request a specific page + * // of `ListTransferLogsRequest` list results. For multiple-page + * // results, `ListTransferLogsResponse` outputs + * // a `next_page` token, which can be used as the + * // `page_token` value to request the next page of list results. + * pageToken: 'placeholder-value', + * // Required. Transfer run name in the form: + * // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * parent: + * 'projects/my-project/transferConfigs/my-transferConfig/runs/my-run', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "transferMessages": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigquerydatatransfer.projects.transferConfigs.runs.transferLogs.list * @memberOf! () * diff --git a/src/apis/bigqueryreservation/v1.ts b/src/apis/bigqueryreservation/v1.ts index 6e9806102b7..33a6026e686 100644 --- a/src/apis/bigqueryreservation/v1.ts +++ b/src/apis/bigqueryreservation/v1.ts @@ -373,6 +373,47 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'operations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.operations.delete * @memberOf! () * @@ -443,6 +484,56 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.operations.list * @memberOf! () * @@ -579,6 +670,52 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.projects.locations.getBiReservation * @desc Retrieves a BI reservation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.getBiReservation({ + * // Required. Name of the requested reservation, for example: + * // `projects/{project_id}/locations/{location_id}/bireservation` + * name: 'projects/my-project/locations/my-location/biReservation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "size": "my_size", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.getBiReservation * @memberOf! () * @@ -653,6 +790,61 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.projects.locations.searchAssignments * @desc Looks up assignments for a specified resource for a particular region. If the request is about a project: 1) Assignments created on the project will be returned if they exist. 2) Otherwise assignments created on the closest ancestor will be returned. 3) Assignments for different JobTypes will all be returned. Same logic applies if the request is about a folder. If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors). Comparing to ListAssignments, there are some behavior differences: 1) permission on the assignee will be verified in this API. 2) Hierarchy lookup (project->folder->organization) happens in this API. 3) Parent here is projects/x/locations/x, instead of projects/x/locations/xreservations/x. Note "-" cannot be used for projects nor locations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.searchAssignments({ + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // Required. The resource name of the admin project(containing project and location), + * // e.g.: + * // "projects/myproject/locations/US". + * parent: 'projects/my-project/locations/my-location', + * // Please specify resource name as assignee in the query. + * // e.g., "assignee=projects/myproject" + * // "assignee=folders/123" + * // "assignee=organizations/456" + * query: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assignments": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.searchAssignments * @memberOf! () * @@ -738,6 +930,65 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.projects.locations.updateBiReservation * @desc Updates a BI reservation. Only fields specified in the field_mask are updated. Singleton BI reservation always exists with default size 0. In order to reserve BI capacity it needs to be updated to an amount greater than 0. In order to release BI capacity reservation size must be set to 0. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.updateBiReservation({ + * // The resource name of the singleton BI reservation. + * // Reservation names have the form + * // `projects/{project_id}/locations/{location_id}/bireservation`. + * name: 'projects/my-project/locations/my-location/biReservation', + * // A list of fields to be updated in this request. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name", + * // "size": "my_size", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "size": "my_size", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.updateBiReservation * @memberOf! () * @@ -879,6 +1130,75 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.projects.locations.capacityCommitments.create * @desc Creates a new capacity commitment resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.capacityCommitments.create( + * { + * // If true, fail the request if another project in the organization has a + * // capacity commitment. + * enforceSingleAdminProjectPerOrg: 'placeholder-value', + * // Required. Resource name of the parent reservation. E.g., + * // projects/myproject/locations/US + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "commitmentEndTime": "my_commitmentEndTime", + * // "failureStatus": {}, + * // "name": "my_name", + * // "plan": "my_plan", + * // "renewalPlan": "my_renewalPlan", + * // "slotCount": "my_slotCount", + * // "state": "my_state" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "commitmentEndTime": "my_commitmentEndTime", + * // "failureStatus": {}, + * // "name": "my_name", + * // "plan": "my_plan", + * // "renewalPlan": "my_renewalPlan", + * // "slotCount": "my_slotCount", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.capacityCommitments.create * @memberOf! () * @@ -956,6 +1276,51 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.projects.locations.capacityCommitments.delete * @desc Deletes a capacity commitment. Attempting to delete capacity commitment before its commitment_end_time will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.capacityCommitments.delete( + * { + * // Required. Resource name of the capacity commitment to delete. E.g., + * // projects/myproject/locations/US/capacityCommitments/123 + * name: + * 'projects/my-project/locations/my-location/capacityCommitments/my-capacityCommitment', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.capacityCommitments.delete * @memberOf! () * @@ -1026,6 +1391,59 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.projects.locations.capacityCommitments.get * @desc Returns information about the capacity commitment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.capacityCommitments.get( + * { + * // Required. Resource name of the capacity commitment to retrieve. E.g., + * // projects/myproject/locations/US/capacityCommitments/123 + * name: + * 'projects/my-project/locations/my-location/capacityCommitments/my-capacityCommitment', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "commitmentEndTime": "my_commitmentEndTime", + * // "failureStatus": {}, + * // "name": "my_name", + * // "plan": "my_plan", + * // "renewalPlan": "my_renewalPlan", + * // "slotCount": "my_slotCount", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.capacityCommitments.get * @memberOf! () * @@ -1098,6 +1516,57 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.projects.locations.capacityCommitments.list * @desc Lists all the capacity commitments for the admin project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.capacityCommitments.list( + * { + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // Required. Resource name of the parent reservation. E.g., + * // projects/myproject/locations/US + * parent: 'projects/my-project/locations/my-location', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "capacityCommitments": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.capacityCommitments.list * @memberOf! () * @@ -1184,6 +1653,66 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.projects.locations.capacityCommitments.merge * @desc Merges capacity commitments of the same plan into one. Resulting capacity commitment has the longer commitment_end_time out of the two. Attempting to merge capacity commitments of different plan will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.capacityCommitments.merge( + * { + * // Parent resource that identifies admin project and location e.g., + * // projects/myproject/locations/us + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "capacityCommitmentIds": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "commitmentEndTime": "my_commitmentEndTime", + * // "failureStatus": {}, + * // "name": "my_name", + * // "plan": "my_plan", + * // "renewalPlan": "my_renewalPlan", + * // "slotCount": "my_slotCount", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.capacityCommitments.merge * @memberOf! () * @@ -1260,6 +1789,75 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.projects.locations.capacityCommitments.patch * @desc Updates an existing capacity commitment. Only plan and renewal_plan fields can be updated. Plan can only be changed to a plan of a longer commitment period. Attempting to change to a plan with shorter commitment period will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.capacityCommitments.patch( + * { + * // Output only. The resource name of the capacity commitment, e.g., + * // projects/myproject/locations/US/capacityCommitments/123 + * name: + * 'projects/my-project/locations/my-location/capacityCommitments/my-capacityCommitment', + * // Standard field mask for the set of fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "commitmentEndTime": "my_commitmentEndTime", + * // "failureStatus": {}, + * // "name": "my_name", + * // "plan": "my_plan", + * // "renewalPlan": "my_renewalPlan", + * // "slotCount": "my_slotCount", + * // "state": "my_state" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "commitmentEndTime": "my_commitmentEndTime", + * // "failureStatus": {}, + * // "name": "my_name", + * // "plan": "my_plan", + * // "renewalPlan": "my_renewalPlan", + * // "slotCount": "my_slotCount", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.capacityCommitments.patch * @memberOf! () * @@ -1334,6 +1932,62 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.projects.locations.capacityCommitments.split * @desc Splits capacity commitment to two commitments of the same plan and commitment_end_time. A common use case to do that is to perform a downgrade e.g., in order to downgrade from 10000 slots to 8000, one might split 10000 capacity commitment to 2000 and 8000, change the plan of the first one to flex and then delete it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.capacityCommitments.split( + * { + * // Required. The resource name e.g.,: + * // projects/myproject/locations/US/capacityCommitments/123 + * name: + * 'projects/my-project/locations/my-location/capacityCommitments/my-capacityCommitment', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "slotCount": "my_slotCount" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "first": {}, + * // "second": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.capacityCommitments.split * @memberOf! () * @@ -1548,6 +2202,65 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.projects.locations.reservations.create * @desc Creates a new reservation resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.create({ + * // Required. Project, location. E.g., + * // projects/myproject/locations/US + * parent: 'projects/my-project/locations/my-location', + * // The reservation ID. This field must only contain lower case alphanumeric + * // characters or dash. Max length is 64 characters. + * reservationId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ignoreIdleSlots": false, + * // "name": "my_name", + * // "slotCapacity": "my_slotCapacity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ignoreIdleSlots": false, + * // "name": "my_name", + * // "slotCapacity": "my_slotCapacity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.create * @memberOf! () * @@ -1625,6 +2338,49 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.projects.locations.reservations.delete * @desc Deletes a reservation. Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has assignments. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.delete({ + * // Required. Resource name of the reservation to retrieve. E.g., + * // projects/myproject/locations/US/reservations/team1-prod + * name: + * 'projects/my-project/locations/my-location/reservations/my-reservation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.delete * @memberOf! () * @@ -1695,6 +2451,53 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.projects.locations.reservations.get * @desc Returns information about the reservation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.get({ + * // Required. Resource name of the reservation to retrieve. E.g., + * // projects/myproject/locations/US/reservations/team1-prod + * name: + * 'projects/my-project/locations/my-location/reservations/my-reservation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ignoreIdleSlots": false, + * // "name": "my_name", + * // "slotCapacity": "my_slotCapacity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.get * @memberOf! () * @@ -1767,6 +2570,55 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.projects.locations.reservations.list * @desc Lists all the reservations for the project in the specified location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.list({ + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // Required. The parent resource name containing project and location, e.g.: + * // "projects/myproject/locations/US" + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "reservations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.list * @memberOf! () * @@ -1846,6 +2698,65 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.projects.locations.reservations.patch * @desc Updates an existing reservation resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.patch({ + * // The resource name of the reservation, e.g., + * // "projects/x/locations/x/reservations/team1-prod". + * name: + * 'projects/my-project/locations/my-location/reservations/my-reservation', + * // Standard field mask for the set of fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ignoreIdleSlots": false, + * // "name": "my_name", + * // "slotCapacity": "my_slotCapacity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ignoreIdleSlots": false, + * // "name": "my_name", + * // "slotCapacity": "my_slotCapacity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.patch * @memberOf! () * @@ -2014,6 +2925,67 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.projects.locations.reservations.assignments.create * @desc Creates an object which allows the given project to submit jobs of a certain type using slots from the specified reservation. Currently a resource (project, folder, organization) can only have one assignment per {job_type, location}, and that reservation will be used for all jobs of the matching type. Within the organization, different assignments can be created on projects, folders or organization level. During query execution, the assignment is looked up at the project, folder and organization levels in that order. The first assignment found is applied to the query. When creating assignments, it does not matter if other assignments exist at higher levels. E.g: organizationA contains project1, project2. Assignments for organizationA, project1 and project2 could all be created, mapping to the same or different reservations. Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have 'bigquery.admin' permissions on the project using the reservation and the project that owns this reservation. Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment does not match location of the reservation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.assignments.create( + * { + * // Required. The parent resource name of the assignment + * // E.g.: projects/myproject/locations/US/reservations/team1-prod + * parent: + * 'projects/my-project/locations/my-location/reservations/my-reservation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "assignee": "my_assignee", + * // "jobType": "my_jobType", + * // "name": "my_name", + * // "state": "my_state" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "assignee": "my_assignee", + * // "jobType": "my_jobType", + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.assignments.create * @memberOf! () * @@ -2090,6 +3062,51 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.projects.locations.reservations.assignments.delete * @desc Deletes a assignment. No expansion will happen. E.g: organizationA contains project1 and project2. Reservation res1 exists. CreateAssignment was invoked previously and following assignments were created explicitly: Then deletion of won't affect . After deletion of , queries from project1 will still use res1, while queries from project2 will use on-demand mode. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.assignments.delete( + * { + * // Required. Name of the resource, e.g.: + * // projects/myproject/locations/US/reservations/team1-prod/assignments/123 + * name: + * 'projects/my-project/locations/my-location/reservations/my-reservation/assignments/my-assignment', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.assignments.delete * @memberOf! () * @@ -2160,6 +3177,60 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.projects.locations.reservations.assignments.list * @desc Lists assignments. Only explicitly created assignments will be returned. E.g: organizationA contains project1 and project2. Reservation res1 exists. CreateAssignment was invoked previously and following assignments were created explicitly: Then this API will just return the above two assignments for reservation res1, and no expansion/merge will happen. Wildcard "-" can be used for reservations in the request. In that case all assignments belongs to the specified project and location will be listed. Note "-" cannot be used for projects nor locations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.assignments.list( + * { + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // Required. The parent resource name e.g.: + * // projects/myproject/locations/US/reservations/team1-prod + * // Or: + * // projects/myproject/locations/US/reservations/- + * parent: + * 'projects/my-project/locations/my-location/reservations/my-reservation', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "assignments": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.assignments.list * @memberOf! () * @@ -2239,6 +3310,65 @@ export namespace bigqueryreservation_v1 { /** * bigqueryreservation.projects.locations.reservations.assignments.move * @desc Moves a assignment under a new reservation. Customers can do this by deleting the existing assignment followed by creating another assignment under the new reservation, but this method provides a transactional way to do so, to make sure the assignee always has an associated reservation. Without the method customers might see some queries run on-demand which might be unexpected. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.assignments.move( + * { + * // Required. The resource name of the assignment, + * // e.g.: + * // projects/myproject/locations/US/reservations/team1-prod/assignments/123 + * name: + * 'projects/my-project/locations/my-location/reservations/my-reservation/assignments/my-assignment', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destinationId": "my_destinationId" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "assignee": "my_assignee", + * // "jobType": "my_jobType", + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.assignments.move * @memberOf! () * diff --git a/src/apis/bigqueryreservation/v1alpha2.ts b/src/apis/bigqueryreservation/v1alpha2.ts index 32ef13c2adc..687aecfc76a 100644 --- a/src/apis/bigqueryreservation/v1alpha2.ts +++ b/src/apis/bigqueryreservation/v1alpha2.ts @@ -322,6 +322,63 @@ export namespace bigqueryreservation_v1alpha2 { /** * bigqueryreservation.projects.locations.searchReservationGrants * @desc Look up grants for a specified resource for a particular region. If the request is about a project: 1) Grants created on the project will be returned if they exist. 2) Otherwise grants created on the closest ancestor will be returned. 3) Grants for different JobTypes will all be returned. Same logic applies if the request is about a folder. If the request is about an organization, then grants created on the organization will be returned (organization doesn't have ancestors). Comparing to ListReservationGrants, there are two behavior differences: 1) permission on the grantee will be verified in this API. 2) Hierarchy lookup (project->folder->organization) happens in this API. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1alpha2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.searchReservationGrants( + * { + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // The parent resource name (containing project and location), which owns the + * // grants. e.g.: + * // "projects/myproject/locations/us-central1". + * parent: 'projects/my-project/locations/my-location', + * // Please specify resource name as grantee in the query. + * // e.g., "grantee=projects/myproject" + * // "grantee=folders/123" + * // "grantee=organizations/456" + * query: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "reservationGrants": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.searchReservationGrants * @memberOf! () * @@ -440,6 +497,47 @@ export namespace bigqueryreservation_v1alpha2 { /** * bigqueryreservation.projects.locations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1alpha2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.operations.cancel * @memberOf! () * @@ -513,6 +611,53 @@ export namespace bigqueryreservation_v1alpha2 { /** * bigqueryreservation.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1alpha2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.operations.get * @memberOf! () * @@ -617,6 +762,68 @@ export namespace bigqueryreservation_v1alpha2 { /** * bigqueryreservation.projects.locations.reservationGrants.create * @desc Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have 'bigquery.admin' permissions on the project using the reservation and the project that owns this reservation. Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the grant does not match location of the reservation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1alpha2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservationGrants.create( + * { + * // The parent resource name of the reservation grant + * // E.g.: projects/myproject/location/eu. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "grantee": "my_grantee", + * // "jobType": "my_jobType", + * // "name": "my_name", + * // "reservation": "my_reservation", + * // "state": "my_state" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "grantee": "my_grantee", + * // "jobType": "my_jobType", + * // "name": "my_name", + * // "reservation": "my_reservation", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservationGrants.create * @memberOf! () * @@ -693,6 +900,51 @@ export namespace bigqueryreservation_v1alpha2 { /** * bigqueryreservation.projects.locations.reservationGrants.delete * @desc Deletes a reservation grant. No expansion will happen. E.g: organizationA contains project1 and project2. Reservation res1 exists. CreateReservationGrant was invoked previously and following grants were created explicitly: Then deletion of won't affect . After deletion of , queries from project1 will still use res1, while queries from project2 will use on-demand mode. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1alpha2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservationGrants.delete( + * { + * // Name of the resource, e.g.: + * // projects/myproject/locations/eu/reservationGrants/123 + * name: + * 'projects/my-project/locations/my-location/reservationGrants/my-reservationGrant', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservationGrants.delete * @memberOf! () * @@ -763,6 +1015,56 @@ export namespace bigqueryreservation_v1alpha2 { /** * bigqueryreservation.projects.locations.reservationGrants.list * @desc Lists reservation grants. Only explicitly created grants will be returned. E.g: organizationA contains project1 and project2. Reservation res1 exists. CreateReservationGrant was invoked previously and following grants were created explicitly: Then this API will just return the above two grants for reservation res1, and no expansion/merge will happen. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1alpha2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservationGrants.list( + * { + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // The parent resource name e.g.: projects/myproject/location/eu. + * parent: 'projects/my-project/locations/my-location', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "reservationGrants": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservationGrants.list * @memberOf! () * @@ -910,6 +1212,65 @@ export namespace bigqueryreservation_v1alpha2 { /** * bigqueryreservation.projects.locations.reservations.create * @desc Creates a new reservation resource. Multiple reservations are created if the ancestor reservations do not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1alpha2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.create({ + * // Project, location, and (optionally) reservation name. E.g., + * // projects/myproject/locations/us-central1/reservations/parent + * parent: 'projects/my-project/locations/my-location', + * // The reservation ID relative to the parent, e.g., "dev". This field must + * // only contain alphanumeric characters. + * reservationId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name", + * // "slotCapacity": "my_slotCapacity", + * // "useParentReservation": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "slotCapacity": "my_slotCapacity", + * // "useParentReservation": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.create * @memberOf! () * @@ -987,6 +1348,67 @@ export namespace bigqueryreservation_v1alpha2 { /** * bigqueryreservation.projects.locations.reservations.createReservation * @desc Creates a new reservation resource. Multiple reservations are created if the ancestor reservations do not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1alpha2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.createReservation( + * { + * // Project, location, and (optionally) reservation name. E.g., + * // projects/myproject/locations/us-central1/reservations/parent + * parent: 'projects/my-project/locations/my-location/reservations/.*', + * // The reservation ID relative to the parent, e.g., "dev". This field must + * // only contain alphanumeric characters. + * reservationId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name", + * // "slotCapacity": "my_slotCapacity", + * // "useParentReservation": false + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "slotCapacity": "my_slotCapacity", + * // "useParentReservation": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.createReservation * @memberOf! () * @@ -1064,6 +1486,53 @@ export namespace bigqueryreservation_v1alpha2 { /** * bigqueryreservation.projects.locations.reservations.delete * @desc Deletes a reservation. Returns `google.rpc.Code.FAILED_PRECONDITION` in the following cases: 1. When reservation has child reservations. This check can be bypassed by setting DeleteReservationRequest.force flag to true. 2. When top-level reservation with slot pools is being deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1alpha2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.delete({ + * // If true, deletes all the child reservations of the given reservation. + * // Otherwise, attempting to delete a reservation that has child + * // reservations will fail with error code + * // `google.rpc.Code.FAILED_PRECONDITION`. + * force: 'placeholder-value', + * // Resource name of the reservation to retrieve. E.g., + * // projects/myproject/locations/us-central1/reservations/my_reservation + * name: 'projects/my-project/locations/my-location/reservations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.delete * @memberOf! () * @@ -1135,6 +1604,52 @@ export namespace bigqueryreservation_v1alpha2 { /** * bigqueryreservation.projects.locations.reservations.get * @desc Returns information about the reservation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1alpha2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.get({ + * // Resource name of the reservation to retrieve. E.g., + * // projects/myproject/locations/us-central1/reservations/path/to/reserv + * name: 'projects/my-project/locations/my-location/reservations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "slotCapacity": "my_slotCapacity", + * // "useParentReservation": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.get * @memberOf! () * @@ -1207,6 +1722,61 @@ export namespace bigqueryreservation_v1alpha2 { /** * bigqueryreservation.projects.locations.reservations.list * @desc Lists all the reservations for the project in the specified location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1alpha2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.list({ + * // Can be used to filter out reservations based on names, capacity, etc, e.g.: + * // filter="reservation.slot_capacity > 200" + * // filter="reservation.name = \"*dev/x\"" + * // Advanced filtering syntax can be + * // [here](https://cloud.google.com/logging/docs/view/advanced-filters). + * filter: 'placeholder-value', + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // The parent resource name containing project and location, e.g.: + * // "projects/myproject/locations/us-central1" + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "reservations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.list * @memberOf! () * @@ -1287,6 +1857,67 @@ export namespace bigqueryreservation_v1alpha2 { /** * bigqueryreservation.projects.locations.reservations.patch * @desc Updates an existing reservation resource. Applicable only for child reservations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1alpha2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.patch({ + * // The resource name of the reservation, e.g., + * // "projects/x/locations/x/reservations/dev/team/product". Reservation names + * // (e.g., "dev/team/product") exceeding a depth of six will fail with + * // `google.rpc.Code.INVALID_ARGUMENT`. + * name: + * 'projects/my-project/locations/my-location/reservations/my-reservation/.*', + * // Standard field mask for the set of fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name", + * // "slotCapacity": "my_slotCapacity", + * // "useParentReservation": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "slotCapacity": "my_slotCapacity", + * // "useParentReservation": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.patch * @memberOf! () * @@ -1484,6 +2115,51 @@ export namespace bigqueryreservation_v1alpha2 { /** * bigqueryreservation.projects.locations.reservations.slotPools.delete * @desc Deletes a slot pool. Attempting to delete slot pool before its commitment_end_time will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1alpha2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.slotPools.delete( + * { + * // Resource name of the slot pool to delete. E.g., + * // projects/myproject/locations/us-central1/reservations/my_reservation/slotPools/123 + * name: + * 'projects/my-project/locations/my-location/reservations/my-reservation/slotPools/my-slotPool', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.slotPools.delete * @memberOf! () * @@ -1554,6 +2230,58 @@ export namespace bigqueryreservation_v1alpha2 { /** * bigqueryreservation.projects.locations.reservations.slotPools.get * @desc Returns information about the slot pool. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1alpha2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.slotPools.get( + * { + * // Resource name of the slot pool to retrieve. E.g., + * // projects/myproject/locations/us-central1/reservations/my_reservation/slotPools/123 + * name: + * 'projects/my-project/locations/my-location/reservations/my-reservation/slotPools/my-slotPool', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "commitmentEndTime": "my_commitmentEndTime", + * // "failureStatus": {}, + * // "name": "my_name", + * // "plan": "my_plan", + * // "slotCount": "my_slotCount", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.slotPools.get * @memberOf! () * @@ -1624,6 +2352,59 @@ export namespace bigqueryreservation_v1alpha2 { /** * bigqueryreservation.projects.locations.reservations.slotPools.list * @desc Lists all the slot pools for the reservation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1alpha2'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.slotPools.list( + * { + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // Resource name of the parent reservation. Only top-level reservations can + * // have slot pools. E.g., + * // projects/myproject/locations/us-central1/reservations/my_reservation + * parent: + * 'projects/my-project/locations/my-location/reservations/my-reservation', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "slotPools": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.slotPools.list * @memberOf! () * diff --git a/src/apis/bigqueryreservation/v1beta1.ts b/src/apis/bigqueryreservation/v1beta1.ts index 1432ac8878b..7a1c721b8c1 100644 --- a/src/apis/bigqueryreservation/v1beta1.ts +++ b/src/apis/bigqueryreservation/v1beta1.ts @@ -367,6 +367,52 @@ export namespace bigqueryreservation_v1beta1 { /** * bigqueryreservation.projects.locations.getBiReservation * @desc Retrieves a BI reservation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.getBiReservation({ + * // Required. Name of the requested reservation, for example: + * // `projects/{project_id}/locations/{location_id}/bireservation` + * name: 'projects/my-project/locations/my-location/biReservation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "size": "my_size", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.getBiReservation * @memberOf! () * @@ -441,6 +487,61 @@ export namespace bigqueryreservation_v1beta1 { /** * bigqueryreservation.projects.locations.searchAssignments * @desc Looks up assignments for a specified resource for a particular region. If the request is about a project: 1) Assignments created on the project will be returned if they exist. 2) Otherwise assignments created on the closest ancestor will be returned. 3) Assignments for different JobTypes will all be returned. Same logic applies if the request is about a folder. If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors). Comparing to ListAssignments, there are some behavior differences: 1) permission on the assignee will be verified in this API. 2) Hierarchy lookup (project->folder->organization) happens in this API. 3) Parent here is projects/x/locations/x, instead of projects/x/locations/xreservations/x. Note "-" cannot be used for projects nor locations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.searchAssignments({ + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // Required. The resource name of the admin project(containing project and location), + * // e.g.: + * // "projects/myproject/locations/US". + * parent: 'projects/my-project/locations/my-location', + * // Please specify resource name as assignee in the query. + * // e.g., "assignee=projects/myproject" + * // "assignee=folders/123" + * // "assignee=organizations/456" + * query: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assignments": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.searchAssignments * @memberOf! () * @@ -526,6 +627,65 @@ export namespace bigqueryreservation_v1beta1 { /** * bigqueryreservation.projects.locations.updateBiReservation * @desc Updates a BI reservation. Only fields specified in the field_mask are updated. Singleton BI reservation always exists with default size 0. In order to reserve BI capacity it needs to be updated to an amount greater than 0. In order to release BI capacity reservation size must be set to 0. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.updateBiReservation({ + * // The resource name of the singleton BI reservation. + * // Reservation names have the form + * // `projects/{project_id}/locations/{location_id}/bireservation`. + * name: 'projects/my-project/locations/my-location/biReservation', + * // A list of fields to be updated in this request. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name", + * // "size": "my_size", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "size": "my_size", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.updateBiReservation * @memberOf! () * @@ -667,6 +827,75 @@ export namespace bigqueryreservation_v1beta1 { /** * bigqueryreservation.projects.locations.capacityCommitments.create * @desc Creates a new capacity commitment resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.capacityCommitments.create( + * { + * // If true, fail the request if another project in the organization has a + * // capacity commitment. + * enforceSingleAdminProjectPerOrg: 'placeholder-value', + * // Required. Resource name of the parent reservation. E.g., + * // projects/myproject/locations/US + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "commitmentEndTime": "my_commitmentEndTime", + * // "failureStatus": {}, + * // "name": "my_name", + * // "plan": "my_plan", + * // "renewalPlan": "my_renewalPlan", + * // "slotCount": "my_slotCount", + * // "state": "my_state" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "commitmentEndTime": "my_commitmentEndTime", + * // "failureStatus": {}, + * // "name": "my_name", + * // "plan": "my_plan", + * // "renewalPlan": "my_renewalPlan", + * // "slotCount": "my_slotCount", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.capacityCommitments.create * @memberOf! () * @@ -744,6 +973,51 @@ export namespace bigqueryreservation_v1beta1 { /** * bigqueryreservation.projects.locations.capacityCommitments.delete * @desc Deletes a capacity commitment. Attempting to delete capacity commitment before its commitment_end_time will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.capacityCommitments.delete( + * { + * // Required. Resource name of the capacity commitment to delete. E.g., + * // projects/myproject/locations/US/capacityCommitments/123 + * name: + * 'projects/my-project/locations/my-location/capacityCommitments/my-capacityCommitment', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.capacityCommitments.delete * @memberOf! () * @@ -814,6 +1088,59 @@ export namespace bigqueryreservation_v1beta1 { /** * bigqueryreservation.projects.locations.capacityCommitments.get * @desc Returns information about the capacity commitment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.capacityCommitments.get( + * { + * // Required. Resource name of the capacity commitment to retrieve. E.g., + * // projects/myproject/locations/US/capacityCommitments/123 + * name: + * 'projects/my-project/locations/my-location/capacityCommitments/my-capacityCommitment', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "commitmentEndTime": "my_commitmentEndTime", + * // "failureStatus": {}, + * // "name": "my_name", + * // "plan": "my_plan", + * // "renewalPlan": "my_renewalPlan", + * // "slotCount": "my_slotCount", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.capacityCommitments.get * @memberOf! () * @@ -886,6 +1213,57 @@ export namespace bigqueryreservation_v1beta1 { /** * bigqueryreservation.projects.locations.capacityCommitments.list * @desc Lists all the capacity commitments for the admin project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.capacityCommitments.list( + * { + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // Required. Resource name of the parent reservation. E.g., + * // projects/myproject/locations/US + * parent: 'projects/my-project/locations/my-location', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "capacityCommitments": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.capacityCommitments.list * @memberOf! () * @@ -972,6 +1350,66 @@ export namespace bigqueryreservation_v1beta1 { /** * bigqueryreservation.projects.locations.capacityCommitments.merge * @desc Merges capacity commitments of the same plan into one. Resulting capacity commitment has the longer commitment_end_time out of the two. Attempting to merge capacity commitments of different plan will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.capacityCommitments.merge( + * { + * // Parent resource that identifies admin project and location e.g., + * // projects/myproject/locations/us + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "capacityCommitmentIds": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "commitmentEndTime": "my_commitmentEndTime", + * // "failureStatus": {}, + * // "name": "my_name", + * // "plan": "my_plan", + * // "renewalPlan": "my_renewalPlan", + * // "slotCount": "my_slotCount", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.capacityCommitments.merge * @memberOf! () * @@ -1047,6 +1485,75 @@ export namespace bigqueryreservation_v1beta1 { /** * bigqueryreservation.projects.locations.capacityCommitments.patch * @desc Updates an existing capacity commitment. Only plan and renewal_plan fields can be updated. Plan can only be changed to a plan of a longer commitment period. Attempting to change to a plan with shorter commitment period will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.capacityCommitments.patch( + * { + * // Output only. The resource name of the capacity commitment, e.g., + * // projects/myproject/locations/US/capacityCommitments/123 + * name: + * 'projects/my-project/locations/my-location/capacityCommitments/my-capacityCommitment', + * // Standard field mask for the set of fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "commitmentEndTime": "my_commitmentEndTime", + * // "failureStatus": {}, + * // "name": "my_name", + * // "plan": "my_plan", + * // "renewalPlan": "my_renewalPlan", + * // "slotCount": "my_slotCount", + * // "state": "my_state" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "commitmentEndTime": "my_commitmentEndTime", + * // "failureStatus": {}, + * // "name": "my_name", + * // "plan": "my_plan", + * // "renewalPlan": "my_renewalPlan", + * // "slotCount": "my_slotCount", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.capacityCommitments.patch * @memberOf! () * @@ -1121,6 +1628,62 @@ export namespace bigqueryreservation_v1beta1 { /** * bigqueryreservation.projects.locations.capacityCommitments.split * @desc Splits capacity commitment to two commitments of the same plan and commitment_end_time. A common use case to do that is to perform a downgrade e.g., in order to downgrade from 10000 slots to 8000, one might split 10000 capacity commitment to 2000 and 8000, change the plan of the first one to flex and then delete it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.capacityCommitments.split( + * { + * // Required. The resource name e.g.,: + * // projects/myproject/locations/US/capacityCommitments/123 + * name: + * 'projects/my-project/locations/my-location/capacityCommitments/my-capacityCommitment', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "slotCount": "my_slotCount" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "first": {}, + * // "second": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.capacityCommitments.split * @memberOf! () * @@ -1338,6 +1901,67 @@ export namespace bigqueryreservation_v1beta1 { /** * bigqueryreservation.projects.locations.reservations.create * @desc Creates a new reservation resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.create({ + * // Required. Project, location. E.g., + * // projects/myproject/locations/US + * parent: 'projects/my-project/locations/my-location', + * // The reservation ID. This field must only contain lower case alphanumeric + * // characters or dash. Max length is 64 characters. + * reservationId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscale": {}, + * // "ignoreIdleSlots": false, + * // "name": "my_name", + * // "slotCapacity": "my_slotCapacity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoscale": {}, + * // "ignoreIdleSlots": false, + * // "name": "my_name", + * // "slotCapacity": "my_slotCapacity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.create * @memberOf! () * @@ -1415,6 +2039,49 @@ export namespace bigqueryreservation_v1beta1 { /** * bigqueryreservation.projects.locations.reservations.delete * @desc Deletes a reservation. Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has assignments. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.delete({ + * // Required. Resource name of the reservation to retrieve. E.g., + * // projects/myproject/locations/US/reservations/team1-prod + * name: + * 'projects/my-project/locations/my-location/reservations/my-reservation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.delete * @memberOf! () * @@ -1485,6 +2152,54 @@ export namespace bigqueryreservation_v1beta1 { /** * bigqueryreservation.projects.locations.reservations.get * @desc Returns information about the reservation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.get({ + * // Required. Resource name of the reservation to retrieve. E.g., + * // projects/myproject/locations/US/reservations/team1-prod + * name: + * 'projects/my-project/locations/my-location/reservations/my-reservation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoscale": {}, + * // "ignoreIdleSlots": false, + * // "name": "my_name", + * // "slotCapacity": "my_slotCapacity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.get * @memberOf! () * @@ -1557,6 +2272,61 @@ export namespace bigqueryreservation_v1beta1 { /** * bigqueryreservation.projects.locations.reservations.list * @desc Lists all the reservations for the project in the specified location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.list({ + * // Can be used to filter out reservations based on names, capacity, etc, e.g.: + * // filter="reservation.slot_capacity > 200" + * // filter="reservation.name = \"*dev/x\"" + * // Advanced filtering syntax can be + * // [here](https://cloud.google.com/logging/docs/view/advanced-filters). + * filter: 'placeholder-value', + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // Required. The parent resource name containing project and location, e.g.: + * // "projects/myproject/locations/US" + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "reservations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.list * @memberOf! () * @@ -1637,6 +2407,67 @@ export namespace bigqueryreservation_v1beta1 { /** * bigqueryreservation.projects.locations.reservations.patch * @desc Updates an existing reservation resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.patch({ + * // The resource name of the reservation, e.g., + * // "projects/x/locations/x/reservations/team1-prod". + * name: + * 'projects/my-project/locations/my-location/reservations/my-reservation', + * // Standard field mask for the set of fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscale": {}, + * // "ignoreIdleSlots": false, + * // "name": "my_name", + * // "slotCapacity": "my_slotCapacity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoscale": {}, + * // "ignoreIdleSlots": false, + * // "name": "my_name", + * // "slotCapacity": "my_slotCapacity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.patch * @memberOf! () * @@ -1809,6 +2640,67 @@ export namespace bigqueryreservation_v1beta1 { /** * bigqueryreservation.projects.locations.reservations.assignments.create * @desc Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have 'bigquery.admin' permissions on the project using the reservation and the project that owns this reservation. Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment does not match location of the reservation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.assignments.create( + * { + * // Required. The parent resource name of the assignment + * // E.g.: projects/myproject/locations/US/reservations/team1-prod + * parent: + * 'projects/my-project/locations/my-location/reservations/my-reservation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "assignee": "my_assignee", + * // "jobType": "my_jobType", + * // "name": "my_name", + * // "state": "my_state" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "assignee": "my_assignee", + * // "jobType": "my_jobType", + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.assignments.create * @memberOf! () * @@ -1885,6 +2777,51 @@ export namespace bigqueryreservation_v1beta1 { /** * bigqueryreservation.projects.locations.reservations.assignments.delete * @desc Deletes a assignment. No expansion will happen. E.g: organizationA contains project1 and project2. Reservation res1 exists. CreateAssignment was invoked previously and following assignments were created explicitly: Then deletion of won't affect . After deletion of , queries from project1 will still use res1, while queries from project2 will use on-demand mode. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.assignments.delete( + * { + * // Required. Name of the resource, e.g.: + * // projects/myproject/locations/US/reservations/team1-prod/assignments/123 + * name: + * 'projects/my-project/locations/my-location/reservations/my-reservation/assignments/my-assignment', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.assignments.delete * @memberOf! () * @@ -1955,6 +2892,60 @@ export namespace bigqueryreservation_v1beta1 { /** * bigqueryreservation.projects.locations.reservations.assignments.list * @desc Lists assignments. Only explicitly created assignments will be returned. E.g: organizationA contains project1 and project2. Reservation res1 exists. CreateAssignment was invoked previously and following assignments were created explicitly: Then this API will just return the above two assignments for reservation res1, and no expansion/merge will happen. Wildcard "-" can be used for reservations in the request. In that case all assignments belongs to the specified project and location will be listed. Note "-" cannot be used for projects nor locations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.assignments.list( + * { + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // Required. The parent resource name e.g.: + * // projects/myproject/locations/US/reservations/team1-prod + * // Or: + * // projects/myproject/locations/US/reservations/- + * parent: + * 'projects/my-project/locations/my-location/reservations/my-reservation', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "assignments": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.assignments.list * @memberOf! () * @@ -2034,6 +3025,65 @@ export namespace bigqueryreservation_v1beta1 { /** * bigqueryreservation.projects.locations.reservations.assignments.move * @desc Moves a assignment under a new reservation. Customers can do this by deleting the existing assignment followed by creating another assignment under the new reservation, but this method provides a transactional way to do so, to make sure the assignee always has an associated reservation. Without the method customers might see some queries run on-demand which might be unexpected. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('v1beta1'); + * + * 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/bigquery', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigqueryreservation.projects.locations.reservations.assignments.move( + * { + * // Required. The resource name of the assignment, + * // e.g.: + * // projects/myproject/locations/US/reservations/team1-prod/assignments/123 + * name: + * 'projects/my-project/locations/my-location/reservations/my-reservation/assignments/my-assignment', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destinationId": "my_destinationId" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "assignee": "my_assignee", + * // "jobType": "my_jobType", + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigqueryreservation.projects.locations.reservations.assignments.move * @memberOf! () * diff --git a/src/apis/bigtableadmin/v2.ts b/src/apis/bigtableadmin/v2.ts index 4a0ace44f55..b6835955814 100644 --- a/src/apis/bigtableadmin/v2.ts +++ b/src/apis/bigtableadmin/v2.ts @@ -833,6 +833,51 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'operations/.+', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.operations.cancel * @memberOf! () * @@ -903,6 +948,51 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'operations/.+', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.operations.delete * @memberOf! () * @@ -973,6 +1063,58 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigtableadmin.operations.get({ + * // The name of the operation resource. + * name: 'operations/.+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.operations.get * @memberOf! () * @@ -1098,6 +1240,61 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.operations.projects.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigtableadmin.operations.projects.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'operations/projects/.+', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.operations.projects.operations.list * @memberOf! () * @@ -1229,6 +1426,69 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.create * @desc Create an instance within a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.create({ + * // Required. The unique name of the project in which to create the new instance. + * // Values are of the form `projects/{project}`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusters": {}, + * // "instance": {}, + * // "instanceId": "my_instanceId", + * // "parent": "my_parent" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.create * @memberOf! () * @@ -1305,6 +1565,52 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.delete * @desc Delete an instance from a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.delete({ + * // Required. The unique name of the instance to be deleted. + * // Values are of the form `projects/{project}/instances/{instance}`. + * name: 'projects/my-project/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.delete * @memberOf! () * @@ -1375,6 +1681,59 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.get * @desc Gets information about an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.get({ + * // Required. The unique name of the requested instance. Values are of the form + * // `projects/{project}/instances/{instance}`. + * name: 'projects/my-project/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "name": "my_name", + * // "state": "my_state", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.get * @memberOf! () * @@ -1445,6 +1804,65 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.getIamPolicy * @desc Gets the access control policy for an instance resource. Returns an empty policy if an instance exists but does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.getIamPolicy * @memberOf! () * @@ -1519,6 +1937,59 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.list * @desc Lists information about instances in a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.list({ + * // DEPRECATED: This field is unused and ignored. + * pageToken: 'placeholder-value', + * // Required. The unique name of the project for which a list of instances is requested. + * // Values are of the form `projects/{project}`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "failedLocations": [], + * // "instances": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.list * @memberOf! () * @@ -1597,6 +2068,74 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.partialUpdateInstance * @desc Partially updates an instance within a project. This method can modify all fields of an Instance and is the preferred way to update an Instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.partialUpdateInstance({ + * // Required. (`OutputOnly`) + * // The unique name of the instance. Values are of the form + * // `projects/{project}/instances/a-z+[a-z0-9]`. + * name: 'projects/my-project/instances/my-instance', + * // Required. The subset of Instance fields which should be replaced. + * // Must be explicitly set. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "name": "my_name", + * // "state": "my_state", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.partialUpdateInstance * @memberOf! () * @@ -1673,6 +2212,66 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.setIamPolicy * @desc Sets the access control policy on an instance resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.setIamPolicy * @memberOf! () * @@ -1747,6 +2346,62 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.testIamPermissions * @desc Returns permissions that the caller has on the specified instance resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.testIamPermissions * @memberOf! () * @@ -1830,6 +2485,71 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.update * @desc Updates an instance within a project. This method updates only the display name and type for an Instance. To update other Instance properties, such as labels, use PartialUpdateInstance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.update({ + * // Required. (`OutputOnly`) + * // The unique name of the instance. Values are of the form + * // `projects/{project}/instances/a-z+[a-z0-9]`. + * name: 'projects/my-project/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "name": "my_name", + * // "state": "my_state", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "name": "my_name", + * // "state": "my_state", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.update * @memberOf! () * @@ -2055,6 +2775,77 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.appProfiles.create * @desc Creates an app profile within an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.appProfiles.create({ + * // Required. The ID to be used when referring to the new app profile within its + * // instance, e.g., just `myprofile` rather than + * // `projects/myproject/instances/myinstance/appProfiles/myprofile`. + * appProfileId: 'placeholder-value', + * // If true, ignore safety checks when creating the app profile. + * ignoreWarnings: 'placeholder-value', + * // Required. The unique name of the instance in which to create the new app profile. + * // Values are of the form + * // `projects/{project}/instances/{instance}`. + * parent: 'projects/my-project/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "etag": "my_etag", + * // "multiClusterRoutingUseAny": {}, + * // "name": "my_name", + * // "singleClusterRouting": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "etag": "my_etag", + * // "multiClusterRoutingUseAny": {}, + * // "name": "my_name", + * // "singleClusterRouting": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.appProfiles.create * @memberOf! () * @@ -2133,6 +2924,54 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.appProfiles.delete * @desc Deletes an app profile from an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.appProfiles.delete({ + * // Required. If true, ignore safety checks when deleting the app profile. + * ignoreWarnings: 'placeholder-value', + * // Required. The unique name of the app profile to be deleted. Values are of the form + * // `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + * name: 'projects/my-project/instances/my-instance/appProfiles/my-appProfile', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.appProfiles.delete * @memberOf! () * @@ -2204,6 +3043,59 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.appProfiles.get * @desc Gets information about an app profile. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.appProfiles.get({ + * // Required. The unique name of the requested app profile. Values are of the form + * // `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. + * name: 'projects/my-project/instances/my-instance/appProfiles/my-appProfile', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "etag": "my_etag", + * // "multiClusterRoutingUseAny": {}, + * // "name": "my_name", + * // "singleClusterRouting": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.appProfiles.get * @memberOf! () * @@ -2276,6 +3168,71 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.appProfiles.list * @desc Lists information about app profiles in an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.appProfiles.list({ + * // Maximum number of results per page. + * // + * // A page_size of zero lets the server choose the number of items to return. + * // A page_size which is strictly positive will return at most that many items. + * // A negative page_size will cause an error. + * // + * // Following the first request, subsequent paginated calls are not required + * // to pass a page_size. If a page_size is set in subsequent calls, it must + * // match the page_size given in the first request. + * pageSize: 'placeholder-value', + * // The value of `next_page_token` returned by a previous call. + * pageToken: 'placeholder-value', + * // Required. The unique name of the instance for which a list of app profiles is + * // requested. Values are of the form + * // `projects/{project}/instances/{instance}`. + * // Use `{instance} = '-'` to list AppProfiles for all Instances in a project, + * // e.g., `projects/myproject/instances/-`. + * parent: 'projects/my-project/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appProfiles": [], + * // "failedLocations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.appProfiles.list * @memberOf! () * @@ -2355,6 +3312,76 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.appProfiles.patch * @desc Updates an app profile within an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.appProfiles.patch({ + * // If true, ignore safety checks when updating the app profile. + * ignoreWarnings: 'placeholder-value', + * // (`OutputOnly`) + * // The unique name of the app profile. Values are of the form + * // `projects//instances//appProfiles/_a-zA-Z0-9*`. + * name: 'projects/my-project/instances/my-instance/appProfiles/my-appProfile', + * // Required. The subset of app profile fields which should be replaced. + * // If unset, all fields will be replaced. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "etag": "my_etag", + * // "multiClusterRoutingUseAny": {}, + * // "name": "my_name", + * // "singleClusterRouting": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.appProfiles.patch * @memberOf! () * @@ -2540,6 +3567,75 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.clusters.create * @desc Creates a cluster within an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.clusters.create({ + * // Required. The ID to be used when referring to the new cluster within its instance, + * // e.g., just `mycluster` rather than + * // `projects/myproject/instances/myinstance/clusters/mycluster`. + * clusterId: 'placeholder-value', + * // Required. The unique name of the instance in which to create the new cluster. + * // Values are of the form + * // `projects/{project}/instances/{instance}`. + * parent: 'projects/my-project/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "defaultStorageType": "my_defaultStorageType", + * // "location": "my_location", + * // "name": "my_name", + * // "serveNodes": 0, + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.clusters.create * @memberOf! () * @@ -2617,6 +3713,52 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.clusters.delete * @desc Deletes a cluster from an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.clusters.delete({ + * // Required. The unique name of the cluster to be deleted. Values are of the form + * // `projects/{project}/instances/{instance}/clusters/{cluster}`. + * name: 'projects/my-project/instances/my-instance/clusters/my-cluster', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.clusters.delete * @memberOf! () * @@ -2687,6 +3829,59 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.clusters.get * @desc Gets information about a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.clusters.get({ + * // Required. The unique name of the requested cluster. Values are of the form + * // `projects/{project}/instances/{instance}/clusters/{cluster}`. + * name: 'projects/my-project/instances/my-instance/clusters/my-cluster', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "defaultStorageType": "my_defaultStorageType", + * // "location": "my_location", + * // "name": "my_name", + * // "serveNodes": 0, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.clusters.get * @memberOf! () * @@ -2757,6 +3952,61 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.clusters.list * @desc Lists information about clusters in an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.clusters.list({ + * // DEPRECATED: This field is unused and ignored. + * pageToken: 'placeholder-value', + * // Required. The unique name of the instance for which a list of clusters is requested. + * // Values are of the form `projects/{project}/instances/{instance}`. + * // Use `{instance} = '-'` to list Clusters for all Instances in a project, + * // e.g., `projects/myproject/instances/-`. + * parent: 'projects/my-project/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusters": [], + * // "failedLocations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.clusters.list * @memberOf! () * @@ -2835,6 +4085,71 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.clusters.update * @desc Updates a cluster within an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.clusters.update({ + * // Required. (`OutputOnly`) + * // The unique name of the cluster. Values are of the form + * // `projects/{project}/instances/{instance}/clusters/a-z*`. + * name: 'projects/my-project/instances/my-instance/clusters/my-cluster', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "defaultStorageType": "my_defaultStorageType", + * // "location": "my_location", + * // "name": "my_name", + * // "serveNodes": 0, + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.clusters.update * @memberOf! () * @@ -2994,6 +4309,67 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.clusters.backups.getIamPolicy * @desc Gets the access control policy for a Table or Backup resource. Returns an empty policy if the resource exists but does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.clusters.backups.getIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/instances/my-instance/clusters/my-cluster/backups/my-backup', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.clusters.backups.getIamPolicy * @memberOf! () * @@ -3068,6 +4444,68 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.clusters.backups.setIamPolicy * @desc Sets the access control policy on a Table or Backup resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.clusters.backups.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/instances/my-instance/clusters/my-cluster/backups/my-backup', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.clusters.backups.setIamPolicy * @memberOf! () * @@ -3142,6 +4580,64 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.clusters.backups.testIamPermissions * @desc Returns permissions that the caller has on the specified table resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.clusters.backups.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/instances/my-instance/clusters/my-cluster/backups/my-backup', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.clusters.backups.testIamPermissions * @memberOf! () * @@ -3284,6 +4780,62 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.tables.checkConsistency * @desc Checks replication consistency based on a consistency token, that is, if replication has caught up based on the conditions specified in the token and the check request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.tables.checkConsistency({ + * // Required. The unique name of the Table for which to check replication consistency. + * // Values are of the form + * // `projects/{project}/instances/{instance}/tables/{table}`. + * name: 'projects/my-project/instances/my-instance/tables/my-table', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "consistencyToken": "my_consistencyToken" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "consistent": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.tables.checkConsistency * @memberOf! () * @@ -3364,6 +4916,66 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.tables.create * @desc Creates a new table in the specified instance. The table can be created with a full set of initial column families, specified in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.tables.create({ + * // Required. The unique name of the instance in which to create the table. + * // Values are of the form `projects/{project}/instances/{instance}`. + * parent: 'projects/my-project/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "initialSplits": [], + * // "table": {}, + * // "tableId": "my_tableId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterStates": {}, + * // "columnFamilies": {}, + * // "granularity": "my_granularity", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.tables.create * @memberOf! () * @@ -3438,6 +5050,52 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.tables.delete * @desc Permanently deletes a specified table and all of its data. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.tables.delete({ + * // Required. The unique name of the table to be deleted. + * // Values are of the form + * // `projects/{project}/instances/{instance}/tables/{table}`. + * name: 'projects/my-project/instances/my-instance/tables/my-table', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.tables.delete * @memberOf! () * @@ -3508,6 +5166,61 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.tables.dropRowRange * @desc Permanently drop/delete a row range from a specified table. The request can specify whether to delete all rows in a table, or only those that match a particular prefix. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.tables.dropRowRange({ + * // Required. The unique name of the table on which to drop a range of rows. + * // Values are of the form + * // `projects/{project}/instances/{instance}/tables/{table}`. + * name: 'projects/my-project/instances/my-instance/tables/my-table', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deleteAllDataFromTable": false, + * // "rowKeyPrefix": "my_rowKeyPrefix" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.tables.dropRowRange * @memberOf! () * @@ -3582,6 +5295,62 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.tables.generateConsistencyToken * @desc Generates a consistency token for a Table, which can be used in CheckConsistency to check whether mutations to the table that finished before this call started have been replicated. The tokens will be available for 90 days. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.tables.generateConsistencyToken( + * { + * // Required. The unique name of the Table for which to create a consistency token. + * // Values are of the form + * // `projects/{project}/instances/{instance}/tables/{table}`. + * name: 'projects/my-project/instances/my-instance/tables/my-table', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "consistencyToken": "my_consistencyToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.tables.generateConsistencyToken * @memberOf! () * @@ -3667,6 +5436,61 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.tables.get * @desc Gets metadata information about the specified table. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.tables.get({ + * // Required. The unique name of the requested table. + * // Values are of the form + * // `projects/{project}/instances/{instance}/tables/{table}`. + * name: 'projects/my-project/instances/my-instance/tables/my-table', + * // The view to be applied to the returned table's fields. + * // Defaults to `SCHEMA_VIEW` if unspecified. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterStates": {}, + * // "columnFamilies": {}, + * // "granularity": "my_granularity", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.tables.get * @memberOf! () * @@ -3738,6 +5562,64 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.tables.getIamPolicy * @desc Gets the access control policy for a Table or Backup resource. Returns an empty policy if the resource exists but does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.tables.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/instances/my-instance/tables/my-table', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.tables.getIamPolicy * @memberOf! () * @@ -3812,6 +5694,70 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.tables.list * @desc Lists all tables served from a specified instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.tables.list({ + * // Maximum number of results per page. + * // + * // A page_size of zero lets the server choose the number of items to return. + * // A page_size which is strictly positive will return at most that many items. + * // A negative page_size will cause an error. + * // + * // Following the first request, subsequent paginated calls are not required + * // to pass a page_size. If a page_size is set in subsequent calls, it must + * // match the page_size given in the first request. + * pageSize: 'placeholder-value', + * // The value of `next_page_token` returned by a previous call. + * pageToken: 'placeholder-value', + * // Required. The unique name of the instance for which tables should be listed. + * // Values are of the form `projects/{project}/instances/{instance}`. + * parent: 'projects/my-project/instances/my-instance', + * // The view to be applied to the returned tables' fields. + * // Only NAME_ONLY view (default) and REPLICATION_VIEW are supported. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "tables": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.tables.list * @memberOf! () * @@ -3890,6 +5836,67 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.tables.modifyColumnFamilies * @desc Performs a series of column family modifications on the specified table. Either all or none of the modifications will occur before this method returns, but data requests received prior to that point may see a table where only some modifications have taken effect. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.tables.modifyColumnFamilies( + * { + * // Required. The unique name of the table whose families should be modified. + * // Values are of the form + * // `projects/{project}/instances/{instance}/tables/{table}`. + * name: 'projects/my-project/instances/my-instance/tables/my-table', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "modifications": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterStates": {}, + * // "columnFamilies": {}, + * // "granularity": "my_granularity", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.tables.modifyColumnFamilies * @memberOf! () * @@ -3964,6 +5971,65 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.tables.setIamPolicy * @desc Sets the access control policy on a Table or Backup resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.tables.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/instances/my-instance/tables/my-table', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.tables.setIamPolicy * @memberOf! () * @@ -4038,6 +6104,61 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.instances.tables.testIamPermissions * @desc Returns permissions that the caller has on the specified table resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.table', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 bigtableadmin.projects.instances.tables.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/instances/my-instance/tables/my-table', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.instances.tables.testIamPermissions * @memberOf! () * @@ -4317,6 +6438,58 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigtableadmin.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.locations.get * @memberOf! () * @@ -4387,6 +6560,61 @@ export namespace bigtableadmin_v2 { /** * bigtableadmin.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigtableadmin.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 bigtableadmin = google.bigtableadmin('v2'); + * + * 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/bigtable.admin', + * 'https://www.googleapis.com/auth/bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/bigtable.admin.instance', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin', + * 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 bigtableadmin.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias bigtableadmin.projects.locations.list * @memberOf! () * diff --git a/src/apis/billingbudgets/v1beta1.ts b/src/apis/billingbudgets/v1beta1.ts index 9636a38e80e..45c83c38f67 100644 --- a/src/apis/billingbudgets/v1beta1.ts +++ b/src/apis/billingbudgets/v1beta1.ts @@ -281,6 +281,61 @@ export namespace billingbudgets_v1beta1 { /** * billingbudgets.billingAccounts.budgets.create * @desc Creates a new budget. See Quotas and limits for more information on the limits of the number of budgets you can create. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/billingbudgets.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 billingbudgets = google.billingbudgets('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 billingbudgets.billingAccounts.budgets.create({ + * // Required. The name of the billing account to create the budget in. Values + * // are of the form `billingAccounts/{billingAccountId}`. + * parent: 'billingAccounts/my-billingAccount', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "budget": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "allUpdatesRule": {}, + * // "amount": {}, + * // "budgetFilter": {}, + * // "displayName": "my_displayName", + * // "etag": "my_etag", + * // "name": "my_name", + * // "thresholdRules": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias billingbudgets.billingAccounts.budgets.create * @memberOf! () * @@ -374,6 +429,45 @@ export namespace billingbudgets_v1beta1 { /** * billingbudgets.billingAccounts.budgets.delete * @desc Deletes a budget. Returns successfully if already deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/billingbudgets.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 billingbudgets = google.billingbudgets('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 billingbudgets.billingAccounts.budgets.delete({ + * // Required. Name of the budget to delete. Values are of the form + * // `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + * name: 'billingAccounts/my-billingAccount/budgets/my-budget', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias billingbudgets.billingAccounts.budgets.delete * @memberOf! () * @@ -446,6 +540,53 @@ export namespace billingbudgets_v1beta1 { /** * billingbudgets.billingAccounts.budgets.get * @desc Returns a budget. WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. When reading from the API, you will not see these fields in the return value, though they may have been set in the Cloud Console. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/billingbudgets.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 billingbudgets = google.billingbudgets('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 billingbudgets.billingAccounts.budgets.get({ + * // Required. Name of budget to get. Values are of the form + * // `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + * name: 'billingAccounts/my-billingAccount/budgets/my-budget', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "allUpdatesRule": {}, + * // "amount": {}, + * // "budgetFilter": {}, + * // "displayName": "my_displayName", + * // "etag": "my_etag", + * // "name": "my_name", + * // "thresholdRules": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias billingbudgets.billingAccounts.budgets.get * @memberOf! () * @@ -535,6 +676,55 @@ export namespace billingbudgets_v1beta1 { /** * billingbudgets.billingAccounts.budgets.list * @desc Returns a list of budgets for a billing account. WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. When reading from the API, you will not see these fields in the return value, though they may have been set in the Cloud Console. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/billingbudgets.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 billingbudgets = google.billingbudgets('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 billingbudgets.billingAccounts.budgets.list({ + * // Optional. The maximum number of budgets to return per page. + * // The default and maximum value are 100. + * pageSize: 'placeholder-value', + * // Optional. The value returned by the last `ListBudgetsResponse` which + * // indicates that this is a continuation of a prior `ListBudgets` call, + * // and that the system should return the next page of data. + * pageToken: 'placeholder-value', + * // Required. Name of billing account to list budgets under. Values + * // are of the form `billingAccounts/{billingAccountId}`. + * parent: 'billingAccounts/my-billingAccount', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "budgets": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias billingbudgets.billingAccounts.budgets.list * @memberOf! () * @@ -638,6 +828,63 @@ export namespace billingbudgets_v1beta1 { /** * billingbudgets.billingAccounts.budgets.patch * @desc Updates a budget and returns the updated budget. WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. Budget fields that are not exposed in this API will not be changed by this method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/billingbudgets.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 billingbudgets = google.billingbudgets('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 billingbudgets.billingAccounts.budgets.patch({ + * // Output only. Resource name of the budget. + * // The resource name implies the scope of a budget. Values are of the form + * // `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + * name: 'billingAccounts/my-billingAccount/budgets/my-budget', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "budget": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "allUpdatesRule": {}, + * // "amount": {}, + * // "budgetFilter": {}, + * // "displayName": "my_displayName", + * // "etag": "my_etag", + * // "name": "my_name", + * // "thresholdRules": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias billingbudgets.billingAccounts.budgets.patch * @memberOf! () * diff --git a/src/apis/binaryauthorization/v1.ts b/src/apis/binaryauthorization/v1.ts index b299a1e48d6..b21c62c25a1 100644 --- a/src/apis/binaryauthorization/v1.ts +++ b/src/apis/binaryauthorization/v1.ts @@ -357,6 +357,53 @@ export namespace binaryauthorization_v1 { /** * binaryauthorization.projects.getPolicy * @desc A policy specifies the attestors that must attest to a container image, before the project is allowed to deploy that image. There is at most one policy per project. All image admission requests are permitted if a project has no policy. Gets the policy for this project. Returns a default policy if the project does not have one. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.getPolicy({ + * // Required. The resource name of the policy to retrieve, + * // in the format `projects/x/policy`. + * name: 'projects/my-project/policy', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "admissionWhitelistPatterns": [], + * // "clusterAdmissionRules": {}, + * // "defaultAdmissionRule": {}, + * // "description": "my_description", + * // "globalPolicyEvaluationMode": "my_globalPolicyEvaluationMode", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.getPolicy * @memberOf! () * @@ -427,6 +474,67 @@ export namespace binaryauthorization_v1 { /** * binaryauthorization.projects.updatePolicy * @desc Creates or updates a project's policy, and returns a copy of the new policy. A policy is always updated as a whole, to avoid race conditions with concurrent policy enforcement (or management!) requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is malformed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.updatePolicy({ + * // Output only. The resource name, in the format `projects/x/policy`. There is + * // at most one policy per project. + * name: 'projects/my-project/policy', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "admissionWhitelistPatterns": [], + * // "clusterAdmissionRules": {}, + * // "defaultAdmissionRule": {}, + * // "description": "my_description", + * // "globalPolicyEvaluationMode": "my_globalPolicyEvaluationMode", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "admissionWhitelistPatterns": [], + * // "clusterAdmissionRules": {}, + * // "defaultAdmissionRule": {}, + * // "description": "my_description", + * // "globalPolicyEvaluationMode": "my_globalPolicyEvaluationMode", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.updatePolicy * @memberOf! () * @@ -535,6 +643,62 @@ export namespace binaryauthorization_v1 { /** * binaryauthorization.projects.attestors.create * @desc Creates an attestor, and returns a copy of the new attestor. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the attestor already exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.attestors.create({ + * // Required. The attestors ID. + * attestorId: 'placeholder-value', + * // Required. The parent of this attestor. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "updateTime": "my_updateTime", + * // "userOwnedGrafeasNote": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "updateTime": "my_updateTime", + * // "userOwnedGrafeasNote": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.attestors.create * @memberOf! () * @@ -610,6 +774,45 @@ export namespace binaryauthorization_v1 { /** * binaryauthorization.projects.attestors.delete * @desc Deletes an attestor. Returns NOT_FOUND if the attestor does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.attestors.delete({ + * // Required. The name of the attestors to delete, in the format + * // `projects/x/attestors/x`. + * name: 'projects/my-project/attestors/my-attestor', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.attestors.delete * @memberOf! () * @@ -680,6 +883,50 @@ export namespace binaryauthorization_v1 { /** * binaryauthorization.projects.attestors.get * @desc Gets an attestor. Returns NOT_FOUND if the attestor does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.attestors.get({ + * // Required. The name of the attestor to retrieve, in the format + * // `projects/x/attestors/x`. + * name: 'projects/my-project/attestors/my-attestor', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "updateTime": "my_updateTime", + * // "userOwnedGrafeasNote": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.attestors.get * @memberOf! () * @@ -750,6 +997,62 @@ export namespace binaryauthorization_v1 { /** * binaryauthorization.projects.attestors.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.attestors.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * // + * // To learn which resources support conditions in their IAM policies, see the + * // [IAM + * // documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/attestors/my-attestor', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.attestors.getIamPolicy * @memberOf! () * @@ -826,6 +1129,55 @@ export namespace binaryauthorization_v1 { /** * binaryauthorization.projects.attestors.list * @desc Lists attestors. Returns INVALID_ARGUMENT if the project does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.attestors.list({ + * // Requested page size. The server may return fewer results than requested. If + * // unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. Typically, + * // this is the value of ListAttestorsResponse.next_page_token returned + * // from the previous call to the `ListAttestors` method. + * pageToken: 'placeholder-value', + * // Required. The resource name of the project associated with the + * // attestors, in the format `projects/x`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestors": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.attestors.list * @memberOf! () * @@ -905,6 +1257,57 @@ export namespace binaryauthorization_v1 { /** * binaryauthorization.projects.attestors.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.attestors.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/attestors/my-attestor', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.attestors.setIamPolicy * @memberOf! () * @@ -981,6 +1384,55 @@ export namespace binaryauthorization_v1 { /** * binaryauthorization.projects.attestors.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.attestors.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/attestors/my-attestor', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.attestors.testIamPermissions * @memberOf! () * @@ -1064,6 +1516,61 @@ export namespace binaryauthorization_v1 { /** * binaryauthorization.projects.attestors.update * @desc Updates an attestor. Returns NOT_FOUND if the attestor does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.attestors.update({ + * // Required. The resource name, in the format: + * // `projects/x/attestors/x`. This field may not be updated. + * name: 'projects/my-project/attestors/my-attestor', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "updateTime": "my_updateTime", + * // "userOwnedGrafeasNote": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "updateTime": "my_updateTime", + * // "userOwnedGrafeasNote": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.attestors.update * @memberOf! () * @@ -1275,6 +1782,62 @@ export namespace binaryauthorization_v1 { /** * binaryauthorization.projects.policy.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.policy.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * // + * // To learn which resources support conditions in their IAM policies, see the + * // [IAM + * // documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/policy', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.policy.getIamPolicy * @memberOf! () * @@ -1351,6 +1914,57 @@ export namespace binaryauthorization_v1 { /** * binaryauthorization.projects.policy.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.policy.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/policy', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.policy.setIamPolicy * @memberOf! () * @@ -1427,6 +2041,55 @@ export namespace binaryauthorization_v1 { /** * binaryauthorization.projects.policy.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.policy.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/policy', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.policy.testIamPermissions * @memberOf! () * diff --git a/src/apis/binaryauthorization/v1beta1.ts b/src/apis/binaryauthorization/v1beta1.ts index 619d302cfea..1d5b3882030 100644 --- a/src/apis/binaryauthorization/v1beta1.ts +++ b/src/apis/binaryauthorization/v1beta1.ts @@ -357,6 +357,53 @@ export namespace binaryauthorization_v1beta1 { /** * binaryauthorization.projects.getPolicy * @desc A policy specifies the attestors that must attest to a container image, before the project is allowed to deploy that image. There is at most one policy per project. All image admission requests are permitted if a project has no policy. Gets the policy for this project. Returns a default policy if the project does not have one. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.getPolicy({ + * // Required. The resource name of the policy to retrieve, + * // in the format `projects/x/policy`. + * name: 'projects/my-project/policy', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "admissionWhitelistPatterns": [], + * // "clusterAdmissionRules": {}, + * // "defaultAdmissionRule": {}, + * // "description": "my_description", + * // "globalPolicyEvaluationMode": "my_globalPolicyEvaluationMode", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.getPolicy * @memberOf! () * @@ -427,6 +474,67 @@ export namespace binaryauthorization_v1beta1 { /** * binaryauthorization.projects.updatePolicy * @desc Creates or updates a project's policy, and returns a copy of the new policy. A policy is always updated as a whole, to avoid race conditions with concurrent policy enforcement (or management!) requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is malformed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.updatePolicy({ + * // Output only. The resource name, in the format `projects/x/policy`. There is + * // at most one policy per project. + * name: 'projects/my-project/policy', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "admissionWhitelistPatterns": [], + * // "clusterAdmissionRules": {}, + * // "defaultAdmissionRule": {}, + * // "description": "my_description", + * // "globalPolicyEvaluationMode": "my_globalPolicyEvaluationMode", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "admissionWhitelistPatterns": [], + * // "clusterAdmissionRules": {}, + * // "defaultAdmissionRule": {}, + * // "description": "my_description", + * // "globalPolicyEvaluationMode": "my_globalPolicyEvaluationMode", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.updatePolicy * @memberOf! () * @@ -535,6 +643,62 @@ export namespace binaryauthorization_v1beta1 { /** * binaryauthorization.projects.attestors.create * @desc Creates an attestor, and returns a copy of the new attestor. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the attestor already exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.attestors.create({ + * // Required. The attestors ID. + * attestorId: 'placeholder-value', + * // Required. The parent of this attestor. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "updateTime": "my_updateTime", + * // "userOwnedDrydockNote": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "updateTime": "my_updateTime", + * // "userOwnedDrydockNote": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.attestors.create * @memberOf! () * @@ -610,6 +774,45 @@ export namespace binaryauthorization_v1beta1 { /** * binaryauthorization.projects.attestors.delete * @desc Deletes an attestor. Returns NOT_FOUND if the attestor does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.attestors.delete({ + * // Required. The name of the attestors to delete, in the format + * // `projects/x/attestors/x`. + * name: 'projects/my-project/attestors/my-attestor', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.attestors.delete * @memberOf! () * @@ -680,6 +883,50 @@ export namespace binaryauthorization_v1beta1 { /** * binaryauthorization.projects.attestors.get * @desc Gets an attestor. Returns NOT_FOUND if the attestor does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.attestors.get({ + * // Required. The name of the attestor to retrieve, in the format + * // `projects/x/attestors/x`. + * name: 'projects/my-project/attestors/my-attestor', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "updateTime": "my_updateTime", + * // "userOwnedDrydockNote": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.attestors.get * @memberOf! () * @@ -750,6 +997,62 @@ export namespace binaryauthorization_v1beta1 { /** * binaryauthorization.projects.attestors.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.attestors.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * // + * // To learn which resources support conditions in their IAM policies, see the + * // [IAM + * // documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/attestors/my-attestor', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.attestors.getIamPolicy * @memberOf! () * @@ -826,6 +1129,55 @@ export namespace binaryauthorization_v1beta1 { /** * binaryauthorization.projects.attestors.list * @desc Lists attestors. Returns INVALID_ARGUMENT if the project does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.attestors.list({ + * // Requested page size. The server may return fewer results than requested. If + * // unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. Typically, + * // this is the value of ListAttestorsResponse.next_page_token returned + * // from the previous call to the `ListAttestors` method. + * pageToken: 'placeholder-value', + * // Required. The resource name of the project associated with the + * // attestors, in the format `projects/x`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestors": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.attestors.list * @memberOf! () * @@ -905,6 +1257,57 @@ export namespace binaryauthorization_v1beta1 { /** * binaryauthorization.projects.attestors.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.attestors.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/attestors/my-attestor', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.attestors.setIamPolicy * @memberOf! () * @@ -981,6 +1384,55 @@ export namespace binaryauthorization_v1beta1 { /** * binaryauthorization.projects.attestors.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.attestors.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/attestors/my-attestor', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.attestors.testIamPermissions * @memberOf! () * @@ -1064,6 +1516,61 @@ export namespace binaryauthorization_v1beta1 { /** * binaryauthorization.projects.attestors.update * @desc Updates an attestor. Returns NOT_FOUND if the attestor does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.attestors.update({ + * // Required. The resource name, in the format: + * // `projects/x/attestors/x`. This field may not be updated. + * name: 'projects/my-project/attestors/my-attestor', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "updateTime": "my_updateTime", + * // "userOwnedDrydockNote": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "updateTime": "my_updateTime", + * // "userOwnedDrydockNote": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.attestors.update * @memberOf! () * @@ -1275,6 +1782,62 @@ export namespace binaryauthorization_v1beta1 { /** * binaryauthorization.projects.policy.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.policy.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * // + * // To learn which resources support conditions in their IAM policies, see the + * // [IAM + * // documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/policy', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.policy.getIamPolicy * @memberOf! () * @@ -1351,6 +1914,57 @@ export namespace binaryauthorization_v1beta1 { /** * binaryauthorization.projects.policy.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.policy.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/policy', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.policy.setIamPolicy * @memberOf! () * @@ -1427,6 +2041,55 @@ export namespace binaryauthorization_v1beta1 { /** * binaryauthorization.projects.policy.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/binaryauthorization.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 binaryauthorization = google.binaryauthorization('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 binaryauthorization.projects.policy.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/policy', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias binaryauthorization.projects.policy.testIamPermissions * @memberOf! () * diff --git a/src/apis/blogger/v2.ts b/src/apis/blogger/v2.ts index e0cb7639f23..26d982ea54d 100644 --- a/src/apis/blogger/v2.ts +++ b/src/apis/blogger/v2.ts @@ -541,6 +541,57 @@ export namespace blogger_v2 { /** * blogger.blogs.get * @desc Gets a blog by id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v2'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.blogs.get({ + * blogId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "customMetaData": "my_customMetaData", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": {}, + * // "name": "my_name", + * // "pages": {}, + * // "posts": {}, + * // "published": "my_published", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.blogs.get * @memberOf! () * @@ -609,6 +660,47 @@ export namespace blogger_v2 { /** * blogger.blogs.list * @desc Lists blogs by user id, possibly filtered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v2'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.blogs.list({ + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "blogUserInfos": [], + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.blogs.list * @memberOf! () * @@ -710,6 +802,59 @@ export namespace blogger_v2 { /** * blogger.comments.get * @desc Gets a comment by blog id, post id and comment id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v2'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.comments.get({ + * blogId: 'placeholder-value', + * + * commentId: 'placeholder-value', + * + * postId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "id": "my_id", + * // "inReplyTo": {}, + * // "kind": "my_kind", + * // "post": {}, + * // "published": "my_published", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.comments.get * @memberOf! () * @@ -782,6 +927,59 @@ export namespace blogger_v2 { /** * blogger.comments.list * @desc Lists comments. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v2'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.comments.list({ + * blogId: 'placeholder-value', + * + * fetchBodies: 'placeholder-value', + * + * maxResults: 'placeholder-value', + * + * pageToken: 'placeholder-value', + * + * postId: 'placeholder-value', + * + * startDate: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "prevPageToken": "my_prevPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.comments.list * @memberOf! () * @@ -917,6 +1115,58 @@ export namespace blogger_v2 { /** * blogger.pages.get * @desc Gets a page by blog id and page id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v2'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.pages.get({ + * blogId: 'placeholder-value', + * + * pageId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "published": "my_published", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.pages.get * @memberOf! () * @@ -989,6 +1239,50 @@ export namespace blogger_v2 { /** * blogger.pages.list * @desc Lists pages. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v2'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.pages.list({ + * blogId: 'placeholder-value', + * + * fetchBodies: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.pages.list * @memberOf! () * @@ -1099,6 +1393,65 @@ export namespace blogger_v2 { /** * blogger.posts.get * @desc Gets a post by blog id and post id + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v2'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.posts.get({ + * blogId: 'placeholder-value', + * + * postId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "customMetaData": "my_customMetaData", + * // "etag": "my_etag", + * // "id": "my_id", + * // "images": [], + * // "kind": "my_kind", + * // "labels": [], + * // "location": {}, + * // "published": "my_published", + * // "readerComments": "my_readerComments", + * // "replies": {}, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "titleLink": "my_titleLink", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.posts.get * @memberOf! () * @@ -1171,6 +1524,57 @@ export namespace blogger_v2 { /** * blogger.posts.list * @desc Lists posts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v2'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.posts.list({ + * blogId: 'placeholder-value', + * + * fetchBodies: 'placeholder-value', + * + * maxResults: 'placeholder-value', + * + * pageToken: 'placeholder-value', + * + * startDate: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "prevPageToken": "my_prevPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.posts.list * @memberOf! () * @@ -1296,6 +1700,53 @@ export namespace blogger_v2 { /** * blogger.users.get * @desc Gets a user by user id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v2'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.users.get({ + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "about": "my_about", + * // "blogs": {}, + * // "created": "my_created", + * // "displayName": "my_displayName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": {}, + * // "selfLink": "my_selfLink", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.users.get * @memberOf! () * diff --git a/src/apis/blogger/v3.ts b/src/apis/blogger/v3.ts index 4142c078191..3dd8cd9f7a8 100644 --- a/src/apis/blogger/v3.ts +++ b/src/apis/blogger/v3.ts @@ -611,6 +611,64 @@ export namespace blogger_v3 { /** * blogger.blogs.get * @desc Gets a blog by id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger', + * 'https://www.googleapis.com/auth/blogger.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 blogger.blogs.get({ + * blogId: 'placeholder-value', + * + * maxPosts: 'placeholder-value', + * + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "customMetaData": "my_customMetaData", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": {}, + * // "name": "my_name", + * // "pages": {}, + * // "posts": {}, + * // "published": "my_published", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.blogs.get * @memberOf! () * @@ -681,6 +739,62 @@ export namespace blogger_v3 { /** * blogger.blogs.getByUrl * @desc Gets a blog by url. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger', + * 'https://www.googleapis.com/auth/blogger.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 blogger.blogs.getByUrl({ + * url: 'placeholder-value', + * + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "customMetaData": "my_customMetaData", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": {}, + * // "name": "my_name", + * // "pages": {}, + * // "posts": {}, + * // "published": "my_published", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.blogs.getByUrl * @memberOf! () * @@ -750,6 +864,58 @@ export namespace blogger_v3 { /** * blogger.blogs.listByUser * @desc Lists blogs by user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger', + * 'https://www.googleapis.com/auth/blogger.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 blogger.blogs.listByUser({ + * fetchUserInfo: 'placeholder-value', + * + * role: 'placeholder-value', + * // Default value of status is LIVE. + * status: 'placeholder-value', + * + * userId: 'placeholder-value', + * + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "blogUserInfos": [], + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.blogs.listByUser * @memberOf! () * @@ -894,6 +1060,54 @@ export namespace blogger_v3 { /** * blogger.blogUserInfos.get * @desc Gets one blog and user info pair by blog id and user id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger', + * 'https://www.googleapis.com/auth/blogger.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 blogger.blogUserInfos.get({ + * blogId: 'placeholder-value', + * + * maxPosts: 'placeholder-value', + * + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "blog": {}, + * // "blog_user_info": {}, + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.blogUserInfos.get * @memberOf! () * @@ -998,6 +1212,59 @@ export namespace blogger_v3 { /** * blogger.comments.approve * @desc Marks a comment as not spam by blog id, post id and comment id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.comments.approve({ + * blogId: 'placeholder-value', + * + * commentId: 'placeholder-value', + * + * postId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "id": "my_id", + * // "inReplyTo": {}, + * // "kind": "my_kind", + * // "post": {}, + * // "published": "my_published", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.comments.approve * @memberOf! () * @@ -1071,6 +1338,44 @@ export namespace blogger_v3 { /** * blogger.comments.delete * @desc Deletes a comment by blog id, post id and comment id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.comments.delete({ + * blogId: 'placeholder-value', + * + * commentId: 'placeholder-value', + * + * postId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.comments.delete * @memberOf! () * @@ -1143,6 +1448,64 @@ export namespace blogger_v3 { /** * blogger.comments.get * @desc Gets a comment by id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger', + * 'https://www.googleapis.com/auth/blogger.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 blogger.comments.get({ + * blogId: 'placeholder-value', + * + * commentId: 'placeholder-value', + * + * postId: 'placeholder-value', + * + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "id": "my_id", + * // "inReplyTo": {}, + * // "kind": "my_kind", + * // "post": {}, + * // "published": "my_published", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.comments.get * @memberOf! () * @@ -1216,6 +1579,68 @@ export namespace blogger_v3 { /** * blogger.comments.list * @desc Lists comments. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger', + * 'https://www.googleapis.com/auth/blogger.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 blogger.comments.list({ + * blogId: 'placeholder-value', + * + * endDate: 'placeholder-value', + * + * fetchBodies: 'placeholder-value', + * + * maxResults: 'placeholder-value', + * + * pageToken: 'placeholder-value', + * + * postId: 'placeholder-value', + * + * startDate: 'placeholder-value', + * + * status: 'placeholder-value', + * + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "prevPageToken": "my_prevPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.comments.list * @memberOf! () * @@ -1296,6 +1721,64 @@ export namespace blogger_v3 { /** * blogger.comments.listByBlog * @desc Lists comments by blog. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger', + * 'https://www.googleapis.com/auth/blogger.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 blogger.comments.listByBlog({ + * blogId: 'placeholder-value', + * + * endDate: 'placeholder-value', + * + * fetchBodies: 'placeholder-value', + * + * maxResults: 'placeholder-value', + * + * pageToken: 'placeholder-value', + * + * startDate: 'placeholder-value', + * + * status: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "prevPageToken": "my_prevPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.comments.listByBlog * @memberOf! () * @@ -1376,6 +1859,59 @@ export namespace blogger_v3 { /** * blogger.comments.markAsSpam * @desc Marks a comment as spam by blog id, post id and comment id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.comments.markAsSpam({ + * blogId: 'placeholder-value', + * + * commentId: 'placeholder-value', + * + * postId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "id": "my_id", + * // "inReplyTo": {}, + * // "kind": "my_kind", + * // "post": {}, + * // "published": "my_published", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.comments.markAsSpam * @memberOf! () * @@ -1450,6 +1986,59 @@ export namespace blogger_v3 { /** * blogger.comments.removeContent * @desc Removes the content of a comment by blog id, post id and comment id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.comments.removeContent({ + * blogId: 'placeholder-value', + * + * commentId: 'placeholder-value', + * + * postId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "id": "my_id", + * // "inReplyTo": {}, + * // "kind": "my_kind", + * // "post": {}, + * // "published": "my_published", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.comments.removeContent * @memberOf! () * @@ -1712,6 +2301,42 @@ export namespace blogger_v3 { /** * blogger.pages.delete * @desc Deletes a page by blog id and page id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.pages.delete({ + * blogId: 'placeholder-value', + * + * pageId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.pages.delete * @memberOf! () * @@ -1784,6 +2409,63 @@ export namespace blogger_v3 { /** * blogger.pages.get * @desc Gets a page by blog id and page id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger', + * 'https://www.googleapis.com/auth/blogger.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 blogger.pages.get({ + * blogId: 'placeholder-value', + * + * pageId: 'placeholder-value', + * + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "published": "my_published", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.pages.get * @memberOf! () * @@ -1857,6 +2539,77 @@ export namespace blogger_v3 { /** * blogger.pages.insert * @desc Inserts a page. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.pages.insert({ + * blogId: 'placeholder-value', + * + * isDraft: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "published": "my_published", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "published": "my_published", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.pages.insert * @memberOf! () * @@ -1930,6 +2683,61 @@ export namespace blogger_v3 { /** * blogger.pages.list * @desc Lists pages. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger', + * 'https://www.googleapis.com/auth/blogger.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 blogger.pages.list({ + * blogId: 'placeholder-value', + * + * fetchBodies: 'placeholder-value', + * + * maxResults: 'placeholder-value', + * + * pageToken: 'placeholder-value', + * + * status: 'placeholder-value', + * + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.pages.list * @memberOf! () * @@ -2006,6 +2814,81 @@ export namespace blogger_v3 { /** * blogger.pages.patch * @desc Patches a page. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.pages.patch({ + * blogId: 'placeholder-value', + * + * pageId: 'placeholder-value', + * + * publish: 'placeholder-value', + * + * revert: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "published": "my_published", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "published": "my_published", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.pages.patch * @memberOf! () * @@ -2081,6 +2964,58 @@ export namespace blogger_v3 { /** * blogger.pages.publish * @desc Publishes a page. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.pages.publish({ + * blogId: 'placeholder-value', + * + * pageId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "published": "my_published", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.pages.publish * @memberOf! () * @@ -2152,6 +3087,58 @@ export namespace blogger_v3 { /** * blogger.pages.revert * @desc Reverts a published or scheduled page to draft state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.pages.revert({ + * blogId: 'placeholder-value', + * + * pageId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "published": "my_published", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.pages.revert * @memberOf! () * @@ -2224,6 +3211,81 @@ export namespace blogger_v3 { /** * blogger.pages.update * @desc Updates a page by blog id and page id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.pages.update({ + * blogId: 'placeholder-value', + * + * pageId: 'placeholder-value', + * + * publish: 'placeholder-value', + * + * revert: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "published": "my_published", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "published": "my_published", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.pages.update * @memberOf! () * @@ -2478,6 +3540,49 @@ export namespace blogger_v3 { /** * blogger.pageViews.get * @desc Gets page views by blog id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.pageViews.get({ + * blogId: 'placeholder-value', + * + * range: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "blogId": "my_blogId", + * // "counts": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.pageViews.get * @memberOf! () * @@ -2575,6 +3680,42 @@ export namespace blogger_v3 { /** * blogger.posts.delete * @desc Deletes a post by blog id and post id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.posts.delete({ + * blogId: 'placeholder-value', + * + * postId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.posts.delete * @memberOf! () * @@ -2647,6 +3788,76 @@ export namespace blogger_v3 { /** * blogger.posts.get * @desc Gets a post by blog id and post id + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger', + * 'https://www.googleapis.com/auth/blogger.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 blogger.posts.get({ + * blogId: 'placeholder-value', + * + * fetchBody: 'placeholder-value', + * + * fetchImages: 'placeholder-value', + * + * maxComments: 'placeholder-value', + * + * postId: 'placeholder-value', + * + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "customMetaData": "my_customMetaData", + * // "etag": "my_etag", + * // "id": "my_id", + * // "images": [], + * // "kind": "my_kind", + * // "labels": [], + * // "location": {}, + * // "published": "my_published", + * // "readerComments": "my_readerComments", + * // "replies": {}, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "titleLink": "my_titleLink", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.posts.get * @memberOf! () * @@ -2723,6 +3934,72 @@ export namespace blogger_v3 { /** * blogger.posts.getByPath * @desc Gets a post by path. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger', + * 'https://www.googleapis.com/auth/blogger.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 blogger.posts.getByPath({ + * blogId: 'placeholder-value', + * + * maxComments: 'placeholder-value', + * + * path: 'placeholder-value', + * + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "customMetaData": "my_customMetaData", + * // "etag": "my_etag", + * // "id": "my_id", + * // "images": [], + * // "kind": "my_kind", + * // "labels": [], + * // "location": {}, + * // "published": "my_published", + * // "readerComments": "my_readerComments", + * // "replies": {}, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "titleLink": "my_titleLink", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.posts.getByPath * @memberOf! () * @@ -2797,6 +4074,95 @@ export namespace blogger_v3 { /** * blogger.posts.insert * @desc Inserts a post. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.posts.insert({ + * blogId: 'placeholder-value', + * + * fetchBody: 'placeholder-value', + * + * fetchImages: 'placeholder-value', + * + * isDraft: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "customMetaData": "my_customMetaData", + * // "etag": "my_etag", + * // "id": "my_id", + * // "images": [], + * // "kind": "my_kind", + * // "labels": [], + * // "location": {}, + * // "published": "my_published", + * // "readerComments": "my_readerComments", + * // "replies": {}, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "titleLink": "my_titleLink", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "customMetaData": "my_customMetaData", + * // "etag": "my_etag", + * // "id": "my_id", + * // "images": [], + * // "kind": "my_kind", + * // "labels": [], + * // "location": {}, + * // "published": "my_published", + * // "readerComments": "my_readerComments", + * // "replies": {}, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "titleLink": "my_titleLink", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.posts.insert * @memberOf! () * @@ -2872,6 +4238,72 @@ export namespace blogger_v3 { /** * blogger.posts.list * @desc Lists posts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger', + * 'https://www.googleapis.com/auth/blogger.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 blogger.posts.list({ + * blogId: 'placeholder-value', + * + * endDate: 'placeholder-value', + * + * fetchBodies: 'placeholder-value', + * + * fetchImages: 'placeholder-value', + * + * labels: 'placeholder-value', + * + * maxResults: 'placeholder-value', + * + * orderBy: 'placeholder-value', + * + * pageToken: 'placeholder-value', + * + * startDate: 'placeholder-value', + * + * status: 'placeholder-value', + * + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "prevPageToken": "my_prevPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.posts.list * @memberOf! () * @@ -2953,6 +4385,101 @@ export namespace blogger_v3 { /** * blogger.posts.patch * @desc Patches a post. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.posts.patch({ + * blogId: 'placeholder-value', + * + * fetchBody: 'placeholder-value', + * + * fetchImages: 'placeholder-value', + * + * maxComments: 'placeholder-value', + * + * postId: 'placeholder-value', + * + * publish: 'placeholder-value', + * + * revert: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "customMetaData": "my_customMetaData", + * // "etag": "my_etag", + * // "id": "my_id", + * // "images": [], + * // "kind": "my_kind", + * // "labels": [], + * // "location": {}, + * // "published": "my_published", + * // "readerComments": "my_readerComments", + * // "replies": {}, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "titleLink": "my_titleLink", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "customMetaData": "my_customMetaData", + * // "etag": "my_etag", + * // "id": "my_id", + * // "images": [], + * // "kind": "my_kind", + * // "labels": [], + * // "location": {}, + * // "published": "my_published", + * // "readerComments": "my_readerComments", + * // "replies": {}, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "titleLink": "my_titleLink", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.posts.patch * @memberOf! () * @@ -3031,6 +4558,67 @@ export namespace blogger_v3 { /** * blogger.posts.publish * @desc Publishes a post. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.posts.publish({ + * blogId: 'placeholder-value', + * + * postId: 'placeholder-value', + * + * publishDate: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "customMetaData": "my_customMetaData", + * // "etag": "my_etag", + * // "id": "my_id", + * // "images": [], + * // "kind": "my_kind", + * // "labels": [], + * // "location": {}, + * // "published": "my_published", + * // "readerComments": "my_readerComments", + * // "replies": {}, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "titleLink": "my_titleLink", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.posts.publish * @memberOf! () * @@ -3103,6 +4691,65 @@ export namespace blogger_v3 { /** * blogger.posts.revert * @desc Reverts a published or scheduled post to draft state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.posts.revert({ + * blogId: 'placeholder-value', + * + * postId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "customMetaData": "my_customMetaData", + * // "etag": "my_etag", + * // "id": "my_id", + * // "images": [], + * // "kind": "my_kind", + * // "labels": [], + * // "location": {}, + * // "published": "my_published", + * // "readerComments": "my_readerComments", + * // "replies": {}, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "titleLink": "my_titleLink", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.posts.revert * @memberOf! () * @@ -3175,6 +4822,58 @@ export namespace blogger_v3 { /** * blogger.posts.search * @desc Searches for posts matching given query terms in the specified blog. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger', + * 'https://www.googleapis.com/auth/blogger.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 blogger.posts.search({ + * blogId: 'placeholder-value', + * + * fetchBodies: 'placeholder-value', + * + * orderBy: 'placeholder-value', + * + * q: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "prevPageToken": "my_prevPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.posts.search * @memberOf! () * @@ -3249,6 +4948,101 @@ export namespace blogger_v3 { /** * blogger.posts.update * @desc Updates a post by blog id and post id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger'], + * }); + * + * // 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 blogger.posts.update({ + * blogId: 'placeholder-value', + * + * fetchBody: 'placeholder-value', + * + * fetchImages: 'placeholder-value', + * + * maxComments: 'placeholder-value', + * + * postId: 'placeholder-value', + * + * publish: 'placeholder-value', + * + * revert: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "customMetaData": "my_customMetaData", + * // "etag": "my_etag", + * // "id": "my_id", + * // "images": [], + * // "kind": "my_kind", + * // "labels": [], + * // "location": {}, + * // "published": "my_published", + * // "readerComments": "my_readerComments", + * // "replies": {}, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "titleLink": "my_titleLink", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "blog": {}, + * // "content": "my_content", + * // "customMetaData": "my_customMetaData", + * // "etag": "my_etag", + * // "id": "my_id", + * // "images": [], + * // "kind": "my_kind", + * // "labels": [], + * // "location": {}, + * // "published": "my_published", + * // "readerComments": "my_readerComments", + * // "replies": {}, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "titleLink": "my_titleLink", + * // "updated": "my_updated", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.posts.update * @memberOf! () * @@ -3620,6 +5414,56 @@ export namespace blogger_v3 { /** * blogger.postUserInfos.get * @desc Gets one post and user info pair, by post_id and user_id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger', + * 'https://www.googleapis.com/auth/blogger.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 blogger.postUserInfos.get({ + * blogId: 'placeholder-value', + * + * maxComments: 'placeholder-value', + * + * postId: 'placeholder-value', + * + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "post": {}, + * // "post_user_info": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.postUserInfos.get * @memberOf! () * @@ -3696,6 +5540,70 @@ export namespace blogger_v3 { /** * blogger.postUserInfos.list * @desc Lists post and user info pairs. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger', + * 'https://www.googleapis.com/auth/blogger.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 blogger.postUserInfos.list({ + * blogId: 'placeholder-value', + * + * endDate: 'placeholder-value', + * + * fetchBodies: 'placeholder-value', + * + * labels: 'placeholder-value', + * + * maxResults: 'placeholder-value', + * + * orderBy: 'placeholder-value', + * + * pageToken: 'placeholder-value', + * + * startDate: 'placeholder-value', + * + * status: 'placeholder-value', + * + * userId: 'placeholder-value', + * + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.postUserInfos.list * @memberOf! () * @@ -3864,6 +5772,56 @@ export namespace blogger_v3 { /** * blogger.users.get * @desc Gets one user by user_id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/blogger.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 blogger = google.blogger('v3'); + * + * 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/blogger', + * 'https://www.googleapis.com/auth/blogger.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 blogger.users.get({ + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "about": "my_about", + * // "blogs": {}, + * // "created": "my_created", + * // "displayName": "my_displayName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": {}, + * // "selfLink": "my_selfLink", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias blogger.users.get * @memberOf! () * diff --git a/src/apis/books/v1.ts b/src/apis/books/v1.ts index 6b021fe8261..0e2d2e8e234 100644 --- a/src/apis/books/v1.ts +++ b/src/apis/books/v1.ts @@ -1166,6 +1166,59 @@ export namespace books_v1 { /** * books.bookshelves.get * @desc Retrieves metadata for a specific bookshelf for the specified user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.bookshelves.get({ + * // ID of bookshelf to retrieve. + * shelf: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // ID of user for whom to retrieve bookshelves. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "access": "my_access", + * // "created": "my_created", + * // "description": "my_description", + * // "id": 0, + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "title": "my_title", + * // "updated": "my_updated", + * // "volumeCount": 0, + * // "volumesLastUpdated": "my_volumesLastUpdated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.bookshelves.get * @memberOf! () * @@ -1240,6 +1293,49 @@ export namespace books_v1 { /** * books.bookshelves.list * @desc Retrieves a list of public bookshelves for the specified user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.bookshelves.list({ + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // ID of user for whom to retrieve bookshelves. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.bookshelves.list * @memberOf! () * @@ -1356,6 +1452,58 @@ export namespace books_v1 { /** * books.bookshelves.volumes.list * @desc Retrieves volumes in a specific bookshelf for the specified user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.bookshelves.volumes.list({ + * // Maximum number of results to return + * maxResults: 'placeholder-value', + * // ID of bookshelf to retrieve volumes. + * shelf: 'placeholder-value', + * // Set to true to show pre-ordered books. Defaults to false. + * showPreorders: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // Index of the first element to return (starts at 0) + * startIndex: 'placeholder-value', + * // ID of user for whom to retrieve bookshelf volumes. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "totalItems": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.bookshelves.volumes.list * @memberOf! () * @@ -1471,6 +1619,55 @@ export namespace books_v1 { /** * books.cloudloading.addBook + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.cloudloading.addBook({ + * // A drive document id. The upload_client_token must not be set. + * drive_document_id: 'placeholder-value', + * // The document MIME type. It can be set only if the drive_document_id is set. + * mime_type: 'placeholder-value', + * // The document name. It can be set only if the drive_document_id is set. + * name: 'placeholder-value', + * + * upload_client_token: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": "my_author", + * // "processingState": "my_processingState", + * // "title": "my_title", + * // "volumeId": "my_volumeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.cloudloading.addBook * @memberOf! () * @@ -1555,6 +1752,41 @@ export namespace books_v1 { /** * books.cloudloading.deleteBook * @desc Remove the book and its contents + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.cloudloading.deleteBook({ + * // The id of the book to be removed. + * volumeId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.cloudloading.deleteBook * @memberOf! () * @@ -1626,6 +1858,57 @@ export namespace books_v1 { /** * books.cloudloading.updateBook + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.cloudloading.updateBook({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "author": "my_author", + * // "processingState": "my_processingState", + * // "title": "my_title", + * // "volumeId": "my_volumeId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": "my_author", + * // "processingState": "my_processingState", + * // "title": "my_title", + * // "volumeId": "my_volumeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.cloudloading.updateBook * @memberOf! () * @@ -1763,6 +2046,47 @@ export namespace books_v1 { /** * books.dictionary.listOfflineMetadata * @desc Returns a list of offline dictionary metadata available + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.dictionary.listOfflineMetadata({ + * // The device/version ID from which to request the data. + * cpksver: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.dictionary.listOfflineMetadata * @memberOf! () * @@ -1855,6 +2179,47 @@ export namespace books_v1 { /** * books.familysharing.getFamilyInfo * @desc Gets information regarding the family that the user is part of. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.familysharing.getFamilyInfo({ + * // String to identify the originator of this request. + * source: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "membership": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.familysharing.getFamilyInfo * @memberOf! () * @@ -1929,6 +2294,45 @@ export namespace books_v1 { /** * books.familysharing.share * @desc Initiates sharing of the content with the user's family. Empty response indicates success. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.familysharing.share({ + * // The docid to share. + * docId: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // The volume to share. + * volumeId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.familysharing.share * @memberOf! () * @@ -2003,6 +2407,45 @@ export namespace books_v1 { /** * books.familysharing.unshare * @desc Initiates revoking content that has already been shared with the user's family. Empty response indicates success. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.familysharing.unshare({ + * // The docid to unshare. + * docId: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // The volume to unshare. + * volumeId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.familysharing.unshare * @memberOf! () * @@ -2143,6 +2586,64 @@ export namespace books_v1 { /** * books.layers.get * @desc Gets the layer summary for a volume. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.layers.get({ + * // The content version for the requested volume. + * contentVersion: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // The ID for the layer to get the summary for. + * summaryId: 'placeholder-value', + * // The volume to retrieve layers for. + * volumeId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "annotationCount": 0, + * // "annotationTypes": [], + * // "annotationsDataLink": "my_annotationsDataLink", + * // "annotationsLink": "my_annotationsLink", + * // "contentVersion": "my_contentVersion", + * // "dataCount": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "layerId": "my_layerId", + * // "selfLink": "my_selfLink", + * // "updated": "my_updated", + * // "volumeAnnotationsVersion": "my_volumeAnnotationsVersion", + * // "volumeId": "my_volumeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.layers.get * @memberOf! () * @@ -2218,6 +2719,56 @@ export namespace books_v1 { /** * books.layers.list * @desc List the layer summaries for a volume. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.layers.list({ + * // The content version for the requested volume. + * contentVersion: 'placeholder-value', + * // Maximum number of results to return + * maxResults: 'placeholder-value', + * // The value of the nextToken from the previous page. + * pageToken: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // The volume to retrieve layers for. + * volumeId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "totalItems": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.layers.list * @memberOf! () * @@ -2352,6 +2903,72 @@ export namespace books_v1 { /** * books.layers.annotationData.get * @desc Gets the annotation data. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.layers.annotationData.get({ + * // For the dictionary layer. Whether or not to allow web definitions. + * allowWebDefinitions: 'placeholder-value', + * // The ID of the annotation data to retrieve. + * annotationDataId: 'placeholder-value', + * // The content version for the volume you are trying to retrieve. + * contentVersion: 'placeholder-value', + * // The requested pixel height for any images. If height is provided width must also be provided. + * h: 'placeholder-value', + * // The ID for the layer to get the annotations. + * layerId: 'placeholder-value', + * // The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. + * locale: 'placeholder-value', + * // The requested scale for the image. + * scale: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // The volume to retrieve annotations for. + * volumeId: 'placeholder-value', + * // The requested pixel width for any images. If width is provided height must also be provided. + * w: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "annotationType": "my_annotationType", + * // "data": {}, + * // "encoded_data": "my_encoded_data", + * // "id": "my_id", + * // "kind": "my_kind", + * // "layerId": "my_layerId", + * // "selfLink": "my_selfLink", + * // "updated": "my_updated", + * // "volumeId": "my_volumeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.layers.annotationData.get * @memberOf! () * @@ -2440,6 +3057,73 @@ export namespace books_v1 { /** * books.layers.annotationData.list * @desc Gets the annotation data for a volume and layer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.layers.annotationData.list({ + * // The list of Annotation Data Ids to retrieve. Pagination is ignored if this is set. + * annotationDataId: 'placeholder-value', + * // The content version for the requested volume. + * contentVersion: 'placeholder-value', + * // The requested pixel height for any images. If height is provided width must also be provided. + * h: 'placeholder-value', + * // The ID for the layer to get the annotation data. + * layerId: 'placeholder-value', + * // The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. + * locale: 'placeholder-value', + * // Maximum number of results to return + * maxResults: 'placeholder-value', + * // The value of the nextToken from the previous page. + * pageToken: 'placeholder-value', + * // The requested scale for the image. + * scale: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). + * updatedMax: 'placeholder-value', + * // RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). + * updatedMin: 'placeholder-value', + * // The volume to retrieve annotation data for. + * volumeId: 'placeholder-value', + * // The requested pixel width for any images. If width is provided height must also be provided. + * w: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "totalItems": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.layers.annotationData.list * @memberOf! () * @@ -2641,6 +3325,67 @@ export namespace books_v1 { /** * books.layers.volumeAnnotations.get * @desc Gets the volume annotation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.layers.volumeAnnotations.get({ + * // The ID of the volume annotation to retrieve. + * annotationId: 'placeholder-value', + * // The ID for the layer to get the annotations. + * layerId: 'placeholder-value', + * // The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. + * locale: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // The volume to retrieve annotations for. + * volumeId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "annotationDataId": "my_annotationDataId", + * // "annotationDataLink": "my_annotationDataLink", + * // "annotationType": "my_annotationType", + * // "contentRanges": {}, + * // "data": "my_data", + * // "deleted": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "layerId": "my_layerId", + * // "pageIds": [], + * // "selectedText": "my_selectedText", + * // "selfLink": "my_selfLink", + * // "updated": "my_updated", + * // "volumeId": "my_volumeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.layers.volumeAnnotations.get * @memberOf! () * @@ -2719,6 +3464,78 @@ export namespace books_v1 { /** * books.layers.volumeAnnotations.list * @desc Gets the volume annotations for a volume and layer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.layers.volumeAnnotations.list({ + * // The content version for the requested volume. + * contentVersion: 'placeholder-value', + * // The end offset to end retrieving data from. + * endOffset: 'placeholder-value', + * // The end position to end retrieving data from. + * endPosition: 'placeholder-value', + * // The ID for the layer to get the annotations. + * layerId: 'placeholder-value', + * // The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. + * locale: 'placeholder-value', + * // Maximum number of results to return + * maxResults: 'placeholder-value', + * // The value of the nextToken from the previous page. + * pageToken: 'placeholder-value', + * // Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false. + * showDeleted: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // The start offset to start retrieving data from. + * startOffset: 'placeholder-value', + * // The start position to start retrieving data from. + * startPosition: 'placeholder-value', + * // RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). + * updatedMax: 'placeholder-value', + * // RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). + * updatedMin: 'placeholder-value', + * // The version of the volume annotations that you are requesting. + * volumeAnnotationsVersion: 'placeholder-value', + * // The volume to retrieve annotations for. + * volumeId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "totalItems": 0, + * // "version": "my_version" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.layers.volumeAnnotations.list * @memberOf! () * @@ -2910,6 +3727,45 @@ export namespace books_v1 { /** * books.myconfig.getUserSettings * @desc Gets the current settings for the user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.myconfig.getUserSettings({}); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "notesExport": {}, + * // "notification": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.myconfig.getUserSettings * @memberOf! () * @@ -2983,6 +3839,53 @@ export namespace books_v1 { /** * books.myconfig.releaseDownloadAccess * @desc Release downloaded content access restriction. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.myconfig.releaseDownloadAccess({ + * // The device/version ID from which to release the restriction. + * cpksver: 'placeholder-value', + * // ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. + * locale: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // The volume(s) to release restrictions for. + * volumeIds: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "downloadAccessList": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.myconfig.releaseDownloadAccess * @memberOf! () * @@ -3062,6 +3965,58 @@ export namespace books_v1 { /** * books.myconfig.requestAccess * @desc Request concurrent and download access restrictions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.myconfig.requestAccess({ + * // The device/version ID from which to request the restrictions. + * cpksver: 'placeholder-value', + * // The type of access license to request. If not specified, the default is BOTH. + * licenseTypes: 'placeholder-value', + * // ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. + * locale: 'placeholder-value', + * // The client nonce value. + * nonce: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // The volume to request concurrent/download restrictions for. + * volumeId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "concurrentAccess": {}, + * // "downloadAccess": {}, + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.myconfig.requestAccess * @memberOf! () * @@ -3141,6 +4096,62 @@ export namespace books_v1 { /** * books.myconfig.syncVolumeLicenses * @desc Request downloaded content access for specified volumes on the My eBooks shelf. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.myconfig.syncVolumeLicenses({ + * // The device/version ID from which to release the restriction. + * cpksver: 'placeholder-value', + * // List of features supported by the client, i.e., 'RENTALS' + * features: 'placeholder-value', + * // Set to true to include non-comics series. Defaults to false. + * includeNonComicsSeries: 'placeholder-value', + * // ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. + * locale: 'placeholder-value', + * // The client nonce value. + * nonce: 'placeholder-value', + * // Set to true to show pre-ordered books. Defaults to false. + * showPreorders: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // The volume(s) to request download restrictions for. + * volumeIds: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "totalItems": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.myconfig.syncVolumeLicenses * @memberOf! () * @@ -3220,6 +4231,55 @@ export namespace books_v1 { /** * books.myconfig.updateUserSettings * @desc Sets the settings for the user. If a sub-object is specified, it will overwrite the existing sub-object stored in the server. Unspecified sub-objects will retain the existing value. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.myconfig.updateUserSettings({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "notesExport": {}, + * // "notification": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "notesExport": {}, + * // "notification": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.myconfig.updateUserSettings * @memberOf! () * @@ -3434,6 +4494,43 @@ export namespace books_v1 { /** * books.mylibrary.annotations.delete * @desc Deletes an annotation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.mylibrary.annotations.delete({ + * // The ID for the annotation to delete. + * annotationId: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.mylibrary.annotations.delete * @memberOf! () * @@ -3506,6 +4603,92 @@ export namespace books_v1 { /** * books.mylibrary.annotations.insert * @desc Inserts a new annotation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.mylibrary.annotations.insert({ + * // The ID for the annotation to insert. + * annotationId: 'placeholder-value', + * // ISO-3166-1 code to override the IP-based location. + * country: 'placeholder-value', + * // Requests that only the summary of the specified layer be provided in the response. + * showOnlySummaryInResponse: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "afterSelectedText": "my_afterSelectedText", + * // "beforeSelectedText": "my_beforeSelectedText", + * // "clientVersionRanges": {}, + * // "created": "my_created", + * // "currentVersionRanges": {}, + * // "data": "my_data", + * // "deleted": false, + * // "highlightStyle": "my_highlightStyle", + * // "id": "my_id", + * // "kind": "my_kind", + * // "layerId": "my_layerId", + * // "layerSummary": {}, + * // "pageIds": [], + * // "selectedText": "my_selectedText", + * // "selfLink": "my_selfLink", + * // "updated": "my_updated", + * // "volumeId": "my_volumeId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "afterSelectedText": "my_afterSelectedText", + * // "beforeSelectedText": "my_beforeSelectedText", + * // "clientVersionRanges": {}, + * // "created": "my_created", + * // "currentVersionRanges": {}, + * // "data": "my_data", + * // "deleted": false, + * // "highlightStyle": "my_highlightStyle", + * // "id": "my_id", + * // "kind": "my_kind", + * // "layerId": "my_layerId", + * // "layerSummary": {}, + * // "pageIds": [], + * // "selectedText": "my_selectedText", + * // "selfLink": "my_selfLink", + * // "updated": "my_updated", + * // "volumeId": "my_volumeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.mylibrary.annotations.insert * @memberOf! () * @@ -3584,6 +4767,67 @@ export namespace books_v1 { /** * books.mylibrary.annotations.list * @desc Retrieves a list of annotations, possibly filtered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.mylibrary.annotations.list({ + * // The content version for the requested volume. + * contentVersion: 'placeholder-value', + * // The layer ID to limit annotation by. + * layerId: 'placeholder-value', + * // The layer ID(s) to limit annotation by. + * layerIds: 'placeholder-value', + * // Maximum number of results to return + * maxResults: 'placeholder-value', + * // The value of the nextToken from the previous page. + * pageToken: 'placeholder-value', + * // Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false. + * showDeleted: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). + * updatedMax: 'placeholder-value', + * // RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). + * updatedMin: 'placeholder-value', + * // The volume to restrict annotations to. + * volumeId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "totalItems": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.mylibrary.annotations.list * @memberOf! () * @@ -3667,6 +4911,49 @@ export namespace books_v1 { /** * books.mylibrary.annotations.summary * @desc Gets the summary of specified layers. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.mylibrary.annotations.summary({ + * // Array of layer IDs to get the summary for. + * layerIds: 'placeholder-value', + * // Volume id to get the summary for. + * volumeId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "layers": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.mylibrary.annotations.summary * @memberOf! () * @@ -3742,6 +5029,88 @@ export namespace books_v1 { /** * books.mylibrary.annotations.update * @desc Updates an existing annotation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.mylibrary.annotations.update({ + * // The ID for the annotation to update. + * annotationId: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "afterSelectedText": "my_afterSelectedText", + * // "beforeSelectedText": "my_beforeSelectedText", + * // "clientVersionRanges": {}, + * // "created": "my_created", + * // "currentVersionRanges": {}, + * // "data": "my_data", + * // "deleted": false, + * // "highlightStyle": "my_highlightStyle", + * // "id": "my_id", + * // "kind": "my_kind", + * // "layerId": "my_layerId", + * // "layerSummary": {}, + * // "pageIds": [], + * // "selectedText": "my_selectedText", + * // "selfLink": "my_selfLink", + * // "updated": "my_updated", + * // "volumeId": "my_volumeId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "afterSelectedText": "my_afterSelectedText", + * // "beforeSelectedText": "my_beforeSelectedText", + * // "clientVersionRanges": {}, + * // "created": "my_created", + * // "currentVersionRanges": {}, + * // "data": "my_data", + * // "deleted": false, + * // "highlightStyle": "my_highlightStyle", + * // "id": "my_id", + * // "kind": "my_kind", + * // "layerId": "my_layerId", + * // "layerSummary": {}, + * // "pageIds": [], + * // "selectedText": "my_selectedText", + * // "selfLink": "my_selfLink", + * // "updated": "my_updated", + * // "volumeId": "my_volumeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.mylibrary.annotations.update * @memberOf! () * @@ -3957,6 +5326,47 @@ export namespace books_v1 { /** * books.mylibrary.bookshelves.addVolume * @desc Adds a volume to a bookshelf. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.mylibrary.bookshelves.addVolume({ + * // The reason for which the book is added to the library. + * reason: 'placeholder-value', + * // ID of bookshelf to which to add a volume. + * shelf: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // ID of volume to add. + * volumeId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.mylibrary.bookshelves.addVolume * @memberOf! () * @@ -4031,6 +5441,43 @@ export namespace books_v1 { /** * books.mylibrary.bookshelves.clearVolumes * @desc Clears all volumes from a bookshelf. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.mylibrary.bookshelves.clearVolumes({ + * // ID of bookshelf from which to remove a volume. + * shelf: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.mylibrary.bookshelves.clearVolumes * @memberOf! () * @@ -4103,6 +5550,57 @@ export namespace books_v1 { /** * books.mylibrary.bookshelves.get * @desc Retrieves metadata for a specific bookshelf belonging to the authenticated user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.mylibrary.bookshelves.get({ + * // ID of bookshelf to retrieve. + * shelf: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "access": "my_access", + * // "created": "my_created", + * // "description": "my_description", + * // "id": 0, + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "title": "my_title", + * // "updated": "my_updated", + * // "volumeCount": 0, + * // "volumesLastUpdated": "my_volumesLastUpdated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.mylibrary.bookshelves.get * @memberOf! () * @@ -4178,6 +5676,47 @@ export namespace books_v1 { /** * books.mylibrary.bookshelves.list * @desc Retrieves a list of bookshelves belonging to the authenticated user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.mylibrary.bookshelves.list({ + * // String to identify the originator of this request. + * source: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.mylibrary.bookshelves.list * @memberOf! () * @@ -4252,6 +5791,47 @@ export namespace books_v1 { /** * books.mylibrary.bookshelves.moveVolume * @desc Moves a volume within a bookshelf. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.mylibrary.bookshelves.moveVolume({ + * // ID of bookshelf with the volume. + * shelf: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // ID of volume to move. + * volumeId: 'placeholder-value', + * // Position on shelf to move the item (0 puts the item before the current first item, 1 puts it between the first and the second and so on.) + * volumePosition: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.mylibrary.bookshelves.moveVolume * @memberOf! () * @@ -4326,6 +5906,47 @@ export namespace books_v1 { /** * books.mylibrary.bookshelves.removeVolume * @desc Removes a volume from a bookshelf. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.mylibrary.bookshelves.removeVolume({ + * // The reason for which the book is removed from the library. + * reason: 'placeholder-value', + * // ID of bookshelf from which to remove a volume. + * shelf: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // ID of volume to remove. + * volumeId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.mylibrary.bookshelves.removeVolume * @memberOf! () * @@ -4524,6 +6145,62 @@ export namespace books_v1 { /** * books.mylibrary.bookshelves.volumes.list * @desc Gets volume information for volumes on a bookshelf. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.mylibrary.bookshelves.volumes.list({ + * // ISO-3166-1 code to override the IP-based location. + * country: 'placeholder-value', + * // Maximum number of results to return + * maxResults: 'placeholder-value', + * // Restrict information returned to a set of selected fields. + * projection: 'placeholder-value', + * // Full-text search query string in this bookshelf. + * q: 'placeholder-value', + * // The bookshelf ID or name retrieve volumes for. + * shelf: 'placeholder-value', + * // Set to true to show pre-ordered books. Defaults to false. + * showPreorders: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // Index of the first element to return (starts at 0) + * startIndex: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "totalItems": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.mylibrary.bookshelves.volumes.list * @memberOf! () * @@ -4650,6 +6327,56 @@ export namespace books_v1 { /** * books.mylibrary.readingpositions.get * @desc Retrieves my reading position information for a volume. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.mylibrary.readingpositions.get({ + * // Volume content version for which this reading position is requested. + * contentVersion: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // ID of volume for which to retrieve a reading position. + * volumeId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "epubCfiPosition": "my_epubCfiPosition", + * // "gbImagePosition": "my_gbImagePosition", + * // "gbTextPosition": "my_gbTextPosition", + * // "kind": "my_kind", + * // "pdfPosition": "my_pdfPosition", + * // "updated": "my_updated", + * // "volumeId": "my_volumeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.mylibrary.readingpositions.get * @memberOf! () * @@ -4725,6 +6452,53 @@ export namespace books_v1 { /** * books.mylibrary.readingpositions.setPosition * @desc Sets my reading position information for a volume. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.mylibrary.readingpositions.setPosition({ + * // Action that caused this reading position to be set. + * action: 'placeholder-value', + * // Volume content version for which this reading position applies. + * contentVersion: 'placeholder-value', + * // Random persistent device cookie optional on set position. + * deviceCookie: 'placeholder-value', + * // Position string for the new volume reading position. + * position: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // RFC 3339 UTC format timestamp associated with this reading position. + * timestamp: 'placeholder-value', + * // ID of volume for which to update the reading position. + * volumeId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.mylibrary.readingpositions.setPosition * @memberOf! () * @@ -4867,6 +6641,65 @@ export namespace books_v1 { /** * books.notification.get * @desc Returns notification details for a given notification id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.notification.get({ + * // ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating notification title and body. + * locale: 'placeholder-value', + * // String to identify the notification. + * notification_id: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "body": "my_body", + * // "crmExperimentIds": [], + * // "doc_id": "my_doc_id", + * // "doc_type": "my_doc_type", + * // "dont_show_notification": false, + * // "iconUrl": "my_iconUrl", + * // "is_document_mature": false, + * // "kind": "my_kind", + * // "notificationGroup": "my_notificationGroup", + * // "notification_type": "my_notification_type", + * // "pcampaign_id": "my_pcampaign_id", + * // "reason": "my_reason", + * // "show_notification_settings_action": false, + * // "targetUrl": "my_targetUrl", + * // "timeToExpireMs": "my_timeToExpireMs", + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.notification.get * @memberOf! () * @@ -4969,6 +6802,47 @@ export namespace books_v1 { /** * books.onboarding.listCategories * @desc List categories for onboarding experience. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.onboarding.listCategories({ + * // ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset. + * locale: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.onboarding.listCategories * @memberOf! () * @@ -5041,6 +6915,56 @@ export namespace books_v1 { /** * books.onboarding.listCategoryVolumes * @desc List available volumes under categories for onboarding experience. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.onboarding.listCategoryVolumes({ + * // List of category ids requested. + * categoryId: 'placeholder-value', + * // ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset. + * locale: 'placeholder-value', + * // The maximum allowed maturity rating of returned volumes. Books with a higher maturity rating are filtered out. + * maxAllowedMaturityRating: 'placeholder-value', + * // Number of maximum results per page to be included in the response. + * pageSize: 'placeholder-value', + * // The value of the nextToken from the previous page. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.onboarding.listCategoryVolumes * @memberOf! () * @@ -5165,6 +7089,52 @@ export namespace books_v1 { /** * books.personalizedstream.get * @desc Returns a stream of personalized book clusters + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.personalizedstream.get({ + * // ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. + * locale: 'placeholder-value', + * // The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. + * maxAllowedMaturityRating: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusters": [], + * // "kind": "my_kind", + * // "totalClusters": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.personalizedstream.get * @memberOf! () * @@ -5268,6 +7238,55 @@ export namespace books_v1 { /** * books.promooffer.accept + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.promooffer.accept({ + * // device android_id + * androidId: 'placeholder-value', + * // device device + * device: 'placeholder-value', + * // device manufacturer + * manufacturer: 'placeholder-value', + * // device model + * model: 'placeholder-value', + * + * offerId: 'placeholder-value', + * // device product + * product: 'placeholder-value', + * // device serial + * serial: 'placeholder-value', + * // Volume id to exercise the offer + * volumeId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.promooffer.accept * @memberOf! () * @@ -5346,6 +7365,53 @@ export namespace books_v1 { /** * books.promooffer.dismiss + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.promooffer.dismiss({ + * // device android_id + * androidId: 'placeholder-value', + * // device device + * device: 'placeholder-value', + * // device manufacturer + * manufacturer: 'placeholder-value', + * // device model + * model: 'placeholder-value', + * // Offer to dimiss + * offerId: 'placeholder-value', + * // device product + * product: 'placeholder-value', + * // device serial + * serial: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.promooffer.dismiss * @memberOf! () * @@ -5424,6 +7490,57 @@ export namespace books_v1 { /** * books.promooffer.get * @desc Returns a list of promo offers available to the user + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.promooffer.get({ + * // device android_id + * androidId: 'placeholder-value', + * // device device + * device: 'placeholder-value', + * // device manufacturer + * manufacturer: 'placeholder-value', + * // device model + * model: 'placeholder-value', + * // device product + * product: 'placeholder-value', + * // device serial + * serial: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.promooffer.get * @memberOf! () * @@ -5617,6 +7734,47 @@ export namespace books_v1 { /** * books.series.get * @desc Returns Series metadata for the given series ids. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.series.get({ + * // String that identifies the series + * series_id: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "series": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.series.get * @memberOf! () * @@ -5707,6 +7865,52 @@ export namespace books_v1 { /** * books.series.membership.get * @desc Returns Series membership data given the series id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.series.membership.get({ + * // Number of maximum results per page to be included in the response. + * page_size: 'placeholder-value', + * // The value of the nextToken from the previous page. + * page_token: 'placeholder-value', + * // String that identifies the series + * series_id: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "member": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.series.membership.get * @memberOf! () * @@ -5819,6 +8023,68 @@ export namespace books_v1 { /** * books.volumes.get * @desc Gets volume information for a single volume. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.volumes.get({ + * // ISO-3166-1 code to override the IP-based location. + * country: 'placeholder-value', + * // Set to true to include non-comics series. Defaults to false. + * includeNonComicsSeries: 'placeholder-value', + * // Brand results for partner ID. + * partner: 'placeholder-value', + * // Restrict information returned to a set of selected fields. + * projection: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * + * user_library_consistent_read: 'placeholder-value', + * // ID of volume to retrieve. + * volumeId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accessInfo": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "layerInfo": {}, + * // "recommendedInfo": {}, + * // "saleInfo": {}, + * // "searchInfo": {}, + * // "selfLink": "my_selfLink", + * // "userInfo": {}, + * // "volumeInfo": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.volumes.get * @memberOf! () * @@ -5896,6 +8162,74 @@ export namespace books_v1 { /** * books.volumes.list * @desc Performs a book search. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.volumes.list({ + * // Restrict to volumes by download availability. + * download: 'placeholder-value', + * // Filter search results. + * filter: 'placeholder-value', + * // Restrict results to books with this language code. + * langRestrict: 'placeholder-value', + * // Restrict search to this user's library. + * libraryRestrict: 'placeholder-value', + * // The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. + * maxAllowedMaturityRating: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Sort search results. + * orderBy: 'placeholder-value', + * // Restrict and brand results for partner ID. + * partner: 'placeholder-value', + * // Restrict to books or magazines. + * printType: 'placeholder-value', + * // Restrict information returned to a set of selected fields. + * projection: 'placeholder-value', + * // Full-text search query string. + * q: 'placeholder-value', + * // Set to true to show books available for preorder. Defaults to false. + * showPreorders: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // Index of the first result to return (starts at 0) + * startIndex: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "totalItems": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.volumes.list * @memberOf! () * @@ -6083,6 +8417,56 @@ export namespace books_v1 { /** * books.volumes.associated.list * @desc Return a list of associated books. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.volumes.associated.list({ + * // Association type. + * association: 'placeholder-value', + * // ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. + * locale: 'placeholder-value', + * // The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. + * maxAllowedMaturityRating: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // ID of the source volume. + * volumeId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "totalItems": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.volumes.associated.list * @memberOf! () * @@ -6195,6 +8579,60 @@ export namespace books_v1 { /** * books.volumes.mybooks.list * @desc Return a list of books in My Library. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.volumes.mybooks.list({ + * // How the book was acquired + * acquireMethod: 'placeholder-value', + * // ISO-3166-1 code to override the IP-based location. + * country: 'placeholder-value', + * // ISO-639-1 language and ISO-3166-1 country code. Ex:'en_US'. Used for generating recommendations. + * locale: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // The processing state of the user uploaded volumes to be returned. Applicable only if the UPLOADED is specified in the acquireMethod. + * processingState: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // Index of the first result to return (starts at 0) + * startIndex: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "totalItems": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.volumes.mybooks.list * @memberOf! () * @@ -6317,6 +8755,52 @@ export namespace books_v1 { /** * books.volumes.recommended.list * @desc Return a list of recommended books for the current user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.volumes.recommended.list({ + * // ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. + * locale: 'placeholder-value', + * // The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. + * maxAllowedMaturityRating: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "totalItems": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.volumes.recommended.list * @memberOf! () * @@ -6391,6 +8875,52 @@ export namespace books_v1 { /** * books.volumes.recommended.rate * @desc Rate a recommended book for the current user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.volumes.recommended.rate({ + * // ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. + * locale: 'placeholder-value', + * // Rating to be given to the volume. + * rating: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // ID of the source volume. + * volumeId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "consistency_token": "my_consistency_token" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.volumes.recommended.rate * @memberOf! () * @@ -6531,6 +9061,58 @@ export namespace books_v1 { /** * books.volumes.useruploaded.list * @desc Return a list of books uploaded by the current user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/books.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 books = google.books('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/books'], + * }); + * + * // 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 books.volumes.useruploaded.list({ + * // ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. + * locale: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // The processing state of the user uploaded volumes to be returned. + * processingState: 'placeholder-value', + * // String to identify the originator of this request. + * source: 'placeholder-value', + * // Index of the first result to return (starts at 0) + * startIndex: 'placeholder-value', + * // The ids of the volumes to be returned. If not specified all that match the processingState are returned. + * volumeId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "totalItems": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias books.volumes.useruploaded.list * @memberOf! () * diff --git a/src/apis/calendar/v3.ts b/src/apis/calendar/v3.ts index 47b603acd43..e3ccbf70fd3 100644 --- a/src/apis/calendar/v3.ts +++ b/src/apis/calendar/v3.ts @@ -955,6 +955,43 @@ export namespace calendar_v3 { /** * calendar.acl.delete * @desc Deletes an access control rule. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar'], + * }); + * + * // 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 calendar.acl.delete({ + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * // ACL rule identifier. + * ruleId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.acl.delete * @memberOf! () * @@ -1026,6 +1063,55 @@ export namespace calendar_v3 { /** * calendar.acl.get * @desc Returns an access control rule. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.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 calendar.acl.get({ + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * // ACL rule identifier. + * ruleId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "scope": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.acl.get * @memberOf! () * @@ -1097,6 +1183,64 @@ export namespace calendar_v3 { /** * calendar.acl.insert * @desc Creates an access control rule. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar'], + * }); + * + * // 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 calendar.acl.insert({ + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * // Whether to send notifications about the calendar sharing change. Optional. The default is True. + * sendNotifications: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "scope": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "scope": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.acl.insert * @memberOf! () * @@ -1170,6 +1314,61 @@ export namespace calendar_v3 { /** * calendar.acl.list * @desc Returns the rules in the access control list for the calendar. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar'], + * }); + * + * // 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 calendar.acl.list({ + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * // Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional. + * maxResults: 'placeholder-value', + * // Token specifying which result page to return. Optional. + * pageToken: 'placeholder-value', + * // Whether to include deleted ACLs in the result. Deleted ACLs are represented by role equal to "none". Deleted ACLs will always be included if syncToken is provided. Optional. The default is False. + * showDeleted: 'placeholder-value', + * // Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All entries deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False. + * // If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. + * // Learn more about incremental synchronization. + * // Optional. The default is to return all entries. + * syncToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "nextSyncToken": "my_nextSyncToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.acl.list * @memberOf! () * @@ -1245,6 +1444,66 @@ export namespace calendar_v3 { /** * calendar.acl.patch * @desc Updates an access control rule. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar'], + * }); + * + * // 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 calendar.acl.patch({ + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * // ACL rule identifier. + * ruleId: 'placeholder-value', + * // Whether to send notifications about the calendar sharing change. Note that there are no notifications on access removal. Optional. The default is True. + * sendNotifications: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "scope": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "scope": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.acl.patch * @memberOf! () * @@ -1318,6 +1577,66 @@ export namespace calendar_v3 { /** * calendar.acl.update * @desc Updates an access control rule. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar'], + * }); + * + * // 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 calendar.acl.update({ + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * // ACL rule identifier. + * ruleId: 'placeholder-value', + * // Whether to send notifications about the calendar sharing change. Note that there are no notifications on access removal. Optional. The default is True. + * sendNotifications: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "scope": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "scope": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.acl.update * @memberOf! () * @@ -1391,6 +1710,83 @@ export namespace calendar_v3 { /** * calendar.acl.watch * @desc Watch for changes to ACL resources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar'], + * }); + * + * // 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 calendar.acl.watch({ + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * // Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional. + * maxResults: 'placeholder-value', + * // Token specifying which result page to return. Optional. + * pageToken: 'placeholder-value', + * // Whether to include deleted ACLs in the result. Deleted ACLs are represented by role equal to "none". Deleted ACLs will always be included if syncToken is provided. Optional. The default is False. + * showDeleted: 'placeholder-value', + * // Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All entries deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False. + * // If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. + * // Learn more about incremental synchronization. + * // Optional. The default is to return all entries. + * syncToken: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.acl.watch * @memberOf! () * @@ -1631,6 +2027,41 @@ export namespace calendar_v3 { /** * calendar.calendarList.delete * @desc Removes a calendar from the user's calendar list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar'], + * }); + * + * // 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 calendar.calendarList.delete({ + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.calendarList.delete * @memberOf! () * @@ -1702,6 +2133,67 @@ export namespace calendar_v3 { /** * calendar.calendarList.get * @desc Returns a calendar from the user's calendar list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.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 calendar.calendarList.get({ + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accessRole": "my_accessRole", + * // "backgroundColor": "my_backgroundColor", + * // "colorId": "my_colorId", + * // "conferenceProperties": {}, + * // "defaultReminders": [], + * // "deleted": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "foregroundColor": "my_foregroundColor", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "notificationSettings": {}, + * // "primary": false, + * // "selected": false, + * // "summary": "my_summary", + * // "summaryOverride": "my_summaryOverride", + * // "timeZone": "my_timeZone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.calendarList.get * @memberOf! () * @@ -1774,6 +2266,90 @@ export namespace calendar_v3 { /** * calendar.calendarList.insert * @desc Inserts an existing calendar into the user's calendar list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar'], + * }); + * + * // 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 calendar.calendarList.insert({ + * // Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId field will be set to the best matching option automatically. Optional. The default is False. + * colorRgbFormat: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accessRole": "my_accessRole", + * // "backgroundColor": "my_backgroundColor", + * // "colorId": "my_colorId", + * // "conferenceProperties": {}, + * // "defaultReminders": [], + * // "deleted": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "foregroundColor": "my_foregroundColor", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "notificationSettings": {}, + * // "primary": false, + * // "selected": false, + * // "summary": "my_summary", + * // "summaryOverride": "my_summaryOverride", + * // "timeZone": "my_timeZone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accessRole": "my_accessRole", + * // "backgroundColor": "my_backgroundColor", + * // "colorId": "my_colorId", + * // "conferenceProperties": {}, + * // "defaultReminders": [], + * // "deleted": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "foregroundColor": "my_foregroundColor", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "notificationSettings": {}, + * // "primary": false, + * // "selected": false, + * // "summary": "my_summary", + * // "summaryOverride": "my_summaryOverride", + * // "timeZone": "my_timeZone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.calendarList.insert * @memberOf! () * @@ -1849,6 +2425,67 @@ export namespace calendar_v3 { /** * calendar.calendarList.list * @desc Returns the calendars on the user's calendar list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.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 calendar.calendarList.list({ + * // Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional. + * maxResults: 'placeholder-value', + * // The minimum access role for the user in the returned entries. Optional. The default is no restriction. + * minAccessRole: 'placeholder-value', + * // Token specifying which result page to return. Optional. + * pageToken: 'placeholder-value', + * // Whether to include deleted calendar list entries in the result. Optional. The default is False. + * showDeleted: 'placeholder-value', + * // Whether to show hidden entries. Optional. The default is False. + * showHidden: 'placeholder-value', + * // Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. If only read-only fields such as calendar properties or ACLs have changed, the entry won't be returned. All entries deleted and hidden since the previous list request will always be in the result set and it is not allowed to set showDeleted neither showHidden to False. + * // To ensure client state consistency minAccessRole query parameter cannot be specified together with nextSyncToken. + * // If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. + * // Learn more about incremental synchronization. + * // Optional. The default is to return all entries. + * syncToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "nextSyncToken": "my_nextSyncToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.calendarList.list * @memberOf! () * @@ -1928,6 +2565,92 @@ export namespace calendar_v3 { /** * calendar.calendarList.patch * @desc Updates an existing calendar on the user's calendar list. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar'], + * }); + * + * // 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 calendar.calendarList.patch({ + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * // Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId field will be set to the best matching option automatically. Optional. The default is False. + * colorRgbFormat: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accessRole": "my_accessRole", + * // "backgroundColor": "my_backgroundColor", + * // "colorId": "my_colorId", + * // "conferenceProperties": {}, + * // "defaultReminders": [], + * // "deleted": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "foregroundColor": "my_foregroundColor", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "notificationSettings": {}, + * // "primary": false, + * // "selected": false, + * // "summary": "my_summary", + * // "summaryOverride": "my_summaryOverride", + * // "timeZone": "my_timeZone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accessRole": "my_accessRole", + * // "backgroundColor": "my_backgroundColor", + * // "colorId": "my_colorId", + * // "conferenceProperties": {}, + * // "defaultReminders": [], + * // "deleted": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "foregroundColor": "my_foregroundColor", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "notificationSettings": {}, + * // "primary": false, + * // "selected": false, + * // "summary": "my_summary", + * // "summaryOverride": "my_summaryOverride", + * // "timeZone": "my_timeZone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.calendarList.patch * @memberOf! () * @@ -2003,6 +2726,92 @@ export namespace calendar_v3 { /** * calendar.calendarList.update * @desc Updates an existing calendar on the user's calendar list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar'], + * }); + * + * // 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 calendar.calendarList.update({ + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * // Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId field will be set to the best matching option automatically. Optional. The default is False. + * colorRgbFormat: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accessRole": "my_accessRole", + * // "backgroundColor": "my_backgroundColor", + * // "colorId": "my_colorId", + * // "conferenceProperties": {}, + * // "defaultReminders": [], + * // "deleted": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "foregroundColor": "my_foregroundColor", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "notificationSettings": {}, + * // "primary": false, + * // "selected": false, + * // "summary": "my_summary", + * // "summaryOverride": "my_summaryOverride", + * // "timeZone": "my_timeZone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accessRole": "my_accessRole", + * // "backgroundColor": "my_backgroundColor", + * // "colorId": "my_colorId", + * // "conferenceProperties": {}, + * // "defaultReminders": [], + * // "deleted": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "foregroundColor": "my_foregroundColor", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "notificationSettings": {}, + * // "primary": false, + * // "selected": false, + * // "summary": "my_summary", + * // "summaryOverride": "my_summaryOverride", + * // "timeZone": "my_timeZone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.calendarList.update * @memberOf! () * @@ -2078,6 +2887,89 @@ export namespace calendar_v3 { /** * calendar.calendarList.watch * @desc Watch for changes to CalendarList resources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.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 calendar.calendarList.watch({ + * // Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional. + * maxResults: 'placeholder-value', + * // The minimum access role for the user in the returned entries. Optional. The default is no restriction. + * minAccessRole: 'placeholder-value', + * // Token specifying which result page to return. Optional. + * pageToken: 'placeholder-value', + * // Whether to include deleted calendar list entries in the result. Optional. The default is False. + * showDeleted: 'placeholder-value', + * // Whether to show hidden entries. Optional. The default is False. + * showHidden: 'placeholder-value', + * // Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. If only read-only fields such as calendar properties or ACLs have changed, the entry won't be returned. All entries deleted and hidden since the previous list request will always be in the result set and it is not allowed to set showDeleted neither showHidden to False. + * // To ensure client state consistency minAccessRole query parameter cannot be specified together with nextSyncToken. + * // If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. + * // Learn more about incremental synchronization. + * // Optional. The default is to return all entries. + * syncToken: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.calendarList.watch * @memberOf! () * @@ -2315,6 +3207,41 @@ export namespace calendar_v3 { /** * calendar.calendars.clear * @desc Clears a primary calendar. This operation deletes all events associated with the primary calendar of an account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar'], + * }); + * + * // 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 calendar.calendars.clear({ + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.calendars.clear * @memberOf! () * @@ -2385,6 +3312,41 @@ export namespace calendar_v3 { /** * calendar.calendars.delete * @desc Deletes a secondary calendar. Use calendars.clear for clearing all events on primary calendars. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar'], + * }); + * + * // 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 calendar.calendars.delete({ + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.calendars.delete * @memberOf! () * @@ -2456,6 +3418,56 @@ export namespace calendar_v3 { /** * calendar.calendars.get * @desc Returns metadata for a calendar. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.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 calendar.calendars.get({ + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "conferenceProperties": {}, + * // "description": "my_description", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "summary": "my_summary", + * // "timeZone": "my_timeZone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.calendars.get * @memberOf! () * @@ -2527,6 +3539,65 @@ export namespace calendar_v3 { /** * calendar.calendars.insert * @desc Creates a secondary calendar. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar'], + * }); + * + * // 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 calendar.calendars.insert({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "conferenceProperties": {}, + * // "description": "my_description", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "summary": "my_summary", + * // "timeZone": "my_timeZone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "conferenceProperties": {}, + * // "description": "my_description", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "summary": "my_summary", + * // "timeZone": "my_timeZone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.calendars.insert * @memberOf! () * @@ -2598,6 +3669,68 @@ export namespace calendar_v3 { /** * calendar.calendars.patch * @desc Updates metadata for a calendar. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar'], + * }); + * + * // 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 calendar.calendars.patch({ + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "conferenceProperties": {}, + * // "description": "my_description", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "summary": "my_summary", + * // "timeZone": "my_timeZone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "conferenceProperties": {}, + * // "description": "my_description", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "summary": "my_summary", + * // "timeZone": "my_timeZone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.calendars.patch * @memberOf! () * @@ -2670,6 +3803,68 @@ export namespace calendar_v3 { /** * calendar.calendars.update * @desc Updates metadata for a calendar. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar'], + * }); + * + * // 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 calendar.calendars.update({ + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "conferenceProperties": {}, + * // "description": "my_description", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "summary": "my_summary", + * // "timeZone": "my_timeZone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "conferenceProperties": {}, + * // "description": "my_description", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "summary": "my_summary", + * // "timeZone": "my_timeZone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.calendars.update * @memberOf! () * @@ -2826,6 +4021,61 @@ export namespace calendar_v3 { /** * calendar.channels.stop * @desc Stop watching resources through this channel + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.events', + * 'https://www.googleapis.com/auth/calendar.events.readonly', + * 'https://www.googleapis.com/auth/calendar.readonly', + * 'https://www.googleapis.com/auth/calendar.settings.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 calendar.channels.stop({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.channels.stop * @memberOf! () * @@ -2916,6 +4166,49 @@ export namespace calendar_v3 { /** * calendar.colors.get * @desc Returns the color definitions for calendars and events. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.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 calendar.colors.get({}); + * console.log(res.data); + * + * // Example response + * // { + * // "calendar": {}, + * // "event": {}, + * // "kind": "my_kind", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.colors.get * @memberOf! () * @@ -3000,6 +4293,52 @@ export namespace calendar_v3 { /** * calendar.events.delete * @desc Deletes an event. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.events', + * ], + * }); + * + * // 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 calendar.events.delete({ + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * // Event identifier. + * eventId: 'placeholder-value', + * // Deprecated. Please use sendUpdates instead. + * // + * // Whether to send notifications about the deletion of the event. Note that some emails might still be sent even if you set the value to false. The default is false. + * sendNotifications: 'placeholder-value', + * // Guests who should receive notifications about the deletion of the event. + * sendUpdates: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.events.delete * @memberOf! () * @@ -3073,6 +4412,96 @@ export namespace calendar_v3 { /** * calendar.events.get * @desc Returns an event. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.events', + * 'https://www.googleapis.com/auth/calendar.events.readonly', + * 'https://www.googleapis.com/auth/calendar.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 calendar.events.get({ + * // Deprecated and ignored. A value will always be returned in the email field for the organizer, creator and attendees, even if no real email address is available (i.e. a generated, non-working value will be provided). + * alwaysIncludeEmail: 'placeholder-value', + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * // Event identifier. + * eventId: 'placeholder-value', + * // The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. + * maxAttendees: 'placeholder-value', + * // Time zone used in the response. Optional. The default is the time zone of the calendar. + * timeZone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "anyoneCanAddSelf": false, + * // "attachments": [], + * // "attendees": [], + * // "attendeesOmitted": false, + * // "colorId": "my_colorId", + * // "conferenceData": {}, + * // "created": "my_created", + * // "creator": {}, + * // "description": "my_description", + * // "end": {}, + * // "endTimeUnspecified": false, + * // "etag": "my_etag", + * // "extendedProperties": {}, + * // "gadget": {}, + * // "guestsCanInviteOthers": false, + * // "guestsCanModify": false, + * // "guestsCanSeeOtherGuests": false, + * // "hangoutLink": "my_hangoutLink", + * // "htmlLink": "my_htmlLink", + * // "iCalUID": "my_iCalUID", + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "locked": false, + * // "organizer": {}, + * // "originalStartTime": {}, + * // "privateCopy": false, + * // "recurrence": [], + * // "recurringEventId": "my_recurringEventId", + * // "reminders": {}, + * // "sequence": 0, + * // "source": {}, + * // "start": {}, + * // "status": "my_status", + * // "summary": "my_summary", + * // "transparency": "my_transparency", + * // "updated": "my_updated", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.events.get * @memberOf! () * @@ -3147,6 +4576,135 @@ export namespace calendar_v3 { /** * calendar.events.import * @desc Imports an event. This operation is used to add a private copy of an existing event to a calendar. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.events', + * ], + * }); + * + * // 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 calendar.events.import({ + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * // Version number of conference data supported by the API client. Version 0 assumes no conference data support and ignores conference data in the event's body. Version 1 enables support for copying of ConferenceData as well as for creating new conferences using the createRequest field of conferenceData. The default is 0. + * conferenceDataVersion: 'placeholder-value', + * // Whether API client performing operation supports event attachments. Optional. The default is False. + * supportsAttachments: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "anyoneCanAddSelf": false, + * // "attachments": [], + * // "attendees": [], + * // "attendeesOmitted": false, + * // "colorId": "my_colorId", + * // "conferenceData": {}, + * // "created": "my_created", + * // "creator": {}, + * // "description": "my_description", + * // "end": {}, + * // "endTimeUnspecified": false, + * // "etag": "my_etag", + * // "extendedProperties": {}, + * // "gadget": {}, + * // "guestsCanInviteOthers": false, + * // "guestsCanModify": false, + * // "guestsCanSeeOtherGuests": false, + * // "hangoutLink": "my_hangoutLink", + * // "htmlLink": "my_htmlLink", + * // "iCalUID": "my_iCalUID", + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "locked": false, + * // "organizer": {}, + * // "originalStartTime": {}, + * // "privateCopy": false, + * // "recurrence": [], + * // "recurringEventId": "my_recurringEventId", + * // "reminders": {}, + * // "sequence": 0, + * // "source": {}, + * // "start": {}, + * // "status": "my_status", + * // "summary": "my_summary", + * // "transparency": "my_transparency", + * // "updated": "my_updated", + * // "visibility": "my_visibility" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "anyoneCanAddSelf": false, + * // "attachments": [], + * // "attendees": [], + * // "attendeesOmitted": false, + * // "colorId": "my_colorId", + * // "conferenceData": {}, + * // "created": "my_created", + * // "creator": {}, + * // "description": "my_description", + * // "end": {}, + * // "endTimeUnspecified": false, + * // "etag": "my_etag", + * // "extendedProperties": {}, + * // "gadget": {}, + * // "guestsCanInviteOthers": false, + * // "guestsCanModify": false, + * // "guestsCanSeeOtherGuests": false, + * // "hangoutLink": "my_hangoutLink", + * // "htmlLink": "my_htmlLink", + * // "iCalUID": "my_iCalUID", + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "locked": false, + * // "organizer": {}, + * // "originalStartTime": {}, + * // "privateCopy": false, + * // "recurrence": [], + * // "recurringEventId": "my_recurringEventId", + * // "reminders": {}, + * // "sequence": 0, + * // "source": {}, + * // "start": {}, + * // "status": "my_status", + * // "summary": "my_summary", + * // "transparency": "my_transparency", + * // "updated": "my_updated", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.events.import * @memberOf! () * @@ -3220,6 +4778,143 @@ export namespace calendar_v3 { /** * calendar.events.insert * @desc Creates an event. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.events', + * ], + * }); + * + * // 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 calendar.events.insert({ + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * // Version number of conference data supported by the API client. Version 0 assumes no conference data support and ignores conference data in the event's body. Version 1 enables support for copying of ConferenceData as well as for creating new conferences using the createRequest field of conferenceData. The default is 0. + * conferenceDataVersion: 'placeholder-value', + * // The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. + * maxAttendees: 'placeholder-value', + * // Deprecated. Please use sendUpdates instead. + * // + * // Whether to send notifications about the creation of the new event. Note that some emails might still be sent even if you set the value to false. The default is false. + * sendNotifications: 'placeholder-value', + * // Whether to send notifications about the creation of the new event. Note that some emails might still be sent. The default is false. + * sendUpdates: 'placeholder-value', + * // Whether API client performing operation supports event attachments. Optional. The default is False. + * supportsAttachments: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "anyoneCanAddSelf": false, + * // "attachments": [], + * // "attendees": [], + * // "attendeesOmitted": false, + * // "colorId": "my_colorId", + * // "conferenceData": {}, + * // "created": "my_created", + * // "creator": {}, + * // "description": "my_description", + * // "end": {}, + * // "endTimeUnspecified": false, + * // "etag": "my_etag", + * // "extendedProperties": {}, + * // "gadget": {}, + * // "guestsCanInviteOthers": false, + * // "guestsCanModify": false, + * // "guestsCanSeeOtherGuests": false, + * // "hangoutLink": "my_hangoutLink", + * // "htmlLink": "my_htmlLink", + * // "iCalUID": "my_iCalUID", + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "locked": false, + * // "organizer": {}, + * // "originalStartTime": {}, + * // "privateCopy": false, + * // "recurrence": [], + * // "recurringEventId": "my_recurringEventId", + * // "reminders": {}, + * // "sequence": 0, + * // "source": {}, + * // "start": {}, + * // "status": "my_status", + * // "summary": "my_summary", + * // "transparency": "my_transparency", + * // "updated": "my_updated", + * // "visibility": "my_visibility" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "anyoneCanAddSelf": false, + * // "attachments": [], + * // "attendees": [], + * // "attendeesOmitted": false, + * // "colorId": "my_colorId", + * // "conferenceData": {}, + * // "created": "my_created", + * // "creator": {}, + * // "description": "my_description", + * // "end": {}, + * // "endTimeUnspecified": false, + * // "etag": "my_etag", + * // "extendedProperties": {}, + * // "gadget": {}, + * // "guestsCanInviteOthers": false, + * // "guestsCanModify": false, + * // "guestsCanSeeOtherGuests": false, + * // "hangoutLink": "my_hangoutLink", + * // "htmlLink": "my_htmlLink", + * // "iCalUID": "my_iCalUID", + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "locked": false, + * // "organizer": {}, + * // "originalStartTime": {}, + * // "privateCopy": false, + * // "recurrence": [], + * // "recurringEventId": "my_recurringEventId", + * // "reminders": {}, + * // "sequence": 0, + * // "source": {}, + * // "start": {}, + * // "status": "my_status", + * // "summary": "my_summary", + * // "transparency": "my_transparency", + * // "updated": "my_updated", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.events.insert * @memberOf! () * @@ -3296,6 +4991,81 @@ export namespace calendar_v3 { /** * calendar.events.instances * @desc Returns instances of the specified recurring event. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.events', + * 'https://www.googleapis.com/auth/calendar.events.readonly', + * 'https://www.googleapis.com/auth/calendar.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 calendar.events.instances({ + * // Deprecated and ignored. A value will always be returned in the email field for the organizer, creator and attendees, even if no real email address is available (i.e. a generated, non-working value will be provided). + * alwaysIncludeEmail: 'placeholder-value', + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * // Recurring event identifier. + * eventId: 'placeholder-value', + * // The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. + * maxAttendees: 'placeholder-value', + * // Maximum number of events returned on one result page. By default the value is 250 events. The page size can never be larger than 2500 events. Optional. + * maxResults: 'placeholder-value', + * // The original start time of the instance in the result. Optional. + * originalStart: 'placeholder-value', + * // Token specifying which result page to return. Optional. + * pageToken: 'placeholder-value', + * // Whether to include deleted events (with status equals "cancelled") in the result. Cancelled instances of recurring events will still be included if singleEvents is False. Optional. The default is False. + * showDeleted: 'placeholder-value', + * // Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset. + * timeMax: 'placeholder-value', + * // Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset. + * timeMin: 'placeholder-value', + * // Time zone used in the response. Optional. The default is the time zone of the calendar. + * timeZone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accessRole": "my_accessRole", + * // "defaultReminders": [], + * // "description": "my_description", + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "nextSyncToken": "my_nextSyncToken", + * // "summary": "my_summary", + * // "timeZone": "my_timeZone", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.events.instances * @memberOf! () * @@ -3377,6 +5147,108 @@ export namespace calendar_v3 { /** * calendar.events.list * @desc Returns events on the specified calendar. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.events', + * 'https://www.googleapis.com/auth/calendar.events.readonly', + * 'https://www.googleapis.com/auth/calendar.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 calendar.events.list({ + * // Deprecated and ignored. A value will always be returned in the email field for the organizer, creator and attendees, even if no real email address is available (i.e. a generated, non-working value will be provided). + * alwaysIncludeEmail: 'placeholder-value', + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * // Specifies event ID in the iCalendar format to be included in the response. Optional. + * iCalUID: 'placeholder-value', + * // The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. + * maxAttendees: 'placeholder-value', + * // Maximum number of events returned on one result page. The number of events in the resulting page may be less than this value, or none at all, even if there are more events matching the query. Incomplete pages can be detected by a non-empty nextPageToken field in the response. By default the value is 250 events. The page size can never be larger than 2500 events. Optional. + * maxResults: 'placeholder-value', + * // The order of the events returned in the result. Optional. The default is an unspecified, stable order. + * orderBy: 'placeholder-value', + * // Token specifying which result page to return. Optional. + * pageToken: 'placeholder-value', + * // Extended properties constraint specified as propertyName=value. Matches only private properties. This parameter might be repeated multiple times to return events that match all given constraints. + * privateExtendedProperty: 'placeholder-value', + * // Free text search terms to find events that match these terms in any field, except for extended properties. Optional. + * q: 'placeholder-value', + * // Extended properties constraint specified as propertyName=value. Matches only shared properties. This parameter might be repeated multiple times to return events that match all given constraints. + * sharedExtendedProperty: 'placeholder-value', + * // Whether to include deleted events (with status equals "cancelled") in the result. Cancelled instances of recurring events (but not the underlying recurring event) will still be included if showDeleted and singleEvents are both False. If showDeleted and singleEvents are both True, only single instances of deleted events (but not the underlying recurring events) are returned. Optional. The default is False. + * showDeleted: 'placeholder-value', + * // Whether to include hidden invitations in the result. Optional. The default is False. + * showHiddenInvitations: 'placeholder-value', + * // Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves. Optional. The default is False. + * singleEvents: 'placeholder-value', + * // Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All events deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False. + * // There are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state. + * // + * // These are: + * // - iCalUID + * // - orderBy + * // - privateExtendedProperty + * // - q + * // - sharedExtendedProperty + * // - timeMin + * // - timeMax + * // - updatedMin If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. + * // Learn more about incremental synchronization. + * // Optional. The default is to return all entries. + * syncToken: 'placeholder-value', + * // Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, for example, 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but are ignored. If timeMin is set, timeMax must be greater than timeMin. + * timeMax: 'placeholder-value', + * // Lower bound (exclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset, for example, 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but are ignored. If timeMax is set, timeMin must be smaller than timeMax. + * timeMin: 'placeholder-value', + * // Time zone used in the response. Optional. The default is the time zone of the calendar. + * timeZone: 'placeholder-value', + * // Lower bound for an event's last modification time (as a RFC3339 timestamp) to filter by. When specified, entries deleted since this time will always be included regardless of showDeleted. Optional. The default is not to filter by last modification time. + * updatedMin: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accessRole": "my_accessRole", + * // "defaultReminders": [], + * // "description": "my_description", + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "nextSyncToken": "my_nextSyncToken", + * // "summary": "my_summary", + * // "timeZone": "my_timeZone", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.events.list * @memberOf! () * @@ -3464,6 +5336,96 @@ export namespace calendar_v3 { /** * calendar.events.move * @desc Moves an event to another calendar, i.e. changes an event's organizer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.events', + * ], + * }); + * + * // 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 calendar.events.move({ + * // Calendar identifier of the source calendar where the event currently is on. + * calendarId: 'placeholder-value', + * // Calendar identifier of the target calendar where the event is to be moved to. + * destination: 'placeholder-value', + * // Event identifier. + * eventId: 'placeholder-value', + * // Deprecated. Please use sendUpdates instead. + * // + * // Whether to send notifications about the change of the event's organizer. Note that some emails might still be sent even if you set the value to false. The default is false. + * sendNotifications: 'placeholder-value', + * // Guests who should receive notifications about the change of the event's organizer. + * sendUpdates: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "anyoneCanAddSelf": false, + * // "attachments": [], + * // "attendees": [], + * // "attendeesOmitted": false, + * // "colorId": "my_colorId", + * // "conferenceData": {}, + * // "created": "my_created", + * // "creator": {}, + * // "description": "my_description", + * // "end": {}, + * // "endTimeUnspecified": false, + * // "etag": "my_etag", + * // "extendedProperties": {}, + * // "gadget": {}, + * // "guestsCanInviteOthers": false, + * // "guestsCanModify": false, + * // "guestsCanSeeOtherGuests": false, + * // "hangoutLink": "my_hangoutLink", + * // "htmlLink": "my_htmlLink", + * // "iCalUID": "my_iCalUID", + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "locked": false, + * // "organizer": {}, + * // "originalStartTime": {}, + * // "privateCopy": false, + * // "recurrence": [], + * // "recurringEventId": "my_recurringEventId", + * // "reminders": {}, + * // "sequence": 0, + * // "source": {}, + * // "start": {}, + * // "status": "my_status", + * // "summary": "my_summary", + * // "transparency": "my_transparency", + * // "updated": "my_updated", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.events.move * @memberOf! () * @@ -3539,6 +5501,147 @@ export namespace calendar_v3 { /** * calendar.events.patch * @desc Updates an event. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.events', + * ], + * }); + * + * // 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 calendar.events.patch({ + * // Deprecated and ignored. A value will always be returned in the email field for the organizer, creator and attendees, even if no real email address is available (i.e. a generated, non-working value will be provided). + * alwaysIncludeEmail: 'placeholder-value', + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * // Version number of conference data supported by the API client. Version 0 assumes no conference data support and ignores conference data in the event's body. Version 1 enables support for copying of ConferenceData as well as for creating new conferences using the createRequest field of conferenceData. The default is 0. + * conferenceDataVersion: 'placeholder-value', + * // Event identifier. + * eventId: 'placeholder-value', + * // The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. + * maxAttendees: 'placeholder-value', + * // Deprecated. Please use sendUpdates instead. + * // + * // Whether to send notifications about the event update (for example, description changes, etc.). Note that some emails might still be sent even if you set the value to false. The default is false. + * sendNotifications: 'placeholder-value', + * // Guests who should receive notifications about the event update (for example, title changes, etc.). + * sendUpdates: 'placeholder-value', + * // Whether API client performing operation supports event attachments. Optional. The default is False. + * supportsAttachments: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "anyoneCanAddSelf": false, + * // "attachments": [], + * // "attendees": [], + * // "attendeesOmitted": false, + * // "colorId": "my_colorId", + * // "conferenceData": {}, + * // "created": "my_created", + * // "creator": {}, + * // "description": "my_description", + * // "end": {}, + * // "endTimeUnspecified": false, + * // "etag": "my_etag", + * // "extendedProperties": {}, + * // "gadget": {}, + * // "guestsCanInviteOthers": false, + * // "guestsCanModify": false, + * // "guestsCanSeeOtherGuests": false, + * // "hangoutLink": "my_hangoutLink", + * // "htmlLink": "my_htmlLink", + * // "iCalUID": "my_iCalUID", + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "locked": false, + * // "organizer": {}, + * // "originalStartTime": {}, + * // "privateCopy": false, + * // "recurrence": [], + * // "recurringEventId": "my_recurringEventId", + * // "reminders": {}, + * // "sequence": 0, + * // "source": {}, + * // "start": {}, + * // "status": "my_status", + * // "summary": "my_summary", + * // "transparency": "my_transparency", + * // "updated": "my_updated", + * // "visibility": "my_visibility" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "anyoneCanAddSelf": false, + * // "attachments": [], + * // "attendees": [], + * // "attendeesOmitted": false, + * // "colorId": "my_colorId", + * // "conferenceData": {}, + * // "created": "my_created", + * // "creator": {}, + * // "description": "my_description", + * // "end": {}, + * // "endTimeUnspecified": false, + * // "etag": "my_etag", + * // "extendedProperties": {}, + * // "gadget": {}, + * // "guestsCanInviteOthers": false, + * // "guestsCanModify": false, + * // "guestsCanSeeOtherGuests": false, + * // "hangoutLink": "my_hangoutLink", + * // "htmlLink": "my_htmlLink", + * // "iCalUID": "my_iCalUID", + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "locked": false, + * // "organizer": {}, + * // "originalStartTime": {}, + * // "privateCopy": false, + * // "recurrence": [], + * // "recurringEventId": "my_recurringEventId", + * // "reminders": {}, + * // "sequence": 0, + * // "source": {}, + * // "start": {}, + * // "status": "my_status", + * // "summary": "my_summary", + * // "transparency": "my_transparency", + * // "updated": "my_updated", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.events.patch * @memberOf! () * @@ -3617,6 +5720,94 @@ export namespace calendar_v3 { /** * calendar.events.quickAdd * @desc Creates an event based on a simple text string. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.events', + * ], + * }); + * + * // 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 calendar.events.quickAdd({ + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * // Deprecated. Please use sendUpdates instead. + * // + * // Whether to send notifications about the creation of the event. Note that some emails might still be sent even if you set the value to false. The default is false. + * sendNotifications: 'placeholder-value', + * // Guests who should receive notifications about the creation of the new event. + * sendUpdates: 'placeholder-value', + * // The text describing the event to be created. + * text: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "anyoneCanAddSelf": false, + * // "attachments": [], + * // "attendees": [], + * // "attendeesOmitted": false, + * // "colorId": "my_colorId", + * // "conferenceData": {}, + * // "created": "my_created", + * // "creator": {}, + * // "description": "my_description", + * // "end": {}, + * // "endTimeUnspecified": false, + * // "etag": "my_etag", + * // "extendedProperties": {}, + * // "gadget": {}, + * // "guestsCanInviteOthers": false, + * // "guestsCanModify": false, + * // "guestsCanSeeOtherGuests": false, + * // "hangoutLink": "my_hangoutLink", + * // "htmlLink": "my_htmlLink", + * // "iCalUID": "my_iCalUID", + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "locked": false, + * // "organizer": {}, + * // "originalStartTime": {}, + * // "privateCopy": false, + * // "recurrence": [], + * // "recurringEventId": "my_recurringEventId", + * // "reminders": {}, + * // "sequence": 0, + * // "source": {}, + * // "start": {}, + * // "status": "my_status", + * // "summary": "my_summary", + * // "transparency": "my_transparency", + * // "updated": "my_updated", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.events.quickAdd * @memberOf! () * @@ -3690,6 +5881,147 @@ export namespace calendar_v3 { /** * calendar.events.update * @desc Updates an event. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.events', + * ], + * }); + * + * // 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 calendar.events.update({ + * // Deprecated and ignored. A value will always be returned in the email field for the organizer, creator and attendees, even if no real email address is available (i.e. a generated, non-working value will be provided). + * alwaysIncludeEmail: 'placeholder-value', + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * // Version number of conference data supported by the API client. Version 0 assumes no conference data support and ignores conference data in the event's body. Version 1 enables support for copying of ConferenceData as well as for creating new conferences using the createRequest field of conferenceData. The default is 0. + * conferenceDataVersion: 'placeholder-value', + * // Event identifier. + * eventId: 'placeholder-value', + * // The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. + * maxAttendees: 'placeholder-value', + * // Deprecated. Please use sendUpdates instead. + * // + * // Whether to send notifications about the event update (for example, description changes, etc.). Note that some emails might still be sent even if you set the value to false. The default is false. + * sendNotifications: 'placeholder-value', + * // Guests who should receive notifications about the event update (for example, title changes, etc.). + * sendUpdates: 'placeholder-value', + * // Whether API client performing operation supports event attachments. Optional. The default is False. + * supportsAttachments: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "anyoneCanAddSelf": false, + * // "attachments": [], + * // "attendees": [], + * // "attendeesOmitted": false, + * // "colorId": "my_colorId", + * // "conferenceData": {}, + * // "created": "my_created", + * // "creator": {}, + * // "description": "my_description", + * // "end": {}, + * // "endTimeUnspecified": false, + * // "etag": "my_etag", + * // "extendedProperties": {}, + * // "gadget": {}, + * // "guestsCanInviteOthers": false, + * // "guestsCanModify": false, + * // "guestsCanSeeOtherGuests": false, + * // "hangoutLink": "my_hangoutLink", + * // "htmlLink": "my_htmlLink", + * // "iCalUID": "my_iCalUID", + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "locked": false, + * // "organizer": {}, + * // "originalStartTime": {}, + * // "privateCopy": false, + * // "recurrence": [], + * // "recurringEventId": "my_recurringEventId", + * // "reminders": {}, + * // "sequence": 0, + * // "source": {}, + * // "start": {}, + * // "status": "my_status", + * // "summary": "my_summary", + * // "transparency": "my_transparency", + * // "updated": "my_updated", + * // "visibility": "my_visibility" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "anyoneCanAddSelf": false, + * // "attachments": [], + * // "attendees": [], + * // "attendeesOmitted": false, + * // "colorId": "my_colorId", + * // "conferenceData": {}, + * // "created": "my_created", + * // "creator": {}, + * // "description": "my_description", + * // "end": {}, + * // "endTimeUnspecified": false, + * // "etag": "my_etag", + * // "extendedProperties": {}, + * // "gadget": {}, + * // "guestsCanInviteOthers": false, + * // "guestsCanModify": false, + * // "guestsCanSeeOtherGuests": false, + * // "hangoutLink": "my_hangoutLink", + * // "htmlLink": "my_htmlLink", + * // "iCalUID": "my_iCalUID", + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": "my_location", + * // "locked": false, + * // "organizer": {}, + * // "originalStartTime": {}, + * // "privateCopy": false, + * // "recurrence": [], + * // "recurringEventId": "my_recurringEventId", + * // "reminders": {}, + * // "sequence": 0, + * // "source": {}, + * // "start": {}, + * // "status": "my_status", + * // "summary": "my_summary", + * // "transparency": "my_transparency", + * // "updated": "my_updated", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.events.update * @memberOf! () * @@ -3768,6 +6100,124 @@ export namespace calendar_v3 { /** * calendar.events.watch * @desc Watch for changes to Events resources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.events', + * 'https://www.googleapis.com/auth/calendar.events.readonly', + * 'https://www.googleapis.com/auth/calendar.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 calendar.events.watch({ + * // Deprecated and ignored. A value will always be returned in the email field for the organizer, creator and attendees, even if no real email address is available (i.e. a generated, non-working value will be provided). + * alwaysIncludeEmail: 'placeholder-value', + * // Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * calendarId: 'placeholder-value', + * // Specifies event ID in the iCalendar format to be included in the response. Optional. + * iCalUID: 'placeholder-value', + * // The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. + * maxAttendees: 'placeholder-value', + * // Maximum number of events returned on one result page. The number of events in the resulting page may be less than this value, or none at all, even if there are more events matching the query. Incomplete pages can be detected by a non-empty nextPageToken field in the response. By default the value is 250 events. The page size can never be larger than 2500 events. Optional. + * maxResults: 'placeholder-value', + * // The order of the events returned in the result. Optional. The default is an unspecified, stable order. + * orderBy: 'placeholder-value', + * // Token specifying which result page to return. Optional. + * pageToken: 'placeholder-value', + * // Extended properties constraint specified as propertyName=value. Matches only private properties. This parameter might be repeated multiple times to return events that match all given constraints. + * privateExtendedProperty: 'placeholder-value', + * // Free text search terms to find events that match these terms in any field, except for extended properties. Optional. + * q: 'placeholder-value', + * // Extended properties constraint specified as propertyName=value. Matches only shared properties. This parameter might be repeated multiple times to return events that match all given constraints. + * sharedExtendedProperty: 'placeholder-value', + * // Whether to include deleted events (with status equals "cancelled") in the result. Cancelled instances of recurring events (but not the underlying recurring event) will still be included if showDeleted and singleEvents are both False. If showDeleted and singleEvents are both True, only single instances of deleted events (but not the underlying recurring events) are returned. Optional. The default is False. + * showDeleted: 'placeholder-value', + * // Whether to include hidden invitations in the result. Optional. The default is False. + * showHiddenInvitations: 'placeholder-value', + * // Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves. Optional. The default is False. + * singleEvents: 'placeholder-value', + * // Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All events deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False. + * // There are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state. + * // + * // These are: + * // - iCalUID + * // - orderBy + * // - privateExtendedProperty + * // - q + * // - sharedExtendedProperty + * // - timeMin + * // - timeMax + * // - updatedMin If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. + * // Learn more about incremental synchronization. + * // Optional. The default is to return all entries. + * syncToken: 'placeholder-value', + * // Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, for example, 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but are ignored. If timeMin is set, timeMax must be greater than timeMin. + * timeMax: 'placeholder-value', + * // Lower bound (exclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset, for example, 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but are ignored. If timeMax is set, timeMin must be smaller than timeMax. + * timeMin: 'placeholder-value', + * // Time zone used in the response. Optional. The default is the time zone of the calendar. + * timeZone: 'placeholder-value', + * // Lower bound for an event's last modification time (as a RFC3339 timestamp) to filter by. When specified, entries deleted since this time will always be included regardless of showDeleted. Optional. The default is not to filter by last modification time. + * updatedMin: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.events.watch * @memberOf! () * @@ -4326,6 +6776,63 @@ export namespace calendar_v3 { /** * calendar.freebusy.query * @desc Returns free/busy information for a set of calendars. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.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 calendar.freebusy.query({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "calendarExpansionMax": 0, + * // "groupExpansionMax": 0, + * // "items": [], + * // "timeMax": "my_timeMax", + * // "timeMin": "my_timeMin", + * // "timeZone": "my_timeZone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "calendars": {}, + * // "groups": {}, + * // "kind": "my_kind", + * // "timeMax": "my_timeMax", + * // "timeMin": "my_timeMin" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.freebusy.query * @memberOf! () * @@ -4418,6 +6925,53 @@ export namespace calendar_v3 { /** * calendar.settings.get * @desc Returns a single user setting. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.readonly', + * 'https://www.googleapis.com/auth/calendar.settings.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 calendar.settings.get({ + * // The id of the user setting. + * setting: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "value": "my_value" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.settings.get * @memberOf! () * @@ -4489,6 +7043,61 @@ export namespace calendar_v3 { /** * calendar.settings.list * @desc Returns all user settings for the authenticated user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.readonly', + * 'https://www.googleapis.com/auth/calendar.settings.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 calendar.settings.list({ + * // Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional. + * maxResults: 'placeholder-value', + * // Token specifying which result page to return. Optional. + * pageToken: 'placeholder-value', + * // Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. + * // If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. + * // Learn more about incremental synchronization. + * // Optional. The default is to return all entries. + * syncToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "nextSyncToken": "my_nextSyncToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.settings.list * @memberOf! () * @@ -4562,6 +7171,83 @@ export namespace calendar_v3 { /** * calendar.settings.watch * @desc Watch for changes to Settings resources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/calendar.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 calendar = google.calendar('v3'); + * + * 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/calendar', + * 'https://www.googleapis.com/auth/calendar.readonly', + * 'https://www.googleapis.com/auth/calendar.settings.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 calendar.settings.watch({ + * // Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional. + * maxResults: 'placeholder-value', + * // Token specifying which result page to return. Optional. + * pageToken: 'placeholder-value', + * // Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. + * // If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. + * // Learn more about incremental synchronization. + * // Optional. The default is to return all entries. + * syncToken: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias calendar.settings.watch * @memberOf! () * diff --git a/src/apis/chat/v1.ts b/src/apis/chat/v1.ts index 700fa27dbd0..9b67049a962 100644 --- a/src/apis/chat/v1.ts +++ b/src/apis/chat/v1.ts @@ -601,6 +601,50 @@ export namespace chat_v1 { /** * chat.spaces.get * @desc Returns a space. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/chat.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 chat = google.chat('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: [], + * }); + * + * // 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 chat.spaces.get({ + * // Required. Resource name of the space, in the form "spaces/x". + * // + * // Example: spaces/AAAAMpdlehY + * name: 'spaces/my-space', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias chat.spaces.get * @memberOf! () * @@ -669,6 +713,51 @@ export namespace chat_v1 { /** * chat.spaces.list * @desc Lists spaces the caller is a member of. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/chat.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 chat = google.chat('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: [], + * }); + * + * // 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 chat.spaces.list({ + * // Requested page size. The value is capped at 1000. + * // Server may return fewer results than requested. + * // If unspecified, server will default to 100. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "spaces": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias chat.spaces.list * @memberOf! () * @@ -774,6 +863,52 @@ export namespace chat_v1 { /** * chat.spaces.members.get * @desc Returns a membership. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/chat.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 chat = google.chat('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: [], + * }); + * + * // 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 chat.spaces.members.get({ + * // Required. Resource name of the membership to be retrieved, in the form + * // "spaces/x/members/x". + * // + * // Example: spaces/AAAAMpdlehY/members/105115627578887013105 + * name: 'spaces/my-space/members/my-member', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "member": {}, + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias chat.spaces.members.get * @memberOf! () * @@ -845,6 +980,56 @@ export namespace chat_v1 { /** * chat.spaces.members.list * @desc Lists human memberships in a space. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/chat.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 chat = google.chat('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: [], + * }); + * + * // 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 chat.spaces.members.list({ + * // Requested page size. The value is capped at 1000. + * // Server may return fewer results than requested. + * // If unspecified, server will default to 100. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * pageToken: 'placeholder-value', + * // Required. The resource name of the space for which membership list is to be + * // fetched, in the form "spaces/x". + * // + * // Example: spaces/AAAAMpdlehY + * parent: 'spaces/my-space', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "memberships": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias chat.spaces.members.list * @memberOf! () * @@ -963,6 +1148,87 @@ export namespace chat_v1 { /** * chat.spaces.messages.create * @desc Creates a message. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/chat.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 chat = google.chat('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: [], + * }); + * + * // 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 chat.spaces.messages.create({ + * // Required. Space resource name, in the form "spaces/x". + * // Example: spaces/AAAAMpdlehY + * parent: 'spaces/my-space', + * // Opaque thread identifier string that can be specified to group messages + * // into a single thread. If this is the first message with a given thread + * // identifier, a new thread is created. Subsequent messages with the same + * // thread identifier will be posted into the same thread. This relieves bots + * // and webhooks from having to store the Hangouts Chat thread ID of a thread (created earlier by them) to post + * // further updates to it. + * // + * // Has no effect if thread field, + * // corresponding to an existing thread, is set in message. + * threadKey: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "actionResponse": {}, + * // "annotations": [], + * // "argumentText": "my_argumentText", + * // "cards": [], + * // "createTime": "my_createTime", + * // "fallbackText": "my_fallbackText", + * // "name": "my_name", + * // "previewText": "my_previewText", + * // "sender": {}, + * // "space": {}, + * // "text": "my_text", + * // "thread": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "actionResponse": {}, + * // "annotations": [], + * // "argumentText": "my_argumentText", + * // "cards": [], + * // "createTime": "my_createTime", + * // "fallbackText": "my_fallbackText", + * // "name": "my_name", + * // "previewText": "my_previewText", + * // "sender": {}, + * // "space": {}, + * // "text": "my_text", + * // "thread": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias chat.spaces.messages.create * @memberOf! () * @@ -1037,6 +1303,47 @@ export namespace chat_v1 { /** * chat.spaces.messages.delete * @desc Deletes a message. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/chat.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 chat = google.chat('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: [], + * }); + * + * // 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 chat.spaces.messages.delete({ + * // Required. Resource name of the message to be deleted, in the form + * // "spaces/x/messages/x" + * // + * // Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 + * name: 'spaces/my-space/messages/my-message', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias chat.spaces.messages.delete * @memberOf! () * @@ -1106,6 +1413,60 @@ export namespace chat_v1 { /** * chat.spaces.messages.get * @desc Returns a message. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/chat.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 chat = google.chat('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: [], + * }); + * + * // 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 chat.spaces.messages.get({ + * // Required. Resource name of the message to be retrieved, in the form + * // "spaces/x/messages/x". + * // + * // Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 + * name: 'spaces/my-space/messages/my-message', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "actionResponse": {}, + * // "annotations": [], + * // "argumentText": "my_argumentText", + * // "cards": [], + * // "createTime": "my_createTime", + * // "fallbackText": "my_fallbackText", + * // "name": "my_name", + * // "previewText": "my_previewText", + * // "sender": {}, + * // "space": {}, + * // "text": "my_text", + * // "thread": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias chat.spaces.messages.get * @memberOf! () * @@ -1175,6 +1536,85 @@ export namespace chat_v1 { /** * chat.spaces.messages.update * @desc Updates a message. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/chat.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 chat = google.chat('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: [], + * }); + * + * // 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 chat.spaces.messages.update({ + * // Resource name, in the form "spaces/x/messages/x". + * // + * // Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 + * name: 'spaces/my-space/messages/my-message', + * // Required. The field paths to be updated, comma separated if there are + * // multiple. + * // + * // Currently supported field paths: + * // * text + * // * cards + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "actionResponse": {}, + * // "annotations": [], + * // "argumentText": "my_argumentText", + * // "cards": [], + * // "createTime": "my_createTime", + * // "fallbackText": "my_fallbackText", + * // "name": "my_name", + * // "previewText": "my_previewText", + * // "sender": {}, + * // "space": {}, + * // "text": "my_text", + * // "thread": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "actionResponse": {}, + * // "annotations": [], + * // "argumentText": "my_argumentText", + * // "cards": [], + * // "createTime": "my_createTime", + * // "fallbackText": "my_fallbackText", + * // "name": "my_name", + * // "previewText": "my_previewText", + * // "sender": {}, + * // "space": {}, + * // "text": "my_text", + * // "thread": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias chat.spaces.messages.update * @memberOf! () * diff --git a/src/apis/civicinfo/v2.ts b/src/apis/civicinfo/v2.ts index 244471b110e..8e085a0b5da 100644 --- a/src/apis/civicinfo/v2.ts +++ b/src/apis/civicinfo/v2.ts @@ -854,6 +854,55 @@ export namespace civicinfo_v2 { /** * civicinfo.divisions.search * @desc Searches for political divisions by their natural name or OCD ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/civicinfo.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 civicinfo = google.civicinfo('v2'); + * + * 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: [], + * }); + * + * // 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 civicinfo.divisions.search({ + * // The search query. Queries can cover any parts of a OCD ID or a human readable division name. All words given in the query are treated as required patterns. In addition to that, most query operators of the Apache Lucene library are supported. See http://lucene.apache.org/core/2_9_4/queryparsersyntax.html + * query: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contextParams": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "results": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias civicinfo.divisions.search * @memberOf! () * @@ -954,6 +1003,52 @@ export namespace civicinfo_v2 { /** * civicinfo.elections.electionQuery * @desc List of available elections to query. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/civicinfo.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 civicinfo = google.civicinfo('v2'); + * + * 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: [], + * }); + * + * // 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 civicinfo.elections.electionQuery({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contextParams": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "elections": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias civicinfo.elections.electionQuery * @memberOf! () * @@ -1032,6 +1127,72 @@ export namespace civicinfo_v2 { /** * civicinfo.elections.voterInfoQuery * @desc Looks up information relevant to a voter based on the voter's registered address. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/civicinfo.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 civicinfo = google.civicinfo('v2'); + * + * 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: [], + * }); + * + * // 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 civicinfo.elections.voterInfoQuery({ + * // The registered address of the voter to look up. + * address: 'placeholder-value', + * // The unique ID of the election to look up. A list of election IDs can be obtained at https://www.googleapis.com/civicinfo/{version}/electionsIf no election ID is specified in the query and there is more than one election with data for the given voter, the additional elections are provided in the otherElections response field. + * electionId: 'placeholder-value', + * // If set to true, only data from official state sources will be returned. + * officialOnly: 'placeholder-value', + * // If set to true, the query will return the success codeand include any partial information when it is unable to determine a matching address or unable to determine the election for electionId=0 queries. + * returnAllAvailableData: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contextParams": {}, + * // "voterInfoSegmentResult": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contests": [], + * // "dropOffLocations": [], + * // "earlyVoteSites": [], + * // "election": {}, + * // "kind": "my_kind", + * // "mailOnly": false, + * // "normalizedInput": {}, + * // "otherElections": [], + * // "pollingLocations": [], + * // "precinctId": "my_precinctId", + * // "segments": [], + * // "state": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias civicinfo.elections.voterInfoQuery * @memberOf! () * @@ -1161,6 +1322,64 @@ export namespace civicinfo_v2 { /** * civicinfo.representatives.representativeInfoByAddress * @desc Looks up political geography and representative information for a single address. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/civicinfo.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 civicinfo = google.civicinfo('v2'); + * + * 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: [], + * }); + * + * // 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 civicinfo.representatives.representativeInfoByAddress({ + * // The address to look up. May only be specified if the field ocdId is not given in the URL. + * address: 'placeholder-value', + * // Whether to return information about offices and officials. If false, only the top-level district information will be returned. + * includeOffices: 'placeholder-value', + * // A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don't contain a matching office will not be returned. + * levels: 'placeholder-value', + * // A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will not be returned. + * roles: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contextParams": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "divisions": {}, + * // "kind": "my_kind", + * // "normalizedInput": {}, + * // "offices": [], + * // "officials": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias civicinfo.representatives.representativeInfoByAddress * @memberOf! () * @@ -1246,6 +1465,62 @@ export namespace civicinfo_v2 { /** * civicinfo.representatives.representativeInfoByDivision * @desc Looks up representative information for a single geographic division. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/civicinfo.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 civicinfo = google.civicinfo('v2'); + * + * 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: [], + * }); + * + * // 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 civicinfo.representatives.representativeInfoByDivision({ + * // A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don't contain a matching office will not be returned. + * levels: 'placeholder-value', + * // The Open Civic Data division identifier of the division to look up. + * ocdId: 'placeholder-value', + * // If true, information about all divisions contained in the division requested will be included as well. For example, if querying ocd-division/country:us/district:dc, this would also return all DC's wards and ANCs. + * recursive: 'placeholder-value', + * // A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will not be returned. + * roles: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contextParams": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "divisions": {}, + * // "offices": [], + * // "officials": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias civicinfo.representatives.representativeInfoByDivision * @memberOf! () * diff --git a/src/apis/classroom/v1.ts b/src/apis/classroom/v1.ts index 3eb8995bb37..35b3d2dd756 100644 --- a/src/apis/classroom/v1.ts +++ b/src/apis/classroom/v1.ts @@ -1232,6 +1232,85 @@ export namespace classroom_v1 { /** * classroom.courses.create * @desc Creates a course. The user specified in `ownerId` is the owner of the created course and added as a teacher. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create courses or for access errors. * `NOT_FOUND` if the primary teacher is not a valid user. * `FAILED_PRECONDITION` if the course owner's account is disabled or for the following request errors: * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if an alias was specified in the `id` and already exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.courses'], + * }); + * + * // 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 classroom.courses.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternateLink": "my_alternateLink", + * // "calendarId": "my_calendarId", + * // "courseGroupEmail": "my_courseGroupEmail", + * // "courseMaterialSets": [], + * // "courseState": "my_courseState", + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "descriptionHeading": "my_descriptionHeading", + * // "enrollmentCode": "my_enrollmentCode", + * // "guardiansEnabled": false, + * // "id": "my_id", + * // "name": "my_name", + * // "ownerId": "my_ownerId", + * // "room": "my_room", + * // "section": "my_section", + * // "teacherFolder": {}, + * // "teacherGroupEmail": "my_teacherGroupEmail", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "calendarId": "my_calendarId", + * // "courseGroupEmail": "my_courseGroupEmail", + * // "courseMaterialSets": [], + * // "courseState": "my_courseState", + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "descriptionHeading": "my_descriptionHeading", + * // "enrollmentCode": "my_enrollmentCode", + * // "guardiansEnabled": false, + * // "id": "my_id", + * // "name": "my_name", + * // "ownerId": "my_ownerId", + * // "room": "my_room", + * // "section": "my_section", + * // "teacherFolder": {}, + * // "teacherGroupEmail": "my_teacherGroupEmail", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.create * @memberOf! () * @@ -1300,6 +1379,46 @@ export namespace classroom_v1 { /** * classroom.courses.delete * @desc Deletes a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.courses'], + * }); + * + * // 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 classroom.courses.delete({ + * // Identifier of the course to delete. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * id: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.delete * @memberOf! () * @@ -1368,6 +1487,68 @@ export namespace classroom_v1 { /** * classroom.courses.get * @desc Returns a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.courses', + * 'https://www.googleapis.com/auth/classroom.courses.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 classroom.courses.get({ + * // Identifier of the course to return. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * id: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "calendarId": "my_calendarId", + * // "courseGroupEmail": "my_courseGroupEmail", + * // "courseMaterialSets": [], + * // "courseState": "my_courseState", + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "descriptionHeading": "my_descriptionHeading", + * // "enrollmentCode": "my_enrollmentCode", + * // "guardiansEnabled": false, + * // "id": "my_id", + * // "name": "my_name", + * // "ownerId": "my_ownerId", + * // "room": "my_room", + * // "section": "my_section", + * // "teacherFolder": {}, + * // "teacherGroupEmail": "my_teacherGroupEmail", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.get * @memberOf! () * @@ -1436,6 +1617,78 @@ export namespace classroom_v1 { /** * classroom.courses.list * @desc Returns a list of courses that the requesting user is permitted to view, restricted to those that match the request. Returned courses are ordered by creation time, with the most recently created coming first. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the query argument is malformed. * `NOT_FOUND` if any users specified in the query arguments do not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.courses', + * 'https://www.googleapis.com/auth/classroom.courses.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 classroom.courses.list({ + * // Restricts returned courses to those in one of the specified states + * // The default value is ACTIVE, ARCHIVED, PROVISIONED, DECLINED. + * courseStates: 'placeholder-value', + * // Maximum number of items to return. Zero or unspecified indicates that the + * // server may assign a maximum. + * // + * // The server may return fewer than the specified number of results. + * pageSize: 'placeholder-value', + * // nextPageToken + * // value returned from a previous + * // list call, + * // indicating that the subsequent page of results should be returned. + * // + * // The list request must be + * // otherwise identical to the one that resulted in this token. + * pageToken: 'placeholder-value', + * // Restricts returned courses to those having a student with the specified + * // identifier. The identifier can be one of the following: + * // + * // * the numeric identifier for the user + * // * the email address of the user + * // * the string literal `"me"`, indicating the requesting user + * studentId: 'placeholder-value', + * // Restricts returned courses to those having a teacher with the specified + * // identifier. The identifier can be one of the following: + * // + * // * the numeric identifier for the user + * // * the email address of the user + * // * the string literal `"me"`, indicating the requesting user + * teacherId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "courses": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.list * @memberOf! () * @@ -1510,6 +1763,110 @@ export namespace classroom_v1 { /** * classroom.courses.patch * @desc Updates one or more fields in a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to modify the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID. * `INVALID_ARGUMENT` if invalid fields are specified in the update mask or if no update mask is supplied. * `FAILED_PRECONDITION` for the following request errors: * CourseNotModifiable + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.courses'], + * }); + * + * // 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 classroom.courses.patch({ + * // Identifier of the course to update. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * id: 'placeholder-value', + * // Mask that identifies which fields on the course to update. + * // This field is required to do an update. The update will fail if invalid + * // fields are specified. The following fields are valid: + * // + * // * `name` + * // * `section` + * // * `descriptionHeading` + * // * `description` + * // * `room` + * // * `courseState` + * // * `ownerId` + * // + * // Note: patches to ownerId are treated as being effective immediately, but in + * // practice it may take some time for the ownership transfer of all affected + * // resources to complete. + * // + * // When set in a query parameter, this field should be specified as + * // + * // `updateMask=,,...` + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternateLink": "my_alternateLink", + * // "calendarId": "my_calendarId", + * // "courseGroupEmail": "my_courseGroupEmail", + * // "courseMaterialSets": [], + * // "courseState": "my_courseState", + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "descriptionHeading": "my_descriptionHeading", + * // "enrollmentCode": "my_enrollmentCode", + * // "guardiansEnabled": false, + * // "id": "my_id", + * // "name": "my_name", + * // "ownerId": "my_ownerId", + * // "room": "my_room", + * // "section": "my_section", + * // "teacherFolder": {}, + * // "teacherGroupEmail": "my_teacherGroupEmail", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "calendarId": "my_calendarId", + * // "courseGroupEmail": "my_courseGroupEmail", + * // "courseMaterialSets": [], + * // "courseState": "my_courseState", + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "descriptionHeading": "my_descriptionHeading", + * // "enrollmentCode": "my_enrollmentCode", + * // "guardiansEnabled": false, + * // "id": "my_id", + * // "name": "my_name", + * // "ownerId": "my_ownerId", + * // "room": "my_room", + * // "section": "my_section", + * // "teacherFolder": {}, + * // "teacherGroupEmail": "my_teacherGroupEmail", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.patch * @memberOf! () * @@ -1580,6 +1937,90 @@ export namespace classroom_v1 { /** * classroom.courses.update * @desc Updates a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to modify the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID. * `FAILED_PRECONDITION` for the following request errors: * CourseNotModifiable + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.courses'], + * }); + * + * // 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 classroom.courses.update({ + * // Identifier of the course to update. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * id: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternateLink": "my_alternateLink", + * // "calendarId": "my_calendarId", + * // "courseGroupEmail": "my_courseGroupEmail", + * // "courseMaterialSets": [], + * // "courseState": "my_courseState", + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "descriptionHeading": "my_descriptionHeading", + * // "enrollmentCode": "my_enrollmentCode", + * // "guardiansEnabled": false, + * // "id": "my_id", + * // "name": "my_name", + * // "ownerId": "my_ownerId", + * // "room": "my_room", + * // "section": "my_section", + * // "teacherFolder": {}, + * // "teacherGroupEmail": "my_teacherGroupEmail", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "calendarId": "my_calendarId", + * // "courseGroupEmail": "my_courseGroupEmail", + * // "courseMaterialSets": [], + * // "courseState": "my_courseState", + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "descriptionHeading": "my_descriptionHeading", + * // "enrollmentCode": "my_enrollmentCode", + * // "guardiansEnabled": false, + * // "id": "my_id", + * // "name": "my_name", + * // "ownerId": "my_ownerId", + * // "room": "my_room", + * // "section": "my_section", + * // "teacherFolder": {}, + * // "teacherGroupEmail": "my_teacherGroupEmail", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.update * @memberOf! () * @@ -1753,6 +2194,56 @@ export namespace classroom_v1 { /** * classroom.courses.aliases.create * @desc Creates an alias for a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create the alias or for access errors. * `NOT_FOUND` if the course does not exist. * `ALREADY_EXISTS` if the alias already exists. * `FAILED_PRECONDITION` if the alias requested does not make sense for the requesting user or course (for example, if a user not in a domain attempts to access a domain-scoped alias). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.courses'], + * }); + * + * // 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 classroom.courses.aliases.create({ + * // Identifier of the course to alias. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alias": "my_alias" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alias": "my_alias" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.aliases.create * @memberOf! () * @@ -1828,6 +2319,49 @@ export namespace classroom_v1 { /** * classroom.courses.aliases.delete * @desc Deletes an alias of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to remove the alias or for access errors. * `NOT_FOUND` if the alias does not exist. * `FAILED_PRECONDITION` if the alias requested does not make sense for the requesting user or course (for example, if a user not in a domain attempts to delete a domain-scoped alias). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.courses'], + * }); + * + * // 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 classroom.courses.aliases.delete({ + * // Alias to delete. + * // This may not be the Classroom-assigned identifier. + * alias: 'placeholder-value', + * // Identifier of the course whose alias should be deleted. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.aliases.delete * @memberOf! () * @@ -1901,6 +2435,65 @@ export namespace classroom_v1 { /** * classroom.courses.aliases.list * @desc Returns a list of aliases for a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the course or for access errors. * `NOT_FOUND` if the course does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.courses', + * 'https://www.googleapis.com/auth/classroom.courses.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 classroom.courses.aliases.list({ + * // The identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Maximum number of items to return. Zero or unspecified indicates that the + * // server may assign a maximum. + * // + * // The server may return fewer than the specified number of results. + * pageSize: 'placeholder-value', + * // nextPageToken + * // value returned from a previous + * // list call, + * // indicating that the subsequent page of results should be returned. + * // + * // The list request + * // must be otherwise identical to the one that resulted in this token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "aliases": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.aliases.list * @memberOf! () * @@ -2045,6 +2638,78 @@ export namespace classroom_v1 { /** * classroom.courses.announcements.create * @desc Creates an announcement. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, create announcements in the requested course, share a Drive attachment, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist. * `FAILED_PRECONDITION` for the following request error: * AttachmentNotVisible + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.announcements'], + * }); + * + * // 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 classroom.courses.announcements.create({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternateLink": "my_alternateLink", + * // "assigneeMode": "my_assigneeMode", + * // "courseId": "my_courseId", + * // "creationTime": "my_creationTime", + * // "creatorUserId": "my_creatorUserId", + * // "id": "my_id", + * // "individualStudentsOptions": {}, + * // "materials": [], + * // "scheduledTime": "my_scheduledTime", + * // "state": "my_state", + * // "text": "my_text", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "assigneeMode": "my_assigneeMode", + * // "courseId": "my_courseId", + * // "creationTime": "my_creationTime", + * // "creatorUserId": "my_creatorUserId", + * // "id": "my_id", + * // "individualStudentsOptions": {}, + * // "materials": [], + * // "scheduledTime": "my_scheduledTime", + * // "state": "my_state", + * // "text": "my_text", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.announcements.create * @memberOf! () * @@ -2120,6 +2785,49 @@ export namespace classroom_v1 { /** * classroom.courses.announcements.delete * @desc Deletes an announcement. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding announcement item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project did not create the corresponding announcement, if the requesting user is not permitted to delete the requested course or for access errors. * `FAILED_PRECONDITION` if the requested announcement has already been deleted. * `NOT_FOUND` if no course exists with the requested ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.announcements'], + * }); + * + * // 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 classroom.courses.announcements.delete({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the announcement to delete. + * // This identifier is a Classroom-assigned identifier. + * id: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.announcements.delete * @memberOf! () * @@ -2192,6 +2900,64 @@ export namespace classroom_v1 { /** * classroom.courses.announcements.get * @desc Returns an announcement. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or announcement, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course or announcement does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.announcements', + * 'https://www.googleapis.com/auth/classroom.announcements.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 classroom.courses.announcements.get({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the announcement. + * id: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "assigneeMode": "my_assigneeMode", + * // "courseId": "my_courseId", + * // "creationTime": "my_creationTime", + * // "creatorUserId": "my_creatorUserId", + * // "id": "my_id", + * // "individualStudentsOptions": {}, + * // "materials": [], + * // "scheduledTime": "my_scheduledTime", + * // "state": "my_state", + * // "text": "my_text", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.announcements.get * @memberOf! () * @@ -2266,6 +3032,74 @@ export namespace classroom_v1 { /** * classroom.courses.announcements.list * @desc Returns a list of announcements that the requester is permitted to view. Course students may only view `PUBLISHED` announcements. Course teachers and domain administrators may view all announcements. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.announcements', + * 'https://www.googleapis.com/auth/classroom.announcements.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 classroom.courses.announcements.list({ + * // Restriction on the `state` of announcements returned. + * // If this argument is left unspecified, the default value is `PUBLISHED`. + * announcementStates: 'placeholder-value', + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Optional sort ordering for results. A comma-separated list of fields with + * // an optional sort direction keyword. Supported field is `updateTime`. + * // Supported direction keywords are `asc` and `desc`. + * // If not specified, `updateTime desc` is the default behavior. + * // Examples: `updateTime asc`, `updateTime` + * orderBy: 'placeholder-value', + * // Maximum number of items to return. Zero or unspecified indicates that the + * // server may assign a maximum. + * // + * // The server may return fewer than the specified number of results. + * pageSize: 'placeholder-value', + * // nextPageToken + * // value returned from a previous + * // list call, + * // indicating that the subsequent page of results should be returned. + * // + * // The list request + * // must be otherwise identical to the one that resulted in this token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "announcements": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.announcements.list * @memberOf! () * @@ -2351,6 +3185,70 @@ export namespace classroom_v1 { /** * classroom.courses.announcements.modifyAssignees * @desc Modifies assignee mode and options of an announcement. Only a teacher of the course that contains the announcement may call this method. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course or course work does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.announcements'], + * }); + * + * // 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 classroom.courses.announcements.modifyAssignees({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the announcement. + * id: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "assigneeMode": "my_assigneeMode", + * // "modifyIndividualStudentsOptions": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "assigneeMode": "my_assigneeMode", + * // "courseId": "my_courseId", + * // "creationTime": "my_creationTime", + * // "creatorUserId": "my_creatorUserId", + * // "id": "my_id", + * // "individualStudentsOptions": {}, + * // "materials": [], + * // "scheduledTime": "my_scheduledTime", + * // "state": "my_state", + * // "text": "my_text", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.announcements.modifyAssignees * @memberOf! () * @@ -2427,6 +3325,94 @@ export namespace classroom_v1 { /** * classroom.courses.announcements.patch * @desc Updates one or more fields of an announcement. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project did not create the corresponding announcement or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `FAILED_PRECONDITION` if the requested announcement has already been deleted. * `NOT_FOUND` if the requested course or announcement does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.announcements'], + * }); + * + * // 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 classroom.courses.announcements.patch({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the announcement. + * id: 'placeholder-value', + * // Mask that identifies which fields on the announcement to update. + * // This field is required to do an update. The update fails if invalid + * // fields are specified. If a field supports empty values, it can be cleared + * // by specifying it in the update mask and not in the Announcement object. If + * // a field that does not support empty values is included in the update mask + * // and not set in the Announcement object, an `INVALID_ARGUMENT` error is + * // returned. + * // + * // The following fields may be specified by teachers: + * // + * // * `text` + * // * `state` + * // * `scheduled_time` + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternateLink": "my_alternateLink", + * // "assigneeMode": "my_assigneeMode", + * // "courseId": "my_courseId", + * // "creationTime": "my_creationTime", + * // "creatorUserId": "my_creatorUserId", + * // "id": "my_id", + * // "individualStudentsOptions": {}, + * // "materials": [], + * // "scheduledTime": "my_scheduledTime", + * // "state": "my_state", + * // "text": "my_text", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "assigneeMode": "my_assigneeMode", + * // "courseId": "my_courseId", + * // "creationTime": "my_creationTime", + * // "creatorUserId": "my_creatorUserId", + * // "id": "my_id", + * // "individualStudentsOptions": {}, + * // "materials": [], + * // "scheduledTime": "my_scheduledTime", + * // "state": "my_state", + * // "text": "my_text", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.announcements.patch * @memberOf! () * @@ -2638,6 +3624,98 @@ export namespace classroom_v1 { /** * classroom.courses.courseWork.create * @desc Creates course work. The resulting course work (and corresponding student submissions) are associated with the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to make the request. Classroom API requests to modify course work and student submissions must be made with an OAuth client ID from the associated Developer Console project. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, create course work in the requested course, share a Drive attachment, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist. * `FAILED_PRECONDITION` for the following request error: * AttachmentNotVisible + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.coursework.students'], + * }); + * + * // 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 classroom.courses.courseWork.create({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternateLink": "my_alternateLink", + * // "assigneeMode": "my_assigneeMode", + * // "assignment": {}, + * // "associatedWithDeveloper": false, + * // "courseId": "my_courseId", + * // "creationTime": "my_creationTime", + * // "creatorUserId": "my_creatorUserId", + * // "description": "my_description", + * // "dueDate": {}, + * // "dueTime": {}, + * // "id": "my_id", + * // "individualStudentsOptions": {}, + * // "materials": [], + * // "maxPoints": {}, + * // "multipleChoiceQuestion": {}, + * // "scheduledTime": "my_scheduledTime", + * // "state": "my_state", + * // "submissionModificationMode": "my_submissionModificationMode", + * // "title": "my_title", + * // "topicId": "my_topicId", + * // "updateTime": "my_updateTime", + * // "workType": "my_workType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "assigneeMode": "my_assigneeMode", + * // "assignment": {}, + * // "associatedWithDeveloper": false, + * // "courseId": "my_courseId", + * // "creationTime": "my_creationTime", + * // "creatorUserId": "my_creatorUserId", + * // "description": "my_description", + * // "dueDate": {}, + * // "dueTime": {}, + * // "id": "my_id", + * // "individualStudentsOptions": {}, + * // "materials": [], + * // "maxPoints": {}, + * // "multipleChoiceQuestion": {}, + * // "scheduledTime": "my_scheduledTime", + * // "state": "my_state", + * // "submissionModificationMode": "my_submissionModificationMode", + * // "title": "my_title", + * // "topicId": "my_topicId", + * // "updateTime": "my_updateTime", + * // "workType": "my_workType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.courseWork.create * @memberOf! () * @@ -2713,6 +3791,49 @@ export namespace classroom_v1 { /** * classroom.courses.courseWork.delete * @desc Deletes a course work. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work, if the requesting user is not permitted to delete the requested course or for access errors. * `FAILED_PRECONDITION` if the requested course work has already been deleted. * `NOT_FOUND` if no course exists with the requested ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.coursework.students'], + * }); + * + * // 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 classroom.courses.courseWork.delete({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the course work to delete. + * // This identifier is a Classroom-assigned identifier. + * id: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.courseWork.delete * @memberOf! () * @@ -2786,6 +3907,76 @@ export namespace classroom_v1 { /** * classroom.courses.courseWork.get * @desc Returns course work. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course or course work does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.coursework.me', + * 'https://www.googleapis.com/auth/classroom.coursework.me.readonly', + * 'https://www.googleapis.com/auth/classroom.coursework.students', + * 'https://www.googleapis.com/auth/classroom.coursework.students.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 classroom.courses.courseWork.get({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the course work. + * id: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "assigneeMode": "my_assigneeMode", + * // "assignment": {}, + * // "associatedWithDeveloper": false, + * // "courseId": "my_courseId", + * // "creationTime": "my_creationTime", + * // "creatorUserId": "my_creatorUserId", + * // "description": "my_description", + * // "dueDate": {}, + * // "dueTime": {}, + * // "id": "my_id", + * // "individualStudentsOptions": {}, + * // "materials": [], + * // "maxPoints": {}, + * // "multipleChoiceQuestion": {}, + * // "scheduledTime": "my_scheduledTime", + * // "state": "my_state", + * // "submissionModificationMode": "my_submissionModificationMode", + * // "title": "my_title", + * // "topicId": "my_topicId", + * // "updateTime": "my_updateTime", + * // "workType": "my_workType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.courseWork.get * @memberOf! () * @@ -2861,6 +4052,77 @@ export namespace classroom_v1 { /** * classroom.courses.courseWork.list * @desc Returns a list of course work that the requester is permitted to view. Course students may only view `PUBLISHED` course work. Course teachers and domain administrators may view all course work. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.coursework.me', + * 'https://www.googleapis.com/auth/classroom.coursework.me.readonly', + * 'https://www.googleapis.com/auth/classroom.coursework.students', + * 'https://www.googleapis.com/auth/classroom.coursework.students.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 classroom.courses.courseWork.list({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Restriction on the work status to return. Only courseWork that matches + * // is returned. If unspecified, items with a work status of `PUBLISHED` + * // is returned. + * courseWorkStates: 'placeholder-value', + * // Optional sort ordering for results. A comma-separated list of fields with + * // an optional sort direction keyword. Supported fields are `updateTime` + * // and `dueDate`. Supported direction keywords are `asc` and `desc`. + * // If not specified, `updateTime desc` is the default behavior. + * // Examples: `dueDate asc,updateTime desc`, `updateTime,dueDate desc` + * orderBy: 'placeholder-value', + * // Maximum number of items to return. Zero or unspecified indicates that the + * // server may assign a maximum. + * // + * // The server may return fewer than the specified number of results. + * pageSize: 'placeholder-value', + * // nextPageToken + * // value returned from a previous + * // list call, + * // indicating that the subsequent page of results should be returned. + * // + * // The list request + * // must be otherwise identical to the one that resulted in this token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "courseWork": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.courseWork.list * @memberOf! () * @@ -2941,6 +4203,80 @@ export namespace classroom_v1 { /** * classroom.courses.courseWork.modifyAssignees * @desc Modifies assignee mode and options of a coursework. Only a teacher of the course that contains the coursework may call this method. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course or course work does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.coursework.students'], + * }); + * + * // 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 classroom.courses.courseWork.modifyAssignees({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the coursework. + * id: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "assigneeMode": "my_assigneeMode", + * // "modifyIndividualStudentsOptions": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "assigneeMode": "my_assigneeMode", + * // "assignment": {}, + * // "associatedWithDeveloper": false, + * // "courseId": "my_courseId", + * // "creationTime": "my_creationTime", + * // "creatorUserId": "my_creatorUserId", + * // "description": "my_description", + * // "dueDate": {}, + * // "dueTime": {}, + * // "id": "my_id", + * // "individualStudentsOptions": {}, + * // "materials": [], + * // "maxPoints": {}, + * // "multipleChoiceQuestion": {}, + * // "scheduledTime": "my_scheduledTime", + * // "state": "my_state", + * // "submissionModificationMode": "my_submissionModificationMode", + * // "title": "my_title", + * // "topicId": "my_topicId", + * // "updateTime": "my_updateTime", + * // "workType": "my_workType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.courseWork.modifyAssignees * @memberOf! () * @@ -3016,6 +4352,120 @@ export namespace classroom_v1 { /** * classroom.courses.courseWork.patch * @desc Updates one or more fields of a course work. See google.classroom.v1.CourseWork for details of which fields may be updated and who may change them. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work, if the user is not permitted to make the requested modification to the student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `FAILED_PRECONDITION` if the requested course work has already been deleted. * `NOT_FOUND` if the requested course, course work, or student submission does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.coursework.students'], + * }); + * + * // 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 classroom.courses.courseWork.patch({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the course work. + * id: 'placeholder-value', + * // Mask that identifies which fields on the course work to update. + * // This field is required to do an update. The update fails if invalid + * // fields are specified. If a field supports empty values, it can be cleared + * // by specifying it in the update mask and not in the CourseWork object. If a + * // field that does not support empty values is included in the update mask and + * // not set in the CourseWork object, an `INVALID_ARGUMENT` error is + * // returned. + * // + * // The following fields may be specified by teachers: + * // + * // * `title` + * // * `description` + * // * `state` + * // * `due_date` + * // * `due_time` + * // * `max_points` + * // * `scheduled_time` + * // * `submission_modification_mode` + * // * `topic_id` + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternateLink": "my_alternateLink", + * // "assigneeMode": "my_assigneeMode", + * // "assignment": {}, + * // "associatedWithDeveloper": false, + * // "courseId": "my_courseId", + * // "creationTime": "my_creationTime", + * // "creatorUserId": "my_creatorUserId", + * // "description": "my_description", + * // "dueDate": {}, + * // "dueTime": {}, + * // "id": "my_id", + * // "individualStudentsOptions": {}, + * // "materials": [], + * // "maxPoints": {}, + * // "multipleChoiceQuestion": {}, + * // "scheduledTime": "my_scheduledTime", + * // "state": "my_state", + * // "submissionModificationMode": "my_submissionModificationMode", + * // "title": "my_title", + * // "topicId": "my_topicId", + * // "updateTime": "my_updateTime", + * // "workType": "my_workType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "assigneeMode": "my_assigneeMode", + * // "assignment": {}, + * // "associatedWithDeveloper": false, + * // "courseId": "my_courseId", + * // "creationTime": "my_creationTime", + * // "creatorUserId": "my_creatorUserId", + * // "description": "my_description", + * // "dueDate": {}, + * // "dueTime": {}, + * // "id": "my_id", + * // "individualStudentsOptions": {}, + * // "materials": [], + * // "maxPoints": {}, + * // "multipleChoiceQuestion": {}, + * // "scheduledTime": "my_scheduledTime", + * // "state": "my_state", + * // "submissionModificationMode": "my_submissionModificationMode", + * // "title": "my_title", + * // "topicId": "my_topicId", + * // "updateTime": "my_updateTime", + * // "workType": "my_workType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.courseWork.patch * @memberOf! () * @@ -3224,6 +4674,75 @@ export namespace classroom_v1 { /** * classroom.courses.courseWork.studentSubmissions.get * @desc Returns a student submission. * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, course work, or student submission or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.coursework.me', + * 'https://www.googleapis.com/auth/classroom.coursework.me.readonly', + * 'https://www.googleapis.com/auth/classroom.coursework.students', + * 'https://www.googleapis.com/auth/classroom.coursework.students.readonly', + * 'https://www.googleapis.com/auth/classroom.student-submissions.me.readonly', + * 'https://www.googleapis.com/auth/classroom.student-submissions.students.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 classroom.courses.courseWork.studentSubmissions.get({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the course work. + * courseWorkId: 'placeholder-value', + * // Identifier of the student submission. + * id: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "assignedGrade": {}, + * // "assignmentSubmission": {}, + * // "associatedWithDeveloper": false, + * // "courseId": "my_courseId", + * // "courseWorkId": "my_courseWorkId", + * // "courseWorkType": "my_courseWorkType", + * // "creationTime": "my_creationTime", + * // "draftGrade": {}, + * // "id": "my_id", + * // "late": false, + * // "multipleChoiceSubmission": {}, + * // "shortAnswerSubmission": {}, + * // "state": "my_state", + * // "submissionHistory": [], + * // "updateTime": "my_updateTime", + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.courseWork.studentSubmissions.get * @memberOf! () * @@ -3300,6 +4819,88 @@ export namespace classroom_v1 { /** * classroom.courses.courseWork.studentSubmissions.list * @desc Returns a list of student submissions that the requester is permitted to view, factoring in the OAuth scopes of the request. `-` may be specified as the `course_work_id` to include student submissions for multiple course work items. Course students may only view their own work. Course teachers and domain administrators may view all student submissions. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.coursework.me', + * 'https://www.googleapis.com/auth/classroom.coursework.me.readonly', + * 'https://www.googleapis.com/auth/classroom.coursework.students', + * 'https://www.googleapis.com/auth/classroom.coursework.students.readonly', + * 'https://www.googleapis.com/auth/classroom.student-submissions.me.readonly', + * 'https://www.googleapis.com/auth/classroom.student-submissions.students.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 classroom.courses.courseWork.studentSubmissions.list({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the student work to request. + * // This may be set to the string literal `"-"` to request student work for + * // all course work in the specified course. + * courseWorkId: 'placeholder-value', + * // Requested lateness value. If specified, returned student submissions are + * // restricted by the requested value. + * // If unspecified, submissions are returned regardless of `late` value. + * late: 'placeholder-value', + * // Maximum number of items to return. Zero or unspecified indicates that the + * // server may assign a maximum. + * // + * // The server may return fewer than the specified number of results. + * pageSize: 'placeholder-value', + * // nextPageToken + * // value returned from a previous + * // list call, + * // indicating that the subsequent page of results should be returned. + * // + * // The list request + * // must be otherwise identical to the one that resulted in this token. + * pageToken: 'placeholder-value', + * // Requested submission states. If specified, returned student submissions + * // match one of the specified submission states. + * states: 'placeholder-value', + * // Optional argument to restrict returned student work to those owned by the + * // student with the specified identifier. The identifier can be one of the + * // following: + * // + * // * the numeric identifier for the user + * // * the email address of the user + * // * the string literal `"me"`, indicating the requesting user + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "studentSubmissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.courseWork.studentSubmissions.list * @memberOf! () * @@ -3389,6 +4990,81 @@ export namespace classroom_v1 { /** * classroom.courses.courseWork.studentSubmissions.modifyAttachments * @desc Modifies attachments of student submission. Attachments may only be added to student submissions belonging to course work objects with a `workType` of `ASSIGNMENT`. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, if the user is not permitted to modify attachments on the requested student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.coursework.me', + * 'https://www.googleapis.com/auth/classroom.coursework.students', + * ], + * }); + * + * // 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 classroom.courses.courseWork.studentSubmissions.modifyAttachments( + * { + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the course work. + * courseWorkId: 'placeholder-value', + * // Identifier of the student submission. + * id: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "addAttachments": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "assignedGrade": {}, + * // "assignmentSubmission": {}, + * // "associatedWithDeveloper": false, + * // "courseId": "my_courseId", + * // "courseWorkId": "my_courseWorkId", + * // "courseWorkType": "my_courseWorkType", + * // "creationTime": "my_creationTime", + * // "draftGrade": {}, + * // "id": "my_id", + * // "late": false, + * // "multipleChoiceSubmission": {}, + * // "shortAnswerSubmission": {}, + * // "state": "my_state", + * // "submissionHistory": [], + * // "updateTime": "my_updateTime", + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.courseWork.studentSubmissions.modifyAttachments * @memberOf! () * @@ -3468,6 +5144,104 @@ export namespace classroom_v1 { /** * classroom.courses.courseWork.studentSubmissions.patch * @desc Updates one or more fields of a student submission. See google.classroom.v1.StudentSubmission for details of which fields may be updated and who may change them. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work, if the user is not permitted to make the requested modification to the student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.coursework.me', + * 'https://www.googleapis.com/auth/classroom.coursework.students', + * ], + * }); + * + * // 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 classroom.courses.courseWork.studentSubmissions.patch({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the course work. + * courseWorkId: 'placeholder-value', + * // Identifier of the student submission. + * id: 'placeholder-value', + * // Mask that identifies which fields on the student submission to update. + * // This field is required to do an update. The update fails if invalid + * // fields are specified. + * // + * // The following fields may be specified by teachers: + * // + * // * `draft_grade` + * // * `assigned_grade` + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternateLink": "my_alternateLink", + * // "assignedGrade": {}, + * // "assignmentSubmission": {}, + * // "associatedWithDeveloper": false, + * // "courseId": "my_courseId", + * // "courseWorkId": "my_courseWorkId", + * // "courseWorkType": "my_courseWorkType", + * // "creationTime": "my_creationTime", + * // "draftGrade": {}, + * // "id": "my_id", + * // "late": false, + * // "multipleChoiceSubmission": {}, + * // "shortAnswerSubmission": {}, + * // "state": "my_state", + * // "submissionHistory": [], + * // "updateTime": "my_updateTime", + * // "userId": "my_userId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "assignedGrade": {}, + * // "assignmentSubmission": {}, + * // "associatedWithDeveloper": false, + * // "courseId": "my_courseId", + * // "courseWorkId": "my_courseWorkId", + * // "courseWorkType": "my_courseWorkType", + * // "creationTime": "my_creationTime", + * // "draftGrade": {}, + * // "id": "my_id", + * // "late": false, + * // "multipleChoiceSubmission": {}, + * // "shortAnswerSubmission": {}, + * // "state": "my_state", + * // "submissionHistory": [], + * // "updateTime": "my_updateTime", + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.courseWork.studentSubmissions.patch * @memberOf! () * @@ -3546,6 +5320,56 @@ export namespace classroom_v1 { /** * classroom.courses.courseWork.studentSubmissions.reclaim * @desc Reclaims a student submission on behalf of the student that owns it. Reclaiming a student submission transfers ownership of attached Drive files to the student and updates the submission state. Only the student that owns the requested student submission may call this method, and only for a student submission that has been turned in. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, unsubmit the requested student submission, or for access errors. * `FAILED_PRECONDITION` if the student submission has not been turned in. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.coursework.me'], + * }); + * + * // 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 classroom.courses.courseWork.studentSubmissions.reclaim({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the course work. + * courseWorkId: 'placeholder-value', + * // Identifier of the student submission. + * id: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.courseWork.studentSubmissions.reclaim * @memberOf! () * @@ -3621,6 +5445,56 @@ export namespace classroom_v1 { /** * classroom.courses.courseWork.studentSubmissions.return * @desc Returns a student submission. Returning a student submission transfers ownership of attached Drive files to the student and may also update the submission state. Unlike the Classroom application, returning a student submission does not set assignedGrade to the draftGrade value. Only a teacher of the course that contains the requested student submission may call this method. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, return the requested student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.coursework.students'], + * }); + * + * // 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 classroom.courses.courseWork.studentSubmissions.return({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the course work. + * courseWorkId: 'placeholder-value', + * // Identifier of the student submission. + * id: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.courseWork.studentSubmissions.return * @memberOf! () * @@ -3696,6 +5570,56 @@ export namespace classroom_v1 { /** * classroom.courses.courseWork.studentSubmissions.turnIn * @desc Turns in a student submission. Turning in a student submission transfers ownership of attached Drive files to the teacher and may also update the submission state. This may only be called by the student that owns the specified student submission. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, turn in the requested student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.coursework.me'], + * }); + * + * // 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 classroom.courses.courseWork.studentSubmissions.turnIn({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the course work. + * courseWorkId: 'placeholder-value', + * // Identifier of the student submission. + * id: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.courseWork.studentSubmissions.turnIn * @memberOf! () * @@ -3964,6 +5888,71 @@ export namespace classroom_v1 { /** * classroom.courses.students.create * @desc Adds a user as a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create students in this course or for access errors. * `NOT_FOUND` if the requested course ID does not exist. * `FAILED_PRECONDITION` if the requested user's account is disabled, for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if the user is already a student or teacher in the course. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.profile.emails', + * 'https://www.googleapis.com/auth/classroom.profile.photos', + * 'https://www.googleapis.com/auth/classroom.rosters', + * ], + * }); + * + * // 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 classroom.courses.students.create({ + * // Identifier of the course to create the student in. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Enrollment code of the course to create the student in. + * // This code is required if userId + * // corresponds to the requesting user; it may be omitted if the requesting + * // user has administrative permissions to create students for any user. + * enrollmentCode: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "courseId": "my_courseId", + * // "profile": {}, + * // "studentWorkFolder": {}, + * // "userId": "my_userId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "courseId": "my_courseId", + * // "profile": {}, + * // "studentWorkFolder": {}, + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.students.create * @memberOf! () * @@ -4038,6 +6027,53 @@ export namespace classroom_v1 { /** * classroom.courses.students.delete * @desc Deletes a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete students of this course or for access errors. * `NOT_FOUND` if no student of this course has the requested ID or if the course does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.rosters'], + * }); + * + * // 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 classroom.courses.students.delete({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the student to delete. The identifier can be one of the + * // following: + * // + * // * the numeric identifier for the user + * // * the email address of the user + * // * the string literal `"me"`, indicating the requesting user + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.students.delete * @memberOf! () * @@ -4111,6 +6147,63 @@ export namespace classroom_v1 { /** * classroom.courses.students.get * @desc Returns a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view students of this course or for access errors. * `NOT_FOUND` if no student of this course has the requested ID or if the course does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.profile.emails', + * 'https://www.googleapis.com/auth/classroom.profile.photos', + * 'https://www.googleapis.com/auth/classroom.rosters', + * 'https://www.googleapis.com/auth/classroom.rosters.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 classroom.courses.students.get({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the student to return. The identifier can be one of the + * // following: + * // + * // * the numeric identifier for the user + * // * the email address of the user + * // * the string literal `"me"`, indicating the requesting user + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "courseId": "my_courseId", + * // "profile": {}, + * // "studentWorkFolder": {}, + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.students.get * @memberOf! () * @@ -4184,6 +6277,66 @@ export namespace classroom_v1 { /** * classroom.courses.students.list * @desc Returns a list of students of this course that the requester is permitted to view. This method returns the following error codes: * `NOT_FOUND` if the course does not exist. * `PERMISSION_DENIED` for access errors. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.profile.emails', + * 'https://www.googleapis.com/auth/classroom.profile.photos', + * 'https://www.googleapis.com/auth/classroom.rosters', + * 'https://www.googleapis.com/auth/classroom.rosters.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 classroom.courses.students.list({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Maximum number of items to return. Zero means no maximum. + * // + * // The server may return fewer than the specified number of results. + * pageSize: 'placeholder-value', + * // nextPageToken + * // value returned from a previous + * // list call, indicating that + * // the subsequent page of results should be returned. + * // + * // The list request must be + * // otherwise identical to the one that resulted in this token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "students": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.students.list * @memberOf! () * @@ -4343,6 +6496,64 @@ export namespace classroom_v1 { /** * classroom.courses.teachers.create * @desc Creates a teacher of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create teachers in this course or for access errors. * `NOT_FOUND` if the requested course ID does not exist. * `FAILED_PRECONDITION` if the requested user's account is disabled, for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * CourseTeacherLimitReached * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if the user is already a teacher or student in the course. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.profile.emails', + * 'https://www.googleapis.com/auth/classroom.profile.photos', + * 'https://www.googleapis.com/auth/classroom.rosters', + * ], + * }); + * + * // 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 classroom.courses.teachers.create({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "courseId": "my_courseId", + * // "profile": {}, + * // "userId": "my_userId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "courseId": "my_courseId", + * // "profile": {}, + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.teachers.create * @memberOf! () * @@ -4416,6 +6627,53 @@ export namespace classroom_v1 { /** * classroom.courses.teachers.delete * @desc Deletes a teacher of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete teachers of this course or for access errors. * `NOT_FOUND` if no teacher of this course has the requested ID or if the course does not exist. * `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher of this course. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.rosters'], + * }); + * + * // 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 classroom.courses.teachers.delete({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the teacher to delete. The identifier can be one of the + * // following: + * // + * // * the numeric identifier for the user + * // * the email address of the user + * // * the string literal `"me"`, indicating the requesting user + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.teachers.delete * @memberOf! () * @@ -4489,6 +6747,62 @@ export namespace classroom_v1 { /** * classroom.courses.teachers.get * @desc Returns a teacher of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view teachers of this course or for access errors. * `NOT_FOUND` if no teacher of this course has the requested ID or if the course does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.profile.emails', + * 'https://www.googleapis.com/auth/classroom.profile.photos', + * 'https://www.googleapis.com/auth/classroom.rosters', + * 'https://www.googleapis.com/auth/classroom.rosters.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 classroom.courses.teachers.get({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the teacher to return. The identifier can be one of the + * // following: + * // + * // * the numeric identifier for the user + * // * the email address of the user + * // * the string literal `"me"`, indicating the requesting user + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "courseId": "my_courseId", + * // "profile": {}, + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.teachers.get * @memberOf! () * @@ -4562,6 +6876,66 @@ export namespace classroom_v1 { /** * classroom.courses.teachers.list * @desc Returns a list of teachers of this course that the requester is permitted to view. This method returns the following error codes: * `NOT_FOUND` if the course does not exist. * `PERMISSION_DENIED` for access errors. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.profile.emails', + * 'https://www.googleapis.com/auth/classroom.profile.photos', + * 'https://www.googleapis.com/auth/classroom.rosters', + * 'https://www.googleapis.com/auth/classroom.rosters.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 classroom.courses.teachers.list({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Maximum number of items to return. Zero means no maximum. + * // + * // The server may return fewer than the specified number of results. + * pageSize: 'placeholder-value', + * // nextPageToken + * // value returned from a previous + * // list call, indicating that + * // the subsequent page of results should be returned. + * // + * // The list request must be + * // otherwise identical to the one that resulted in this token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "teachers": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.teachers.list * @memberOf! () * @@ -4717,6 +7091,62 @@ export namespace classroom_v1 { /** * classroom.courses.topics.create * @desc Creates a topic. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, create a topic in the requested course, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.topics'], + * }); + * + * // 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 classroom.courses.topics.create({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "courseId": "my_courseId", + * // "name": "my_name", + * // "topicId": "my_topicId", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "courseId": "my_courseId", + * // "name": "my_name", + * // "topicId": "my_topicId", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.topics.create * @memberOf! () * @@ -4790,6 +7220,48 @@ export namespace classroom_v1 { /** * classroom.courses.topics.delete * @desc Deletes a topic. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not allowed to delete the requested topic or for access errors. * `FAILED_PRECONDITION` if the requested topic has already been deleted. * `NOT_FOUND` if no course or topic exists with the requested ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.topics'], + * }); + * + * // 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 classroom.courses.topics.delete({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the topic to delete. + * id: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.topics.delete * @memberOf! () * @@ -4863,6 +7335,54 @@ export namespace classroom_v1 { /** * classroom.courses.topics.get * @desc Returns a topic. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or topic, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course or topic does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.topics', + * 'https://www.googleapis.com/auth/classroom.topics.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 classroom.courses.topics.get({ + * // Identifier of the course. + * courseId: 'placeholder-value', + * // Identifier of the topic. + * id: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "courseId": "my_courseId", + * // "name": "my_name", + * // "topicId": "my_topicId", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.topics.get * @memberOf! () * @@ -4936,6 +7456,65 @@ export namespace classroom_v1 { /** * classroom.courses.topics.list * @desc Returns the list of topics that the requester is permitted to view. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.topics', + * 'https://www.googleapis.com/auth/classroom.topics.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 classroom.courses.topics.list({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Maximum number of items to return. Zero or unspecified indicates that the + * // server may assign a maximum. + * // + * // The server may return fewer than the specified number of results. + * pageSize: 'placeholder-value', + * // nextPageToken + * // value returned from a previous + * // list call, + * // indicating that the subsequent page of results should be returned. + * // + * // The list request + * // must be otherwise identical to the one that resulted in this token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "topic": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.topics.list * @memberOf! () * @@ -5012,6 +7591,76 @@ export namespace classroom_v1 { /** * classroom.courses.topics.patch * @desc Updates one or more fields of a topic. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project did not create the corresponding topic or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course or topic does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.topics'], + * }); + * + * // 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 classroom.courses.topics.patch({ + * // Identifier of the course. + * // This identifier can be either the Classroom-assigned identifier or an + * // alias. + * courseId: 'placeholder-value', + * // Identifier of the topic. + * id: 'placeholder-value', + * // Mask that identifies which fields on the topic to update. + * // This field is required to do an update. The update fails if invalid + * // fields are specified. If a field supports empty values, it can be cleared + * // by specifying it in the update mask and not in the Topic object. If a + * // field that does not support empty values is included in the update mask and + * // not set in the Topic object, an `INVALID_ARGUMENT` error is + * // returned. + * // + * // The following fields may be specified: + * // + * // * `name` + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "courseId": "my_courseId", + * // "name": "my_name", + * // "topicId": "my_topicId", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "courseId": "my_courseId", + * // "name": "my_name", + * // "topicId": "my_topicId", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.courses.topics.patch * @memberOf! () * @@ -5189,6 +7838,44 @@ export namespace classroom_v1 { /** * classroom.invitations.accept * @desc Accepts an invitation, removing it and adding the invited user to the teachers or students (as appropriate) of the specified course. Only the invited user may accept an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to accept the requested invitation or for access errors. * `FAILED_PRECONDITION` for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * CourseTeacherLimitReached * UserGroupsMembershipLimitReached * `NOT_FOUND` if no invitation exists with the requested ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.rosters'], + * }); + * + * // 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 classroom.invitations.accept({ + * // Identifier of the invitation to accept. + * id: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.invitations.accept * @memberOf! () * @@ -5261,6 +7948,57 @@ export namespace classroom_v1 { /** * classroom.invitations.create * @desc Creates an invitation. Only one invitation for a user and course may exist at a time. Delete and re-create an invitation to make changes. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create invitations for this course or for access errors. * `NOT_FOUND` if the course or the user does not exist. * `FAILED_PRECONDITION` if the requested user's account is disabled or if the user already has this role or a role with greater permissions. * `ALREADY_EXISTS` if an invitation for the specified user and course already exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.rosters'], + * }); + * + * // 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 classroom.invitations.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "courseId": "my_courseId", + * // "id": "my_id", + * // "role": "my_role", + * // "userId": "my_userId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "courseId": "my_courseId", + * // "id": "my_id", + * // "role": "my_role", + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.invitations.create * @memberOf! () * @@ -5332,6 +8070,44 @@ export namespace classroom_v1 { /** * classroom.invitations.delete * @desc Deletes an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete the requested invitation or for access errors. * `NOT_FOUND` if no invitation exists with the requested ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.rosters'], + * }); + * + * // 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 classroom.invitations.delete({ + * // Identifier of the invitation to delete. + * id: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.invitations.delete * @memberOf! () * @@ -5404,6 +8180,52 @@ export namespace classroom_v1 { /** * classroom.invitations.get * @desc Returns an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view the requested invitation or for access errors. * `NOT_FOUND` if no invitation exists with the requested ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.rosters', + * 'https://www.googleapis.com/auth/classroom.rosters.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 classroom.invitations.get({ + * // Identifier of the invitation to return. + * id: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "courseId": "my_courseId", + * // "id": "my_id", + * // "role": "my_role", + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.invitations.get * @memberOf! () * @@ -5477,6 +8299,70 @@ export namespace classroom_v1 { /** * classroom.invitations.list * @desc Returns a list of invitations that the requesting user is permitted to view, restricted to those that match the list request. *Note:* At least one of `user_id` or `course_id` must be supplied. Both fields can be supplied. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.rosters', + * 'https://www.googleapis.com/auth/classroom.rosters.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 classroom.invitations.list({ + * // Restricts returned invitations to those for a course with the specified + * // identifier. + * courseId: 'placeholder-value', + * // Maximum number of items to return. Zero means no maximum. + * // + * // The server may return fewer than the specified number of results. + * pageSize: 'placeholder-value', + * // nextPageToken + * // value returned from a previous + * // list call, indicating + * // that the subsequent page of results should be returned. + * // + * // The list request must be + * // otherwise identical to the one that resulted in this token. + * pageToken: 'placeholder-value', + * // Restricts returned invitations to those for a specific user. The identifier + * // can be one of the following: + * // + * // * the numeric identifier for the user + * // * the email address of the user + * // * the string literal `"me"`, indicating the requesting user + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "invitations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.invitations.list * @memberOf! () * @@ -5630,6 +8516,57 @@ export namespace classroom_v1 { /** * classroom.registrations.create * @desc Creates a `Registration`, causing Classroom to start sending notifications from the provided `feed` to the destination provided in `cloudPubSubTopic`. Returns the created `Registration`. Currently, this will be the same as the argument, but with server-assigned fields such as `expiry_time` and `id` filled in. Note that any value specified for the `expiry_time` or `id` fields will be ignored. While Classroom may validate the `cloudPubSubTopic` and return errors on a best effort basis, it is the caller's responsibility to ensure that it exists and that Classroom has permission to publish to it. This method may return the following error codes: * `PERMISSION_DENIED` if: * the authenticated user does not have permission to receive notifications from the requested field; or * the credential provided does not include the appropriate scope for the requested feed. * another access error is encountered. * `INVALID_ARGUMENT` if: * no `cloudPubsubTopic` is specified, or the specified `cloudPubsubTopic` is not valid; or * no `feed` is specified, or the specified `feed` is not valid. * `NOT_FOUND` if: * the specified `feed` cannot be located, or the requesting user does not have permission to determine whether or not it exists; or * the specified `cloudPubsubTopic` cannot be located, or Classroom has not been granted permission to publish to it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.push-notifications'], + * }); + * + * // 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 classroom.registrations.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "cloudPubsubTopic": {}, + * // "expiryTime": "my_expiryTime", + * // "feed": {}, + * // "registrationId": "my_registrationId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cloudPubsubTopic": {}, + * // "expiryTime": "my_expiryTime", + * // "feed": {}, + * // "registrationId": "my_registrationId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.registrations.create * @memberOf! () * @@ -5701,6 +8638,44 @@ export namespace classroom_v1 { /** * classroom.registrations.delete * @desc Deletes a `Registration`, causing Classroom to stop sending notifications for that `Registration`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.push-notifications'], + * }); + * + * // 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 classroom.registrations.delete({ + * // The `registration_id` of the `Registration` to be deleted. + * registrationId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.registrations.delete * @memberOf! () * @@ -5811,6 +8786,61 @@ export namespace classroom_v1 { /** * classroom.userProfiles.get * @desc Returns a user profile. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access this user profile, if no profile exists with the requested ID, or for access errors. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.profile.emails', + * 'https://www.googleapis.com/auth/classroom.profile.photos', + * 'https://www.googleapis.com/auth/classroom.rosters', + * 'https://www.googleapis.com/auth/classroom.rosters.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 classroom.userProfiles.get({ + * // Identifier of the profile to return. The identifier can be one of the + * // following: + * // + * // * the numeric identifier for the user + * // * the email address of the user + * // * the string literal `"me"`, indicating the requesting user + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "emailAddress": "my_emailAddress", + * // "id": "my_id", + * // "name": {}, + * // "permissions": [], + * // "photoUrl": "my_photoUrl", + * // "verifiedTeacher": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.userProfiles.get * @memberOf! () * @@ -5903,6 +8933,64 @@ export namespace classroom_v1 { /** * classroom.userProfiles.guardianInvitations.create * @desc Creates a guardian invitation, and sends an email to the guardian asking them to confirm that they are the student's guardian. Once the guardian accepts the invitation, their `state` will change to `COMPLETED` and they will start receiving guardian notifications. A `Guardian` resource will also be created to represent the active guardian. The request object must have the `student_id` and `invited_email_address` fields set. Failing to set these fields, or setting any other fields in the request, will result in an error. This method returns the following error codes: * `PERMISSION_DENIED` if the current user does not have permission to manage guardians, if the guardian in question has already rejected too many requests for that student, if guardians are not enabled for the domain in question, or for other access errors. * `RESOURCE_EXHAUSTED` if the student or guardian has exceeded the guardian link limit. * `INVALID_ARGUMENT` if the guardian email address is not valid (for example, if it is too long), or if the format of the student ID provided cannot be recognized (it is not an email address, nor a `user_id` from this API). This error will also be returned if read-only fields are set, or if the `state` field is set to to a value other than `PENDING`. * `NOT_FOUND` if the student ID provided is a valid student ID, but Classroom has no record of that student. * `ALREADY_EXISTS` if there is already a pending guardian invitation for the student and `invited_email_address` provided, or if the provided `invited_email_address` matches the Google account of an existing `Guardian` for this user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.guardianlinks.students', + * ], + * }); + * + * // 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 classroom.userProfiles.guardianInvitations.create({ + * // ID of the student (in standard format) + * studentId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTime": "my_creationTime", + * // "invitationId": "my_invitationId", + * // "invitedEmailAddress": "my_invitedEmailAddress", + * // "state": "my_state", + * // "studentId": "my_studentId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "invitationId": "my_invitationId", + * // "invitedEmailAddress": "my_invitedEmailAddress", + * // "state": "my_state", + * // "studentId": "my_studentId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.userProfiles.guardianInvitations.create * @memberOf! () * @@ -5977,6 +9065,55 @@ export namespace classroom_v1 { /** * classroom.userProfiles.guardianInvitations.get * @desc Returns a specific guardian invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view guardian invitations for the student identified by the `student_id`, if guardians are not enabled for the domain in question, or for other access errors. * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`). * `NOT_FOUND` if Classroom cannot find any record of the given student or `invitation_id`. May also be returned if the student exists, but the requesting user does not have access to see that student. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.guardianlinks.students', + * 'https://www.googleapis.com/auth/classroom.guardianlinks.students.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 classroom.userProfiles.guardianInvitations.get({ + * // The `id` field of the `GuardianInvitation` being requested. + * invitationId: 'placeholder-value', + * // The ID of the student whose guardian invitation is being requested. + * studentId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "invitationId": "my_invitationId", + * // "invitedEmailAddress": "my_invitedEmailAddress", + * // "state": "my_state", + * // "studentId": "my_studentId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.userProfiles.guardianInvitations.get * @memberOf! () * @@ -6052,6 +9189,77 @@ export namespace classroom_v1 { /** * classroom.userProfiles.guardianInvitations.list * @desc Returns a list of guardian invitations that the requesting user is permitted to view, filtered by the parameters provided. This method returns the following error codes: * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting user is not permitted to view guardian invitations for that student, if `"-"` is specified as the `student_id` and the user is not a domain administrator, if guardians are not enabled for the domain in question, or for other access errors. * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`). May also be returned if an invalid `page_token` or `state` is provided. * `NOT_FOUND` if a `student_id` is specified, and its format can be recognized, but Classroom has no record of that student. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.guardianlinks.students', + * 'https://www.googleapis.com/auth/classroom.guardianlinks.students.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 classroom.userProfiles.guardianInvitations.list({ + * // If specified, only results with the specified `invited_email_address` + * // are returned. + * invitedEmailAddress: 'placeholder-value', + * // Maximum number of items to return. Zero or unspecified indicates that the + * // server may assign a maximum. + * // + * // The server may return fewer than the specified number of results. + * pageSize: 'placeholder-value', + * // nextPageToken + * // value returned from a previous + * // list + * // call, indicating that the subsequent page of results should be returned. + * // + * // The list + * // request must be otherwise identical to the one that resulted in this token. + * pageToken: 'placeholder-value', + * // If specified, only results with the specified `state` values are + * // returned. Otherwise, results with a `state` of `PENDING` are returned. + * states: 'placeholder-value', + * // The ID of the student whose guardian invitations are to be returned. + * // The identifier can be one of the following: + * // + * // * the numeric identifier for the user + * // * the email address of the user + * // * the string literal `"me"`, indicating the requesting user + * // * the string literal `"-"`, indicating that results should be returned for + * // all students that the requesting user is permitted to view guardian + * // invitations. + * studentId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "guardianInvitations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.userProfiles.guardianInvitations.list * @memberOf! () * @@ -6138,6 +9346,76 @@ export namespace classroom_v1 { /** * classroom.userProfiles.guardianInvitations.patch * @desc Modifies a guardian invitation. Currently, the only valid modification is to change the `state` from `PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the current user does not have permission to manage guardians, if guardians are not enabled for the domain in question or for other access errors. * `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state. * `INVALID_ARGUMENT` if the format of the student ID provided cannot be recognized (it is not an email address, nor a `user_id` from this API), or if the passed `GuardianInvitation` has a `state` other than `COMPLETE`, or if it modifies fields other than `state`. * `NOT_FOUND` if the student ID provided is a valid student ID, but Classroom has no record of that student, or if the `id` field does not refer to a guardian invitation known to Classroom. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.guardianlinks.students', + * ], + * }); + * + * // 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 classroom.userProfiles.guardianInvitations.patch({ + * // The `id` field of the `GuardianInvitation` to be modified. + * invitationId: 'placeholder-value', + * // The ID of the student whose guardian invitation is to be modified. + * studentId: 'placeholder-value', + * // Mask that identifies which fields on the course to update. + * // This field is required to do an update. The update fails if invalid + * // fields are specified. The following fields are valid: + * // + * // * `state` + * // + * // When set in a query parameter, this field should be specified as + * // + * // `updateMask=,,...` + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTime": "my_creationTime", + * // "invitationId": "my_invitationId", + * // "invitedEmailAddress": "my_invitedEmailAddress", + * // "state": "my_state", + * // "studentId": "my_studentId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "invitationId": "my_invitationId", + * // "invitedEmailAddress": "my_invitedEmailAddress", + * // "state": "my_state", + * // "studentId": "my_studentId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.userProfiles.guardianInvitations.patch * @memberOf! () * @@ -6309,6 +9587,52 @@ export namespace classroom_v1 { /** * classroom.userProfiles.guardians.delete * @desc Deletes a guardian. The guardian will no longer receive guardian notifications and the guardian will no longer be accessible via the API. This method returns the following error codes: * `PERMISSION_DENIED` if no user that matches the provided `student_id` is visible to the requesting user, if the requesting user is not permitted to manage guardians for the student identified by the `student_id`, if guardians are not enabled for the domain in question, or for other access errors. * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API). * `NOT_FOUND` if the requesting user is permitted to modify guardians for the requested `student_id`, but no `Guardian` record exists for that student with the provided `guardian_id`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.guardianlinks.students', + * ], + * }); + * + * // 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 classroom.userProfiles.guardians.delete({ + * // The `id` field from a `Guardian`. + * guardianId: 'placeholder-value', + * // The student whose guardian is to be deleted. One of the following: + * // + * // * the numeric identifier for the user + * // * the email address of the user + * // * the string literal `"me"`, indicating the requesting user + * studentId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.userProfiles.guardians.delete * @memberOf! () * @@ -6381,6 +9705,59 @@ export namespace classroom_v1 { /** * classroom.userProfiles.guardians.get * @desc Returns a specific guardian. This method returns the following error codes: * `PERMISSION_DENIED` if no user that matches the provided `student_id` is visible to the requesting user, if the requesting user is not permitted to view guardian information for the student identified by the `student_id`, if guardians are not enabled for the domain in question, or for other access errors. * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`). * `NOT_FOUND` if the requesting user is permitted to view guardians for the requested `student_id`, but no `Guardian` record exists for that student that matches the provided `guardian_id`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.guardianlinks.me.readonly', + * 'https://www.googleapis.com/auth/classroom.guardianlinks.students', + * 'https://www.googleapis.com/auth/classroom.guardianlinks.students.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 classroom.userProfiles.guardians.get({ + * // The `id` field from a `Guardian`. + * guardianId: 'placeholder-value', + * // The student whose guardian is being requested. One of the following: + * // + * // * the numeric identifier for the user + * // * the email address of the user + * // * the string literal `"me"`, indicating the requesting user + * studentId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "guardianId": "my_guardianId", + * // "guardianProfile": {}, + * // "invitedEmailAddress": "my_invitedEmailAddress", + * // "studentId": "my_studentId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.userProfiles.guardians.get * @memberOf! () * @@ -6453,6 +9830,75 @@ export namespace classroom_v1 { /** * classroom.userProfiles.guardians.list * @desc Returns a list of guardians that the requesting user is permitted to view, restricted to those that match the request. To list guardians for any student that the requesting user may view guardians for, use the literal character `-` for the student ID. This method returns the following error codes: * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting user is not permitted to view guardian information for that student, if `"-"` is specified as the `student_id` and the user is not a domain administrator, if guardians are not enabled for the domain in question, if the `invited_email_address` filter is set by a user who is not a domain administrator, or for other access errors. * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`). May also be returned if an invalid `page_token` is provided. * `NOT_FOUND` if a `student_id` is specified, and its format can be recognized, but Classroom has no record of that student. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/classroom.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 classroom = google.classroom('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/classroom.guardianlinks.me.readonly', + * 'https://www.googleapis.com/auth/classroom.guardianlinks.students', + * 'https://www.googleapis.com/auth/classroom.guardianlinks.students.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 classroom.userProfiles.guardians.list({ + * // Filter results by the email address that the original invitation was sent + * // to, resulting in this guardian link. + * // This filter can only be used by domain administrators. + * invitedEmailAddress: 'placeholder-value', + * // Maximum number of items to return. Zero or unspecified indicates that the + * // server may assign a maximum. + * // + * // The server may return fewer than the specified number of results. + * pageSize: 'placeholder-value', + * // nextPageToken + * // value returned from a previous + * // list call, + * // indicating that the subsequent page of results should be returned. + * // + * // The list request + * // must be otherwise identical to the one that resulted in this token. + * pageToken: 'placeholder-value', + * // Filter results by the student who the guardian is linked to. + * // The identifier can be one of the following: + * // + * // * the numeric identifier for the user + * // * the email address of the user + * // * the string literal `"me"`, indicating the requesting user + * // * the string literal `"-"`, indicating that results should be returned for + * // all students that the requesting user has access to view. + * studentId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "guardians": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias classroom.userProfiles.guardians.list * @memberOf! () * diff --git a/src/apis/cloudasset/v1.ts b/src/apis/cloudasset/v1.ts index 728c9a7a8f4..12103135950 100644 --- a/src/apis/cloudasset/v1.ts +++ b/src/apis/cloudasset/v1.ts @@ -778,6 +778,63 @@ export namespace cloudasset_v1 { /** * cloudasset.feeds.create * @desc Creates a feed in a parent project/folder/organization to listen to its asset updates. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudasset.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 cloudasset = google.cloudasset('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/cloud-platform'], + * }); + * + * // 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 cloudasset.feeds.create({ + * // Required. The name of the project/folder/organization where this feed + * // should be created in. It can only be an organization number (such as + * // "organizations/123"), a folder number (such as "folders/123"), a project ID + * // (such as "projects/my-project-id")", or a project number (such as + * // "projects/12345"). + * parent: '[^/]+/[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "feed": {}, + * // "feedId": "my_feedId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assetNames": [], + * // "assetTypes": [], + * // "contentType": "my_contentType", + * // "feedOutputConfig": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudasset.feeds.create * @memberOf! () * @@ -850,6 +907,47 @@ export namespace cloudasset_v1 { /** * cloudasset.feeds.delete * @desc Deletes an asset feed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudasset.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 cloudasset = google.cloudasset('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/cloud-platform'], + * }); + * + * // 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 cloudasset.feeds.delete({ + * // Required. The name of the feed and it must be in the format of: + * // projects/project_number/feeds/feed_id + * // folders/folder_number/feeds/feed_id + * // organizations/organization_number/feeds/feed_id + * name: '[^/]+/[^/]+/feeds/my-feed', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudasset.feeds.delete * @memberOf! () * @@ -918,6 +1016,53 @@ export namespace cloudasset_v1 { /** * cloudasset.feeds.get * @desc Gets details about an asset feed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudasset.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 cloudasset = google.cloudasset('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/cloud-platform'], + * }); + * + * // 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 cloudasset.feeds.get({ + * // Required. The name of the Feed and it must be in the format of: + * // projects/project_number/feeds/feed_id + * // folders/folder_number/feeds/feed_id + * // organizations/organization_number/feeds/feed_id + * name: '[^/]+/[^/]+/feeds/my-feed', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assetNames": [], + * // "assetTypes": [], + * // "contentType": "my_contentType", + * // "feedOutputConfig": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudasset.feeds.get * @memberOf! () * @@ -986,6 +1131,48 @@ export namespace cloudasset_v1 { /** * cloudasset.feeds.list * @desc Lists all asset feeds in a parent project/folder/organization. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudasset.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 cloudasset = google.cloudasset('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/cloud-platform'], + * }); + * + * // 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 cloudasset.feeds.list({ + * // Required. The parent project/folder/organization whose feeds are to be + * // listed. It can only be using project/folder/organization number (such as + * // "folders/12345")", or a project ID (such as "projects/my-project-id"). + * parent: '[^/]+/[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "feeds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudasset.feeds.list * @memberOf! () * @@ -1059,6 +1246,65 @@ export namespace cloudasset_v1 { /** * cloudasset.feeds.patch * @desc Updates an asset feed configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudasset.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 cloudasset = google.cloudasset('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/cloud-platform'], + * }); + * + * // 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 cloudasset.feeds.patch({ + * // Required. The format will be + * // projects/{project_number}/feeds/{client-assigned_feed_identifier} or + * // folders/{folder_number}/feeds/{client-assigned_feed_identifier} or + * // organizations/{organization_number}/feeds/{client-assigned_feed_identifier} + * // + * // The client-assigned feed identifier must be unique within the parent + * // project/folder/organization. + * name: '[^/]+/[^/]+/feeds/my-feed', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "feed": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assetNames": [], + * // "assetTypes": [], + * // "contentType": "my_contentType", + * // "feedOutputConfig": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudasset.feeds.patch * @memberOf! () * @@ -1201,6 +1447,50 @@ export namespace cloudasset_v1 { /** * cloudasset.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudasset.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 cloudasset = google.cloudasset('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/cloud-platform'], + * }); + * + * // 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 cloudasset.operations.get({ + * // The name of the operation resource. + * name: '[^/]+/[^/]+/operations/my-operation/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudasset.operations.get * @memberOf! () * @@ -1290,6 +1580,66 @@ export namespace cloudasset_v1 { /** * cloudasset.batchGetAssetsHistory * @desc Batch gets the update history of assets that overlap a time window. For RESOURCE content, this API outputs history with asset in both non-delete or deleted status. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. If a specified asset does not exist, this API returns an INVALID_ARGUMENT error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudasset.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 cloudasset = google.cloudasset('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/cloud-platform'], + * }); + * + * // 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 cloudasset.batchGetAssetsHistory({ + * // A list of the full names of the assets. For example: + * // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * // See [Resource + * // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * // and [Resource Name + * // Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * // for more info. + * // + * // The request becomes a no-op if the asset name list is empty, and the max + * // size of the asset name list is 100 in one request. + * assetNames: 'placeholder-value', + * // Optional. The content type. + * contentType: 'placeholder-value', + * // Required. The relative name of the root asset. It can only be an + * // organization number (such as "organizations/123"), a project ID (such as + * // "projects/my-project-id")", or a project number (such as "projects/12345"). + * parent: '[^/]+/[^/]+', + * // End time of the time window (inclusive). If not specified, the current + * // timestamp is used instead. + * 'readTimeWindow.endTime': 'placeholder-value', + * // Start time of the time window (exclusive). + * 'readTimeWindow.startTime': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assets": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudasset.batchGetAssetsHistory * @memberOf! () * @@ -1377,6 +1727,64 @@ export namespace cloudasset_v1 { /** * cloudasset.exportAssets * @desc Exports assets with time and resource types to a given Cloud Storage location. The output format is newline-delimited JSON. This API implements the google.longrunning.Operation API allowing you to keep track of the export. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudasset.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 cloudasset = google.cloudasset('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/cloud-platform'], + * }); + * + * // 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 cloudasset.exportAssets({ + * // Required. The relative name of the root asset. This can only be an + * // organization number (such as "organizations/123"), a project ID (such as + * // "projects/my-project-id"), or a project number (such as "projects/12345"), + * // or a folder number (such as "folders/123"). + * parent: '[^/]+/[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "assetTypes": [], + * // "contentType": "my_contentType", + * // "outputConfig": {}, + * // "readTime": "my_readTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudasset.exportAssets * @memberOf! () * diff --git a/src/apis/cloudasset/v1beta1.ts b/src/apis/cloudasset/v1beta1.ts index 34b37051487..4316d89009c 100644 --- a/src/apis/cloudasset/v1beta1.ts +++ b/src/apis/cloudasset/v1beta1.ts @@ -388,6 +388,64 @@ export namespace cloudasset_v1beta1 { /** * cloudasset.folders.exportAssets * @desc Exports assets with time and resource types to a given Cloud Storage location. The output format is newline-delimited JSON. This API implements the google.longrunning.Operation API allowing you to keep track of the export. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudasset.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 cloudasset = google.cloudasset('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudasset.folders.exportAssets({ + * // Required. The relative name of the root asset. This can only be an + * // organization number (such as "organizations/123"), a project ID (such as + * // "projects/my-project-id"), a project number (such as "projects/12345"), or + * // a folder number (such as "folders/123"). + * parent: 'folders/my-folder', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "assetTypes": [], + * // "contentType": "my_contentType", + * // "outputConfig": {}, + * // "readTime": "my_readTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudasset.folders.exportAssets * @memberOf! () * @@ -488,6 +546,50 @@ export namespace cloudasset_v1beta1 { /** * cloudasset.folders.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudasset.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 cloudasset = google.cloudasset('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudasset.folders.operations.get({ + * // The name of the operation resource. + * name: 'folders/my-folder/operations/my-operation/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudasset.folders.operations.get * @memberOf! () * @@ -581,6 +683,64 @@ export namespace cloudasset_v1beta1 { /** * cloudasset.organizations.batchGetAssetsHistory * @desc Batch gets the update history of assets that overlap a time window. For RESOURCE content, this API outputs history with asset in both non-delete or deleted status. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. If a specified asset does not exist, this API returns an INVALID_ARGUMENT error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudasset.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 cloudasset = google.cloudasset('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudasset.organizations.batchGetAssetsHistory({ + * // A list of the full names of the assets. For example: + * // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * // See [Resource + * // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * // for more info. + * // + * // The request becomes a no-op if the asset name list is empty, and the max + * // size of the asset name list is 100 in one request. + * assetNames: 'placeholder-value', + * // Optional. The content type. + * contentType: 'placeholder-value', + * // Required. The relative name of the root asset. It can only be an + * // organization number (such as "organizations/123"), a project ID (such as + * // "projects/my-project-id")", or a project number (such as "projects/12345"). + * parent: 'organizations/my-organization', + * // End time of the time window (inclusive). + * // Current timestamp if not specified. + * 'readTimeWindow.endTime': 'placeholder-value', + * // Start time of the time window (exclusive). + * 'readTimeWindow.startTime': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assets": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudasset.organizations.batchGetAssetsHistory * @memberOf! () * @@ -668,6 +828,64 @@ export namespace cloudasset_v1beta1 { /** * cloudasset.organizations.exportAssets * @desc Exports assets with time and resource types to a given Cloud Storage location. The output format is newline-delimited JSON. This API implements the google.longrunning.Operation API allowing you to keep track of the export. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudasset.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 cloudasset = google.cloudasset('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudasset.organizations.exportAssets({ + * // Required. The relative name of the root asset. This can only be an + * // organization number (such as "organizations/123"), a project ID (such as + * // "projects/my-project-id"), a project number (such as "projects/12345"), or + * // a folder number (such as "folders/123"). + * parent: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "assetTypes": [], + * // "contentType": "my_contentType", + * // "outputConfig": {}, + * // "readTime": "my_readTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudasset.organizations.exportAssets * @memberOf! () * @@ -796,6 +1014,50 @@ export namespace cloudasset_v1beta1 { /** * cloudasset.organizations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudasset.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 cloudasset = google.cloudasset('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudasset.organizations.operations.get({ + * // The name of the operation resource. + * name: 'organizations/my-organization/operations/my-operation/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudasset.organizations.operations.get * @memberOf! () * @@ -889,6 +1151,64 @@ export namespace cloudasset_v1beta1 { /** * cloudasset.projects.batchGetAssetsHistory * @desc Batch gets the update history of assets that overlap a time window. For RESOURCE content, this API outputs history with asset in both non-delete or deleted status. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. If a specified asset does not exist, this API returns an INVALID_ARGUMENT error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudasset.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 cloudasset = google.cloudasset('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudasset.projects.batchGetAssetsHistory({ + * // A list of the full names of the assets. For example: + * // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * // See [Resource + * // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * // for more info. + * // + * // The request becomes a no-op if the asset name list is empty, and the max + * // size of the asset name list is 100 in one request. + * assetNames: 'placeholder-value', + * // Optional. The content type. + * contentType: 'placeholder-value', + * // Required. The relative name of the root asset. It can only be an + * // organization number (such as "organizations/123"), a project ID (such as + * // "projects/my-project-id")", or a project number (such as "projects/12345"). + * parent: 'projects/my-project', + * // End time of the time window (inclusive). + * // Current timestamp if not specified. + * 'readTimeWindow.endTime': 'placeholder-value', + * // Start time of the time window (exclusive). + * 'readTimeWindow.startTime': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assets": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudasset.projects.batchGetAssetsHistory * @memberOf! () * @@ -976,6 +1296,64 @@ export namespace cloudasset_v1beta1 { /** * cloudasset.projects.exportAssets * @desc Exports assets with time and resource types to a given Cloud Storage location. The output format is newline-delimited JSON. This API implements the google.longrunning.Operation API allowing you to keep track of the export. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudasset.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 cloudasset = google.cloudasset('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudasset.projects.exportAssets({ + * // Required. The relative name of the root asset. This can only be an + * // organization number (such as "organizations/123"), a project ID (such as + * // "projects/my-project-id"), a project number (such as "projects/12345"), or + * // a folder number (such as "folders/123"). + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "assetTypes": [], + * // "contentType": "my_contentType", + * // "outputConfig": {}, + * // "readTime": "my_readTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudasset.projects.exportAssets * @memberOf! () * @@ -1104,6 +1482,50 @@ export namespace cloudasset_v1beta1 { /** * cloudasset.projects.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudasset.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 cloudasset = google.cloudasset('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudasset.projects.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/operations/my-operation/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudasset.projects.operations.get * @memberOf! () * diff --git a/src/apis/cloudasset/v1p1beta1.ts b/src/apis/cloudasset/v1p1beta1.ts index a3f85619d61..14023677339 100644 --- a/src/apis/cloudasset/v1p1beta1.ts +++ b/src/apis/cloudasset/v1p1beta1.ts @@ -308,6 +308,67 @@ export namespace cloudasset_v1p1beta1 { /** * cloudasset.iamPolicies.searchAll * @desc Searches all the IAM policies under a given accessible CRM scope (project/folder/organization). This RPC gives callers especially admins the ability to search all the IAM policies under a scope, even if they don't have .getIamPolicy permission of all the IAM policies. Callers should have cloud.assets.SearchAllIamPolicies permission on the requested scope, otherwise it will be rejected. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudasset.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 cloudasset = google.cloudasset('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudasset.iamPolicies.searchAll({ + * // Optional. The page size for search result pagination. Page size is capped at 500 even + * // if a larger value is given. If set to zero, server will pick an appropriate + * // default. Returned results may be fewer than requested. When this happens, + * // there could be more results as long as `next_page_token` is returned. + * pageSize: 'placeholder-value', + * // Optional. If present, retrieve the next batch of results from the preceding call to + * // this method. `page_token` must be the value of `next_page_token` from the + * // previous response. The values of all other method parameters must be + * // identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Optional. The query statement. + * // Examples: + * // * "policy:myuser@mydomain.com" + * // * "policy:(myuser@mydomain.com viewer)" + * query: 'placeholder-value', + * // Required. The relative name of an asset. The search is limited to the resources + * // within the `scope`. The allowed value must be: + * // * Organization number (such as "organizations/123") + * // * Folder number(such as "folders/1234") + * // * Project number (such as "projects/12345") + * // * Project id (such as "projects/abc") + * scope: '[^/]+/[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "results": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudasset.iamPolicies.searchAll * @memberOf! () * @@ -425,6 +486,72 @@ export namespace cloudasset_v1p1beta1 { /** * cloudasset.resources.searchAll * @desc Searches all the resources under a given accessible CRM scope (project/folder/organization). This RPC gives callers especially admins the ability to search all the resources under a scope, even if they don't have .get permission of all the resources. Callers should have cloud.assets.SearchAllResources permission on the requested scope, otherwise it will be rejected. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudasset.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 cloudasset = google.cloudasset('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudasset.resources.searchAll({ + * // Optional. A list of asset types that this request searches for. If empty, it will + * // search all the supported asset types. + * assetTypes: 'placeholder-value', + * // Optional. A comma separated list of fields specifying the sorting order of the + * // results. The default order is ascending. Add " desc" after the field name + * // to indicate descending order. Redundant space characters are ignored. For + * // example, " foo , bar desc ". + * orderBy: 'placeholder-value', + * // Optional. The page size for search result pagination. Page size is capped at 500 even + * // if a larger value is given. If set to zero, server will pick an appropriate + * // default. Returned results may be fewer than requested. When this happens, + * // there could be more results as long as `next_page_token` is returned. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call + * // to this method. `page_token` must be the value of `next_page_token` from + * // the previous response. The values of all other method parameters, must be + * // identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Optional. The query statement. + * query: 'placeholder-value', + * // Required. The relative name of an asset. The search is limited to the resources + * // within the `scope`. The allowed value must be: + * // * Organization number (such as "organizations/123") + * // * Folder number(such as "folders/1234") + * // * Project number (such as "projects/12345") + * // * Project id (such as "projects/abc") + * scope: '[^/]+/[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "results": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudasset.resources.searchAll * @memberOf! () * diff --git a/src/apis/cloudasset/v1p4beta1.ts b/src/apis/cloudasset/v1p4beta1.ts index e746f1c4116..545229a5093 100644 --- a/src/apis/cloudasset/v1p4beta1.ts +++ b/src/apis/cloudasset/v1p4beta1.ts @@ -478,6 +478,134 @@ export namespace cloudasset_v1p4beta1 { /** * cloudasset.analyzeIamPolicy * @desc Analyzes IAM policies based on the specified request. Returns a list of IamPolicyAnalysisResult matching the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudasset.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 cloudasset = google.cloudasset('v1p4beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudasset.analyzeIamPolicy({ + * // Optional. The permissions to appear in result. + * 'analysisQuery.accessSelector.permissions': 'placeholder-value', + * // Optional. The roles to appear in result. + * 'analysisQuery.accessSelector.roles': 'placeholder-value', + * // Required. The identity appear in the form of members in + * // [IAM policy + * // binding](https://cloud.google.com/iam/reference/rest/v1/Binding). + * 'analysisQuery.identitySelector.identity': 'placeholder-value', + * // Required. The [full resource + * // name](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * // . + * 'analysisQuery.resourceSelector.fullResourceName': 'placeholder-value', + * // Optional. If true, the response will include access analysis from identities to + * // resources via service account impersonation. This is a very expensive + * // operation, because many derived queries will be executed. We highly + * // recommend you use ExportIamPolicyAnalysis rpc instead. + * // + * // For example, if the request analyzes for which resources user A has + * // permission P, and there's an IAM policy states user A has + * // iam.serviceAccounts.getAccessToken permission to a service account SA, + * // and there's another IAM policy states service account SA has permission P + * // to a GCP folder F, then user A potentially has access to the GCP folder + * // F. And those advanced analysis results will be included in + * // AnalyzeIamPolicyResponse.service_account_impersonation_analysis. + * // + * // Another example, if the request analyzes for who has + * // permission P to a GCP folder F, and there's an IAM policy states user A + * // has iam.serviceAccounts.actAs permission to a service account SA, and + * // there's another IAM policy states service account SA has permission P to + * // the GCP folder F, then user A potentially has access to the GCP folder + * // F. And those advanced analysis results will be included in + * // AnalyzeIamPolicyResponse.service_account_impersonation_analysis. + * // + * // Default is false. + * 'options.analyzeServiceAccountImpersonation': 'placeholder-value', + * // Optional. Amount of time executable has to complete. See JSON representation of + * // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). + * // + * // If this field is set with a value less than the RPC deadline, and the + * // execution of your query hasn't finished in the specified + * // execution timeout, you will get a response with partial result. + * // Otherwise, your query's execution will continue until the RPC deadline. + * // If it's not finished until then, you will get a DEADLINE_EXCEEDED error. + * // + * // Default is empty. + * 'options.executionTimeout': 'placeholder-value', + * // Optional. If true, the identities section of the result will expand any + * // Google groups appearing in an IAM policy binding. + * // + * // If identity_selector is specified, the identity in the result will + * // be determined by the selector, and this flag will have no effect. + * // + * // Default is false. + * 'options.expandGroups': 'placeholder-value', + * // Optional. If true, the resource section of the result will expand any + * // resource attached to an IAM policy to include resources lower in the + * // resource hierarchy. + * // + * // For example, if the request analyzes for which resources user A has + * // permission P, and the results include an IAM policy with P on a GCP + * // folder, the results will also include resources in that folder with + * // permission P. + * // + * // If resource_selector is specified, the resource section of the result + * // will be determined by the selector, and this flag will have no effect. + * // Default is false. + * 'options.expandResources': 'placeholder-value', + * // Optional. If true, the access section of result will expand any roles + * // appearing in IAM policy bindings to include their permissions. + * // + * // If access_selector is specified, the access section of the result + * // will be determined by the selector, and this flag will have no effect. + * // + * // Default is false. + * 'options.expandRoles': 'placeholder-value', + * // Optional. If true, the result will output group identity edges, starting + * // from the binding's group members, to any expanded identities. + * // Default is false. + * 'options.outputGroupEdges': 'placeholder-value', + * // Optional. If true, the result will output resource edges, starting + * // from the policy attached resource, to any expanded resources. + * // Default is false. + * 'options.outputResourceEdges': 'placeholder-value', + * // Required. The relative name of the root asset. Only resources and IAM policies within + * // the parent will be analyzed. This can only be an organization number (such + * // as "organizations/123") or a folder number (such as "folders/123"). + * parent: '[^/]+/[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "fullyExplored": false, + * // "mainAnalysis": {}, + * // "nonCriticalErrors": [], + * // "serviceAccountImpersonationAnalysis": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudasset.analyzeIamPolicy * @memberOf! () * @@ -567,6 +695,62 @@ export namespace cloudasset_v1p4beta1 { /** * cloudasset.exportIamPolicyAnalysis * @desc Exports IAM policy analysis based on the specified request. This API implements the google.longrunning.Operation API allowing you to keep track of the export. The metadata contains the request to help callers to map responses to requests. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudasset.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 cloudasset = google.cloudasset('v1p4beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudasset.exportIamPolicyAnalysis({ + * // Required. The relative name of the root asset. Only resources and IAM policies within + * // the parent will be analyzed. This can only be an organization number (such + * // as "organizations/123") or a folder number (such as "folders/123"). + * parent: '[^/]+/[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "analysisQuery": {}, + * // "options": {}, + * // "outputConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudasset.exportIamPolicyAnalysis * @memberOf! () * diff --git a/src/apis/cloudbilling/v1.ts b/src/apis/cloudbilling/v1.ts index 2549f6a02da..4c3923990d3 100644 --- a/src/apis/cloudbilling/v1.ts +++ b/src/apis/cloudbilling/v1.ts @@ -514,52 +514,56 @@ export namespace cloudbilling_v1 { * cloudbilling.billingAccounts.create * @desc Creates a billing account. This method can only be used to create [billing subaccounts](https://cloud.google.com/billing/docs/concepts) by GCP resellers. When creating a subaccount, the current authenticated user must have the `billing.accounts.update` IAM permission on the master account, which is typically given to billing account [administrators](https://cloud.google.com/billing/docs/how-to/billing-access). This method will return an error if the master account has not been provisioned as a reseller account. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Billing API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudbilling - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbilling.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'); - * var cloudbilling = google.cloudbilling('v1'); + * const cloudbilling = google.cloudbilling('v1'); * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudbilling.billingAccounts.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * 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/cloud-platform'], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 cloudbilling.billingAccounts.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "masterBillingAccount": "my_masterBillingAccount", + * // "name": "my_name", + * // "open": false + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "masterBillingAccount": "my_masterBillingAccount", + * // "name": "my_name", + * // "open": false + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbilling.billingAccounts.create * @memberOf! () * @@ -635,52 +639,49 @@ export namespace cloudbilling_v1 { * cloudbilling.billingAccounts.get * @desc Gets information about a billing account. The current authenticated user must be a [viewer of the billing account](https://cloud.google.com/billing/docs/how-to/billing-access). * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Billing API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudbilling - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbilling.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'); - * var cloudbilling = google.cloudbilling('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the billing account to retrieve. For example, - * // `billingAccounts/012345-567890-ABCDEF`. - * name: 'billingAccounts/my-billing-account', // TODO: Update placeholder value. + * const cloudbilling = google.cloudbilling('v1'); * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudbilling.billingAccounts.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudbilling.billingAccounts.get({ + * // Required. The resource name of the billing account to retrieve. For example, + * // `billingAccounts/012345-567890-ABCDEF`. + * name: 'billingAccounts/my-billingAccount', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "masterBillingAccount": "my_masterBillingAccount", + * // "name": "my_name", + * // "open": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudbilling.billingAccounts.get * @memberOf! () * @@ -753,52 +754,62 @@ export namespace cloudbilling_v1 { * cloudbilling.billingAccounts.getIamPolicy * @desc Gets the access control policy for a billing account. The caller must have the `billing.accounts.getIamPolicy` permission on the account, which is often given to billing account [viewers](https://cloud.google.com/billing/docs/how-to/billing-access). * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Billing API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudbilling - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbilling.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'); - * var cloudbilling = google.cloudbilling('v1'); + * const cloudbilling = google.cloudbilling('v1'); * - * authorize(function(authClient) { - * var request = { + * 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/cloud-platform'], + * }); + * + * // 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 cloudbilling.billingAccounts.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * // + * // To learn which resources support conditions in their IAM policies, see the + * // [IAM + * // documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * 'options.requestedPolicyVersion': 'placeholder-value', * // REQUIRED: The resource for which the policy is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'billingAccounts/my-billing-account', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudbilling.billingAccounts.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * resource: 'billingAccounts/my-billingAccount', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudbilling.billingAccounts.getIamPolicy * @memberOf! () * @@ -873,61 +884,58 @@ export namespace cloudbilling_v1 { * cloudbilling.billingAccounts.list * @desc Lists the billing accounts that the current authenticated user has permission to [view](https://cloud.google.com/billing/docs/how-to/billing-access). * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Billing API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudbilling - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbilling.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'); - * var cloudbilling = google.cloudbilling('v1'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var billingAccountsPage = response['billingAccounts']; - * if (!billingAccountsPage) { - * return; - * } - * for (var i = 0; i < billingAccountsPage.length; i++) { - * // TODO: Change code below to process each resource in `billingAccountsPage`: - * console.log(JSON.stringify(billingAccountsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudbilling.billingAccounts.list(request, handlePage); - * } - * }; - * - * cloudbilling.billingAccounts.list(request, handlePage); - * }); + * const cloudbilling = google.cloudbilling('v1'); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * 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/cloud-platform'], * }); + * + * // 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 cloudbilling.billingAccounts.list({ + * // Options for how to filter the returned billing accounts. + * // Currently this only supports filtering for + * // [subaccounts](https://cloud.google.com/billing/docs/concepts) under a + * // single provided reseller billing account. + * // (e.g. "master_billing_account=billingAccounts/012345-678901-ABCDEF"). + * // Boolean algebra and other fields are not currently supported. + * filter: 'placeholder-value', + * // Requested page size. The maximum page size is 100; this is also the + * // default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results to return. This should be a + * // `next_page_token` value returned from a previous `ListBillingAccounts` + * // call. If unspecified, the first page of results is returned. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billingAccounts": [], + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbilling.billingAccounts.list * @memberOf! () * @@ -1012,56 +1020,62 @@ export namespace cloudbilling_v1 { * cloudbilling.billingAccounts.patch * @desc Updates a billing account's fields. Currently the only field that can be edited is `display_name`. The current authenticated user must have the `billing.accounts.update` IAM permission, which is typically given to the [administrator](https://cloud.google.com/billing/docs/how-to/billing-access) of the billing account. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Billing API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudbilling - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbilling.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'); - * var cloudbilling = google.cloudbilling('v1'); + * const cloudbilling = google.cloudbilling('v1'); * - * authorize(function(authClient) { - * var request = { - * // The name of the billing account resource to be updated. - * name: 'billingAccounts/my-billing-account', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * // 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 cloudbilling.billingAccounts.patch({ + * // Required. The name of the billing account resource to be updated. + * name: 'billingAccounts/my-billingAccount', + * // The update mask applied to the resource. + * // Only "display_name" is currently supported. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "masterBillingAccount": "my_masterBillingAccount", + * // "name": "my_name", + * // "open": false + * // } * }, - * - * auth: authClient, - * }; - * - * cloudbilling.billingAccounts.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "masterBillingAccount": "my_masterBillingAccount", + * // "name": "my_name", + * // "open": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudbilling.billingAccounts.patch * @memberOf! () * @@ -1136,56 +1150,58 @@ export namespace cloudbilling_v1 { * cloudbilling.billingAccounts.setIamPolicy * @desc Sets the access control policy for a billing account. Replaces any existing policy. The caller must have the `billing.accounts.setIamPolicy` permission on the account, which is often given to billing account [administrators](https://cloud.google.com/billing/docs/how-to/billing-access). * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Billing API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudbilling - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbilling.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'); - * var cloudbilling = google.cloudbilling('v1'); + * const cloudbilling = google.cloudbilling('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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await cloudbilling.billingAccounts.setIamPolicy({ * // REQUIRED: The resource for which the policy is being specified. * // See the operation documentation for the appropriate value for this field. - * resource_: 'billingAccounts/my-billing-account', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'billingAccounts/my-billingAccount', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudbilling.billingAccounts.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudbilling.billingAccounts.setIamPolicy * @memberOf! () * @@ -1260,56 +1276,54 @@ export namespace cloudbilling_v1 { * cloudbilling.billingAccounts.testIamPermissions * @desc Tests the access control policy for a billing account. This method takes the resource and a set of permissions as input and returns the subset of the input permissions that the caller is allowed for that resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Billing API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudbilling - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbilling.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'); - * var cloudbilling = google.cloudbilling('v1'); + * const cloudbilling = google.cloudbilling('v1'); * - * authorize(function(authClient) { - * var request = { + * 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/cloud-platform'], + * }); + * + * // 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 cloudbilling.billingAccounts.testIamPermissions({ * // REQUIRED: The resource for which the policy detail is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'billingAccounts/my-billing-account', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'billingAccounts/my-billingAccount', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * cloudbilling.billingAccounts.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudbilling.billingAccounts.testIamPermissions * @memberOf! () * @@ -1516,65 +1530,54 @@ export namespace cloudbilling_v1 { * cloudbilling.billingAccounts.projects.list * @desc Lists the projects associated with a billing account. The current authenticated user must have the `billing.resourceAssociations.list` IAM permission, which is often given to billing account [viewers](https://cloud.google.com/billing/docs/how-to/billing-access). * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Billing API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudbilling - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbilling.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'); - * var cloudbilling = google.cloudbilling('v1'); + * const cloudbilling = google.cloudbilling('v1'); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the billing account associated with the projects that - * // you want to list. For example, `billingAccounts/012345-567890-ABCDEF`. - * name: 'billingAccounts/my-billing-account', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var projectBillingInfoPage = response['projectBillingInfo']; - * if (!projectBillingInfoPage) { - * return; - * } - * for (var i = 0; i < projectBillingInfoPage.length; i++) { - * // TODO: Change code below to process each resource in `projectBillingInfoPage`: - * console.log(JSON.stringify(projectBillingInfoPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudbilling.billingAccounts.projects.list(request, handlePage); - * } - * }; - * - * cloudbilling.billingAccounts.projects.list(request, handlePage); - * }); + * 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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // Do the magic + * const res = await cloudbilling.billingAccounts.projects.list({ + * // Required. The resource name of the billing account associated with the projects that + * // you want to list. For example, `billingAccounts/012345-567890-ABCDEF`. + * name: 'billingAccounts/my-billingAccount', + * // Requested page size. The maximum page size is 100; this is also the + * // default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results to be returned. This should be a + * // `next_page_token` value returned from a previous `ListProjectBillingInfo` + * // call. If unspecified, the first page of results is returned. + * pageToken: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "projectBillingInfo": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbilling.billingAccounts.projects.list * @memberOf! () * @@ -1689,52 +1692,49 @@ export namespace cloudbilling_v1 { * cloudbilling.projects.getBillingInfo * @desc Gets the billing information for a project. The current authenticated user must have [permission to view the project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo ). * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Billing API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudbilling - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbilling.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'); - * var cloudbilling = google.cloudbilling('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the project for which billing information is - * // retrieved. For example, `projects/tokyo-rain-123`. - * name: 'projects/my-project', // TODO: Update placeholder value. + * const cloudbilling = google.cloudbilling('v1'); * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudbilling.projects.getBillingInfo(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudbilling.projects.getBillingInfo({ + * // Required. The resource name of the project for which billing information is + * // retrieved. For example, `projects/tokyo-rain-123`. + * name: 'projects/my-project', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billingAccountName": "my_billingAccountName", + * // "billingEnabled": false, + * // "name": "my_name", + * // "projectId": "my_projectId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudbilling.projects.getBillingInfo * @memberOf! () * @@ -1812,57 +1812,60 @@ export namespace cloudbilling_v1 { * cloudbilling.projects.updateBillingInfo * @desc Sets or updates the billing account associated with a project. You specify the new billing account by setting the `billing_account_name` in the `ProjectBillingInfo` resource to the resource name of a billing account. Associating a project with an open billing account enables billing on the project and allows charges for resource usage. If the project already had a billing account, this method changes the billing account used for resource usage charges. *Note:* Incurred charges that have not yet been reported in the transaction history of the GCP Console might be billed to the new billing account, even if the charge occurred before the new billing account was assigned to the project. The current authenticated user must have ownership privileges for both the [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo ) and the [billing account](https://cloud.google.com/billing/docs/how-to/billing-access). You can disable billing on the project by setting the `billing_account_name` field to empty. This action disassociates the current billing account from the project. Any billable activity of your in-use services will stop, and your application could stop functioning as expected. Any unbilled charges to date will be billed to the previously associated account. The current authenticated user must be either an owner of the project or an owner of the billing account for the project. Note that associating a project with a *closed* billing account will have much the same effect as disabling billing on the project: any paid resources used by the project will be shut down. Thus, unless you wish to disable billing, you should always call this method with the name of an *open* billing account. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Billing API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudbilling - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbilling.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'); - * var cloudbilling = google.cloudbilling('v1'); + * const cloudbilling = google.cloudbilling('v1'); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the project associated with the billing information - * // that you want to update. For example, `projects/tokyo-rain-123`. - * name: 'projects/my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudbilling.projects.updateBillingInfo(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudbilling.projects.updateBillingInfo({ + * // Required. The resource name of the project associated with the billing information + * // that you want to update. For example, `projects/tokyo-rain-123`. + * name: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "billingAccountName": "my_billingAccountName", + * // "billingEnabled": false, + * // "name": "my_name", + * // "projectId": "my_projectId" + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billingAccountName": "my_billingAccountName", + * // "billingEnabled": false, + * // "name": "my_name", + * // "projectId": "my_projectId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudbilling.projects.updateBillingInfo * @memberOf! () * @@ -1980,61 +1983,50 @@ export namespace cloudbilling_v1 { * cloudbilling.services.list * @desc Lists all public cloud services. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Billing API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudbilling - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbilling.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'); - * var cloudbilling = google.cloudbilling('v1'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var servicesPage = response['services']; - * if (!servicesPage) { - * return; - * } - * for (var i = 0; i < servicesPage.length; i++) { - * // TODO: Change code below to process each resource in `servicesPage`: - * console.log(JSON.stringify(servicesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudbilling.services.list(request, handlePage); - * } - * }; - * - * cloudbilling.services.list(request, handlePage); - * }); + * const cloudbilling = google.cloudbilling('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/cloud-platform'], + * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 cloudbilling.services.list({ + * // Requested page size. Defaults to 5000. + * pageSize: 'placeholder-value', + * // A token identifying a page of results to return. This should be a + * // `next_page_token` value returned from a previous `ListServices` + * // call. If unspecified, the first page of results is returned. + * pageToken: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "services": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbilling.services.list * @memberOf! () * @@ -2132,65 +2124,71 @@ export namespace cloudbilling_v1 { * cloudbilling.services.skus.list * @desc Lists all publicly available SKUs for a given cloud service. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Billing API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudbilling - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbilling.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'); - * var cloudbilling = google.cloudbilling('v1'); + * const cloudbilling = google.cloudbilling('v1'); * - * authorize(function(authClient) { - * var request = { - * // The name of the service. - * // Example: "services/DA34-426B-A397" - * parent: 'services/my-service', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var skusPage = response['skus']; - * if (!skusPage) { - * return; - * } - * for (var i = 0; i < skusPage.length; i++) { - * // TODO: Change code below to process each resource in `skusPage`: - * console.log(JSON.stringify(skusPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudbilling.services.skus.list(request, handlePage); - * } - * }; - * - * cloudbilling.services.skus.list(request, handlePage); - * }); + * 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/cloud-platform'], + * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 cloudbilling.services.skus.list({ + * // The ISO 4217 currency code for the pricing info in the response proto. + * // Will use the conversion rate as of start_time. + * // Optional. If not specified USD will be used. + * currencyCode: 'placeholder-value', + * // Optional exclusive end time of the time range for which the pricing + * // versions will be returned. Timestamps in the future are not allowed. + * // The time range has to be within a single calendar month in + * // America/Los_Angeles timezone. Time range as a whole is optional. If not + * // specified, the latest pricing will be returned (up to 12 hours old at + * // most). + * endTime: 'placeholder-value', + * // Requested page size. Defaults to 5000. + * pageSize: 'placeholder-value', + * // A token identifying a page of results to return. This should be a + * // `next_page_token` value returned from a previous `ListSkus` + * // call. If unspecified, the first page of results is returned. + * pageToken: 'placeholder-value', + * // Required. The name of the service. + * // Example: "services/DA34-426B-A397" + * parent: 'services/my-service', + * // Optional inclusive start time of the time range for which the pricing + * // versions will be returned. Timestamps in the future are not allowed. + * // The time range has to be within a single calendar month in + * // America/Los_Angeles timezone. Time range as a whole is optional. If not + * // specified, the latest pricing will be returned (up to 12 hours old at + * // most). + * startTime: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "skus": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbilling.services.skus.list * @memberOf! () * diff --git a/src/apis/cloudbuild/v1.ts b/src/apis/cloudbuild/v1.ts index c85a11eaa9c..d4e5cd51055 100644 --- a/src/apis/cloudbuild/v1.ts +++ b/src/apis/cloudbuild/v1.ts @@ -784,6 +784,50 @@ export namespace cloudbuild_v1 { /** * cloudbuild.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('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/cloud-platform'], + * }); + * + * // 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 cloudbuild.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'operations/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.operations.cancel * @memberOf! () * @@ -854,6 +898,50 @@ export namespace cloudbuild_v1 { /** * cloudbuild.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('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/cloud-platform'], + * }); + * + * // 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 cloudbuild.operations.get({ + * // The name of the operation resource. + * name: 'operations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.operations.get * @memberOf! () * @@ -924,6 +1012,53 @@ export namespace cloudbuild_v1 { /** * cloudbuild.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('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/cloud-platform'], + * }); + * + * // 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 cloudbuild.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.operations.list * @memberOf! () * @@ -1069,6 +1204,76 @@ export namespace cloudbuild_v1 { /** * cloudbuild.projects.builds.cancel * @desc Cancels a build in progress. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.builds.cancel({ + * // Required. ID of the build. + * id: 'placeholder-value', + * // Required. ID of the project. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "artifacts": {}, + * // "buildTriggerId": "my_buildTriggerId", + * // "createTime": "my_createTime", + * // "finishTime": "my_finishTime", + * // "id": "my_id", + * // "images": [], + * // "logUrl": "my_logUrl", + * // "logsBucket": "my_logsBucket", + * // "options": {}, + * // "projectId": "my_projectId", + * // "queueTtl": "my_queueTtl", + * // "results": {}, + * // "secrets": [], + * // "source": {}, + * // "sourceProvenance": {}, + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusDetail": "my_statusDetail", + * // "steps": [], + * // "substitutions": {}, + * // "tags": [], + * // "timeout": "my_timeout", + * // "timing": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.builds.cancel * @memberOf! () * @@ -1142,6 +1347,80 @@ export namespace cloudbuild_v1 { /** * cloudbuild.projects.builds.create * @desc Starts a build with the specified configuration. This method returns a long-running `Operation`, which includes the build ID. Pass the build ID to `GetBuild` to determine the build status (such as `SUCCESS` or `FAILURE`). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.builds.create({ + * // Required. ID of the project. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "artifacts": {}, + * // "buildTriggerId": "my_buildTriggerId", + * // "createTime": "my_createTime", + * // "finishTime": "my_finishTime", + * // "id": "my_id", + * // "images": [], + * // "logUrl": "my_logUrl", + * // "logsBucket": "my_logsBucket", + * // "options": {}, + * // "projectId": "my_projectId", + * // "queueTtl": "my_queueTtl", + * // "results": {}, + * // "secrets": [], + * // "source": {}, + * // "sourceProvenance": {}, + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusDetail": "my_statusDetail", + * // "steps": [], + * // "substitutions": {}, + * // "tags": [], + * // "timeout": "my_timeout", + * // "timing": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.builds.create * @memberOf! () * @@ -1217,6 +1496,70 @@ export namespace cloudbuild_v1 { /** * cloudbuild.projects.builds.get * @desc Returns information about a previously requested build. The `Build` that is returned includes its status (such as `SUCCESS`, `FAILURE`, or `WORKING`), and timing information. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.builds.get({ + * // Required. ID of the build. + * id: 'placeholder-value', + * // Required. ID of the project. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "artifacts": {}, + * // "buildTriggerId": "my_buildTriggerId", + * // "createTime": "my_createTime", + * // "finishTime": "my_finishTime", + * // "id": "my_id", + * // "images": [], + * // "logUrl": "my_logUrl", + * // "logsBucket": "my_logsBucket", + * // "options": {}, + * // "projectId": "my_projectId", + * // "queueTtl": "my_queueTtl", + * // "results": {}, + * // "secrets": [], + * // "source": {}, + * // "sourceProvenance": {}, + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusDetail": "my_statusDetail", + * // "steps": [], + * // "substitutions": {}, + * // "tags": [], + * // "timeout": "my_timeout", + * // "timing": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.builds.get * @memberOf! () * @@ -1290,6 +1633,53 @@ export namespace cloudbuild_v1 { /** * cloudbuild.projects.builds.list * @desc Lists previously requested builds. Previously requested builds may still be in-progress, or may have finished successfully or unsuccessfully. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.builds.list({ + * // The raw filter text to constrain the results. + * filter: 'placeholder-value', + * // Number of results to return in the list. + * pageSize: 'placeholder-value', + * // Token to provide to skip to a particular spot in the list. + * pageToken: 'placeholder-value', + * // Required. ID of the project. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "builds": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.builds.list * @memberOf! () * @@ -1367,6 +1757,58 @@ export namespace cloudbuild_v1 { /** * cloudbuild.projects.builds.retry * @desc Creates a new build based on the specified build. This method creates a new build using the original build request, which may or may not result in an identical build. For triggered builds: * Triggered builds resolve to a precise revision; therefore a retry of a triggered build will result in a build that uses the same revision. For non-triggered builds that specify `RepoSource`: * If the original build built from the tip of a branch, the retried build will build from the tip of that branch, which may not be the same revision as the original build. * If the original build specified a commit sha or revision ID, the retried build will use the identical source. For builds that specify `StorageSource`: * If the original build pulled source from Google Cloud Storage without specifying the generation of the object, the new build will use the current object, which may be different from the original build source. * If the original build pulled source from Cloud Storage and specified the generation of the object, the new build will attempt to use the same object, which may or may not be available depending on the bucket's lifecycle management settings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.builds.retry({ + * // Required. Build ID of the original build. + * id: 'placeholder-value', + * // Required. ID of the project. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.builds.retry * @memberOf! () * @@ -1549,6 +1991,78 @@ export namespace cloudbuild_v1 { /** * cloudbuild.projects.triggers.create * @desc Creates a new `BuildTrigger`. This API is experimental. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.triggers.create({ + * // Required. ID of the project for which to configure automatic builds. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "build": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filename": "my_filename", + * // "github": {}, + * // "id": "my_id", + * // "ignoredFiles": [], + * // "includedFiles": [], + * // "name": "my_name", + * // "substitutions": {}, + * // "tags": [], + * // "triggerTemplate": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "build": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filename": "my_filename", + * // "github": {}, + * // "id": "my_id", + * // "ignoredFiles": [], + * // "includedFiles": [], + * // "name": "my_name", + * // "substitutions": {}, + * // "tags": [], + * // "triggerTemplate": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.triggers.create * @memberOf! () * @@ -1624,6 +2138,46 @@ export namespace cloudbuild_v1 { /** * cloudbuild.projects.triggers.delete * @desc Deletes a `BuildTrigger` by its project ID and trigger ID. This API is experimental. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.triggers.delete({ + * // Required. ID of the project that owns the trigger. + * projectId: 'placeholder-value', + * // Required. ID of the `BuildTrigger` to delete. + * triggerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.triggers.delete * @memberOf! () * @@ -1696,6 +2250,60 @@ export namespace cloudbuild_v1 { /** * cloudbuild.projects.triggers.get * @desc Returns information about a `BuildTrigger`. This API is experimental. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.triggers.get({ + * // Required. ID of the project that owns the trigger. + * projectId: 'placeholder-value', + * // Required. Identifier (`id` or `name`) of the `BuildTrigger` to get. + * triggerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "build": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filename": "my_filename", + * // "github": {}, + * // "id": "my_id", + * // "ignoredFiles": [], + * // "includedFiles": [], + * // "name": "my_name", + * // "substitutions": {}, + * // "tags": [], + * // "triggerTemplate": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.triggers.get * @memberOf! () * @@ -1770,6 +2378,51 @@ export namespace cloudbuild_v1 { /** * cloudbuild.projects.triggers.list * @desc Lists existing `BuildTrigger`s. This API is experimental. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.triggers.list({ + * // Number of results to return in the list. + * pageSize: 'placeholder-value', + * // Token to provide to skip to a particular spot in the list. + * pageToken: 'placeholder-value', + * // Required. ID of the project for which to list BuildTriggers. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "triggers": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.triggers.list * @memberOf! () * @@ -1853,6 +2506,80 @@ export namespace cloudbuild_v1 { /** * cloudbuild.projects.triggers.patch * @desc Updates a `BuildTrigger` by its project ID and trigger ID. This API is experimental. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.triggers.patch({ + * // Required. ID of the project that owns the trigger. + * projectId: 'placeholder-value', + * // Required. ID of the `BuildTrigger` to update. + * triggerId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "build": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filename": "my_filename", + * // "github": {}, + * // "id": "my_id", + * // "ignoredFiles": [], + * // "includedFiles": [], + * // "name": "my_name", + * // "substitutions": {}, + * // "tags": [], + * // "triggerTemplate": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "build": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filename": "my_filename", + * // "github": {}, + * // "id": "my_id", + * // "ignoredFiles": [], + * // "includedFiles": [], + * // "name": "my_name", + * // "substitutions": {}, + * // "tags": [], + * // "triggerTemplate": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.triggers.patch * @memberOf! () * @@ -1928,6 +2655,67 @@ export namespace cloudbuild_v1 { /** * cloudbuild.projects.triggers.run * @desc Runs a `BuildTrigger` at a particular source revision. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.triggers.run({ + * // Required. ID of the project. + * projectId: 'placeholder-value', + * // Required. ID of the trigger. + * triggerId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "branchName": "my_branchName", + * // "commitSha": "my_commitSha", + * // "dir": "my_dir", + * // "invertRegex": false, + * // "projectId": "my_projectId", + * // "repoName": "my_repoName", + * // "substitutions": {}, + * // "tagName": "my_tagName" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.triggers.run * @memberOf! () * diff --git a/src/apis/cloudbuild/v1alpha1.ts b/src/apis/cloudbuild/v1alpha1.ts index 307c1cb3d9b..4d6e987001f 100644 --- a/src/apis/cloudbuild/v1alpha1.ts +++ b/src/apis/cloudbuild/v1alpha1.ts @@ -674,6 +674,72 @@ export namespace cloudbuild_v1alpha1 { /** * cloudbuild.projects.workerPools.create * @desc Creates a `WorkerPool` to run the builds, and returns the new worker pool. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.workerPools.create({ + * // ID of the parent project. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "deleteTime": "my_deleteTime", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "regions": [], + * // "serviceAccountEmail": "my_serviceAccountEmail", + * // "status": "my_status", + * // "updateTime": "my_updateTime", + * // "workerConfig": {}, + * // "workerCount": "my_workerCount" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "deleteTime": "my_deleteTime", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "regions": [], + * // "serviceAccountEmail": "my_serviceAccountEmail", + * // "status": "my_status", + * // "updateTime": "my_updateTime", + * // "workerConfig": {}, + * // "workerCount": "my_workerCount" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.workerPools.create * @memberOf! () * @@ -749,6 +815,45 @@ export namespace cloudbuild_v1alpha1 { /** * cloudbuild.projects.workerPools.delete * @desc Deletes a `WorkerPool` by its project ID and WorkerPool name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.workerPools.delete({ + * // The field will contain name of the resource requested, for example: + * // "projects/project-1/workerPools/workerpool-name" + * name: 'projects/my-project/workerPools/my-workerPool', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.workerPools.delete * @memberOf! () * @@ -818,6 +923,56 @@ export namespace cloudbuild_v1alpha1 { /** * cloudbuild.projects.workerPools.get * @desc Returns information about a `WorkerPool`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.workerPools.get({ + * // The field will contain name of the resource requested, for example: + * // "projects/project-1/workerPools/workerpool-name" + * name: 'projects/my-project/workerPools/my-workerPool', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "deleteTime": "my_deleteTime", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "regions": [], + * // "serviceAccountEmail": "my_serviceAccountEmail", + * // "status": "my_status", + * // "updateTime": "my_updateTime", + * // "workerConfig": {}, + * // "workerCount": "my_workerCount" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.workerPools.get * @memberOf! () * @@ -889,6 +1044,46 @@ export namespace cloudbuild_v1alpha1 { /** * cloudbuild.projects.workerPools.list * @desc List project's `WorkerPool`s. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.workerPools.list({ + * // ID of the parent project. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "workerPools": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.workerPools.list * @memberOf! () * @@ -965,6 +1160,73 @@ export namespace cloudbuild_v1alpha1 { /** * cloudbuild.projects.workerPools.patch * @desc Update a `WorkerPool`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.workerPools.patch({ + * // The field will contain name of the resource requested, for example: + * // "projects/project-1/workerPools/workerpool-name" + * name: 'projects/my-project/workerPools/my-workerPool', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "deleteTime": "my_deleteTime", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "regions": [], + * // "serviceAccountEmail": "my_serviceAccountEmail", + * // "status": "my_status", + * // "updateTime": "my_updateTime", + * // "workerConfig": {}, + * // "workerCount": "my_workerCount" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "deleteTime": "my_deleteTime", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "regions": [], + * // "serviceAccountEmail": "my_serviceAccountEmail", + * // "status": "my_status", + * // "updateTime": "my_updateTime", + * // "workerConfig": {}, + * // "workerCount": "my_workerCount" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.workerPools.patch * @memberOf! () * diff --git a/src/apis/cloudbuild/v1alpha2.ts b/src/apis/cloudbuild/v1alpha2.ts index 5276a1fb1fa..567104d445a 100644 --- a/src/apis/cloudbuild/v1alpha2.ts +++ b/src/apis/cloudbuild/v1alpha2.ts @@ -650,6 +650,75 @@ export namespace cloudbuild_v1alpha2 { /** * cloudbuild.projects.workerPools.create * @desc Creates a `WorkerPool` to run the builds, and returns the new worker pool. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('v1alpha2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.workerPools.create({ + * // Required. The parent resource where this book will be created. + * // Format: projects/{project} + * parent: 'projects/my-project', + * // Required. Immutable. The ID to use for the `WorkerPool`, which will become the final component + * // of the resource name. + * // + * // This value should be 1-63 characters, and valid characters + * // are /a-z-/. + * workerPoolId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "deleteTime": "my_deleteTime", + * // "name": "my_name", + * // "networkConfig": {}, + * // "region": "my_region", + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "workerConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "deleteTime": "my_deleteTime", + * // "name": "my_name", + * // "networkConfig": {}, + * // "region": "my_region", + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "workerConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.workerPools.create * @memberOf! () * @@ -726,6 +795,45 @@ export namespace cloudbuild_v1alpha2 { /** * cloudbuild.projects.workerPools.delete * @desc Deletes a `WorkerPool`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('v1alpha2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.workerPools.delete({ + * // Required. The name of the `WorkerPool` to delete. + * // Format: projects/{project}/workerPools/{workerPool} + * name: 'projects/my-project/workerPools/my-workerPool', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.workerPools.delete * @memberOf! () * @@ -795,6 +903,54 @@ export namespace cloudbuild_v1alpha2 { /** * cloudbuild.projects.workerPools.get * @desc Returns details of a `WorkerPool`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('v1alpha2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.workerPools.get({ + * // Required. The name of the `WorkerPool` to retrieve. + * // Format: projects/{project}/workerPools/{workerPool} + * name: 'projects/my-project/workerPools/my-workerPool', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "deleteTime": "my_deleteTime", + * // "name": "my_name", + * // "networkConfig": {}, + * // "region": "my_region", + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "workerConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.workerPools.get * @memberOf! () * @@ -866,6 +1022,47 @@ export namespace cloudbuild_v1alpha2 { /** * cloudbuild.projects.workerPools.list * @desc Lists `WorkerPool`s by project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('v1alpha2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.workerPools.list({ + * // Required. The parent, which owns this collection of `WorkerPools`. + * // Format: projects/{project} + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "workerPools": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.workerPools.list * @memberOf! () * @@ -942,6 +1139,73 @@ export namespace cloudbuild_v1alpha2 { /** * cloudbuild.projects.workerPools.patch * @desc Updates a `WorkerPool`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudbuild.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 cloudbuild = google.cloudbuild('v1alpha2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudbuild.projects.workerPools.patch({ + * // Output only. The resource name of the `WorkerPool`. + * // Format of the name is `projects/{project_id}/workerPools/{worker_pool_id}`, + * // where the value of {worker_pool_id} is provided in the CreateWorkerPool + * // request. + * name: 'projects/my-project/workerPools/my-workerPool', + * // A mask specifying which fields in `WorkerPool` should be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "deleteTime": "my_deleteTime", + * // "name": "my_name", + * // "networkConfig": {}, + * // "region": "my_region", + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "workerConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "deleteTime": "my_deleteTime", + * // "name": "my_name", + * // "networkConfig": {}, + * // "region": "my_region", + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "workerConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudbuild.projects.workerPools.patch * @memberOf! () * diff --git a/src/apis/clouddebugger/v2.ts b/src/apis/clouddebugger/v2.ts index ea98fc22af1..540f910ecaf 100644 --- a/src/apis/clouddebugger/v2.ts +++ b/src/apis/clouddebugger/v2.ts @@ -620,52 +620,54 @@ export namespace clouddebugger_v2 { * clouddebugger.controller.debuggees.register * @desc Registers the debuggee with the controller service. All agents attached to the same application must call this method with exactly the same request content to get back the same stable `debuggee_id`. Agents should call this method again whenever `google.rpc.Code.NOT_FOUND` is returned from any controller method. This protocol allows the controller service to disable debuggees, recover from data loss, or change the `debuggee_id` format. Agents must handle `debuggee_id` value changing upon re-registration. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Debugger API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/clouddebugger - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/clouddebugger.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'); - * var cloudDebugger = google.clouddebugger('v2'); + * const clouddebugger = google.clouddebugger('v2'); * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud_debugger', + * ], + * }); * - * cloudDebugger.controller.debuggees.register(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await clouddebugger.controller.debuggees.register({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "debuggee": {} + * // } + * }, * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // { + * // "agentId": "my_agentId", + * // "debuggee": {} + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias clouddebugger.controller.debuggees.register * @memberOf! () * @@ -766,51 +768,65 @@ export namespace clouddebugger_v2 { * clouddebugger.controller.debuggees.breakpoints.list * @desc Returns the list of all active breakpoints for the debuggee. The breakpoint specification (`location`, `condition`, and `expressions` fields) is semantically immutable, although the field values may change. For example, an agent may update the location line number to reflect the actual line where the breakpoint was set, but this doesn't change the breakpoint semantics. This means that an agent does not need to check if a breakpoint has changed when it encounters the same breakpoint on a successive call. Moreover, an agent should remember the breakpoints that are completed until the controller removes them from the active list to avoid setting those breakpoints again. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Debugger API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/clouddebugger - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/clouddebugger.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'); - * var cloudDebugger = google.clouddebugger('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the debuggee. - * debuggeeId: 'my-debuggee-id', // TODO: Update placeholder value. + * const clouddebugger = google.clouddebugger('v2'); * - * auth: authClient, - * }; + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud_debugger', + * ], + * }); * - * cloudDebugger.controller.debuggees.breakpoints.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await clouddebugger.controller.debuggees.breakpoints.list({ + * // Identifies the agent. + * // This is the ID returned in the RegisterDebuggee response. + * agentId: 'placeholder-value', + * // Required. Identifies the debuggee. + * debuggeeId: 'placeholder-value', + * // If set to `true` (recommended), returns `google.rpc.Code.OK` status and + * // sets the `wait_expired` response field to `true` when the server-selected + * // timeout has expired. + * // + * // If set to `false` (deprecated), returns `google.rpc.Code.ABORTED` status + * // when the server-selected timeout has expired. + * successOnTimeout: 'placeholder-value', + * // A token that, if specified, blocks the method call until the list + * // of active breakpoints has changed, or a server-selected timeout has + * // expired. The value should be set from the `next_wait_token` field in + * // the last response. The initial value should be set to `"init"`. + * waitToken: 'placeholder-value', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // { + * // "breakpoints": [], + * // "nextWaitToken": "my_nextWaitToken", + * // "waitExpired": false + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias clouddebugger.controller.debuggees.breakpoints.list * @memberOf! () * @@ -898,59 +914,56 @@ export namespace clouddebugger_v2 { * clouddebugger.controller.debuggees.breakpoints.update * @desc Updates the breakpoint state or mutable fields. The entire Breakpoint message must be sent back to the controller service. Updates to active breakpoint fields are only allowed if the new value does not change the breakpoint specification. Updates to the `location`, `condition` and `expressions` fields should not alter the breakpoint semantics. These may only make changes such as canonicalizing a value or snapping the location to the correct line of code. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Debugger API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/clouddebugger - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/clouddebugger.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'); - * var cloudDebugger = google.clouddebugger('v2'); + * const clouddebugger = google.clouddebugger('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud_debugger', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Identifies the debuggee being debugged. - * debuggeeId: 'my-debuggee-id', // TODO: Update placeholder value. + * // 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 clouddebugger.controller.debuggees.breakpoints.update({ + * // Required. Identifies the debuggee being debugged. + * debuggeeId: 'placeholder-value', * // Breakpoint identifier, unique in the scope of the debuggee. - * id: 'my-id', // TODO: Update placeholder value. + * id: 'placeholder-value', * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "breakpoint": {} + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * cloudDebugger.controller.debuggees.breakpoints.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // {} + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias clouddebugger.controller.debuggees.breakpoints.update * @memberOf! () * @@ -1103,48 +1116,54 @@ export namespace clouddebugger_v2 { * clouddebugger.debugger.debuggees.list * @desc Lists all the debuggees that the user has access to. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Debugger API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/clouddebugger - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/clouddebugger.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'); - * var cloudDebugger = google.clouddebugger('v2'); + * const clouddebugger = google.clouddebugger('v2'); * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud_debugger', + * ], + * }); * - * cloudDebugger.debugger.debuggees.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await clouddebugger.debugger.debuggees.list({ + * // Required. The client version making the call. + * // Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + * clientVersion: 'placeholder-value', + * // When set to `true`, the result includes all debuggees. Otherwise, the + * // result includes only debuggees that are active. + * includeInactive: 'placeholder-value', + * // Required. Project number of a Google Cloud project whose debuggees to list. + * project: 'placeholder-value', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // { + * // "debuggees": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias clouddebugger.debugger.debuggees.list * @memberOf! () * @@ -1253,51 +1272,51 @@ export namespace clouddebugger_v2 { * clouddebugger.debugger.debuggees.breakpoints.delete * @desc Deletes the breakpoint from the debuggee. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Debugger API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/clouddebugger - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/clouddebugger.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'); - * var cloudDebugger = google.clouddebugger('v2'); + * const clouddebugger = google.clouddebugger('v2'); * - * authorize(function(authClient) { - * var request = { - * // ID of the debuggee whose breakpoint to delete. - * debuggeeId: 'my-debuggee-id', // TODO: Update placeholder value. - * - * // ID of the breakpoint to delete. - * breakpointId: 'my-breakpoint-id', // TODO: Update placeholder value. + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud_debugger', + * ], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudDebugger.debugger.debuggees.breakpoints.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await clouddebugger.debugger.debuggees.breakpoints.delete({ + * // Required. ID of the breakpoint to delete. + * breakpointId: 'placeholder-value', + * // Required. The client version making the call. + * // Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + * clientVersion: 'placeholder-value', + * // Required. ID of the debuggee whose breakpoint to delete. + * debuggeeId: 'placeholder-value', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias clouddebugger.debugger.debuggees.breakpoints.delete * @memberOf! () * @@ -1374,54 +1393,53 @@ export namespace clouddebugger_v2 { * clouddebugger.debugger.debuggees.breakpoints.get * @desc Gets breakpoint information. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Debugger API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/clouddebugger - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/clouddebugger.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'); - * var cloudDebugger = google.clouddebugger('v2'); + * const clouddebugger = google.clouddebugger('v2'); * - * authorize(function(authClient) { - * var request = { - * // ID of the debuggee whose breakpoint to get. - * debuggeeId: 'my-debuggee-id', // TODO: Update placeholder value. + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud_debugger', + * ], + * }); * - * // ID of the breakpoint to get. - * breakpointId: 'my-breakpoint-id', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * auth: authClient, - * }; + * // Do the magic + * const res = await clouddebugger.debugger.debuggees.breakpoints.get({ + * // Required. ID of the breakpoint to get. + * breakpointId: 'placeholder-value', + * // Required. The client version making the call. + * // Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + * clientVersion: 'placeholder-value', + * // Required. ID of the debuggee whose breakpoint to get. + * debuggeeId: 'placeholder-value', + * }); + * console.log(res.data); * - * cloudDebugger.debugger.debuggees.breakpoints.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "breakpoint": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias clouddebugger.debugger.debuggees.breakpoints.get * @memberOf! () * @@ -1502,51 +1520,69 @@ export namespace clouddebugger_v2 { * clouddebugger.debugger.debuggees.breakpoints.list * @desc Lists all breakpoints for the debuggee. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Debugger API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/clouddebugger - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/clouddebugger.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'); - * var cloudDebugger = google.clouddebugger('v2'); - * - * authorize(function(authClient) { - * var request = { - * // ID of the debuggee whose breakpoints to list. - * debuggeeId: 'my-debuggee-id', // TODO: Update placeholder value. + * const clouddebugger = google.clouddebugger('v2'); * - * auth: authClient, - * }; + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud_debugger', + * ], + * }); * - * cloudDebugger.debugger.debuggees.breakpoints.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await clouddebugger.debugger.debuggees.breakpoints.list({ + * // Only breakpoints with the specified action will pass the filter. + * 'action.value': 'placeholder-value', + * // Required. The client version making the call. + * // Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + * clientVersion: 'placeholder-value', + * // Required. ID of the debuggee whose breakpoints to list. + * debuggeeId: 'placeholder-value', + * // When set to `true`, the response includes the list of breakpoints set by + * // any user. Otherwise, it includes only breakpoints set by the caller. + * includeAllUsers: 'placeholder-value', + * // When set to `true`, the response includes active and inactive + * // breakpoints. Otherwise, it includes only active breakpoints. + * includeInactive: 'placeholder-value', + * // This field is deprecated. The following fields are always stripped out of + * // the result: `stack_frames`, `evaluated_expressions` and `variable_table`. + * stripResults: 'placeholder-value', + * // A wait token that, if specified, blocks the call until the breakpoints + * // list has changed, or a server selected timeout has expired. The value + * // should be set from the last response. The error code + * // `google.rpc.Code.ABORTED` (RPC) is returned on wait timeout, which + * // should be called again with the same `wait_token`. + * waitToken: 'placeholder-value', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // { + * // "breakpoints": [], + * // "nextWaitToken": "my_nextWaitToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias clouddebugger.debugger.debuggees.breakpoints.list * @memberOf! () * @@ -1630,55 +1666,78 @@ export namespace clouddebugger_v2 { * clouddebugger.debugger.debuggees.breakpoints.set * @desc Sets the breakpoint to the debuggee. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Debugger API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/clouddebugger - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/clouddebugger.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'); - * var cloudDebugger = google.clouddebugger('v2'); - * - * authorize(function(authClient) { - * var request = { - * // ID of the debuggee where the breakpoint is to be set. - * debuggeeId: 'my-debuggee-id', // TODO: Update placeholder value. + * const clouddebugger = google.clouddebugger('v2'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud_debugger', + * ], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudDebugger.debugger.debuggees.breakpoints.set(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await clouddebugger.debugger.debuggees.breakpoints.set({ + * // The canary option set by the user upon setting breakpoint. + * canaryOption: 'placeholder-value', + * // Required. The client version making the call. + * // Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + * clientVersion: 'placeholder-value', + * // Required. ID of the debuggee where the breakpoint is to be set. + * debuggeeId: 'placeholder-value', * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "canaryExpireTime": "my_canaryExpireTime", + * // "condition": "my_condition", + * // "createTime": "my_createTime", + * // "evaluatedExpressions": [], + * // "expressions": [], + * // "finalTime": "my_finalTime", + * // "id": "my_id", + * // "isFinalState": false, + * // "labels": {}, + * // "location": {}, + * // "logLevel": "my_logLevel", + * // "logMessageFormat": "my_logMessageFormat", + * // "stackFrames": [], + * // "state": "my_state", + * // "status": {}, + * // "userEmail": "my_userEmail", + * // "variableTable": [] + * // } + * }, * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // { + * // "breakpoint": {} + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias clouddebugger.debugger.debuggees.breakpoints.set * @memberOf! () * diff --git a/src/apis/clouderrorreporting/v1beta1.ts b/src/apis/clouderrorreporting/v1beta1.ts index 28972f0d3b7..75ff130b9b5 100644 --- a/src/apis/clouderrorreporting/v1beta1.ts +++ b/src/apis/clouderrorreporting/v1beta1.ts @@ -394,6 +394,49 @@ export namespace clouderrorreporting_v1beta1 { /** * clouderrorreporting.projects.deleteEvents * @desc Deletes all error events of a given project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/clouderrorreporting.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 clouderrorreporting = google.clouderrorreporting('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 clouderrorreporting.projects.deleteEvents({ + * // Required. The resource name of the Google Cloud Platform project. Written + * // as `projects/{projectID}`, where `{projectID}` is the + * // [Google Cloud Platform project + * // ID](https://support.google.com/cloud/answer/6158840). + * // + * // Example: `projects/my-project-123`. + * projectName: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias clouderrorreporting.projects.deleteEvents * @memberOf! () * @@ -493,6 +536,70 @@ export namespace clouderrorreporting_v1beta1 { /** * clouderrorreporting.projects.events.list * @desc Lists the specified events. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/clouderrorreporting.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 clouderrorreporting = google.clouderrorreporting('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 clouderrorreporting.projects.events.list({ + * // Required. The group for which events shall be returned. + * groupId: 'placeholder-value', + * // Optional. The maximum number of results to return per response. + * pageSize: 'placeholder-value', + * // Optional. A `next_page_token` provided by a previous response. + * pageToken: 'placeholder-value', + * // Required. The resource name of the Google Cloud Platform project. Written + * // as `projects/{projectID}`, where `{projectID}` is the + * // [Google Cloud Platform project + * // ID](https://support.google.com/cloud/answer/6158840). + * // + * // Example: `projects/my-project-123`. + * projectName: 'projects/my-project', + * // Optional. The exact value to match against + * // [`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type). + * 'serviceFilter.resourceType': 'placeholder-value', + * // Optional. The exact value to match against + * // [`ServiceContext.service`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service). + * 'serviceFilter.service': 'placeholder-value', + * // Optional. The exact value to match against + * // [`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version). + * 'serviceFilter.version': 'placeholder-value', + * // Restricts the query to the specified time range. + * 'timeRange.period': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "errorEvents": [], + * // "nextPageToken": "my_nextPageToken", + * // "timeRangeBegin": "my_timeRangeBegin" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias clouderrorreporting.projects.events.list * @memberOf! () * @@ -575,6 +682,60 @@ export namespace clouderrorreporting_v1beta1 { /** * clouderrorreporting.projects.events.report * @desc Report an individual error event. This endpoint accepts **either** an OAuth token, **or** an [API key](https://support.google.com/cloud/answer/6158862) for authentication. To use an API key, append it to the URL as the value of a `key` parameter. For example: `POST https://clouderrorreporting.googleapis.com/v1beta1/{projectName}/events:report?key=123ABC456` + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/clouderrorreporting.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 clouderrorreporting = google.clouderrorreporting('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 clouderrorreporting.projects.events.report({ + * // Required. The resource name of the Google Cloud Platform project. Written + * // as `projects/{projectId}`, where `{projectId}` is the + * // [Google Cloud Platform project + * // ID](https://support.google.com/cloud/answer/6158840). + * // + * // Example: // `projects/my-project-123`. + * projectName: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "context": {}, + * // "eventTime": "my_eventTime", + * // "message": "my_message", + * // "serviceContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias clouderrorreporting.projects.events.report * @memberOf! () * @@ -720,6 +881,55 @@ export namespace clouderrorreporting_v1beta1 { /** * clouderrorreporting.projects.groups.get * @desc Get the specified group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/clouderrorreporting.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 clouderrorreporting = google.clouderrorreporting('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 clouderrorreporting.projects.groups.get({ + * // Required. The group resource name. Written as + * // projects/projectID/groups/group_name. + * // Call + * // + * // groupStats.list to return a list of groups belonging to + * // this project. + * // + * // Example: projects/my-project-123/groups/my-group + * groupName: 'projects/my-project/groups/my-group', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "groupId": "my_groupId", + * // "name": "my_name", + * // "trackingIssues": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias clouderrorreporting.projects.groups.get * @memberOf! () * @@ -795,6 +1005,59 @@ export namespace clouderrorreporting_v1beta1 { /** * clouderrorreporting.projects.groups.update * @desc Replace the data for the specified group. Fails if the group does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/clouderrorreporting.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 clouderrorreporting = google.clouderrorreporting('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 clouderrorreporting.projects.groups.update({ + * // The group resource name. + * // Example: projects/my-project-123/groups/CNSgkpnppqKCUw + * name: 'projects/my-project/groups/my-group', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "groupId": "my_groupId", + * // "name": "my_name", + * // "trackingIssues": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "groupId": "my_groupId", + * // "name": "my_name", + * // "trackingIssues": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias clouderrorreporting.projects.groups.update * @memberOf! () * @@ -905,6 +1168,85 @@ export namespace clouderrorreporting_v1beta1 { /** * clouderrorreporting.projects.groupStats.list * @desc Lists the specified groups. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/clouderrorreporting.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 clouderrorreporting = google.clouderrorreporting('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 clouderrorreporting.projects.groupStats.list({ + * // Optional. The alignment of the timed counts to be returned. + * // Default is `ALIGNMENT_EQUAL_AT_END`. + * alignment: 'placeholder-value', + * // Optional. Time where the timed counts shall be aligned if rounded + * // alignment is chosen. Default is 00:00 UTC. + * alignmentTime: 'placeholder-value', + * // Optional. List all ErrorGroupStats with these IDs. + * groupId: 'placeholder-value', + * // Optional. The sort order in which the results are returned. + * // Default is `COUNT_DESC`. + * order: 'placeholder-value', + * // Optional. The maximum number of results to return per response. + * // Default is 20. + * pageSize: 'placeholder-value', + * // Optional. A `next_page_token` provided by a previous response. To view + * // additional results, pass this token along with the identical query + * // parameters as the first request. + * pageToken: 'placeholder-value', + * // Required. The resource name of the Google Cloud Platform project. Written + * // as `projects/{projectID}`, where `{projectID}` is the + * // [Google Cloud Platform project + * // ID](https://support.google.com/cloud/answer/6158840). + * // + * // Example: `projects/my-project-123`. + * projectName: 'projects/my-project', + * // Optional. The exact value to match against + * // [`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type). + * 'serviceFilter.resourceType': 'placeholder-value', + * // Optional. The exact value to match against + * // [`ServiceContext.service`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service). + * 'serviceFilter.service': 'placeholder-value', + * // Optional. The exact value to match against + * // [`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version). + * 'serviceFilter.version': 'placeholder-value', + * // Optional. The preferred duration for a single returned `TimedCount`. + * // If not set, no timed counts are returned. + * timedCountDuration: 'placeholder-value', + * // Restricts the query to the specified time range. + * 'timeRange.period': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "errorGroupStats": [], + * // "nextPageToken": "my_nextPageToken", + * // "timeRangeBegin": "my_timeRangeBegin" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias clouderrorreporting.projects.groupStats.list * @memberOf! () * diff --git a/src/apis/cloudfunctions/v1.ts b/src/apis/cloudfunctions/v1.ts index fd26fabe06f..7f768c5320e 100644 --- a/src/apis/cloudfunctions/v1.ts +++ b/src/apis/cloudfunctions/v1.ts @@ -607,6 +607,50 @@ export namespace cloudfunctions_v1 { /** * cloudfunctions.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.operations.get({ + * // The name of the operation resource. + * name: 'operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.operations.get * @memberOf! () * @@ -678,6 +722,53 @@ export namespace cloudfunctions_v1 { /** * cloudfunctions.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.operations.list({ + * // Required. A filter for matching the requested operations.

                          The supported formats of filter are:
                          To query for a specific function: project:*,location:*,function:*
                          To query for all of the latest operations for a project: project:*,latest:true + * filter: 'placeholder-value', + * // Must not be set. + * name: 'placeholder-value', + * // The maximum number of records that should be returned.
                          Requested page size cannot exceed 100. If not set, the default page size is 100.

                          Pagination is only supported when querying for a specific function. + * pageSize: 'placeholder-value', + * // Token identifying which result to start with, which is returned by a previous list call.

                          Pagination is only supported when querying for a specific function. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.operations.list * @memberOf! () * @@ -807,6 +898,53 @@ export namespace cloudfunctions_v1 { /** * cloudfunctions.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.list * @memberOf! () * @@ -919,6 +1057,56 @@ export namespace cloudfunctions_v1 { /** * cloudfunctions.projects.locations.functions.call * @desc Synchronously invokes a deployed Cloud Function. To be used for testing purposes as very limited traffic is allowed. For more information on the actual limits, refer to [Rate Limits](https://cloud.google.com/functions/quotas#rate_limits). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.functions.call({ + * // Required. The name of the function to be called. + * name: 'projects/my-project/locations/my-location/functions/my-function', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "data": "my_data" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "error": "my_error", + * // "executionId": "my_executionId", + * // "result": "my_result" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.functions.call * @memberOf! () * @@ -994,6 +1182,80 @@ export namespace cloudfunctions_v1 { /** * cloudfunctions.projects.locations.functions.create * @desc Creates a new function. If a function with the given name already exists in the specified project, the long running operation will return `ALREADY_EXISTS` error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.functions.create({ + * // Required. The project and location in which the function should be created, specified + * // in the format `projects/x/locations/x` + * location: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "availableMemoryMb": 0, + * // "description": "my_description", + * // "entryPoint": "my_entryPoint", + * // "environmentVariables": {}, + * // "eventTrigger": {}, + * // "httpsTrigger": {}, + * // "ingressSettings": "my_ingressSettings", + * // "labels": {}, + * // "maxInstances": 0, + * // "name": "my_name", + * // "network": "my_network", + * // "runtime": "my_runtime", + * // "serviceAccountEmail": "my_serviceAccountEmail", + * // "sourceArchiveUrl": "my_sourceArchiveUrl", + * // "sourceRepository": {}, + * // "sourceUploadUrl": "my_sourceUploadUrl", + * // "status": "my_status", + * // "timeout": "my_timeout", + * // "updateTime": "my_updateTime", + * // "versionId": "my_versionId", + * // "vpcConnector": "my_vpcConnector", + * // "vpcConnectorEgressSettings": "my_vpcConnectorEgressSettings" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.functions.create * @memberOf! () * @@ -1070,6 +1332,50 @@ export namespace cloudfunctions_v1 { /** * cloudfunctions.projects.locations.functions.delete * @desc Deletes a function with the given name from the specified project. If the given function is used by some trigger, the trigger will be updated to remove this function. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.functions.delete({ + * // Required. The name of the function which should be deleted. + * name: 'projects/my-project/locations/my-location/functions/my-function', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.functions.delete * @memberOf! () * @@ -1142,6 +1448,57 @@ export namespace cloudfunctions_v1 { /** * cloudfunctions.projects.locations.functions.generateDownloadUrl * @desc Returns a signed URL for downloading deployed function source code. The URL is only valid for a limited period and should be used within minutes after generation. For more information about the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.functions.generateDownloadUrl( + * { + * // The name of function for which source code Google Cloud Storage signed + * // URL should be generated. + * name: 'projects/my-project/locations/my-location/functions/my-function', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "versionId": "my_versionId" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "downloadUrl": "my_downloadUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.functions.generateDownloadUrl * @memberOf! () * @@ -1225,6 +1582,55 @@ export namespace cloudfunctions_v1 { /** * cloudfunctions.projects.locations.functions.generateUploadUrl * @desc Returns a signed URL for uploading a function source code. For more information about the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls. Once the function source code upload is complete, the used signed URL should be provided in CreateFunction or UpdateFunction request as a reference to the function source code. When uploading source code to the generated signed URL, please follow these restrictions: * Source file type should be a zip file. * Source file size should not exceed 100MB limit. * No credentials should be attached - the signed URLs provide access to the target bucket using internal service identity; if credentials were attached, the identity from the credentials would be used, but that identity does not have permissions to upload files to the URL. When making a HTTP PUT request, these two headers need to be specified: * `content-type: application/zip` * `x-goog-content-length-range: 0,104857600` And this header SHOULD NOT be specified: * `Authorization: Bearer YOUR_TOKEN` + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.functions.generateUploadUrl( + * { + * // The project and location in which the Google Cloud Storage signed URL + * // should be generated, specified in the format `projects/x/locations/x`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "uploadUrl": "my_uploadUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.functions.generateUploadUrl * @memberOf! () * @@ -1307,6 +1713,67 @@ export namespace cloudfunctions_v1 { /** * cloudfunctions.projects.locations.functions.get * @desc Returns a function with the given name from the requested project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.functions.get({ + * // Required. The name of the function which details should be obtained. + * name: 'projects/my-project/locations/my-location/functions/my-function', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "availableMemoryMb": 0, + * // "description": "my_description", + * // "entryPoint": "my_entryPoint", + * // "environmentVariables": {}, + * // "eventTrigger": {}, + * // "httpsTrigger": {}, + * // "ingressSettings": "my_ingressSettings", + * // "labels": {}, + * // "maxInstances": 0, + * // "name": "my_name", + * // "network": "my_network", + * // "runtime": "my_runtime", + * // "serviceAccountEmail": "my_serviceAccountEmail", + * // "sourceArchiveUrl": "my_sourceArchiveUrl", + * // "sourceRepository": {}, + * // "sourceUploadUrl": "my_sourceUploadUrl", + * // "status": "my_status", + * // "timeout": "my_timeout", + * // "updateTime": "my_updateTime", + * // "versionId": "my_versionId", + * // "vpcConnector": "my_vpcConnector", + * // "vpcConnectorEgressSettings": "my_vpcConnectorEgressSettings" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.functions.get * @memberOf! () * @@ -1379,6 +1846,59 @@ export namespace cloudfunctions_v1 { /** * cloudfunctions.projects.locations.functions.getIamPolicy * @desc Gets the IAM access control policy for a function. Returns an empty policy if the function exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.functions.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/my-location/functions/my-function', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.functions.getIamPolicy * @memberOf! () * @@ -1453,6 +1973,60 @@ export namespace cloudfunctions_v1 { /** * cloudfunctions.projects.locations.functions.list * @desc Returns a list of functions that belong to the requested project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.functions.list({ + * // Maximum number of functions to return per call. + * pageSize: 'placeholder-value', + * // The value returned by the last + * // `ListFunctionsResponse`; indicates that + * // this is a continuation of a prior `ListFunctions` call, and that the + * // system should return the next page of data. + * pageToken: 'placeholder-value', + * // The project and location from which the function should be listed, + * // specified in the format `projects/x/locations/x` + * // If you want to list functions in all locations, use "-" in place of a + * // location. When listing functions in all locations, if one or more + * // location(s) are unreachable, the response will contain functions from all + * // reachable locations along with the names of any unreachable locations. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "functions": [], + * // "nextPageToken": "my_nextPageToken", + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.functions.list * @memberOf! () * @@ -1532,6 +2106,82 @@ export namespace cloudfunctions_v1 { /** * cloudfunctions.projects.locations.functions.patch * @desc Updates existing function. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.functions.patch({ + * // A user-defined name of the function. Function names must be unique + * // globally and match pattern `projects/x/locations/x/functions/x` + * name: 'projects/my-project/locations/my-location/functions/my-function', + * // Required list of fields to be updated in this request. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "availableMemoryMb": 0, + * // "description": "my_description", + * // "entryPoint": "my_entryPoint", + * // "environmentVariables": {}, + * // "eventTrigger": {}, + * // "httpsTrigger": {}, + * // "ingressSettings": "my_ingressSettings", + * // "labels": {}, + * // "maxInstances": 0, + * // "name": "my_name", + * // "network": "my_network", + * // "runtime": "my_runtime", + * // "serviceAccountEmail": "my_serviceAccountEmail", + * // "sourceArchiveUrl": "my_sourceArchiveUrl", + * // "sourceRepository": {}, + * // "sourceUploadUrl": "my_sourceUploadUrl", + * // "status": "my_status", + * // "timeout": "my_timeout", + * // "updateTime": "my_updateTime", + * // "versionId": "my_versionId", + * // "vpcConnector": "my_vpcConnector", + * // "vpcConnectorEgressSettings": "my_vpcConnectorEgressSettings" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.functions.patch * @memberOf! () * @@ -1606,6 +2256,59 @@ export namespace cloudfunctions_v1 { /** * cloudfunctions.projects.locations.functions.setIamPolicy * @desc Sets the IAM access control policy on the specified function. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.functions.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/my-location/functions/my-function', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.functions.setIamPolicy * @memberOf! () * @@ -1680,6 +2383,58 @@ export namespace cloudfunctions_v1 { /** * cloudfunctions.projects.locations.functions.testIamPermissions * @desc Tests the specified permissions against the IAM access control policy for a function. If the function does not exist, this will return an empty set of permissions, not a NOT_FOUND error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.functions.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/functions/my-function', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.functions.testIamPermissions * @memberOf! () * diff --git a/src/apis/cloudfunctions/v1beta2.ts b/src/apis/cloudfunctions/v1beta2.ts index 10176139680..b6ed5acfd18 100644 --- a/src/apis/cloudfunctions/v1beta2.ts +++ b/src/apis/cloudfunctions/v1beta2.ts @@ -503,6 +503,50 @@ export namespace cloudfunctions_v1beta2 { /** * cloudfunctions.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.operations.get({ + * // The name of the operation resource. + * name: 'operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.operations.get * @memberOf! () * @@ -574,6 +618,53 @@ export namespace cloudfunctions_v1beta2 { /** * cloudfunctions.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.operations.list({ + * // Required. A filter for matching the requested operations.

                          The supported formats of filter are:
                          To query for a specific function: project:*,location:*,function:*
                          To query for all of the latest operations for a project: project:*,latest:true + * filter: 'placeholder-value', + * // Must not be set. + * name: 'placeholder-value', + * // The maximum number of records that should be returned.
                          Requested page size cannot exceed 100. If not set, the default page size is 100.

                          Pagination is only supported when querying for a specific function. + * pageSize: 'placeholder-value', + * // Token identifying which result to start with, which is returned by a previous list call.

                          Pagination is only supported when querying for a specific function. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.operations.list * @memberOf! () * @@ -706,6 +797,53 @@ export namespace cloudfunctions_v1beta2 { /** * cloudfunctions.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.list * @memberOf! () * @@ -818,6 +956,56 @@ export namespace cloudfunctions_v1beta2 { /** * cloudfunctions.projects.locations.functions.call * @desc Synchronously invokes a deployed Cloud Function. To be used for testing purposes as very limited traffic is allowed. For more information on the actual limits refer to [API Calls]( https://cloud.google.com/functions/quotas#rate_limits). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.functions.call({ + * // Required. The name of the function to be called. + * name: 'projects/my-project/locations/my-location/functions/my-function', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "data": "my_data" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "error": "my_error", + * // "executionId": "my_executionId", + * // "result": "my_result" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.functions.call * @memberOf! () * @@ -896,6 +1084,79 @@ export namespace cloudfunctions_v1beta2 { /** * cloudfunctions.projects.locations.functions.create * @desc Creates a new function. If a function with the given name already exists in the specified project, the long running operation will return `ALREADY_EXISTS` error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.functions.create({ + * // Required. The project and location in which the function should be created, specified + * // in the format `projects/x/locations/x` + * location: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "availableMemoryMb": 0, + * // "entryPoint": "my_entryPoint", + * // "environmentVariables": {}, + * // "eventTrigger": {}, + * // "httpsTrigger": {}, + * // "labels": {}, + * // "latestOperation": "my_latestOperation", + * // "maxInstances": 0, + * // "name": "my_name", + * // "network": "my_network", + * // "runtime": "my_runtime", + * // "serviceAccount": "my_serviceAccount", + * // "sourceArchiveUrl": "my_sourceArchiveUrl", + * // "sourceRepository": {}, + * // "sourceRepositoryUrl": "my_sourceRepositoryUrl", + * // "sourceUploadUrl": "my_sourceUploadUrl", + * // "status": "my_status", + * // "timeout": "my_timeout", + * // "updateTime": "my_updateTime", + * // "versionId": "my_versionId", + * // "vpcConnector": "my_vpcConnector" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.functions.create * @memberOf! () * @@ -972,6 +1233,50 @@ export namespace cloudfunctions_v1beta2 { /** * cloudfunctions.projects.locations.functions.delete * @desc Deletes a function with the given name from the specified project. If the given function is used by some trigger, the trigger will be updated to remove this function. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.functions.delete({ + * // Required. The name of the function which should be deleted. + * name: 'projects/my-project/locations/my-location/functions/my-function', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.functions.delete * @memberOf! () * @@ -1044,6 +1349,57 @@ export namespace cloudfunctions_v1beta2 { /** * cloudfunctions.projects.locations.functions.generateDownloadUrl * @desc Returns a signed URL for downloading deployed function source code. The URL is only valid for a limited period and should be used within minutes after generation. For more information about the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.functions.generateDownloadUrl( + * { + * // The name of function for which source code Google Cloud Storage signed + * // URL should be generated. + * name: 'projects/my-project/locations/my-location/functions/my-function', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "versionId": "my_versionId" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "downloadUrl": "my_downloadUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.functions.generateDownloadUrl * @memberOf! () * @@ -1127,6 +1483,55 @@ export namespace cloudfunctions_v1beta2 { /** * cloudfunctions.projects.locations.functions.generateUploadUrl * @desc Returns a signed URL for uploading a function source code. For more information about the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls Once the function source code upload is complete, the used signed URL should be provided in CreateFunction or UpdateFunction request as a reference to the function source code. When uploading source code to the generated signed URL, please follow these restrictions: * Source file type should be a zip file. * Source file size should not exceed 100MB limit. * No credentials should be attached - the signed URLs provide access to the target bucket using internal service identity; if credentials were attached, the identity from the credentials would be used, but that identity does not have permissions to upload files to the URL. When making a HTTP PUT request, these two headers need to be specified: * `content-type: application/zip` * `x-goog-content-length-range: 0,104857600` And this header SHOULD NOT be specified: * `Authorization: Bearer YOUR_TOKEN` + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.functions.generateUploadUrl( + * { + * // The project and location in which the Google Cloud Storage signed URL + * // should be generated, specified in the format `projects/x/locations/x`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "uploadUrl": "my_uploadUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.functions.generateUploadUrl * @memberOf! () * @@ -1209,6 +1614,66 @@ export namespace cloudfunctions_v1beta2 { /** * cloudfunctions.projects.locations.functions.get * @desc Returns a function with the given name from the requested project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.functions.get({ + * // Required. The name of the function which details should be obtained. + * name: 'projects/my-project/locations/my-location/functions/my-function', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "availableMemoryMb": 0, + * // "entryPoint": "my_entryPoint", + * // "environmentVariables": {}, + * // "eventTrigger": {}, + * // "httpsTrigger": {}, + * // "labels": {}, + * // "latestOperation": "my_latestOperation", + * // "maxInstances": 0, + * // "name": "my_name", + * // "network": "my_network", + * // "runtime": "my_runtime", + * // "serviceAccount": "my_serviceAccount", + * // "sourceArchiveUrl": "my_sourceArchiveUrl", + * // "sourceRepository": {}, + * // "sourceRepositoryUrl": "my_sourceRepositoryUrl", + * // "sourceUploadUrl": "my_sourceUploadUrl", + * // "status": "my_status", + * // "timeout": "my_timeout", + * // "updateTime": "my_updateTime", + * // "versionId": "my_versionId", + * // "vpcConnector": "my_vpcConnector" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.functions.get * @memberOf! () * @@ -1281,6 +1746,60 @@ export namespace cloudfunctions_v1beta2 { /** * cloudfunctions.projects.locations.functions.list * @desc Returns a list of functions that belong to the requested project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.functions.list({ + * // Required. The project and location from which the function should be listed, + * // specified in the format `projects/x/locations/x` + * // If you want to list functions in all locations, use "-" in place of a + * // location. When listing functions in all locations, if one or more + * // location(s) are unreachable, the response will contain functions from all + * // reachable locations along with the names of any unreachable locations. + * location: 'projects/my-project/locations/my-location', + * // Maximum number of functions to return per call. + * pageSize: 'placeholder-value', + * // The value returned by the last + * // `ListFunctionsResponse`; indicates that + * // this is a continuation of a prior `ListFunctions` call, and that the + * // system should return the next page of data. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "functions": [], + * // "nextPageToken": "my_nextPageToken", + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.functions.list * @memberOf! () * @@ -1360,6 +1879,78 @@ export namespace cloudfunctions_v1beta2 { /** * cloudfunctions.projects.locations.functions.update * @desc Updates existing function. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudfunctions.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 cloudfunctions = google.cloudfunctions('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudfunctions.projects.locations.functions.update({ + * // Required. The name of the function to be updated. + * name: 'projects/my-project/locations/my-location/functions/my-function', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "availableMemoryMb": 0, + * // "entryPoint": "my_entryPoint", + * // "environmentVariables": {}, + * // "eventTrigger": {}, + * // "httpsTrigger": {}, + * // "labels": {}, + * // "latestOperation": "my_latestOperation", + * // "maxInstances": 0, + * // "name": "my_name", + * // "network": "my_network", + * // "runtime": "my_runtime", + * // "serviceAccount": "my_serviceAccount", + * // "sourceArchiveUrl": "my_sourceArchiveUrl", + * // "sourceRepository": {}, + * // "sourceRepositoryUrl": "my_sourceRepositoryUrl", + * // "sourceUploadUrl": "my_sourceUploadUrl", + * // "status": "my_status", + * // "timeout": "my_timeout", + * // "updateTime": "my_updateTime", + * // "versionId": "my_versionId", + * // "vpcConnector": "my_vpcConnector" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudfunctions.projects.locations.functions.update * @memberOf! () * diff --git a/src/apis/cloudidentity/v1.ts b/src/apis/cloudidentity/v1.ts index ae821f468ee..46bea859ef7 100644 --- a/src/apis/cloudidentity/v1.ts +++ b/src/apis/cloudidentity/v1.ts @@ -296,6 +296,65 @@ export namespace cloudidentity_v1 { /** * cloudidentity.groups.create * @desc Creates a Group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "groupKey": {}, + * // "labels": {}, + * // "name": "my_name", + * // "parent": "my_parent", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.create * @memberOf! () * @@ -367,6 +426,55 @@ export namespace cloudidentity_v1 { /** * cloudidentity.groups.delete * @desc Deletes a Group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.delete({ + * // Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the + * // Group in the format: `groups/{group_id}`, where `group_id` is the unique ID + * // assigned to the Group. + * name: 'groups/my-group', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.delete * @memberOf! () * @@ -438,6 +546,59 @@ export namespace cloudidentity_v1 { /** * cloudidentity.groups.get * @desc Retrieves a Group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-identity.groups.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.get({ + * // Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the + * // Group in the format: `groups/{group_id}`, where `group_id` is the unique ID + * // assigned to the Group. + * name: 'groups/my-group', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "groupKey": {}, + * // "labels": {}, + * // "name": "my_name", + * // "parent": "my_parent", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.get * @memberOf! () * @@ -507,6 +668,58 @@ export namespace cloudidentity_v1 { /** * cloudidentity.groups.list * @desc Lists groups within a customer or a domain. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-identity.groups.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.list({ + * // The default page size is 200 (max 1000) for the BASIC view, and 50 + * // (max 500) for the FULL view. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous list request, if any. + * pageToken: 'placeholder-value', + * // Required. Customer ID to list all groups from. + * parent: 'placeholder-value', + * // Group resource view to be returned. Defaults to [View.BASIC](). + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "groups": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.list * @memberOf! () * @@ -581,6 +794,58 @@ export namespace cloudidentity_v1 { /** * cloudidentity.groups.lookup * @desc Looks up [resource name](https://cloud.google.com/apis/design/resource_names) of a Group by its EntityKey. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-identity.groups.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.lookup({ + * // The ID of the entity within the given namespace. The ID must be unique + * // within its namespace. + * 'groupKey.id': 'placeholder-value', + * // Namespaces provide isolation for IDs, so an ID only needs to be unique + * // within its namespace. + * // + * // Namespaces are currently only created as part of IdentitySource creation + * // from Admin Console. A namespace `"identitysources/{identity_source_id}"` is + * // created corresponding to every Identity Source `identity_source_id`. + * 'groupKey.namespace': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.lookup * @memberOf! () * @@ -657,6 +922,74 @@ export namespace cloudidentity_v1 { /** * cloudidentity.groups.patch * @desc Updates a Group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.patch({ + * // Output only. [Resource name](https://cloud.google.com/apis/design/resource_names) of the + * // Group in the format: `groups/{group_id}`, where group_id is the unique ID + * // assigned to the Group. + * // + * // Must be left blank while creating a Group. + * name: 'groups/my-group', + * // Required. Editable fields: `display_name`, `description` + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "groupKey": {}, + * // "labels": {}, + * // "name": "my_name", + * // "parent": "my_parent", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.patch * @memberOf! () * @@ -730,6 +1063,61 @@ export namespace cloudidentity_v1 { /** * cloudidentity.groups.search * @desc Searches for Groups. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-identity.groups.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.search({ + * // The default page size is 200 (max 1000) for the BASIC view, and 50 + * // (max 500) for the FULL view. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous search request, if any. + * pageToken: 'placeholder-value', + * // Required. `Required`. Query string for performing search on groups. Users can search + * // on parent and label attributes of groups. + * // EXACT match ('==') is supported on parent, and CONTAINS match ('in') is + * // supported on labels. + * query: 'placeholder-value', + * // Group resource view to be returned. Defaults to [View.BASIC](). + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "groups": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.search * @memberOf! () * @@ -928,6 +1316,67 @@ export namespace cloudidentity_v1 { /** * cloudidentity.groups.memberships.create * @desc Creates a Membership. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.memberships.create({ + * // Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the + * // Group to create Membership within. Format: `groups/{group_id}`, where + * // `group_id` is the unique ID assigned to the Group. + * parent: 'groups/my-group', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "name": "my_name", + * // "preferredMemberKey": {}, + * // "roles": [], + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.memberships.create * @memberOf! () * @@ -1004,6 +1453,58 @@ export namespace cloudidentity_v1 { /** * cloudidentity.groups.memberships.delete * @desc Deletes a Membership. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.memberships.delete({ + * // Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the + * // Membership to be deleted. + * // + * // Format: `groups/{group_id}/memberships/{member_id}`, where `group_id` is + * // the unique ID assigned to the Group to which Membership belongs to, and + * // member_id is the unique ID assigned to the member. + * name: 'groups/my-group/memberships/my-membership', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.memberships.delete * @memberOf! () * @@ -1076,6 +1577,59 @@ export namespace cloudidentity_v1 { /** * cloudidentity.groups.memberships.get * @desc Retrieves a Membership. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-identity.groups.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.memberships.get({ + * // Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the + * // Membership to be retrieved. + * // + * // Format: `groups/{group_id}/memberships/{member_id}`, where `group_id` is + * // the unique id assigned to the Group to which Membership belongs to, and + * // `member_id` is the unique ID assigned to the member. + * name: 'groups/my-group/memberships/my-membership', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "name": "my_name", + * // "preferredMemberKey": {}, + * // "roles": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.memberships.get * @memberOf! () * @@ -1148,6 +1702,62 @@ export namespace cloudidentity_v1 { /** * cloudidentity.groups.memberships.list * @desc Lists Memberships within a Group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-identity.groups.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.memberships.list({ + * // The default page size is 200 (max 1000) for the BASIC view, and 50 + * // (max 500) for the FULL view. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous list request, if any. + * pageToken: 'placeholder-value', + * // Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the + * // Group to list Memberships within. + * // + * // Format: `groups/{group_id}`, where `group_id` is the unique ID assigned to + * // the Group. + * parent: 'groups/my-group', + * // Membership resource view to be returned. Defaults to View.BASIC. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "memberships": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.memberships.list * @memberOf! () * @@ -1228,6 +1838,64 @@ export namespace cloudidentity_v1 { /** * cloudidentity.groups.memberships.lookup * @desc Looks up [resource name](https://cloud.google.com/apis/design/resource_names) of a Membership within a Group by member's EntityKey. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-identity.groups.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.memberships.lookup({ + * // The ID of the entity within the given namespace. The ID must be unique + * // within its namespace. + * 'memberKey.id': 'placeholder-value', + * // Namespaces provide isolation for IDs, so an ID only needs to be unique + * // within its namespace. + * // + * // Namespaces are currently only created as part of IdentitySource creation + * // from Admin Console. A namespace `"identitysources/{identity_source_id}"` is + * // created corresponding to every Identity Source `identity_source_id`. + * 'memberKey.namespace': 'placeholder-value', + * // Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the + * // Group to lookup Membership within. + * // + * // Format: `groups/{group_id}`, where `group_id` is the unique ID assigned to + * // the Group. + * parent: 'groups/my-group', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.memberships.lookup * @memberOf! () * diff --git a/src/apis/cloudidentity/v1beta1.ts b/src/apis/cloudidentity/v1beta1.ts index 8925806a903..afacfc58126 100644 --- a/src/apis/cloudidentity/v1beta1.ts +++ b/src/apis/cloudidentity/v1beta1.ts @@ -769,6 +769,69 @@ export namespace cloudidentity_v1beta1 { /** * cloudidentity.groups.create * @desc Creates a `Group`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('v1beta1'); + * + * 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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.create({ + * // Required. The initial configuration option for the `Group`. + * initialGroupConfig: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "additionalGroupKeys": [], + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "groupKey": {}, + * // "labels": {}, + * // "name": "my_name", + * // "parent": "my_parent", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.create * @memberOf! () * @@ -841,6 +904,56 @@ export namespace cloudidentity_v1beta1 { /** * cloudidentity.groups.delete * @desc Deletes a `Group`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('v1beta1'); + * + * 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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.delete({ + * // Required. The [resource name](https://cloud.google.com/apis/design/resource_names) of + * // the `Group` to retrieve. + * // + * // Must be of the form `groups/{group_id}`. + * name: 'groups/my-group', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.delete * @memberOf! () * @@ -912,6 +1025,61 @@ export namespace cloudidentity_v1beta1 { /** * cloudidentity.groups.get * @desc Retrieves a `Group`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('v1beta1'); + * + * 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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-identity.groups.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.get({ + * // Required. The [resource name](https://cloud.google.com/apis/design/resource_names) of + * // the `Group` to retrieve. + * // + * // Must be of the form `groups/{group_id}`. + * name: 'groups/my-group', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "additionalGroupKeys": [], + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "groupKey": {}, + * // "labels": {}, + * // "name": "my_name", + * // "parent": "my_parent", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.get * @memberOf! () * @@ -981,6 +1149,71 @@ export namespace cloudidentity_v1beta1 { /** * cloudidentity.groups.list * @desc Lists the `Group`s under a customer or namespace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('v1beta1'); + * + * 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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-identity.groups.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.list({ + * // The maximum number of results to return. + * // + * // Note that the number of results returned may be less than this value even + * // if there are more available results. To fetch all results, clients must + * // continue calling this method repeatedly until the response no longer + * // contains a `next_page_token`. + * // + * // If unspecified, defaults to 200 for `View.BASIC` and to 50 for `View.FULL`. + * // + * // Must not be greater than 1000 for `View.BASIC` or 500 for `View.FULL`. + * pageSize: 'placeholder-value', + * // The `next_page_token` value returned from a previous list request, if any. + * pageToken: 'placeholder-value', + * // Required. The parent resource under which to list all `Group`s. + * // + * // Must be of the form `identitysources/{identity_source_id}` for external- + * // identity-mapped groups or `customers/{customer_id}` for Google Groups. + * parent: 'placeholder-value', + * // The level of detail to be returned. + * // + * // If unspecified, defaults to `View.BASIC`. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "groups": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.list * @memberOf! () * @@ -1055,6 +1288,67 @@ export namespace cloudidentity_v1beta1 { /** * cloudidentity.groups.lookup * @desc Looks up the [resource name](https://cloud.google.com/apis/design/resource_names) of a `Group` by its `EntityKey`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('v1beta1'); + * + * 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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-identity.groups.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.lookup({ + * // The ID of the entity. + * // + * // For Google-managed entities, the `id` must be the email address of an + * // existing group or user. + * // + * // For external-identity-mapped entities, the `id` must be a string conforming + * // to the Identity Source's requirements. + * // + * // Must be unique within a `namespace`. + * 'groupKey.id': 'placeholder-value', + * // The namespace in which the entity exists. + * // + * // If not specified, the `EntityKey` represents a Google-managed entity such + * // as a Google user or a Google Group. + * // + * // If specified, the `EntityKey` represents an external-identity-mapped group. + * // The namespace must correspond to an identity source created in Admin + * // Console and must be in the form of `identitysources/{identity_source_id}. + * 'groupKey.namespace': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.lookup * @memberOf! () * @@ -1134,6 +1428,76 @@ export namespace cloudidentity_v1beta1 { /** * cloudidentity.groups.patch * @desc Updates a `Group`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('v1beta1'); + * + * 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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.patch({ + * // Output only. The [resource name](https://cloud.google.com/apis/design/resource_names) of + * // the `Group`. + * // + * // Shall be of the form `groups/{group_id}`. + * name: 'groups/my-group', + * // Required. The fully-qualified names of fields to update. + * // + * // May only contain the following fields: `display_name`, `description`. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "additionalGroupKeys": [], + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "groupKey": {}, + * // "labels": {}, + * // "name": "my_name", + * // "parent": "my_parent", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.patch * @memberOf! () * @@ -1207,6 +1571,77 @@ export namespace cloudidentity_v1beta1 { /** * cloudidentity.groups.search * @desc Searches for `Group`s matching a specified query. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('v1beta1'); + * + * 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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-identity.groups.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.search({ + * // The maximum number of results to return. + * // + * // Note that the number of results returned may be less than this value even + * // if there are more available results. To fetch all results, clients must + * // continue calling this method repeatedly until the response no longer + * // contains a `next_page_token`. + * // + * // If unspecified, defaults to 200 for `GroupView.BASIC` and to 50 for + * // `GroupView.FULL`. + * // + * // Must not be greater than 1000 for `GroupView.BASIC` or 500 for + * // `GroupView.FULL`. + * pageSize: 'placeholder-value', + * // The `next_page_token` value returned from a previous search request, if + * // any. + * pageToken: 'placeholder-value', + * // Required. The search query. + * // + * // Must be specified in [Common Expression + * // Language](https://opensource.google/projects/cel). May only contain + * // equality operators on the parent and inclusion operators on labels (e.g., + * // `parent == 'customers/{customer_id}' && + * // 'cloudidentity.googleapis.com/groups.discussion_forum' in labels`). + * query: 'placeholder-value', + * // The level of detail to be returned. + * // + * // If unspecified, defaults to `View.BASIC`. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "groups": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.search * @memberOf! () * @@ -1413,6 +1848,68 @@ export namespace cloudidentity_v1beta1 { /** * cloudidentity.groups.memberships.create * @desc Creates a `Membership`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('v1beta1'); + * + * 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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.memberships.create({ + * // Required. The parent `Group` resource under which to create the `Membership`. + * // + * // Must be of the form `groups/{group_id}`. + * parent: 'groups/my-group', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "memberKey": {}, + * // "name": "my_name", + * // "preferredMemberKey": {}, + * // "roles": [], + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.memberships.create * @memberOf! () * @@ -1489,6 +1986,56 @@ export namespace cloudidentity_v1beta1 { /** * cloudidentity.groups.memberships.delete * @desc Deletes a `Membership`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('v1beta1'); + * + * 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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.memberships.delete({ + * // Required. The [resource name](https://cloud.google.com/apis/design/resource_names) of + * // the `Membership` to delete. + * // + * // Must be of the form `groups/{group_id}/memberships/{membership_id}`. + * name: 'groups/my-group/memberships/my-membership', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.memberships.delete * @memberOf! () * @@ -1561,6 +2108,58 @@ export namespace cloudidentity_v1beta1 { /** * cloudidentity.groups.memberships.get * @desc Retrieves a `Membership`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('v1beta1'); + * + * 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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-identity.groups.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.memberships.get({ + * // Required. The [resource name](https://cloud.google.com/apis/design/resource_names) of + * // the `Membership` to retrieve. + * // + * // Must be of the form `groups/{group_id}/memberships/{membership_id}`. + * name: 'groups/my-group/memberships/my-membership', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "memberKey": {}, + * // "name": "my_name", + * // "preferredMemberKey": {}, + * // "roles": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.memberships.get * @memberOf! () * @@ -1633,6 +2232,73 @@ export namespace cloudidentity_v1beta1 { /** * cloudidentity.groups.memberships.list * @desc Lists the `Membership`s within a `Group`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('v1beta1'); + * + * 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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-identity.groups.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.memberships.list({ + * // The maximum number of results to return. + * // + * // Note that the number of results returned may be less than this value even + * // if there are more available results. To fetch all results, clients must + * // continue calling this method repeatedly until the response no longer + * // contains a `next_page_token`. + * // + * // If unspecified, defaults to 200 for `GroupView.BASIC` and to 50 for + * // `GroupView.FULL`. + * // + * // Must not be greater than 1000 for `GroupView.BASIC` or 500 for + * // `GroupView.FULL`. + * pageSize: 'placeholder-value', + * // The `next_page_token` value returned from a previous search request, if + * // any. + * pageToken: 'placeholder-value', + * // Required. The parent `Group` resource under which to lookup the `Membership` name. + * // + * // Must be of the form `groups/{group_id}`. + * parent: 'groups/my-group', + * // The level of detail to be returned. + * // + * // If unspecified, defaults to `MembershipView.BASIC`. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "memberships": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.memberships.list * @memberOf! () * @@ -1713,6 +2379,71 @@ export namespace cloudidentity_v1beta1 { /** * cloudidentity.groups.memberships.lookup * @desc Looks up the [resource name](https://cloud.google.com/apis/design/resource_names) of a `Membership` by its `EntityKey`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('v1beta1'); + * + * 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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-identity.groups.readonly', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.memberships.lookup({ + * // The ID of the entity. + * // + * // For Google-managed entities, the `id` must be the email address of an + * // existing group or user. + * // + * // For external-identity-mapped entities, the `id` must be a string conforming + * // to the Identity Source's requirements. + * // + * // Must be unique within a `namespace`. + * 'memberKey.id': 'placeholder-value', + * // The namespace in which the entity exists. + * // + * // If not specified, the `EntityKey` represents a Google-managed entity such + * // as a Google user or a Google Group. + * // + * // If specified, the `EntityKey` represents an external-identity-mapped group. + * // The namespace must correspond to an identity source created in Admin + * // Console and must be in the form of `identitysources/{identity_source_id}. + * 'memberKey.namespace': 'placeholder-value', + * // Required. The parent `Group` resource under which to lookup the `Membership` name. + * // + * // Must be of the form `groups/{group_id}`. + * parent: 'groups/my-group', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.memberships.lookup * @memberOf! () * @@ -1799,6 +2530,62 @@ export namespace cloudidentity_v1beta1 { /** * cloudidentity.groups.memberships.modifyMembershipRoles * @desc Modifies the `MembershipRole`s of a `Membership`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudidentity.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 cloudidentity = google.cloudidentity('v1beta1'); + * + * 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/cloud-identity.groups', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 cloudidentity.groups.memberships.modifyMembershipRoles({ + * // Required. The [resource name](https://cloud.google.com/apis/design/resource_names) of + * // the `Membership` whose roles are to be modified. + * // + * // Must be of the form `groups/{group_id}/memberships/{membership_id}`. + * name: 'groups/my-group/memberships/my-membership', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "addRoles": [], + * // "removeRoles": [], + * // "updateRolesParams": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "membership": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudidentity.groups.memberships.modifyMembershipRoles * @memberOf! () * diff --git a/src/apis/cloudiot/v1.ts b/src/apis/cloudiot/v1.ts index f1cfb588be1..1965b1c8102 100644 --- a/src/apis/cloudiot/v1.ts +++ b/src/apis/cloudiot/v1.ts @@ -666,6 +666,57 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.bindDeviceToGateway * @desc Associates the device with the gateway. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.bindDeviceToGateway({ + * // Required. The name of the registry. For example, + * // `projects/example-project/locations/us-central1/registries/my-registry`. + * parent: 'projects/my-project/locations/my-location/registries/my-registrie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deviceId": "my_deviceId", + * // "gatewayId": "my_gatewayId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.bindDeviceToGateway * @memberOf! () * @@ -748,6 +799,72 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.create * @desc Creates a device registry that contains devices. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.create({ + * // Required. The project and cloud region where this device registry must be created. + * // For example, `projects/example-project/locations/us-central1`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "credentials": [], + * // "eventNotificationConfigs": [], + * // "httpConfig": {}, + * // "id": "my_id", + * // "logLevel": "my_logLevel", + * // "mqttConfig": {}, + * // "name": "my_name", + * // "stateNotificationConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "credentials": [], + * // "eventNotificationConfigs": [], + * // "httpConfig": {}, + * // "id": "my_id", + * // "logLevel": "my_logLevel", + * // "mqttConfig": {}, + * // "name": "my_name", + * // "stateNotificationConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.create * @memberOf! () * @@ -823,6 +940,48 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.delete * @desc Deletes a device registry configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.delete({ + * // Required. The name of the device registry. For example, + * // `projects/example-project/locations/us-central1/registries/my-registry`. + * name: 'projects/my-project/locations/my-location/registries/my-registrie', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.delete * @memberOf! () * @@ -892,6 +1051,57 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.get * @desc Gets a device registry configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.get({ + * // Required. The name of the device registry. For example, + * // `projects/example-project/locations/us-central1/registries/my-registry`. + * name: 'projects/my-project/locations/my-location/registries/my-registrie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "credentials": [], + * // "eventNotificationConfigs": [], + * // "httpConfig": {}, + * // "id": "my_id", + * // "logLevel": "my_logLevel", + * // "mqttConfig": {}, + * // "name": "my_name", + * // "stateNotificationConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.get * @memberOf! () * @@ -963,6 +1173,61 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/registries/my-registrie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.getIamPolicy * @memberOf! () * @@ -1036,6 +1301,60 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.list * @desc Lists device registries. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.list({ + * // The maximum number of registries to return in the response. If this value + * // is zero, the service will select a default size. A call may return fewer + * // objects than requested. A non-empty `next_page_token` in the response + * // indicates that more data is available. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListDeviceRegistriesResponse`; indicates + * // that this is a continuation of a prior `ListDeviceRegistries` call and + * // the system should return the next page of data. + * pageToken: 'placeholder-value', + * // Required. The project and cloud region path. For example, + * // `projects/example-project/locations/us-central1`. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deviceRegistries": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.list * @memberOf! () * @@ -1121,6 +1440,78 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.patch * @desc Updates a device registry configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.patch({ + * // The resource path name. For example, + * // `projects/example-project/locations/us-central1/registries/my-registry`. + * name: 'projects/my-project/locations/my-location/registries/my-registrie', + * // Required. Only updates the `device_registry` fields indicated by this mask. + * // The field mask must not be empty, and it must not contain fields that + * // are immutable or only set by the server. + * // Mutable top-level fields: `event_notification_config`, `http_config`, + * // `mqtt_config`, and `state_notification_config`. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "credentials": [], + * // "eventNotificationConfigs": [], + * // "httpConfig": {}, + * // "id": "my_id", + * // "logLevel": "my_logLevel", + * // "mqttConfig": {}, + * // "name": "my_name", + * // "stateNotificationConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "credentials": [], + * // "eventNotificationConfigs": [], + * // "httpConfig": {}, + * // "id": "my_id", + * // "logLevel": "my_logLevel", + * // "mqttConfig": {}, + * // "name": "my_name", + * // "stateNotificationConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.patch * @memberOf! () * @@ -1194,6 +1585,61 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/registries/my-registrie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.setIamPolicy * @memberOf! () * @@ -1267,6 +1713,59 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/registries/my-registrie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.testIamPermissions * @memberOf! () * @@ -1349,6 +1848,60 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.unbindDeviceFromGateway * @desc Deletes the association between the device and the gateway. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.unbindDeviceFromGateway( + * { + * // Required. The name of the registry. For example, + * // `projects/example-project/locations/us-central1/registries/my-registry`. + * parent: + * 'projects/my-project/locations/my-location/registries/my-registrie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deviceId": "my_deviceId", + * // "gatewayId": "my_gatewayId" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.unbindDeviceFromGateway * @memberOf! () * @@ -1616,6 +2169,91 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.devices.create * @desc Creates a device in a device registry. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.devices.create({ + * // Required. The name of the device registry where this device should be created. + * // For example, + * // `projects/example-project/locations/us-central1/registries/my-registry`. + * parent: 'projects/my-project/locations/my-location/registries/my-registrie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "blocked": false, + * // "config": {}, + * // "credentials": [], + * // "gatewayConfig": {}, + * // "id": "my_id", + * // "lastConfigAckTime": "my_lastConfigAckTime", + * // "lastConfigSendTime": "my_lastConfigSendTime", + * // "lastErrorStatus": {}, + * // "lastErrorTime": "my_lastErrorTime", + * // "lastEventTime": "my_lastEventTime", + * // "lastHeartbeatTime": "my_lastHeartbeatTime", + * // "lastStateTime": "my_lastStateTime", + * // "logLevel": "my_logLevel", + * // "metadata": {}, + * // "name": "my_name", + * // "numId": "my_numId", + * // "state": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "blocked": false, + * // "config": {}, + * // "credentials": [], + * // "gatewayConfig": {}, + * // "id": "my_id", + * // "lastConfigAckTime": "my_lastConfigAckTime", + * // "lastConfigSendTime": "my_lastConfigSendTime", + * // "lastErrorStatus": {}, + * // "lastErrorTime": "my_lastErrorTime", + * // "lastEventTime": "my_lastEventTime", + * // "lastHeartbeatTime": "my_lastHeartbeatTime", + * // "lastStateTime": "my_lastStateTime", + * // "logLevel": "my_logLevel", + * // "metadata": {}, + * // "name": "my_name", + * // "numId": "my_numId", + * // "state": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.devices.create * @memberOf! () * @@ -1689,6 +2327,50 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.devices.delete * @desc Deletes a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.devices.delete({ + * // Required. The name of the device. For example, + * // `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + * // `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + * name: + * 'projects/my-project/locations/my-location/registries/my-registrie/devices/my-device', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.devices.delete * @memberOf! () * @@ -1758,6 +2440,71 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.devices.get * @desc Gets details about a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.devices.get({ + * // The fields of the `Device` resource to be returned in the response. If the + * // field mask is unset or empty, all fields are returned. + * fieldMask: 'placeholder-value', + * // Required. The name of the device. For example, + * // `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + * // `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + * name: + * 'projects/my-project/locations/my-location/registries/my-registrie/devices/my-device', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "blocked": false, + * // "config": {}, + * // "credentials": [], + * // "gatewayConfig": {}, + * // "id": "my_id", + * // "lastConfigAckTime": "my_lastConfigAckTime", + * // "lastConfigSendTime": "my_lastConfigSendTime", + * // "lastErrorStatus": {}, + * // "lastErrorTime": "my_lastErrorTime", + * // "lastEventTime": "my_lastEventTime", + * // "lastHeartbeatTime": "my_lastHeartbeatTime", + * // "lastStateTime": "my_lastStateTime", + * // "logLevel": "my_logLevel", + * // "metadata": {}, + * // "name": "my_name", + * // "numId": "my_numId", + * // "state": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.devices.get * @memberOf! () * @@ -1828,6 +2575,84 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.devices.list * @desc List devices in a device registry. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.devices.list({ + * // A list of device string IDs. For example, `['device0', 'device12']`. + * // If empty, this field is ignored. Maximum IDs: 10,000 + * deviceIds: 'placeholder-value', + * // A list of device numeric IDs. If empty, this field is ignored. Maximum + * // IDs: 10,000. + * deviceNumIds: 'placeholder-value', + * // The fields of the `Device` resource to be returned in the response. The + * // fields `id` and `num_id` are always returned, along with any + * // other fields specified. + * fieldMask: 'placeholder-value', + * // If set, returns only the gateways with which the specified device is + * // associated. The device ID can be numeric (`num_id`) or the user-defined + * // string (`id`). For example, if `456` is specified, returns only the + * // gateways to which the device with `num_id` 456 is bound. + * 'gatewayListOptions.associationsDeviceId': 'placeholder-value', + * // If set, only devices associated with the specified gateway are returned. + * // The gateway ID can be numeric (`num_id`) or the user-defined string + * // (`id`). For example, if `123` is specified, only devices bound to the + * // gateway with `num_id` 123 are returned. + * 'gatewayListOptions.associationsGatewayId': 'placeholder-value', + * // If `GATEWAY` is specified, only gateways are returned. If `NON_GATEWAY` + * // is specified, only non-gateway devices are returned. If + * // `GATEWAY_TYPE_UNSPECIFIED` is specified, all devices are returned. + * 'gatewayListOptions.gatewayType': 'placeholder-value', + * // The maximum number of devices to return in the response. If this value + * // is zero, the service will select a default size. A call may return fewer + * // objects than requested. A non-empty `next_page_token` in the response + * // indicates that more data is available. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListDevicesResponse`; indicates + * // that this is a continuation of a prior `ListDevices` call and + * // the system should return the next page of data. + * pageToken: 'placeholder-value', + * // Required. The device registry path. Required. For example, + * // `projects/my-project/locations/us-central1/registries/my-registry`. + * parent: 'projects/my-project/locations/my-location/registries/my-registrie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "devices": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.devices.list * @memberOf! () * @@ -1910,6 +2735,66 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.devices.modifyCloudToDeviceConfig * @desc Modifies the configuration for the device, which is eventually sent from the Cloud IoT Core servers. Returns the modified configuration version and its metadata. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.devices.modifyCloudToDeviceConfig( + * { + * // Required. The name of the device. For example, + * // `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + * // `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + * name: + * 'projects/my-project/locations/my-location/registries/my-registrie/devices/my-device', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "binaryData": "my_binaryData", + * // "versionToUpdate": "my_versionToUpdate" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "binaryData": "my_binaryData", + * // "cloudUpdateTime": "my_cloudUpdateTime", + * // "deviceAckTime": "my_deviceAckTime", + * // "version": "my_version" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.devices.modifyCloudToDeviceConfig * @memberOf! () * @@ -1987,6 +2872,99 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.devices.patch * @desc Updates a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.devices.patch({ + * // The resource path name. For example, + * // `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or + * // `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`. + * // When `name` is populated as a response from the service, it always ends + * // in the device numeric ID. + * name: + * 'projects/my-project/locations/my-location/registries/my-registrie/devices/my-device', + * // Required. Only updates the `device` fields indicated by this mask. + * // The field mask must not be empty, and it must not contain fields that + * // are immutable or only set by the server. + * // Mutable top-level fields: `credentials`, `blocked`, and `metadata` + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "blocked": false, + * // "config": {}, + * // "credentials": [], + * // "gatewayConfig": {}, + * // "id": "my_id", + * // "lastConfigAckTime": "my_lastConfigAckTime", + * // "lastConfigSendTime": "my_lastConfigSendTime", + * // "lastErrorStatus": {}, + * // "lastErrorTime": "my_lastErrorTime", + * // "lastEventTime": "my_lastEventTime", + * // "lastHeartbeatTime": "my_lastHeartbeatTime", + * // "lastStateTime": "my_lastStateTime", + * // "logLevel": "my_logLevel", + * // "metadata": {}, + * // "name": "my_name", + * // "numId": "my_numId", + * // "state": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "blocked": false, + * // "config": {}, + * // "credentials": [], + * // "gatewayConfig": {}, + * // "id": "my_id", + * // "lastConfigAckTime": "my_lastConfigAckTime", + * // "lastConfigSendTime": "my_lastConfigSendTime", + * // "lastErrorStatus": {}, + * // "lastErrorTime": "my_lastErrorTime", + * // "lastEventTime": "my_lastEventTime", + * // "lastHeartbeatTime": "my_lastHeartbeatTime", + * // "lastStateTime": "my_lastStateTime", + * // "logLevel": "my_logLevel", + * // "metadata": {}, + * // "name": "my_name", + * // "numId": "my_numId", + * // "state": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.devices.patch * @memberOf! () * @@ -2058,6 +3036,61 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.devices.sendCommandToDevice * @desc Sends a command to the specified device. In order for a device to be able to receive commands, it must: 1) be connected to Cloud IoT Core using the MQTT protocol, and 2) be subscribed to the group of MQTT topics specified by /devices/{device-id}/commands/#. This subscription will receive commands at the top-level topic /devices/{device-id}/commands as well as commands for subfolders, like /devices/{device-id}/commands/subfolder. Note that subscribing to specific subfolders is not supported. If the command could not be delivered to the device, this method will return an error; in particular, if the device is not subscribed, this method will return FAILED_PRECONDITION. Otherwise, this method will return OK. If the subscription is QoS 1, at least once delivery will be guaranteed; for QoS 0, no acknowledgment will be expected from the device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.devices.sendCommandToDevice( + * { + * // Required. The name of the device. For example, + * // `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + * // `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + * name: + * 'projects/my-project/locations/my-location/registries/my-registrie/devices/my-device', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "binaryData": "my_binaryData", + * // "subfolder": "my_subfolder" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.devices.sendCommandToDevice * @memberOf! () * @@ -2292,6 +3325,58 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.devices.configVersions.list * @desc Lists the last few versions of the device configuration in descending order (i.e.: newest first). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.devices.configVersions.list( + * { + * // Required. The name of the device. For example, + * // `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + * // `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + * name: + * 'projects/my-project/locations/my-location/registries/my-registrie/devices/my-device', + * // The number of versions to list. Versions are listed in decreasing order of + * // the version number. The maximum number of versions retained is 10. If this + * // value is zero, it will return all the versions available. + * numVersions: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "deviceConfigs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.devices.configVersions.list * @memberOf! () * @@ -2400,6 +3485,56 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.devices.states.list * @desc Lists the last few versions of the device state in descending order (i.e.: newest first). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.devices.states.list({ + * // Required. The name of the device. For example, + * // `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + * // `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + * name: + * 'projects/my-project/locations/my-location/registries/my-registrie/devices/my-device', + * // The number of states to list. States are listed in descending order of + * // update time. The maximum number of states retained is 10. If this + * // value is zero, it will return all the states available. + * numStates: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deviceStates": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.devices.states.list * @memberOf! () * @@ -2502,6 +3637,61 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.groups.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.groups.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/registries/my-registrie/groups/my-group', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.groups.getIamPolicy * @memberOf! () * @@ -2575,6 +3765,61 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.groups.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.groups.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/registries/my-registrie/groups/my-group', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.groups.setIamPolicy * @memberOf! () * @@ -2648,6 +3893,61 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.groups.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.groups.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/registries/my-registrie/groups/my-group', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.groups.testIamPermissions * @memberOf! () * @@ -2789,6 +4089,85 @@ export namespace cloudiot_v1 { /** * cloudiot.projects.locations.registries.groups.devices.list * @desc List devices in a device registry. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudiot.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 cloudiot = google.cloudiot('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudiot', + * ], + * }); + * + * // 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 cloudiot.projects.locations.registries.groups.devices.list({ + * // A list of device string IDs. For example, `['device0', 'device12']`. + * // If empty, this field is ignored. Maximum IDs: 10,000 + * deviceIds: 'placeholder-value', + * // A list of device numeric IDs. If empty, this field is ignored. Maximum + * // IDs: 10,000. + * deviceNumIds: 'placeholder-value', + * // The fields of the `Device` resource to be returned in the response. The + * // fields `id` and `num_id` are always returned, along with any + * // other fields specified. + * fieldMask: 'placeholder-value', + * // If set, returns only the gateways with which the specified device is + * // associated. The device ID can be numeric (`num_id`) or the user-defined + * // string (`id`). For example, if `456` is specified, returns only the + * // gateways to which the device with `num_id` 456 is bound. + * 'gatewayListOptions.associationsDeviceId': 'placeholder-value', + * // If set, only devices associated with the specified gateway are returned. + * // The gateway ID can be numeric (`num_id`) or the user-defined string + * // (`id`). For example, if `123` is specified, only devices bound to the + * // gateway with `num_id` 123 are returned. + * 'gatewayListOptions.associationsGatewayId': 'placeholder-value', + * // If `GATEWAY` is specified, only gateways are returned. If `NON_GATEWAY` + * // is specified, only non-gateway devices are returned. If + * // `GATEWAY_TYPE_UNSPECIFIED` is specified, all devices are returned. + * 'gatewayListOptions.gatewayType': 'placeholder-value', + * // The maximum number of devices to return in the response. If this value + * // is zero, the service will select a default size. A call may return fewer + * // objects than requested. A non-empty `next_page_token` in the response + * // indicates that more data is available. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListDevicesResponse`; indicates + * // that this is a continuation of a prior `ListDevices` call and + * // the system should return the next page of data. + * pageToken: 'placeholder-value', + * // Required. The device registry path. Required. For example, + * // `projects/my-project/locations/us-central1/registries/my-registry`. + * parent: + * 'projects/my-project/locations/my-location/registries/my-registrie/groups/my-group', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "devices": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudiot.projects.locations.registries.groups.devices.list * @memberOf! () * diff --git a/src/apis/cloudkms/v1.ts b/src/apis/cloudkms/v1.ts index ff93d1e1bfa..789666e49d4 100644 --- a/src/apis/cloudkms/v1.ts +++ b/src/apis/cloudkms/v1.ts @@ -713,6 +713,53 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.get * @memberOf! () * @@ -782,6 +829,56 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.list * @memberOf! () * @@ -913,6 +1010,63 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.create * @desc Create a new KeyRing in a given Project and Location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.create({ + * // Required. It must be unique within a location and match the regular + * // expression `[a-zA-Z0-9_-]{1,63}` + * keyRingId: 'placeholder-value', + * // Required. The resource name of the location associated with the + * // KeyRings, in the format `projects/x/locations/x`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.create * @memberOf! () * @@ -987,6 +1141,50 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.get * @desc Returns metadata for a given KeyRing. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.get({ + * // Required. The name of the KeyRing to get. + * name: 'projects/my-project/locations/my-location/keyRings/my-keyRing', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.get * @memberOf! () * @@ -1056,6 +1254,62 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/my-location/keyRings/my-keyRing', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.getIamPolicy * @memberOf! () * @@ -1129,6 +1383,70 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.list * @desc Lists KeyRings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.list({ + * // Optional. Only include resources that match the filter in the response. For + * // more information, see + * // [Sorting and filtering list + * // results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * filter: 'placeholder-value', + * // Optional. Specify how the results should be sorted. If not specified, the + * // results will be sorted in the default order. For more information, see + * // [Sorting and filtering list + * // results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * orderBy: 'placeholder-value', + * // Optional. Optional limit on the number of KeyRings to include in the + * // response. Further KeyRings can subsequently be obtained by + * // including the ListKeyRingsResponse.next_page_token in a subsequent + * // request. If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // Optional. Optional pagination token, returned earlier via + * // ListKeyRingsResponse.next_page_token. + * pageToken: 'placeholder-value', + * // Required. The resource name of the location associated with the + * // KeyRings, in the format `projects/x/locations/x`. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "keyRings": [], + * // "nextPageToken": "my_nextPageToken", + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.list * @memberOf! () * @@ -1209,6 +1527,62 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/my-location/keyRings/my-keyRing', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.setIamPolicy * @memberOf! () * @@ -1282,6 +1656,58 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/my-location/keyRings/my-keyRing', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.testIamPermissions * @memberOf! () * @@ -1487,6 +1913,81 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.cryptoKeys.create * @desc Create a new CryptoKey within a KeyRing. CryptoKey.purpose and CryptoKey.version_template.algorithm are required. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.cryptoKeys.create({ + * // Required. It must be unique within a KeyRing and match the regular + * // expression `[a-zA-Z0-9_-]{1,63}` + * cryptoKeyId: 'placeholder-value', + * // Required. The name of the KeyRing associated with the + * // CryptoKeys. + * parent: 'projects/my-project/locations/my-location/keyRings/my-keyRing', + * // If set to true, the request will create a CryptoKey without any + * // CryptoKeyVersions. You must manually call + * // CreateCryptoKeyVersion or + * // ImportCryptoKeyVersion + * // before you can use this CryptoKey. + * skipInitialVersionCreation: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "nextRotationTime": "my_nextRotationTime", + * // "primary": {}, + * // "purpose": "my_purpose", + * // "rotationPeriod": "my_rotationPeriod", + * // "versionTemplate": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "nextRotationTime": "my_nextRotationTime", + * // "primary": {}, + * // "purpose": "my_purpose", + * // "rotationPeriod": "my_rotationPeriod", + * // "versionTemplate": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.cryptoKeys.create * @memberOf! () * @@ -1564,6 +2065,60 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.cryptoKeys.decrypt * @desc Decrypts data that was protected by Encrypt. The CryptoKey.purpose must be ENCRYPT_DECRYPT. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.cryptoKeys.decrypt({ + * // Required. The resource name of the CryptoKey to use for decryption. + * // The server will choose the appropriate version. + * name: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/cryptoKeys/my-cryptoKey', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "additionalAuthenticatedData": "my_additionalAuthenticatedData", + * // "ciphertext": "my_ciphertext" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "plaintext": "my_plaintext" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.cryptoKeys.decrypt * @memberOf! () * @@ -1639,6 +2194,64 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.cryptoKeys.encrypt * @desc Encrypts data, so that it can only be recovered by a call to Decrypt. The CryptoKey.purpose must be ENCRYPT_DECRYPT. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.cryptoKeys.encrypt({ + * // Required. The resource name of the CryptoKey or CryptoKeyVersion + * // to use for encryption. + * // + * // If a CryptoKey is specified, the server will use its + * // primary version. + * name: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/cryptoKeys/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "additionalAuthenticatedData": "my_additionalAuthenticatedData", + * // "plaintext": "my_plaintext" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ciphertext": "my_ciphertext", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.cryptoKeys.encrypt * @memberOf! () * @@ -1714,6 +2327,57 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.cryptoKeys.get * @desc Returns metadata for a given CryptoKey, as well as its primary CryptoKeyVersion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.cryptoKeys.get({ + * // Required. The name of the CryptoKey to get. + * name: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/cryptoKeys/my-cryptoKey', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "nextRotationTime": "my_nextRotationTime", + * // "primary": {}, + * // "purpose": "my_purpose", + * // "rotationPeriod": "my_rotationPeriod", + * // "versionTemplate": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.cryptoKeys.get * @memberOf! () * @@ -1785,6 +2449,65 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.cryptoKeys.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.cryptoKeys.getIamPolicy( + * { + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/cryptoKeys/my-cryptoKey', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.cryptoKeys.getIamPolicy * @memberOf! () * @@ -1858,6 +2581,72 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.cryptoKeys.list * @desc Lists CryptoKeys. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.cryptoKeys.list({ + * // Optional. Only include resources that match the filter in the response. For + * // more information, see + * // [Sorting and filtering list + * // results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * filter: 'placeholder-value', + * // Optional. Specify how the results should be sorted. If not specified, the + * // results will be sorted in the default order. For more information, see + * // [Sorting and filtering list + * // results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * orderBy: 'placeholder-value', + * // Optional. Optional limit on the number of CryptoKeys to include in the + * // response. Further CryptoKeys can subsequently be obtained by + * // including the ListCryptoKeysResponse.next_page_token in a subsequent + * // request. If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // Optional. Optional pagination token, returned earlier via + * // ListCryptoKeysResponse.next_page_token. + * pageToken: 'placeholder-value', + * // Required. The resource name of the KeyRing to list, in the format + * // `projects/x/locations/x/keyRings/x`. + * parent: 'projects/my-project/locations/my-location/keyRings/my-keyRing', + * // The fields of the primary version to include in the response. + * versionView: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cryptoKeys": [], + * // "nextPageToken": "my_nextPageToken", + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.cryptoKeys.list * @memberOf! () * @@ -1939,6 +2728,75 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.cryptoKeys.patch * @desc Update a CryptoKey. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.cryptoKeys.patch({ + * // Output only. The resource name for this CryptoKey in the format + * // `projects/x/locations/x/keyRings/x/cryptoKeys/x`. + * name: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/cryptoKeys/my-cryptoKey', + * // Required. List of fields to be updated in this request. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "nextRotationTime": "my_nextRotationTime", + * // "primary": {}, + * // "purpose": "my_purpose", + * // "rotationPeriod": "my_rotationPeriod", + * // "versionTemplate": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "nextRotationTime": "my_nextRotationTime", + * // "primary": {}, + * // "purpose": "my_purpose", + * // "rotationPeriod": "my_rotationPeriod", + * // "versionTemplate": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.cryptoKeys.patch * @memberOf! () * @@ -2012,6 +2870,65 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.cryptoKeys.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.cryptoKeys.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/cryptoKeys/my-cryptoKey', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.cryptoKeys.setIamPolicy * @memberOf! () * @@ -2085,6 +3002,61 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.cryptoKeys.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.cryptoKeys.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/cryptoKeys/my-cryptoKey', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.cryptoKeys.testIamPermissions * @memberOf! () * @@ -2167,6 +3139,67 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.cryptoKeys.updatePrimaryVersion * @desc Update the version of a CryptoKey that will be used in Encrypt. Returns an error if called on an asymmetric key. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.cryptoKeys.updatePrimaryVersion( + * { + * // Required. The resource name of the CryptoKey to update. + * name: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/cryptoKeys/my-cryptoKey', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "cryptoKeyVersionId": "my_cryptoKeyVersionId" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "nextRotationTime": "my_nextRotationTime", + * // "primary": {}, + * // "purpose": "my_purpose", + * // "rotationPeriod": "my_rotationPeriod", + * // "versionTemplate": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.cryptoKeys.updatePrimaryVersion * @memberOf! () * @@ -2443,6 +3476,61 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.asymmetricDecrypt * @desc Decrypts data that was encrypted with a public key retrieved from GetPublicKey corresponding to a CryptoKeyVersion with CryptoKey.purpose ASYMMETRIC_DECRYPT. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.asymmetricDecrypt( + * { + * // Required. The resource name of the CryptoKeyVersion to use for + * // decryption. + * name: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/cryptoKeys/my-cryptoKey/cryptoKeyVersions/my-cryptoKeyVersion', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ciphertext": "my_ciphertext" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "plaintext": "my_plaintext" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.asymmetricDecrypt * @memberOf! () * @@ -2525,6 +3613,60 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.asymmetricSign * @desc Signs data using a CryptoKeyVersion with CryptoKey.purpose ASYMMETRIC_SIGN, producing a signature that can be verified with the public key retrieved from GetPublicKey. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.asymmetricSign( + * { + * // Required. The resource name of the CryptoKeyVersion to use for signing. + * name: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/cryptoKeys/my-cryptoKey/cryptoKeyVersions/my-cryptoKeyVersion', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "digest": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "signature": "my_signature" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.asymmetricSign * @memberOf! () * @@ -2604,6 +3746,85 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.create * @desc Create a new CryptoKeyVersion in a CryptoKey. The server will assign the next sequential id. If unset, state will be set to ENABLED. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.create( + * { + * // Required. The name of the CryptoKey associated with + * // the CryptoKeyVersions. + * parent: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/cryptoKeys/my-cryptoKey', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "algorithm": "my_algorithm", + * // "attestation": {}, + * // "createTime": "my_createTime", + * // "destroyEventTime": "my_destroyEventTime", + * // "destroyTime": "my_destroyTime", + * // "externalProtectionLevelOptions": {}, + * // "generateTime": "my_generateTime", + * // "importFailureReason": "my_importFailureReason", + * // "importJob": "my_importJob", + * // "importTime": "my_importTime", + * // "name": "my_name", + * // "protectionLevel": "my_protectionLevel", + * // "state": "my_state" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "algorithm": "my_algorithm", + * // "attestation": {}, + * // "createTime": "my_createTime", + * // "destroyEventTime": "my_destroyEventTime", + * // "destroyTime": "my_destroyTime", + * // "externalProtectionLevelOptions": {}, + * // "generateTime": "my_generateTime", + * // "importFailureReason": "my_importFailureReason", + * // "importJob": "my_importJob", + * // "importTime": "my_importTime", + * // "name": "my_name", + * // "protectionLevel": "my_protectionLevel", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.create * @memberOf! () * @@ -2679,6 +3900,70 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.destroy * @desc Schedule a CryptoKeyVersion for destruction. Upon calling this method, CryptoKeyVersion.state will be set to DESTROY_SCHEDULED and destroy_time will be set to a time 24 hours in the future, at which point the state will be changed to DESTROYED, and the key material will be irrevocably destroyed. Before the destroy_time is reached, RestoreCryptoKeyVersion may be called to reverse the process. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.destroy( + * { + * // Required. The resource name of the CryptoKeyVersion to destroy. + * name: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/cryptoKeys/my-cryptoKey/cryptoKeyVersions/my-cryptoKeyVersion', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "algorithm": "my_algorithm", + * // "attestation": {}, + * // "createTime": "my_createTime", + * // "destroyEventTime": "my_destroyEventTime", + * // "destroyTime": "my_destroyTime", + * // "externalProtectionLevelOptions": {}, + * // "generateTime": "my_generateTime", + * // "importFailureReason": "my_importFailureReason", + * // "importJob": "my_importJob", + * // "importTime": "my_importTime", + * // "name": "my_name", + * // "protectionLevel": "my_protectionLevel", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.destroy * @memberOf! () * @@ -2754,6 +4039,64 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.get * @desc Returns metadata for a given CryptoKeyVersion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.get( + * { + * // Required. The name of the CryptoKeyVersion to get. + * name: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/cryptoKeys/my-cryptoKey/cryptoKeyVersions/my-cryptoKeyVersion', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "algorithm": "my_algorithm", + * // "attestation": {}, + * // "createTime": "my_createTime", + * // "destroyEventTime": "my_destroyEventTime", + * // "destroyTime": "my_destroyTime", + * // "externalProtectionLevelOptions": {}, + * // "generateTime": "my_generateTime", + * // "importFailureReason": "my_importFailureReason", + * // "importJob": "my_importJob", + * // "importTime": "my_importTime", + * // "name": "my_name", + * // "protectionLevel": "my_protectionLevel", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.get * @memberOf! () * @@ -2825,6 +4168,54 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.getPublicKey * @desc Returns the public key for the given CryptoKeyVersion. The CryptoKey.purpose must be ASYMMETRIC_SIGN or ASYMMETRIC_DECRYPT. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.getPublicKey( + * { + * // Required. The name of the CryptoKeyVersion public key to + * // get. + * name: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/cryptoKeys/my-cryptoKey/cryptoKeyVersions/my-cryptoKeyVersion', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "algorithm": "my_algorithm", + * // "pem": "my_pem" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.getPublicKey * @memberOf! () * @@ -2899,6 +4290,75 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.import * @desc Imports a new CryptoKeyVersion into an existing CryptoKey using the wrapped key material provided in the request. The version ID will be assigned the next sequential id within the CryptoKey. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.import( + * { + * // Required. The name of the CryptoKey to + * // be imported into. + * parent: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/cryptoKeys/my-cryptoKey', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "algorithm": "my_algorithm", + * // "importJob": "my_importJob", + * // "rsaAesWrappedKey": "my_rsaAesWrappedKey" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "algorithm": "my_algorithm", + * // "attestation": {}, + * // "createTime": "my_createTime", + * // "destroyEventTime": "my_destroyEventTime", + * // "destroyTime": "my_destroyTime", + * // "externalProtectionLevelOptions": {}, + * // "generateTime": "my_generateTime", + * // "importFailureReason": "my_importFailureReason", + * // "importJob": "my_importJob", + * // "importTime": "my_importTime", + * // "name": "my_name", + * // "protectionLevel": "my_protectionLevel", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.import * @memberOf! () * @@ -2974,6 +4434,76 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.list * @desc Lists CryptoKeyVersions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.list( + * { + * // Optional. Only include resources that match the filter in the response. For + * // more information, see + * // [Sorting and filtering list + * // results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * filter: 'placeholder-value', + * // Optional. Specify how the results should be sorted. If not specified, the + * // results will be sorted in the default order. For more information, see + * // [Sorting and filtering list + * // results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * orderBy: 'placeholder-value', + * // Optional. Optional limit on the number of CryptoKeyVersions to + * // include in the response. Further CryptoKeyVersions can + * // subsequently be obtained by including the + * // ListCryptoKeyVersionsResponse.next_page_token in a subsequent request. + * // If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // Optional. Optional pagination token, returned earlier via + * // ListCryptoKeyVersionsResponse.next_page_token. + * pageToken: 'placeholder-value', + * // Required. The resource name of the CryptoKey to list, in the format + * // `projects/x/locations/x/keyRings/x/cryptoKeys/x`. + * parent: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/cryptoKeys/my-cryptoKey', + * // The fields to include in the response. + * view: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "cryptoKeyVersions": [], + * // "nextPageToken": "my_nextPageToken", + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.list * @memberOf! () * @@ -3062,6 +4592,87 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.patch * @desc Update a CryptoKeyVersion's metadata. state may be changed between ENABLED and DISABLED using this method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to move between other states. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.patch( + * { + * // Output only. The resource name for this CryptoKeyVersion in the format + * // `projects/x/locations/x/keyRings/x/cryptoKeys/x/cryptoKeyVersions/x`. + * name: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/cryptoKeys/my-cryptoKey/cryptoKeyVersions/my-cryptoKeyVersion', + * // Required. List of fields to be updated in this request. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "algorithm": "my_algorithm", + * // "attestation": {}, + * // "createTime": "my_createTime", + * // "destroyEventTime": "my_destroyEventTime", + * // "destroyTime": "my_destroyTime", + * // "externalProtectionLevelOptions": {}, + * // "generateTime": "my_generateTime", + * // "importFailureReason": "my_importFailureReason", + * // "importJob": "my_importJob", + * // "importTime": "my_importTime", + * // "name": "my_name", + * // "protectionLevel": "my_protectionLevel", + * // "state": "my_state" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "algorithm": "my_algorithm", + * // "attestation": {}, + * // "createTime": "my_createTime", + * // "destroyEventTime": "my_destroyEventTime", + * // "destroyTime": "my_destroyTime", + * // "externalProtectionLevelOptions": {}, + * // "generateTime": "my_generateTime", + * // "importFailureReason": "my_importFailureReason", + * // "importJob": "my_importJob", + * // "importTime": "my_importTime", + * // "name": "my_name", + * // "protectionLevel": "my_protectionLevel", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.patch * @memberOf! () * @@ -3135,6 +4746,70 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.restore * @desc Restore a CryptoKeyVersion in the DESTROY_SCHEDULED state. Upon restoration of the CryptoKeyVersion, state will be set to DISABLED, and destroy_time will be cleared. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.restore( + * { + * // Required. The resource name of the CryptoKeyVersion to restore. + * name: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/cryptoKeys/my-cryptoKey/cryptoKeyVersions/my-cryptoKeyVersion', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "algorithm": "my_algorithm", + * // "attestation": {}, + * // "createTime": "my_createTime", + * // "destroyEventTime": "my_destroyEventTime", + * // "destroyTime": "my_destroyTime", + * // "externalProtectionLevelOptions": {}, + * // "generateTime": "my_generateTime", + * // "importFailureReason": "my_importFailureReason", + * // "importJob": "my_importJob", + * // "importTime": "my_importTime", + * // "name": "my_name", + * // "protectionLevel": "my_protectionLevel", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.restore * @memberOf! () * @@ -3397,6 +5072,79 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.importJobs.create * @desc Create a new ImportJob within a KeyRing. ImportJob.import_method is required. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.importJobs.create({ + * // Required. It must be unique within a KeyRing and match the regular + * // expression `[a-zA-Z0-9_-]{1,63}` + * importJobId: 'placeholder-value', + * // Required. The name of the KeyRing associated with the + * // ImportJobs. + * parent: 'projects/my-project/locations/my-location/keyRings/my-keyRing', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "attestation": {}, + * // "createTime": "my_createTime", + * // "expireEventTime": "my_expireEventTime", + * // "expireTime": "my_expireTime", + * // "generateTime": "my_generateTime", + * // "importMethod": "my_importMethod", + * // "name": "my_name", + * // "protectionLevel": "my_protectionLevel", + * // "publicKey": {}, + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestation": {}, + * // "createTime": "my_createTime", + * // "expireEventTime": "my_expireEventTime", + * // "expireTime": "my_expireTime", + * // "generateTime": "my_generateTime", + * // "importMethod": "my_importMethod", + * // "name": "my_name", + * // "protectionLevel": "my_protectionLevel", + * // "publicKey": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.importJobs.create * @memberOf! () * @@ -3473,6 +5221,59 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.importJobs.get * @desc Returns metadata for a given ImportJob. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.importJobs.get({ + * // Required. The name of the ImportJob to get. + * name: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/importJobs/my-importJob', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestation": {}, + * // "createTime": "my_createTime", + * // "expireEventTime": "my_expireEventTime", + * // "expireTime": "my_expireTime", + * // "generateTime": "my_generateTime", + * // "importMethod": "my_importMethod", + * // "name": "my_name", + * // "protectionLevel": "my_protectionLevel", + * // "publicKey": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.importJobs.get * @memberOf! () * @@ -3544,6 +5345,65 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.importJobs.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.importJobs.getIamPolicy( + * { + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/importJobs/my-importJob', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.importJobs.getIamPolicy * @memberOf! () * @@ -3617,6 +5477,70 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.importJobs.list * @desc Lists ImportJobs. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.importJobs.list({ + * // Optional. Only include resources that match the filter in the response. For + * // more information, see + * // [Sorting and filtering list + * // results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * filter: 'placeholder-value', + * // Optional. Specify how the results should be sorted. If not specified, the + * // results will be sorted in the default order. For more information, see + * // [Sorting and filtering list + * // results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * orderBy: 'placeholder-value', + * // Optional. Optional limit on the number of ImportJobs to include in the + * // response. Further ImportJobs can subsequently be obtained by + * // including the ListImportJobsResponse.next_page_token in a subsequent + * // request. If unspecified, the server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // Optional. Optional pagination token, returned earlier via + * // ListImportJobsResponse.next_page_token. + * pageToken: 'placeholder-value', + * // Required. The resource name of the KeyRing to list, in the format + * // `projects/x/locations/x/keyRings/x`. + * parent: 'projects/my-project/locations/my-location/keyRings/my-keyRing', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "importJobs": [], + * // "nextPageToken": "my_nextPageToken", + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.importJobs.list * @memberOf! () * @@ -3697,6 +5621,65 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.importJobs.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.importJobs.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/importJobs/my-importJob', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.importJobs.setIamPolicy * @memberOf! () * @@ -3770,6 +5753,61 @@ export namespace cloudkms_v1 { /** * cloudkms.projects.locations.keyRings.importJobs.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudkms.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 cloudkms = google.cloudkms('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudkms', + * ], + * }); + * + * // 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 cloudkms.projects.locations.keyRings.importJobs.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/keyRings/my-keyRing/importJobs/my-importJob', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudkms.projects.locations.keyRings.importJobs.testIamPermissions * @memberOf! () * diff --git a/src/apis/cloudprofiler/v2.ts b/src/apis/cloudprofiler/v2.ts index 9b91f641964..ffb077dd95b 100644 --- a/src/apis/cloudprofiler/v2.ts +++ b/src/apis/cloudprofiler/v2.ts @@ -191,6 +191,64 @@ export namespace cloudprofiler_v2 { /** * cloudprofiler.projects.profiles.create * @desc CreateProfile creates a new profile resource in the online mode. The server ensures that the new profiles are created at a constant rate per deployment, so the creation request may hang for some time until the next profile session is available. The request may fail with ABORTED error if the creation is not available within ~1m, the response will indicate the duration of the backoff the client should take before attempting creating a profile again. The backoff duration is returned in google.rpc.RetryInfo extension on the response status. To a gRPC client, the extension will be return as a binary-serialized proto in the trailing metadata item named "google.rpc.retryinfo-bin". + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudprofiler.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 cloudprofiler = google.cloudprofiler('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.write', + * ], + * }); + * + * // 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 cloudprofiler.projects.profiles.create({ + * // Parent project to create the profile in. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deployment": {}, + * // "profileType": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deployment": {}, + * // "duration": "my_duration", + * // "labels": {}, + * // "name": "my_name", + * // "profileBytes": "my_profileBytes", + * // "profileType": "my_profileType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudprofiler.projects.profiles.create * @memberOf! () * @@ -265,6 +323,68 @@ export namespace cloudprofiler_v2 { /** * cloudprofiler.projects.profiles.createOffline * @desc CreateOfflineProfile creates a new profile resource in the offline mode. The client provides the profile to create along with the profile bytes, the server records it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudprofiler.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 cloudprofiler = google.cloudprofiler('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.write', + * ], + * }); + * + * // 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 cloudprofiler.projects.profiles.createOffline({ + * // Parent project to create the profile in. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deployment": {}, + * // "duration": "my_duration", + * // "labels": {}, + * // "name": "my_name", + * // "profileBytes": "my_profileBytes", + * // "profileType": "my_profileType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deployment": {}, + * // "duration": "my_duration", + * // "labels": {}, + * // "name": "my_name", + * // "profileBytes": "my_profileBytes", + * // "profileType": "my_profileType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudprofiler.projects.profiles.createOffline * @memberOf! () * @@ -339,6 +459,73 @@ export namespace cloudprofiler_v2 { /** * cloudprofiler.projects.profiles.patch * @desc UpdateProfile updates the profile bytes and labels on the profile resource created in the online mode. Updating the bytes for profiles created in the offline mode is currently not supported: the profile content must be provided at the time of the profile creation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudprofiler.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 cloudprofiler = google.cloudprofiler('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.write', + * ], + * }); + * + * // 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 cloudprofiler.projects.profiles.patch({ + * // Output only. Opaque, server-assigned, unique ID for this profile. + * name: 'projects/my-project/profiles/my-profile', + * // Field mask used to specify the fields to be overwritten. Currently only + * // profile_bytes and labels fields are supported by UpdateProfile, so only + * // those fields can be specified in the mask. When no mask is provided, all + * // fields are overwritten. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deployment": {}, + * // "duration": "my_duration", + * // "labels": {}, + * // "name": "my_name", + * // "profileBytes": "my_profileBytes", + * // "profileType": "my_profileType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deployment": {}, + * // "duration": "my_duration", + * // "labels": {}, + * // "name": "my_name", + * // "profileBytes": "my_profileBytes", + * // "profileType": "my_profileType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudprofiler.projects.profiles.patch * @memberOf! () * diff --git a/src/apis/cloudresourcemanager/v1.ts b/src/apis/cloudresourcemanager/v1.ts index 04f68306663..b250a838429 100644 --- a/src/apis/cloudresourcemanager/v1.ts +++ b/src/apis/cloudresourcemanager/v1.ts @@ -763,52 +763,52 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.folders.clearOrgPolicy * @desc Clears a `Policy` from a resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('v1'); * - * authorize(function(authClient) { - * var request = { - * // Name of the resource for the `Policy` to clear. - * resource_: 'folders/my-folder', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 cloudresourcemanager.folders.clearOrgPolicy({ + * // Name of the resource for the `Policy` to clear. + * resource: 'folders/my-folder', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "constraint": "my_constraint", + * // "etag": "my_etag" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * cloudResourceManager.folders.clearOrgPolicy(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.folders.clearOrgPolicy * @memberOf! () * @@ -884,55 +884,62 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.folders.getEffectiveOrgPolicy * @desc Gets the effective `Policy` on a resource. This is the result of merging `Policies` in the resource hierarchy. The returned `Policy` will not have an `etag`set because it is a computed `Policy` across multiple resources. Subtrees of Resource Manager resource hierarchy with 'under:' prefix will not be expanded. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The name of the resource to start computing the effective `Policy`. - * resource_: 'folders/my-folder', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await cloudresourcemanager.folders.getEffectiveOrgPolicy({ + * // The name of the resource to start computing the effective `Policy`. + * resource: 'folders/my-folder', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "constraint": "my_constraint" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.folders.getEffectiveOrgPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "booleanPolicy": {}, + * // "constraint": "my_constraint", + * // "etag": "my_etag", + * // "listPolicy": {}, + * // "restoreDefault": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.folders.getEffectiveOrgPolicy * @memberOf! () * @@ -1012,55 +1019,62 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.folders.getOrgPolicy * @desc Gets a `Policy` on a resource. If no `Policy` is set on the resource, a `Policy` is returned with default values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value can be used with `SetOrgPolicy()` to create or update a `Policy` during read-modify-write. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Name of the resource the `Policy` is set on. - * resource_: 'folders/my-folder', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await cloudresourcemanager.folders.getOrgPolicy({ + * // Name of the resource the `Policy` is set on. + * resource: 'folders/my-folder', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "constraint": "my_constraint" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.folders.getOrgPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "booleanPolicy": {}, + * // "constraint": "my_constraint", + * // "etag": "my_etag", + * // "listPolicy": {}, + * // "restoreDefault": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.folders.getOrgPolicy * @memberOf! () * @@ -1138,68 +1152,60 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.folders.listAvailableOrgPolicyConstraints * @desc Lists `Constraints` that could be applied on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the resource to list `Constraints` for. - * resource_: 'folders/my-folder', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var constraintsPage = response['constraints']; - * if (!constraintsPage) { - * return; - * } - * for (var i = 0; i < constraintsPage.length; i++) { - * // TODO: Change code below to process each resource in `constraintsPage`: - * console.log(JSON.stringify(constraintsPage[i], null, 2)); - * } + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * cloudResourceManager.folders.listAvailableOrgPolicyConstraints(request, handlePage); + * // 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 cloudresourcemanager.folders.listAvailableOrgPolicyConstraints( + * { + * // Name of the resource to list `Constraints` for. + * resource: 'folders/my-folder', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "pageSize": 0, + * // "pageToken": "my_pageToken" + * // } + * }, * } - * }; + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "constraints": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } * - * cloudResourceManager.folders.listAvailableOrgPolicyConstraints(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.folders.listAvailableOrgPolicyConstraints * @memberOf! () * @@ -1299,68 +1305,58 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.folders.listOrgPolicies * @desc Lists all the `Policies` set for a particular resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Name of the resource to list Policies for. - * resource_: 'folders/my-folder', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await cloudresourcemanager.folders.listOrgPolicies({ + * // Name of the resource to list Policies for. + * resource: 'folders/my-folder', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "pageSize": 0, + * // "pageToken": "my_pageToken" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var policiesPage = response['policies']; - * if (!policiesPage) { - * return; - * } - * for (var i = 0; i < policiesPage.length; i++) { - * // TODO: Change code below to process each resource in `policiesPage`: - * console.log(JSON.stringify(policiesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * cloudResourceManager.folders.listOrgPolicies(request, handlePage); - * } - * }; + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "policies": [] + * // } + * } * - * cloudResourceManager.folders.listOrgPolicies(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.folders.listOrgPolicies * @memberOf! () * @@ -1442,55 +1438,59 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.folders.setOrgPolicy * @desc Updates the specified `Policy` on the resource. Creates a new `Policy` for that `Constraint` on the resource if one does not exist. Not supplying an `etag` on the request `Policy` results in an unconditional write of the `Policy`. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('v1'); * - * authorize(function(authClient) { - * var request = { - * // Resource name of the resource to attach the `Policy`. - * resource_: 'folders/my-folder', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudResourceManager.folders.setOrgPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudresourcemanager.folders.setOrgPolicy({ + * // Resource name of the resource to attach the `Policy`. + * resource: 'folders/my-folder', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "booleanPolicy": {}, + * // "constraint": "my_constraint", + * // "etag": "my_etag", + * // "listPolicy": {}, + * // "restoreDefault": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.folders.setOrgPolicy * @memberOf! () * @@ -1678,52 +1678,63 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.liens.create * @desc Create a Lien which applies to the resource denoted by the `parent` field. Callers of this method will require permission on the `parent` resource. For example, applying to `projects/1234` requires permission `resourcemanager.projects.updateLiens`. NOTE: Some resources may limit the number of Liens which may be applied. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 cloudresourcemanager.liens.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "name": "my_name", + * // "origin": "my_origin", + * // "parent": "my_parent", + * // "reason": "my_reason", + * // "restrictions": [] + * // } * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.liens.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "name": "my_name", + * // "origin": "my_origin", + * // "parent": "my_parent", + * // "reason": "my_reason", + * // "restrictions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.liens.create * @memberOf! () * @@ -1794,48 +1805,46 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.liens.delete * @desc Delete a Lien by `name`. Callers of this method will require permission on the `parent` resource. For example, a Lien with a `parent` of `projects/1234` requires permission `resourcemanager.projects.updateLiens`. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name/identifier of the Lien to delete. - * name: 'liens/my-lien', // TODO: Update placeholder value. + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudResourceManager.liens.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudresourcemanager.liens.delete({ + * // Required. The name/identifier of the Lien to delete. + * name: 'liens/.*', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.liens.delete * @memberOf! () * @@ -1906,51 +1915,53 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.liens.get * @desc Retrieve a Lien by `name`. Callers of this method will require permission on the `parent` resource. For example, a Lien with a `parent` of `projects/1234` requires permission requires permission `resourcemanager.projects.get` or `resourcemanager.projects.updateLiens`. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name/identifier of the Lien. - * name: 'liens/my-lien', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * cloudResourceManager.liens.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudresourcemanager.liens.get({ + * // Required. The name/identifier of the Lien. + * name: 'liens/.*', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "name": "my_name", + * // "origin": "my_origin", + * // "parent": "my_parent", + * // "reason": "my_reason", + * // "restrictions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.liens.get * @memberOf! () * @@ -2021,61 +2032,58 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.liens.list * @desc List all Liens applied to the `parent` resource. Callers of this method will require permission on the `parent` resource. For example, a Lien with a `parent` of `projects/1234` requires permission `resourcemanager.projects.get`. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * var liensPage = response['liens']; - * if (!liensPage) { - * return; - * } - * for (var i = 0; i < liensPage.length; i++) { - * // TODO: Change code below to process each resource in `liensPage`: - * console.log(JSON.stringify(liensPage[i], null, 2)); - * } + * // 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 cloudresourcemanager.liens.list({ + * // The maximum number of items to return. This is a suggestion for the server. + * pageSize: 'placeholder-value', + * // The `next_page_token` value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // Required. The name of the resource to list all attached Liens. + * // For example, `projects/1234`. + * // + * // (google.api.field_policy).resource_type annotation is not set since the + * // parent depends on the meta api implementation. This field could be a + * // project or other sub project resources. + * parent: 'placeholder-value', + * }); + * console.log(res.data); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudResourceManager.liens.list(request, handlePage); - * } - * }; + * // Example response + * // { + * // "liens": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } * - * cloudResourceManager.liens.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.liens.list * @memberOf! () * @@ -2210,51 +2218,52 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.operations.get * @desc 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. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource. - * name: 'operations/my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * cloudResourceManager.operations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudresourcemanager.operations.get({ + * // The name of the operation resource. + * name: 'operations/.*', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.operations.get * @memberOf! () * @@ -2346,52 +2355,52 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.organizations.clearOrgPolicy * @desc Clears a `Policy` from a resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('v1'); * - * authorize(function(authClient) { - * var request = { - * // Name of the resource for the `Policy` to clear. - * resource_: 'organizations/my-organization', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await cloudresourcemanager.organizations.clearOrgPolicy({ + * // Name of the resource for the `Policy` to clear. + * resource: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "constraint": "my_constraint", + * // "etag": "my_etag" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * cloudResourceManager.organizations.clearOrgPolicy(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.organizations.clearOrgPolicy * @memberOf! () * @@ -2467,53 +2476,54 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.organizations.get * @desc Fetches an Organization resource identified by the specified resource name. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 cloudresourcemanager.organizations.get({ * // The resource name of the Organization to fetch. This is the organization's * // relative path in the API, formatted as "organizations/[organizationId]". * // For example, "organizations/1234". - * name: 'organizations/my-organization', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * name: 'organizations/my-organization', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "displayName": "my_displayName", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "owner": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.organizations.get * @memberOf! () * @@ -2587,55 +2597,62 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.organizations.getEffectiveOrgPolicy * @desc Gets the effective `Policy` on a resource. This is the result of merging `Policies` in the resource hierarchy. The returned `Policy` will not have an `etag`set because it is a computed `Policy` across multiple resources. Subtrees of Resource Manager resource hierarchy with 'under:' prefix will not be expanded. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The name of the resource to start computing the effective `Policy`. - * resource_: 'organizations/my-organization', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await cloudresourcemanager.organizations.getEffectiveOrgPolicy({ + * // The name of the resource to start computing the effective `Policy`. + * resource: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "constraint": "my_constraint" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.getEffectiveOrgPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "booleanPolicy": {}, + * // "constraint": "my_constraint", + * // "etag": "my_etag", + * // "listPolicy": {}, + * // "restoreDefault": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.organizations.getEffectiveOrgPolicy * @memberOf! () * @@ -2715,56 +2732,60 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.organizations.getIamPolicy * @desc Gets the access control policy for an Organization resource. May be empty if no such policy or resource exists. The `resource` field should be the organization's resource name, e.g. "organizations/123". Authorization requires the Google IAM permission `resourcemanager.organizations.getIamPolicy` on the specified organization * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await cloudresourcemanager.organizations.getIamPolicy({ * // REQUIRED: The resource for which the policy is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'organizations/my-organization', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.organizations.getIamPolicy * @memberOf! () * @@ -2840,55 +2861,62 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.organizations.getOrgPolicy * @desc Gets a `Policy` on a resource. If no `Policy` is set on the resource, a `Policy` is returned with default values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value can be used with `SetOrgPolicy()` to create or update a `Policy` during read-modify-write. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Name of the resource the `Policy` is set on. - * resource_: 'organizations/my-organization', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await cloudresourcemanager.organizations.getOrgPolicy({ + * // Name of the resource the `Policy` is set on. + * resource: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "constraint": "my_constraint" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.getOrgPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "booleanPolicy": {}, + * // "constraint": "my_constraint", + * // "etag": "my_etag", + * // "listPolicy": {}, + * // "restoreDefault": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.organizations.getOrgPolicy * @memberOf! () * @@ -2966,68 +2994,60 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.organizations.listAvailableOrgPolicyConstraints * @desc Lists `Constraints` that could be applied on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the resource to list `Constraints` for. - * resource_: 'organizations/my-organization', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var constraintsPage = response['constraints']; - * if (!constraintsPage) { - * return; - * } - * for (var i = 0; i < constraintsPage.length; i++) { - * // TODO: Change code below to process each resource in `constraintsPage`: - * console.log(JSON.stringify(constraintsPage[i], null, 2)); - * } + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * cloudResourceManager.organizations.listAvailableOrgPolicyConstraints(request, handlePage); + * // 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 cloudresourcemanager.organizations.listAvailableOrgPolicyConstraints( + * { + * // Name of the resource to list `Constraints` for. + * resource: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "pageSize": 0, + * // "pageToken": "my_pageToken" + * // } + * }, * } - * }; + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "constraints": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } * - * cloudResourceManager.organizations.listAvailableOrgPolicyConstraints(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.organizations.listAvailableOrgPolicyConstraints * @memberOf! () * @@ -3127,68 +3147,58 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.organizations.listOrgPolicies * @desc Lists all the `Policies` set for a particular resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Name of the resource to list Policies for. - * resource_: 'organizations/my-organization', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await cloudresourcemanager.organizations.listOrgPolicies({ + * // Name of the resource to list Policies for. + * resource: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "pageSize": 0, + * // "pageToken": "my_pageToken" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var policiesPage = response['policies']; - * if (!policiesPage) { - * return; - * } - * for (var i = 0; i < policiesPage.length; i++) { - * // TODO: Change code below to process each resource in `policiesPage`: - * console.log(JSON.stringify(policiesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * cloudResourceManager.organizations.listOrgPolicies(request, handlePage); - * } - * }; + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "policies": [] + * // } + * } * - * cloudResourceManager.organizations.listOrgPolicies(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.organizations.listOrgPolicies * @memberOf! () * @@ -3270,65 +3280,56 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.organizations.search * @desc Searches Organization resources that are visible to the user and satisfy the specified filter. This method returns Organizations in an unspecified order. New Organizations do not necessarily appear at the end of the results. Search will only return organizations on which the user has the permission `resourcemanager.organizations.get` * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 cloudresourcemanager.organizations.search({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "filter": "my_filter", + * // "pageSize": 0, + * // "pageToken": "my_pageToken" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var organizationsPage = response['organizations']; - * if (!organizationsPage) { - * return; - * } - * for (var i = 0; i < organizationsPage.length; i++) { - * // TODO: Change code below to process each resource in `organizationsPage`: - * console.log(JSON.stringify(organizationsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * cloudResourceManager.organizations.search(request, handlePage); - * } - * }; + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "organizations": [] + * // } + * } * - * cloudResourceManager.organizations.search(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.organizations.search * @memberOf! () * @@ -3412,56 +3413,58 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.organizations.setIamPolicy * @desc Sets the access control policy on an Organization resource. Replaces any existing policy. The `resource` field should be the organization's resource name, e.g. "organizations/123". Authorization requires the Google IAM permission `resourcemanager.organizations.setIamPolicy` on the specified organization * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('v1'); * - * authorize(function(authClient) { - * var request = { + * 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/cloud-platform'], + * }); + * + * // 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 cloudresourcemanager.organizations.setIamPolicy({ * // REQUIRED: The resource for which the policy is being specified. * // See the operation documentation for the appropriate value for this field. - * resource_: 'organizations/my-organization', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.organizations.setIamPolicy * @memberOf! () * @@ -3537,55 +3540,59 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.organizations.setOrgPolicy * @desc Updates the specified `Policy` on the resource. Creates a new `Policy` for that `Constraint` on the resource if one does not exist. Not supplying an `etag` on the request `Policy` results in an unconditional write of the `Policy`. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Resource name of the resource to attach the `Policy`. - * resource_: 'organizations/my-organization', // TODO: Update placeholder value. + * const cloudresourcemanager = google.cloudresourcemanager('v1'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudResourceManager.organizations.setOrgPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudresourcemanager.organizations.setOrgPolicy({ + * // Resource name of the resource to attach the `Policy`. + * resource: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "booleanPolicy": {}, + * // "constraint": "my_constraint", + * // "etag": "my_etag", + * // "listPolicy": {}, + * // "restoreDefault": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.organizations.setOrgPolicy * @memberOf! () * @@ -3663,56 +3670,57 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.organizations.testIamPermissions * @desc Returns permissions that a caller has on the specified Organization. The `resource` field should be the organization's resource name, e.g. "organizations/123". There are no permissions required for making this API call. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await cloudresourcemanager.organizations.testIamPermissions({ * // REQUIRED: The resource for which the policy detail is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'organizations/my-organization', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.organizations.testIamPermissions * @memberOf! () * @@ -3982,52 +3990,52 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.projects.clearOrgPolicy * @desc Clears a `Policy` from a resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('v1'); * - * authorize(function(authClient) { - * var request = { - * // Name of the resource for the `Policy` to clear. - * resource_: 'projects/my-project', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 cloudresourcemanager.projects.clearOrgPolicy({ + * // Name of the resource for the `Policy` to clear. + * resource: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "constraint": "my_constraint", + * // "etag": "my_etag" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * cloudResourceManager.projects.clearOrgPolicy(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.clearOrgPolicy * @memberOf! () * @@ -4103,52 +4111,60 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.projects.create * @desc Request that a new Project be created. The result is an Operation which can be used to track the creation process. This process usually takes a few seconds, but can sometimes take much longer. The tracking Operation is automatically deleted after a few hours, so there is no need to call DeleteOperation. Authorization requires the Google IAM permission `resourcemanager.projects.create` on the specified parent for the new project. The parent is identified by a specified ResourceId, which must include both an ID and a type, such as organization. This method does not associate the new project with a billing account. You can set or update the billing account associated with a project using the [`projects.updateBillingInfo`] (/billing/reference/rest/v1/projects/updateBillingInfo) method. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * const cloudresourcemanager = google.cloudresourcemanager('v1'); * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * 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/cloud-platform'], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 cloudresourcemanager.projects.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": {}, + * // "projectId": "my_projectId", + * // "projectNumber": "my_projectNumber" + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.projects.create * @memberOf! () * @@ -4221,49 +4237,45 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.projects.delete * @desc Marks the Project identified by the specified `project_id` (for example, `my-project-123`) for deletion. This method will only affect the Project if it has a lifecycle state of ACTIVE. This method changes the Project's lifecycle state from ACTIVE to DELETE_REQUESTED. The deletion starts at an unspecified time, at which point the Project is no longer accessible. Until the deletion completes, you can check the lifecycle state checked by retrieving the Project with GetProject, and the Project remains visible to ListProjects. However, you cannot update the project. After the deletion completes, the Project is not retrievable by the GetProject and ListProjects methods. The caller must have modify permissions for this Project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 cloudresourcemanager.projects.delete({ * // The Project ID (for example, `foo-bar-123`). + * // * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * cloudResourceManager.projects.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.delete * @memberOf! () * @@ -4337,52 +4349,56 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.projects.get * @desc Retrieves the Project identified by the specified `project_id` (for example, `my-project-123`). The caller must have read permissions for this Project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await cloudresourcemanager.projects.get({ * // The Project ID (for example, `my-project-123`). + * // * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * projectId: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": {}, + * // "projectId": "my_projectId", + * // "projectNumber": "my_projectNumber" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.get * @memberOf! () * @@ -4456,56 +4472,56 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.projects.getAncestry * @desc Gets a list of ancestors in the resource hierarchy for the Project identified by the specified `project_id` (for example, `my-project-123`). The caller must have read permissions for this Project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await cloudresourcemanager.projects.getAncestry({ * // The Project ID (for example, `my-project-123`). + * // * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * projectId: 'placeholder-value', * - * resource: { - * // TODO: Add desired properties to the request body. + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.getAncestry(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "ancestor": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.getAncestry * @memberOf! () * @@ -4585,55 +4601,62 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.projects.getEffectiveOrgPolicy * @desc Gets the effective `Policy` on a resource. This is the result of merging `Policies` in the resource hierarchy. The returned `Policy` will not have an `etag`set because it is a computed `Policy` across multiple resources. Subtrees of Resource Manager resource hierarchy with 'under:' prefix will not be expanded. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The name of the resource to start computing the effective `Policy`. - * resource_: 'projects/my-project', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await cloudresourcemanager.projects.getEffectiveOrgPolicy({ + * // The name of the resource to start computing the effective `Policy`. + * resource: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "constraint": "my_constraint" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.getEffectiveOrgPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "booleanPolicy": {}, + * // "constraint": "my_constraint", + * // "etag": "my_etag", + * // "listPolicy": {}, + * // "restoreDefault": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.getEffectiveOrgPolicy * @memberOf! () * @@ -4713,56 +4736,60 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.projects.getIamPolicy * @desc Returns the IAM access control policy for the specified Project. Permission is denied if the policy or the resource does not exist. Authorization requires the Google IAM permission `resourcemanager.projects.getIamPolicy` on the project. For additional information about resource structure and identification, see [Resource Names](/apis/design/resource_names). * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await cloudresourcemanager.projects.getIamPolicy({ * // REQUIRED: The resource for which the policy is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.getIamPolicy * @memberOf! () * @@ -4838,55 +4865,62 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.projects.getOrgPolicy * @desc Gets a `Policy` on a resource. If no `Policy` is set on the resource, a `Policy` is returned with default values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value can be used with `SetOrgPolicy()` to create or update a `Policy` during read-modify-write. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Name of the resource the `Policy` is set on. - * resource_: 'projects/my-project', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await cloudresourcemanager.projects.getOrgPolicy({ + * // Name of the resource the `Policy` is set on. + * resource: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "constraint": "my_constraint" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.getOrgPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "booleanPolicy": {}, + * // "constraint": "my_constraint", + * // "etag": "my_etag", + * // "listPolicy": {}, + * // "restoreDefault": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.getOrgPolicy * @memberOf! () * @@ -4964,61 +4998,92 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.projects.list * @desc Lists Projects that the caller has the `resourcemanager.projects.get` permission on and satisfy the specified filter. This method returns Projects in an unspecified order. This method is eventually consistent with project mutations; this means that a newly created project may not appear in the results or recent updates to an existing project may not be reflected in the results. To retrieve the latest state of a project, use the GetProject method. NOTE: If the request filter contains a `parent.type` and `parent.id` and the caller has the `resourcemanager.projects.list` permission on the parent, the results will be drawn from an alternate index which provides more consistent results. In future versions of this API, this List method will be split into List and Search to properly capture the behavorial difference. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * var projectsPage = response['projects']; - * if (!projectsPage) { - * return; - * } - * for (var i = 0; i < projectsPage.length; i++) { - * // TODO: Change code below to process each resource in `projectsPage`: - * console.log(JSON.stringify(projectsPage[i], null, 2)); - * } + * // 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 cloudresourcemanager.projects.list({ + * // An expression for filtering the results of the request. Filter rules are + * // case insensitive. The fields eligible for filtering are: + * // + * // + `name` + * // + `id` + * // + `labels.` (where *key* is the name of a label) + * // + `parent.type` + * // + `parent.id` + * // + * // Some examples of using labels as filters: + * // + * // | Filter | Description | + * // |------------------|-----------------------------------------------------| + * // | name:how* | The project's name starts with "how". | + * // | name:Howl | The project's name is `Howl` or `howl`. | + * // | name:HOWL | Equivalent to above. | + * // | NAME:howl | Equivalent to above. | + * // | labels.color:* | The project has the label `color`. | + * // | labels.color:red | The project's label `color` has the value `red`. | + * // | labels.color:red labels.size:big |The project's label `color` has + * // the value `red` and its label `size` has the value `big`. | + * // + * // If no filter is specified, the call will return projects for which the user + * // has the `resourcemanager.projects.get` permission. + * // + * // NOTE: To perform a by-parent query (eg., what projects are directly in a + * // Folder), the caller must have the `resourcemanager.projects.list` + * // permission on the parent and the filter must contain both a `parent.type` + * // and a `parent.id` restriction + * // (example: "parent.type:folder parent.id:123"). In this case an alternate + * // search index is used which provides more consistent results. + * // + * // Optional. + * filter: 'placeholder-value', + * // The maximum number of Projects to return in the response. + * // The server can return fewer Projects than requested. + * // If unspecified, server picks an appropriate default. + * // + * // Optional. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call to ListProjects + * // that indicates from where listing should continue. + * // + * // Optional. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudResourceManager.projects.list(request, handlePage); - * } - * }; + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "projects": [] + * // } + * } * - * cloudResourceManager.projects.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.list * @memberOf! () * @@ -5095,68 +5160,60 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.projects.listAvailableOrgPolicyConstraints * @desc Lists `Constraints` that could be applied on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the resource to list `Constraints` for. - * resource_: 'projects/my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var constraintsPage = response['constraints']; - * if (!constraintsPage) { - * return; - * } - * for (var i = 0; i < constraintsPage.length; i++) { - * // TODO: Change code below to process each resource in `constraintsPage`: - * console.log(JSON.stringify(constraintsPage[i], null, 2)); - * } + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * cloudResourceManager.projects.listAvailableOrgPolicyConstraints(request, handlePage); + * // 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 cloudresourcemanager.projects.listAvailableOrgPolicyConstraints( + * { + * // Name of the resource to list `Constraints` for. + * resource: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "pageSize": 0, + * // "pageToken": "my_pageToken" + * // } + * }, * } - * }; + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "constraints": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } * - * cloudResourceManager.projects.listAvailableOrgPolicyConstraints(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.listAvailableOrgPolicyConstraints * @memberOf! () * @@ -5256,68 +5313,58 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.projects.listOrgPolicies * @desc Lists all the `Policies` set for a particular resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Name of the resource to list Policies for. - * resource_: 'projects/my-project', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await cloudresourcemanager.projects.listOrgPolicies({ + * // Name of the resource to list Policies for. + * resource: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "pageSize": 0, + * // "pageToken": "my_pageToken" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var policiesPage = response['policies']; - * if (!policiesPage) { - * return; - * } - * for (var i = 0; i < policiesPage.length; i++) { - * // TODO: Change code below to process each resource in `policiesPage`: - * console.log(JSON.stringify(policiesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * cloudResourceManager.projects.listOrgPolicies(request, handlePage); - * } - * }; + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "policies": [] + * // } + * } * - * cloudResourceManager.projects.listOrgPolicies(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.listOrgPolicies * @memberOf! () * @@ -5399,56 +5446,58 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.projects.setIamPolicy * @desc Sets the IAM access control policy for the specified Project. Overwrites any existing policy. The following constraints apply when using `setIamPolicy()`: + Project does not support `allUsers` and `allAuthenticatedUsers` as `members` in a `Binding` of a `Policy`. + The owner role can be granted to a `user`, `serviceAccount`, or a group that is part of an organization. For example, group@myownpersonaldomain.com could be added as an owner to a project in the myownpersonaldomain.com organization, but not the examplepetstore.com organization. + Service accounts can be made owners of a project directly without any restrictions. However, to be added as an owner, a user must be invited via Cloud Platform console and must accept the invitation. + A user cannot be granted the owner role using `setIamPolicy()`. The user must be granted the owner role using the Cloud Platform Console and must explicitly accept the invitation. + You can only grant ownership of a project to a member by using the GCP Console. Inviting a member will deliver an invitation email that they must accept. An invitation email is not generated if you are granting a role other than owner, or if both the member you are inviting and the project are part of your organization. + Membership changes that leave the project without any owners that have accepted the Terms of Service (ToS) will be rejected. + If the project is not part of an organization, there must be at least one owner who has accepted the Terms of Service (ToS) agreement in the policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner from the policy will fail. This restriction also applies to legacy projects that no longer have owners who have accepted the ToS. Edits to IAM policies will be rejected until the lack of a ToS-accepting owner is rectified. + This method will replace the existing policy, and cannot be used to append additional IAM settings. Note: Removing service accounts from policies or changing their roles can render services completely inoperable. It is important to understand how the service account is being used before removing or updating its roles. Authorization requires the Google IAM permission `resourcemanager.projects.setIamPolicy` on the project * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await cloudresourcemanager.projects.setIamPolicy({ * // REQUIRED: The resource for which the policy is being specified. * // See the operation documentation for the appropriate value for this field. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.setIamPolicy * @memberOf! () * @@ -5524,55 +5573,59 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.projects.setOrgPolicy * @desc Updates the specified `Policy` on the resource. Creates a new `Policy` for that `Constraint` on the resource if one does not exist. Not supplying an `etag` on the request `Policy` results in an unconditional write of the `Policy`. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Resource name of the resource to attach the `Policy`. - * resource_: 'projects/my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * const cloudresourcemanager = google.cloudresourcemanager('v1'); * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudResourceManager.projects.setOrgPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudresourcemanager.projects.setOrgPolicy({ + * // Resource name of the resource to attach the `Policy`. + * resource: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "booleanPolicy": {}, + * // "constraint": "my_constraint", + * // "etag": "my_etag", + * // "listPolicy": {}, + * // "restoreDefault": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.setOrgPolicy * @memberOf! () * @@ -5650,56 +5703,57 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.projects.testIamPermissions * @desc Returns permissions that a caller has on the specified Project. There are no permissions required for making this API call. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await cloudresourcemanager.projects.testIamPermissions({ * // REQUIRED: The resource for which the policy detail is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.testIamPermissions * @memberOf! () * @@ -5783,53 +5837,51 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.projects.undelete * @desc Restores the Project identified by the specified `project_id` (for example, `my-project-123`). You can only use this method for a Project that has a lifecycle state of DELETE_REQUESTED. After deletion starts, the Project cannot be restored. The caller must have modify permissions for this Project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 cloudresourcemanager.projects.undelete({ * // The project ID (for example, `foo-bar-123`). + * // * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * projectId: 'placeholder-value', * - * resource: { - * // TODO: Add desired properties to the request body. + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * cloudResourceManager.projects.undelete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.undelete * @memberOf! () * @@ -5905,57 +5957,67 @@ export namespace cloudresourcemanager_v1 { * cloudresourcemanager.projects.update * @desc Updates the attributes of the Project identified by the specified `project_id` (for example, `my-project-123`). The caller must have modify permissions for this Project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); + * const cloudresourcemanager = google.cloudresourcemanager('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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await cloudresourcemanager.projects.update({ * // The project ID (for example, `my-project-123`). + * // * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": {}, + * // "projectId": "my_projectId", + * // "projectNumber": "my_projectNumber" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": {}, + * // "projectId": "my_projectId", + * // "projectNumber": "my_projectNumber" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.update * @memberOf! () * diff --git a/src/apis/cloudresourcemanager/v1beta1.ts b/src/apis/cloudresourcemanager/v1beta1.ts index e4d00f8e1e3..82f2d66bd95 100644 --- a/src/apis/cloudresourcemanager/v1beta1.ts +++ b/src/apis/cloudresourcemanager/v1beta1.ts @@ -447,53 +447,58 @@ export namespace cloudresourcemanager_v1beta1 { * cloudresourcemanager.organizations.get * @desc Fetches an Organization resource identified by the specified resource name. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * const cloudresourcemanager = google.cloudresourcemanager('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await cloudresourcemanager.organizations.get({ * // The resource name of the Organization to fetch. This is the organization's * // relative path in the API, formatted as "organizations/[organizationId]". * // For example, "organizations/1234". - * name: 'organizations/my-organization', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * name: 'organizations/my-organization', + * // The id of the Organization resource to fetch. + * // This field is deprecated and will be removed in v1. Use name instead. + * organizationId: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "displayName": "my_displayName", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "organizationId": "my_organizationId", + * // "owner": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.organizations.get * @memberOf! () * @@ -568,56 +573,60 @@ export namespace cloudresourcemanager_v1beta1 { * cloudresourcemanager.organizations.getIamPolicy * @desc Gets the access control policy for an Organization resource. May be empty if no such policy or resource exists. The `resource` field should be the organization's resource name, e.g. "organizations/123". * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * const cloudresourcemanager = google.cloudresourcemanager('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 cloudresourcemanager.organizations.getIamPolicy({ * // REQUIRED: The resource for which the policy is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'organizations/my-organization', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.organizations.getIamPolicy * @memberOf! () * @@ -693,61 +702,68 @@ export namespace cloudresourcemanager_v1beta1 { * cloudresourcemanager.organizations.list * @desc Lists Organization resources that are visible to the user and satisfy the specified filter. This method returns Organizations in an unspecified order. New Organizations do not necessarily appear at the end of the list. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var organizationsPage = response['organizations']; - * if (!organizationsPage) { - * return; - * } - * for (var i = 0; i < organizationsPage.length; i++) { - * // TODO: Change code below to process each resource in `organizationsPage`: - * console.log(JSON.stringify(organizationsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudResourceManager.organizations.list(request, handlePage); - * } - * }; - * - * cloudResourceManager.organizations.list(request, handlePage); - * }); + * const cloudresourcemanager = google.cloudresourcemanager('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 cloudresourcemanager.organizations.list({ + * // An optional query string used to filter the Organizations to return in + * // the response. Filter rules are case-insensitive. + * // + * // + * // Organizations may be filtered by `owner.directoryCustomerId` or by + * // `domain`, where the domain is a G Suite domain, for example: + * // + * // * Filter `owner.directorycustomerid:123456789` returns Organization + * // resources with `owner.directory_customer_id` equal to `123456789`. + * // * Filter `domain:google.com` returns Organization resources corresponding + * // to the domain `google.com`. + * // + * // This field is optional. + * filter: 'placeholder-value', + * // The maximum number of Organizations to return in the response. + * // This field is optional. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call to `ListOrganizations` + * // that indicates from where listing should continue. + * // This field is optional. + * pageToken: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "organizations": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.organizations.list * @memberOf! () * @@ -833,56 +849,58 @@ export namespace cloudresourcemanager_v1beta1 { * cloudresourcemanager.organizations.setIamPolicy * @desc Sets the access control policy on an Organization resource. Replaces any existing policy. The `resource` field should be the organization's resource name, e.g. "organizations/123". * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * const cloudresourcemanager = google.cloudresourcemanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await cloudresourcemanager.organizations.setIamPolicy({ * // REQUIRED: The resource for which the policy is being specified. * // See the operation documentation for the appropriate value for this field. - * resource_: 'organizations/my-organization', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.organizations.setIamPolicy * @memberOf! () * @@ -958,56 +976,57 @@ export namespace cloudresourcemanager_v1beta1 { * cloudresourcemanager.organizations.testIamPermissions * @desc Returns permissions that a caller has on the specified Organization. The `resource` field should be the organization's resource name, e.g. "organizations/123". * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * const cloudresourcemanager = google.cloudresourcemanager('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 cloudresourcemanager.organizations.testIamPermissions({ * // REQUIRED: The resource for which the policy detail is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'organizations/my-organization', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.organizations.testIamPermissions * @memberOf! () * @@ -1092,58 +1111,65 @@ export namespace cloudresourcemanager_v1beta1 { * cloudresourcemanager.organizations.update * @desc Updates an Organization resource identified by the specified resource name. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * const cloudresourcemanager = google.cloudresourcemanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { - * // Output Only. The resource name of the organization. This is the + * // Do the magic + * const res = await cloudresourcemanager.organizations.update({ + * // Output only. The resource name of the organization. This is the * // organization's relative path in the API. Its format is * // "organizations/[organization_id]". For example, "organizations/1234". - * name: 'organizations/my-organization', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * name: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTime": "my_creationTime", + * // "displayName": "my_displayName", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "organizationId": "my_organizationId", + * // "owner": {} + * // } * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "displayName": "my_displayName", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "organizationId": "my_organizationId", + * // "owner": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.organizations.update * @memberOf! () * @@ -1330,52 +1356,65 @@ export namespace cloudresourcemanager_v1beta1 { * cloudresourcemanager.projects.create * @desc Creates a Project resource. Initially, the Project resource is owned by its creator exclusively. The creator can later grant permission to others to read or update the Project. Several APIs are activated automatically for the Project, including Google Cloud Storage. The parent is identified by a specified ResourceId, which must include both an ID and a type, such as project, folder, or organization. This method does not associate the new project with a billing account. You can set or update the billing account associated with a project using the [`projects.updateBillingInfo`] (/billing/reference/rest/v1/projects/updateBillingInfo) method. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * const cloudresourcemanager = google.cloudresourcemanager('v1beta1'); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * 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/cloud-platform'], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 cloudresourcemanager.projects.create({ + * // A now unused experiment opt-out option. + * useLegacyStack: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": {}, + * // "projectId": "my_projectId", + * // "projectNumber": "my_projectNumber" + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": {}, + * // "projectId": "my_projectId", + * // "projectNumber": "my_projectNumber" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.projects.create * @memberOf! () * @@ -1447,49 +1486,45 @@ export namespace cloudresourcemanager_v1beta1 { * cloudresourcemanager.projects.delete * @desc Marks the Project identified by the specified `project_id` (for example, `my-project-123`) for deletion. This method will only affect the Project if it has a lifecycle state of ACTIVE. This method changes the Project's lifecycle state from ACTIVE to DELETE_REQUESTED. The deletion starts at an unspecified time, at which point the project is no longer accessible. Until the deletion completes, you can check the lifecycle state checked by retrieving the Project with GetProject, and the Project remains visible to ListProjects. However, you cannot update the project. After the deletion completes, the Project is not retrievable by the GetProject and ListProjects methods. The caller must have modify permissions for this Project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * const cloudresourcemanager = google.cloudresourcemanager('v1beta1'); + * + * 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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 cloudresourcemanager.projects.delete({ * // The Project ID (for example, `foo-bar-123`). + * // * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * cloudResourceManager.projects.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.delete * @memberOf! () * @@ -1563,52 +1598,56 @@ export namespace cloudresourcemanager_v1beta1 { * cloudresourcemanager.projects.get * @desc Retrieves the Project identified by the specified `project_id` (for example, `my-project-123`). The caller must have read permissions for this Project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * const cloudresourcemanager = google.cloudresourcemanager('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await cloudresourcemanager.projects.get({ * // The Project ID (for example, `my-project-123`). + * // * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * projectId: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": {}, + * // "projectId": "my_projectId", + * // "projectNumber": "my_projectNumber" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.get * @memberOf! () * @@ -1682,56 +1721,56 @@ export namespace cloudresourcemanager_v1beta1 { * cloudresourcemanager.projects.getAncestry * @desc Gets a list of ancestors in the resource hierarchy for the Project identified by the specified `project_id` (for example, `my-project-123`). The caller must have read permissions for this Project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * const cloudresourcemanager = google.cloudresourcemanager('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await cloudresourcemanager.projects.getAncestry({ * // The Project ID (for example, `my-project-123`). + * // * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * projectId: 'placeholder-value', * - * resource: { - * // TODO: Add desired properties to the request body. + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.getAncestry(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "ancestor": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.getAncestry * @memberOf! () * @@ -1810,56 +1849,60 @@ export namespace cloudresourcemanager_v1beta1 { * cloudresourcemanager.projects.getIamPolicy * @desc Returns the IAM access control policy for the specified Project. Permission is denied if the policy or the resource does not exist. For additional information about resource structure and identification, see [Resource Names](/apis/design/resource_names). * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * const cloudresourcemanager = google.cloudresourcemanager('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 cloudresourcemanager.projects.getIamPolicy({ * // REQUIRED: The resource for which the policy is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.getIamPolicy * @memberOf! () * @@ -1934,61 +1977,92 @@ export namespace cloudresourcemanager_v1beta1 { * cloudresourcemanager.projects.list * @desc Lists Projects that the caller has the `resourcemanager.projects.get` permission on and satisfy the specified filter. This method returns Projects in an unspecified order. This method is eventually consistent with project mutations; this means that a newly created project may not appear in the results or recent updates to an existing project may not be reflected in the results. To retrieve the latest state of a project, use the GetProject method. NOTE: If the request filter contains a `parent.type` and `parent.id` and the caller has the `resourcemanager.projects.list` permission on the parent, the results will be drawn from an alternate index which provides more consistent results. In future versions of this API, this List method will be split into List and Search to properly capture the behavorial difference. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var projectsPage = response['projects']; - * if (!projectsPage) { - * return; - * } - * for (var i = 0; i < projectsPage.length; i++) { - * // TODO: Change code below to process each resource in `projectsPage`: - * console.log(JSON.stringify(projectsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudResourceManager.projects.list(request, handlePage); - * } - * }; - * - * cloudResourceManager.projects.list(request, handlePage); - * }); + * const cloudresourcemanager = google.cloudresourcemanager('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 cloudresourcemanager.projects.list({ + * // An expression for filtering the results of the request. Filter rules are + * // case insensitive. The fields eligible for filtering are: + * // + * // + `name` + * // + `id` + * // + `labels.` (where *key* is the name of a label) + * // + `parent.type` + * // + `parent.id` + * // + * // Some examples of using labels as filters: + * // + * // | Filter | Description | + * // |------------------|-----------------------------------------------------| + * // | name:how* | The project's name starts with "how". | + * // | name:Howl | The project's name is `Howl` or `howl`. | + * // | name:HOWL | Equivalent to above. | + * // | NAME:howl | Equivalent to above. | + * // | labels.color:* | The project has the label `color`. | + * // | labels.color:red | The project's label `color` has the value `red`. | + * // | labels.color:red labels.size:big |The project's label `color` has + * // the value `red` and its label `size` has the value `big`. | + * // + * // If no filter is specified, the call will return projects for which the user + * // has the `resourcemanager.projects.get` permission. + * // + * // NOTE: To perform a by-parent query (eg., what projects are directly in a + * // Folder), the caller must have the `resourcemanager.projects.list` + * // permission on the parent and the filter must contain both a `parent.type` + * // and a `parent.id` restriction + * // (example: "parent.type:folder parent.id:123"). In this case an alternate + * // search index is used which provides more consistent results. + * // + * // Optional. + * filter: 'placeholder-value', + * // The maximum number of Projects to return in the response. + * // The server can return fewer Projects than requested. + * // If unspecified, server picks an appropriate default. + * // + * // Optional. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call to ListProjects + * // that indicates from where listing should continue. + * // + * // Optional. + * pageToken: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "projects": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.projects.list * @memberOf! () * @@ -2065,56 +2139,58 @@ export namespace cloudresourcemanager_v1beta1 { * cloudresourcemanager.projects.setIamPolicy * @desc Sets the IAM access control policy for the specified Project. Overwrites any existing policy. The following constraints apply when using `setIamPolicy()`: + Project does not support `allUsers` and `allAuthenticatedUsers` as `members` in a `Binding` of a `Policy`. + The owner role can be granted to a `user`, `serviceAccount`, or a group that is part of an organization. For example, group@myownpersonaldomain.com could be added as an owner to a project in the myownpersonaldomain.com organization, but not the examplepetstore.com organization. + Service accounts can be made owners of a project directly without any restrictions. However, to be added as an owner, a user must be invited via Cloud Platform console and must accept the invitation. + A user cannot be granted the owner role using `setIamPolicy()`. The user must be granted the owner role using the Cloud Platform Console and must explicitly accept the invitation. + Invitations to grant the owner role cannot be sent using `setIamPolicy()`; they must be sent only using the Cloud Platform Console. + Membership changes that leave the project without any owners that have accepted the Terms of Service (ToS) will be rejected. + If the project is not part of an organization, there must be at least one owner who has accepted the Terms of Service (ToS) agreement in the policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner from the policy will fail. This restriction also applies to legacy projects that no longer have owners who have accepted the ToS. Edits to IAM policies will be rejected until the lack of a ToS-accepting owner is rectified. + This method will replace the existing policy, and cannot be used to append additional IAM settings. Note: Removing service accounts from policies or changing their roles can render services completely inoperable. It is important to understand how the service account is being used before removing or updating its roles. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * const cloudresourcemanager = google.cloudresourcemanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await cloudresourcemanager.projects.setIamPolicy({ * // REQUIRED: The resource for which the policy is being specified. * // See the operation documentation for the appropriate value for this field. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.setIamPolicy * @memberOf! () * @@ -2189,56 +2265,57 @@ export namespace cloudresourcemanager_v1beta1 { * cloudresourcemanager.projects.testIamPermissions * @desc Returns permissions that a caller has on the specified Project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * const cloudresourcemanager = google.cloudresourcemanager('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 cloudresourcemanager.projects.testIamPermissions({ * // REQUIRED: The resource for which the policy detail is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.testIamPermissions * @memberOf! () * @@ -2322,53 +2399,51 @@ export namespace cloudresourcemanager_v1beta1 { * cloudresourcemanager.projects.undelete * @desc Restores the Project identified by the specified `project_id` (for example, `my-project-123`). You can only use this method for a Project that has a lifecycle state of DELETE_REQUESTED. After deletion starts, the Project cannot be restored. The caller must have modify permissions for this Project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * const cloudresourcemanager = google.cloudresourcemanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await cloudresourcemanager.projects.undelete({ * // The project ID (for example, `foo-bar-123`). + * // * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * projectId: 'placeholder-value', * - * resource: { - * // TODO: Add desired properties to the request body. + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * cloudResourceManager.projects.undelete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.undelete * @memberOf! () * @@ -2444,57 +2519,67 @@ export namespace cloudresourcemanager_v1beta1 { * cloudresourcemanager.projects.update * @desc Updates the attributes of the Project identified by the specified `project_id` (for example, `my-project-123`). The caller must have modify permissions for this Project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * const cloudresourcemanager = google.cloudresourcemanager('v1beta1'); + * + * 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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 cloudresourcemanager.projects.update({ * // The project ID (for example, `my-project-123`). + * // * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": {}, + * // "projectId": "my_projectId", + * // "projectNumber": "my_projectNumber" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": {}, + * // "projectId": "my_projectId", + * // "projectNumber": "my_projectNumber" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudresourcemanager.projects.update * @memberOf! () * diff --git a/src/apis/cloudresourcemanager/v2.ts b/src/apis/cloudresourcemanager/v2.ts index 38305af189c..6ac308c076d 100644 --- a/src/apis/cloudresourcemanager/v2.ts +++ b/src/apis/cloudresourcemanager/v2.ts @@ -429,6 +429,63 @@ export namespace cloudresourcemanager_v2 { /** * cloudresourcemanager.folders.create * @desc Creates a Folder in the resource hierarchy. Returns an Operation which can be used to track the progress of the folder creation workflow. Upon success the Operation.response field will be populated with the created Folder. In order to succeed, the addition of this new Folder must not violate the Folder naming, height or fanout constraints. + The Folder's display_name must be distinct from all other Folder's that share its parent. + The addition of the Folder must not cause the active Folder hierarchy to exceed a height of 4. Note, the full active + deleted Folder hierarchy is allowed to reach a height of 8; this provides additional headroom when moving folders that contain deleted folders. + The addition of the Folder must not cause the total number of Folders under its parent to exceed 100. If the operation fails due to a folder constraint violation, some errors may be returned by the CreateFolder request, with status code FAILED_PRECONDITION and an error description. Other folder constraint violations will be communicated in the Operation, with the specific PreconditionFailure returned via the details list in the Operation.error field. The caller must have `resourcemanager.folders.create` permission on the identified parent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudresourcemanager.folders.create({ + * // Required. The resource name of the new Folder's parent. + * // Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + * parent: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "displayName": "my_displayName", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": "my_parent" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.create * @memberOf! () * @@ -501,6 +558,51 @@ export namespace cloudresourcemanager_v2 { /** * cloudresourcemanager.folders.delete * @desc Requests deletion of a Folder. The Folder is moved into the DELETE_REQUESTED state immediately, and is deleted approximately 30 days later. This method may only be called on an empty Folder in the ACTIVE state, where a Folder is empty if it doesn't contain any Folders or Projects in the ACTIVE state. The caller must have `resourcemanager.folders.delete` permission on the identified folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudresourcemanager.folders.delete({ + * // Required. the resource name of the Folder to be deleted. + * // Must be of the form `folders/{folder_id}`. + * name: 'folders/my-folder', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "displayName": "my_displayName", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": "my_parent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.delete * @memberOf! () * @@ -570,6 +672,54 @@ export namespace cloudresourcemanager_v2 { /** * cloudresourcemanager.folders.get * @desc Retrieves a Folder identified by the supplied resource name. Valid Folder resource names have the format `folders/{folder_id}` (for example, `folders/1234`). The caller must have `resourcemanager.folders.get` permission on the identified folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 cloudresourcemanager.folders.get({ + * // Required. The resource name of the Folder to retrieve. + * // Must be of the form `folders/{folder_id}`. + * name: 'folders/my-folder', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "displayName": "my_displayName", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": "my_parent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.get * @memberOf! () * @@ -639,6 +789,61 @@ export namespace cloudresourcemanager_v2 { /** * cloudresourcemanager.folders.getIamPolicy * @desc Gets the access control policy for a Folder. The returned policy may be empty if no such policy or resource exists. The `resource` field should be the Folder's resource name, e.g. "folders/1234". The caller must have `resourcemanager.folders.getIamPolicy` permission on the identified folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 cloudresourcemanager.folders.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'folders/my-folder', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.getIamPolicy * @memberOf! () * @@ -713,6 +918,63 @@ export namespace cloudresourcemanager_v2 { /** * cloudresourcemanager.folders.list * @desc Lists the Folders that are direct descendants of supplied parent resource. List provides a strongly consistent view of the Folders underneath the specified parent resource. List returns Folders sorted based upon the (ascending) lexical ordering of their display_name. The caller must have `resourcemanager.folders.list` permission on the identified parent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 cloudresourcemanager.folders.list({ + * // Optional. The maximum number of Folders to return in the response. + * pageSize: 'placeholder-value', + * // Optional. A pagination token returned from a previous call to `ListFolders` + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The resource name of the Organization or Folder whose Folders are + * // being listed. + * // Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + * // Access to this method is controlled by checking the + * // `resourcemanager.folders.list` permission on the `parent`. + * parent: 'placeholder-value', + * // Optional. Controls whether Folders in the + * // DELETE_REQUESTED + * // state should be returned. Defaults to false. + * showDeleted: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "folders": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.list * @memberOf! () * @@ -787,6 +1049,59 @@ export namespace cloudresourcemanager_v2 { /** * cloudresourcemanager.folders.move * @desc Moves a Folder under a new resource parent. Returns an Operation which can be used to track the progress of the folder move workflow. Upon success the Operation.response field will be populated with the moved Folder. Upon failure, a FolderOperationError categorizing the failure cause will be returned - if the failure occurs synchronously then the FolderOperationError will be returned via the Status.details field and if it occurs asynchronously then the FolderOperation will be returned via the Operation.error field. In addition, the Operation.metadata field will be populated with a FolderOperation message as an aid to stateless clients. Folder moves will be rejected if they violate either the naming, height or fanout constraints described in the CreateFolder documentation. The caller must have `resourcemanager.folders.move` permission on the folder's current and proposed new parent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudresourcemanager.folders.move({ + * // Required. The resource name of the Folder to move. + * // Must be of the form folders/{folder_id} + * name: 'folders/my-folder', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destinationParent": "my_destinationParent" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.move * @memberOf! () * @@ -859,6 +1174,66 @@ export namespace cloudresourcemanager_v2 { /** * cloudresourcemanager.folders.patch * @desc Updates a Folder, changing its display_name. Changes to the folder display_name will be rejected if they violate either the display_name formatting rules or naming constraints described in the CreateFolder documentation. The Folder's display name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be no longer than 30 characters. This is captured by the regular expression: [\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. The caller must have `resourcemanager.folders.update` permission on the identified folder. If the update fails due to the unique name constraint then a PreconditionFailure explaining this violation will be returned in the Status.details field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudresourcemanager.folders.patch({ + * // Output only. The resource name of the Folder. + * // Its format is `folders/{folder_id}`, for example: "folders/1234". + * name: 'folders/my-folder', + * // Required. Fields to be updated. + * // Only the `display_name` can be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "displayName": "my_displayName", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": "my_parent" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "displayName": "my_displayName", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": "my_parent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.patch * @memberOf! () * @@ -930,6 +1305,57 @@ export namespace cloudresourcemanager_v2 { /** * cloudresourcemanager.folders.search * @desc Search for folders that match specific filter criteria. Search provides an eventually consistent view of the folders a user has access to which meet the specified filter criteria. This will only return folders on which the caller has the permission `resourcemanager.folders.get`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 cloudresourcemanager.folders.search({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "pageSize": 0, + * // "pageToken": "my_pageToken", + * // "query": "my_query" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "folders": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.search * @memberOf! () * @@ -1003,6 +1429,59 @@ export namespace cloudresourcemanager_v2 { /** * cloudresourcemanager.folders.setIamPolicy * @desc Sets the access control policy on a Folder, replacing any existing policy. The `resource` field should be the Folder's resource name, e.g. "folders/1234". The caller must have `resourcemanager.folders.setIamPolicy` permission on the identified folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudresourcemanager.folders.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'folders/my-folder', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.setIamPolicy * @memberOf! () * @@ -1077,6 +1556,55 @@ export namespace cloudresourcemanager_v2 { /** * cloudresourcemanager.folders.testIamPermissions * @desc Returns permissions that a caller has on the specified Folder. The `resource` field should be the Folder's resource name, e.g. "folders/1234". There are no permissions required for making this API call. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudresourcemanager.folders.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'folders/my-folder', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.testIamPermissions * @memberOf! () * @@ -1160,6 +1688,57 @@ export namespace cloudresourcemanager_v2 { /** * cloudresourcemanager.folders.undelete * @desc Cancels the deletion request for a Folder. This method may only be called on a Folder in the DELETE_REQUESTED state. In order to succeed, the Folder's parent must be in the ACTIVE state. In addition, reintroducing the folder into the tree must not violate folder naming, height and fanout constraints described in the CreateFolder documentation. The caller must have `resourcemanager.folders.undelete` permission on the identified folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudresourcemanager.folders.undelete({ + * // Required. The resource name of the Folder to undelete. + * // Must be of the form `folders/{folder_id}`. + * name: 'folders/my-folder', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "displayName": "my_displayName", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": "my_parent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.undelete * @memberOf! () * @@ -1416,6 +1995,53 @@ export namespace cloudresourcemanager_v2 { /** * cloudresourcemanager.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 cloudresourcemanager.operations.get({ + * // The name of the operation resource. + * name: 'operations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.operations.get * @memberOf! () * diff --git a/src/apis/cloudresourcemanager/v2beta1.ts b/src/apis/cloudresourcemanager/v2beta1.ts index bfa7ad2569c..022df338391 100644 --- a/src/apis/cloudresourcemanager/v2beta1.ts +++ b/src/apis/cloudresourcemanager/v2beta1.ts @@ -429,6 +429,63 @@ export namespace cloudresourcemanager_v2beta1 { /** * cloudresourcemanager.folders.create * @desc Creates a Folder in the resource hierarchy. Returns an Operation which can be used to track the progress of the folder creation workflow. Upon success the Operation.response field will be populated with the created Folder. In order to succeed, the addition of this new Folder must not violate the Folder naming, height or fanout constraints. + The Folder's display_name must be distinct from all other Folder's that share its parent. + The addition of the Folder must not cause the active Folder hierarchy to exceed a height of 4. Note, the full active + deleted Folder hierarchy is allowed to reach a height of 8; this provides additional headroom when moving folders that contain deleted folders. + The addition of the Folder must not cause the total number of Folders under its parent to exceed 100. If the operation fails due to a folder constraint violation, some errors may be returned by the CreateFolder request, with status code FAILED_PRECONDITION and an error description. Other folder constraint violations will be communicated in the Operation, with the specific PreconditionFailure returned via the details list in the Operation.error field. The caller must have `resourcemanager.folders.create` permission on the identified parent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudresourcemanager.folders.create({ + * // Required. The resource name of the new Folder's parent. + * // Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + * parent: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "displayName": "my_displayName", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": "my_parent" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.create * @memberOf! () * @@ -501,6 +558,51 @@ export namespace cloudresourcemanager_v2beta1 { /** * cloudresourcemanager.folders.delete * @desc Requests deletion of a Folder. The Folder is moved into the DELETE_REQUESTED state immediately, and is deleted approximately 30 days later. This method may only be called on an empty Folder in the ACTIVE state, where a Folder is empty if it doesn't contain any Folders or Projects in the ACTIVE state. The caller must have `resourcemanager.folders.delete` permission on the identified folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudresourcemanager.folders.delete({ + * // Required. the resource name of the Folder to be deleted. + * // Must be of the form `folders/{folder_id}`. + * name: 'folders/my-folder', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "displayName": "my_displayName", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": "my_parent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.delete * @memberOf! () * @@ -570,6 +672,54 @@ export namespace cloudresourcemanager_v2beta1 { /** * cloudresourcemanager.folders.get * @desc Retrieves a Folder identified by the supplied resource name. Valid Folder resource names have the format `folders/{folder_id}` (for example, `folders/1234`). The caller must have `resourcemanager.folders.get` permission on the identified folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 cloudresourcemanager.folders.get({ + * // Required. The resource name of the Folder to retrieve. + * // Must be of the form `folders/{folder_id}`. + * name: 'folders/my-folder', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "displayName": "my_displayName", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": "my_parent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.get * @memberOf! () * @@ -639,6 +789,61 @@ export namespace cloudresourcemanager_v2beta1 { /** * cloudresourcemanager.folders.getIamPolicy * @desc Gets the access control policy for a Folder. The returned policy may be empty if no such policy or resource exists. The `resource` field should be the Folder's resource name, e.g. "folders/1234". The caller must have `resourcemanager.folders.getIamPolicy` permission on the identified folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 cloudresourcemanager.folders.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'folders/my-folder', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.getIamPolicy * @memberOf! () * @@ -713,6 +918,63 @@ export namespace cloudresourcemanager_v2beta1 { /** * cloudresourcemanager.folders.list * @desc Lists the Folders that are direct descendants of supplied parent resource. List provides a strongly consistent view of the Folders underneath the specified parent resource. List returns Folders sorted based upon the (ascending) lexical ordering of their display_name. The caller must have `resourcemanager.folders.list` permission on the identified parent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 cloudresourcemanager.folders.list({ + * // Optional. The maximum number of Folders to return in the response. + * pageSize: 'placeholder-value', + * // Optional. A pagination token returned from a previous call to `ListFolders` + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The resource name of the Organization or Folder whose Folders are + * // being listed. + * // Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + * // Access to this method is controlled by checking the + * // `resourcemanager.folders.list` permission on the `parent`. + * parent: 'placeholder-value', + * // Optional. Controls whether Folders in the + * // DELETE_REQUESTED + * // state should be returned. Defaults to false. + * showDeleted: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "folders": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.list * @memberOf! () * @@ -787,6 +1049,59 @@ export namespace cloudresourcemanager_v2beta1 { /** * cloudresourcemanager.folders.move * @desc Moves a Folder under a new resource parent. Returns an Operation which can be used to track the progress of the folder move workflow. Upon success the Operation.response field will be populated with the moved Folder. Upon failure, a FolderOperationError categorizing the failure cause will be returned - if the failure occurs synchronously then the FolderOperationError will be returned via the Status.details field and if it occurs asynchronously then the FolderOperation will be returned via the Operation.error field. In addition, the Operation.metadata field will be populated with a FolderOperation message as an aid to stateless clients. Folder moves will be rejected if they violate either the naming, height or fanout constraints described in the CreateFolder documentation. The caller must have `resourcemanager.folders.move` permission on the folder's current and proposed new parent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudresourcemanager.folders.move({ + * // Required. The resource name of the Folder to move. + * // Must be of the form folders/{folder_id} + * name: 'folders/my-folder', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destinationParent": "my_destinationParent" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.move * @memberOf! () * @@ -859,6 +1174,66 @@ export namespace cloudresourcemanager_v2beta1 { /** * cloudresourcemanager.folders.patch * @desc Updates a Folder, changing its display_name. Changes to the folder display_name will be rejected if they violate either the display_name formatting rules or naming constraints described in the CreateFolder documentation. The Folder's display name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be no longer than 30 characters. This is captured by the regular expression: [\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. The caller must have `resourcemanager.folders.update` permission on the identified folder. If the update fails due to the unique name constraint then a PreconditionFailure explaining this violation will be returned in the Status.details field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudresourcemanager.folders.patch({ + * // Output only. The resource name of the Folder. + * // Its format is `folders/{folder_id}`, for example: "folders/1234". + * name: 'folders/my-folder', + * // Required. Fields to be updated. + * // Only the `display_name` can be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "displayName": "my_displayName", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": "my_parent" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "displayName": "my_displayName", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": "my_parent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.patch * @memberOf! () * @@ -930,6 +1305,57 @@ export namespace cloudresourcemanager_v2beta1 { /** * cloudresourcemanager.folders.search * @desc Search for folders that match specific filter criteria. Search provides an eventually consistent view of the folders a user has access to which meet the specified filter criteria. This will only return folders on which the caller has the permission `resourcemanager.folders.get`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 cloudresourcemanager.folders.search({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "pageSize": 0, + * // "pageToken": "my_pageToken", + * // "query": "my_query" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "folders": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.search * @memberOf! () * @@ -1003,6 +1429,59 @@ export namespace cloudresourcemanager_v2beta1 { /** * cloudresourcemanager.folders.setIamPolicy * @desc Sets the access control policy on a Folder, replacing any existing policy. The `resource` field should be the Folder's resource name, e.g. "folders/1234". The caller must have `resourcemanager.folders.setIamPolicy` permission on the identified folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudresourcemanager.folders.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'folders/my-folder', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.setIamPolicy * @memberOf! () * @@ -1077,6 +1556,55 @@ export namespace cloudresourcemanager_v2beta1 { /** * cloudresourcemanager.folders.testIamPermissions * @desc Returns permissions that a caller has on the specified Folder. The `resource` field should be the Folder's resource name, e.g. "folders/1234". There are no permissions required for making this API call. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudresourcemanager.folders.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'folders/my-folder', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.testIamPermissions * @memberOf! () * @@ -1160,6 +1688,57 @@ export namespace cloudresourcemanager_v2beta1 { /** * cloudresourcemanager.folders.undelete * @desc Cancels the deletion request for a Folder. This method may only be called on a Folder in the DELETE_REQUESTED state. In order to succeed, the Folder's parent must be in the ACTIVE state. In addition, reintroducing the folder into the tree must not violate folder naming, height and fanout constraints described in the CreateFolder documentation. The caller must have `resourcemanager.folders.undelete` permission on the identified folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudresourcemanager.folders.undelete({ + * // Required. The resource name of the Folder to undelete. + * // Must be of the form `folders/{folder_id}`. + * name: 'folders/my-folder', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "displayName": "my_displayName", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "parent": "my_parent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.folders.undelete * @memberOf! () * @@ -1416,6 +1995,53 @@ export namespace cloudresourcemanager_v2beta1 { /** * cloudresourcemanager.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudresourcemanager.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 cloudresourcemanager = google.cloudresourcemanager('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 cloudresourcemanager.operations.get({ + * // The name of the operation resource. + * name: 'operations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudresourcemanager.operations.get * @memberOf! () * diff --git a/src/apis/cloudscheduler/v1.ts b/src/apis/cloudscheduler/v1.ts index 48184a630be..d78f0ba1636 100644 --- a/src/apis/cloudscheduler/v1.ts +++ b/src/apis/cloudscheduler/v1.ts @@ -444,51 +444,49 @@ export namespace cloudscheduler_v1 { * cloudscheduler.projects.locations.get * @desc Gets information about a location. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Scheduler API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudscheduler - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudscheduler.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'); - * var cloudScheduler = google.cloudscheduler('v1'); + * const cloudscheduler = google.cloudscheduler('v1'); * - * authorize(function(authClient) { - * var request = { - * // Resource name for the location. - * name: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudScheduler.projects.locations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudscheduler.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudscheduler.projects.locations.get * @memberOf! () * @@ -560,64 +558,52 @@ export namespace cloudscheduler_v1 { * cloudscheduler.projects.locations.list * @desc Lists information about the supported locations for this service. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Scheduler API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudscheduler - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudscheduler.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'); - * var cloudScheduler = google.cloudscheduler('v1'); + * const cloudscheduler = google.cloudscheduler('v1'); * - * authorize(function(authClient) { - * var request = { - * // The resource that owns the locations collection, if applicable. - * name: 'projects/my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var locationsPage = response['locations']; - * if (!locationsPage) { - * return; - * } - * for (var i = 0; i < locationsPage.length; i++) { - * // TODO: Change code below to process each resource in `locationsPage`: - * console.log(JSON.stringify(locationsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudScheduler.projects.locations.list(request, handlePage); - * } - * }; - * - * cloudScheduler.projects.locations.list(request, handlePage); - * }); + * 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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // Do the magic + * const res = await cloudscheduler.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudscheduler.projects.locations.list * @memberOf! () * @@ -743,57 +729,80 @@ export namespace cloudscheduler_v1 { * cloudscheduler.projects.locations.jobs.create * @desc Creates a job. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Scheduler API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudscheduler - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudscheduler.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'); - * var cloudScheduler = google.cloudscheduler('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The location name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID`. - * parent: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. + * const cloudscheduler = google.cloudscheduler('v1'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudScheduler.projects.locations.jobs.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudscheduler.projects.locations.jobs.create({ + * // Required. The location name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appEngineHttpTarget": {}, + * // "attemptDeadline": "my_attemptDeadline", + * // "description": "my_description", + * // "httpTarget": {}, + * // "lastAttemptTime": "my_lastAttemptTime", + * // "name": "my_name", + * // "pubsubTarget": {}, + * // "retryConfig": {}, + * // "schedule": "my_schedule", + * // "scheduleTime": "my_scheduleTime", + * // "state": "my_state", + * // "status": {}, + * // "timeZone": "my_timeZone", + * // "userUpdateTime": "my_userUpdateTime" + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpTarget": {}, + * // "attemptDeadline": "my_attemptDeadline", + * // "description": "my_description", + * // "httpTarget": {}, + * // "lastAttemptTime": "my_lastAttemptTime", + * // "name": "my_name", + * // "pubsubTarget": {}, + * // "retryConfig": {}, + * // "schedule": "my_schedule", + * // "scheduleTime": "my_scheduleTime", + * // "state": "my_state", + * // "status": {}, + * // "timeZone": "my_timeZone", + * // "userUpdateTime": "my_userUpdateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudscheduler.projects.locations.jobs.create * @memberOf! () * @@ -866,50 +875,44 @@ export namespace cloudscheduler_v1 { * cloudscheduler.projects.locations.jobs.delete * @desc Deletes a job. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Scheduler API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudscheduler - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudscheduler.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'); - * var cloudScheduler = google.cloudscheduler('v1'); + * const cloudscheduler = google.cloudscheduler('v1'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The job name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * name: 'projects/my-project/locations/my-location/jobs/my-job', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudScheduler.projects.locations.jobs.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudscheduler.projects.locations.jobs.delete({ + * // Required. The job name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * name: 'projects/my-project/locations/my-location/jobs/my-job', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudscheduler.projects.locations.jobs.delete * @memberOf! () * @@ -981,53 +984,59 @@ export namespace cloudscheduler_v1 { * cloudscheduler.projects.locations.jobs.get * @desc Gets a job. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Scheduler API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudscheduler - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudscheduler.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'); - * var cloudScheduler = google.cloudscheduler('v1'); + * const cloudscheduler = google.cloudscheduler('v1'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The job name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * name: 'projects/my-project/locations/my-location/jobs/my-job', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudScheduler.projects.locations.jobs.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudscheduler.projects.locations.jobs.get({ + * // Required. The job name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * name: 'projects/my-project/locations/my-location/jobs/my-job', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpTarget": {}, + * // "attemptDeadline": "my_attemptDeadline", + * // "description": "my_description", + * // "httpTarget": {}, + * // "lastAttemptTime": "my_lastAttemptTime", + * // "name": "my_name", + * // "pubsubTarget": {}, + * // "retryConfig": {}, + * // "schedule": "my_schedule", + * // "scheduleTime": "my_scheduleTime", + * // "state": "my_state", + * // "status": {}, + * // "timeZone": "my_timeZone", + * // "userUpdateTime": "my_userUpdateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudscheduler.projects.locations.jobs.get * @memberOf! () * @@ -1099,66 +1108,62 @@ export namespace cloudscheduler_v1 { * cloudscheduler.projects.locations.jobs.list * @desc Lists jobs. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Scheduler API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudscheduler - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudscheduler.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'); - * var cloudScheduler = google.cloudscheduler('v1'); + * const cloudscheduler = google.cloudscheduler('v1'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The location name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID`. - * parent: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var jobsPage = response['jobs']; - * if (!jobsPage) { - * return; - * } - * for (var i = 0; i < jobsPage.length; i++) { - * // TODO: Change code below to process each resource in `jobsPage`: - * console.log(JSON.stringify(jobsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudScheduler.projects.locations.jobs.list(request, handlePage); - * } - * }; - * - * cloudScheduler.projects.locations.jobs.list(request, handlePage); - * }); + * 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/cloud-platform'], + * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 cloudscheduler.projects.locations.jobs.list({ + * // Requested page size. + * // + * // The maximum page size is 500. If unspecified, the page size will + * // be the maximum. Fewer jobs than requested might be returned, + * // even if more jobs exist; use next_page_token to determine if more + * // jobs exist. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server will return. To + * // request the first page results, page_token must be empty. To + * // request the next page of results, page_token must be the value of + * // next_page_token returned from + * // the previous call to ListJobs. It is an error to + * // switch the value of filter or + * // order_by while iterating through pages. + * pageToken: 'placeholder-value', + * // Required. The location name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID`. + * parent: 'projects/my-project/locations/my-location', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "jobs": [], + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudscheduler.projects.locations.jobs.list * @memberOf! () * @@ -1234,71 +1239,97 @@ export namespace cloudscheduler_v1 { * cloudscheduler.projects.locations.jobs.patch * @desc Updates a job. If successful, the updated Job is returned. If the job does not exist, `NOT_FOUND` is returned. If UpdateJob does not successfully return, it is possible for the job to be in an Job.State.UPDATE_FAILED state. A job in this state may not be executed. If this happens, retry the UpdateJob request until a successful response is received. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Scheduler API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudscheduler - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudscheduler.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'); - * var cloudScheduler = google.cloudscheduler('v1'); + * const cloudscheduler = google.cloudscheduler('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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 cloudscheduler.projects.locations.jobs.patch({ * // Optionally caller-specified in CreateJob, after * // which it becomes output only. + * // * // The job name. For example: * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * // * // * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * // hyphens (-), colons (:), or periods (.). - * // For more information, see - * // [Identifying - * // projects] - * // (https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * // hyphens (-), colons (:), or periods (.). + * // For more information, see + * // [Identifying + * // projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) * // * `LOCATION_ID` is the canonical ID for the job's location. - * // The list of available locations can be obtained by calling - * // ListLocations. - * // For more information, see https://cloud.google.com/about/locations/. + * // The list of available locations can be obtained by calling + * // ListLocations. + * // For more information, see https://cloud.google.com/about/locations/. * // * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - * // hyphens (-), or underscores (_). The maximum length is 500 characters. - * name: 'projects/my-project/locations/my-location/jobs/my-job', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * // hyphens (-), or underscores (_). The maximum length is 500 characters. + * name: 'projects/my-project/locations/my-location/jobs/my-job', + * // A mask used to specify which fields of the job are being updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appEngineHttpTarget": {}, + * // "attemptDeadline": "my_attemptDeadline", + * // "description": "my_description", + * // "httpTarget": {}, + * // "lastAttemptTime": "my_lastAttemptTime", + * // "name": "my_name", + * // "pubsubTarget": {}, + * // "retryConfig": {}, + * // "schedule": "my_schedule", + * // "scheduleTime": "my_scheduleTime", + * // "state": "my_state", + * // "status": {}, + * // "timeZone": "my_timeZone", + * // "userUpdateTime": "my_userUpdateTime" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudScheduler.projects.locations.jobs.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpTarget": {}, + * // "attemptDeadline": "my_attemptDeadline", + * // "description": "my_description", + * // "httpTarget": {}, + * // "lastAttemptTime": "my_lastAttemptTime", + * // "name": "my_name", + * // "pubsubTarget": {}, + * // "retryConfig": {}, + * // "schedule": "my_schedule", + * // "scheduleTime": "my_scheduleTime", + * // "state": "my_state", + * // "status": {}, + * // "timeZone": "my_timeZone", + * // "userUpdateTime": "my_userUpdateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudscheduler.projects.locations.jobs.patch * @memberOf! () * @@ -1372,57 +1403,65 @@ export namespace cloudscheduler_v1 { * cloudscheduler.projects.locations.jobs.pause * @desc Pauses a job. If a job is paused then the system will stop executing the job until it is re-enabled via ResumeJob. The state of the job is stored in state; if paused it will be set to Job.State.PAUSED. A job must be in Job.State.ENABLED to be paused. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Scheduler API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudscheduler - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudscheduler.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'); - * var cloudScheduler = google.cloudscheduler('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The job name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * name: 'projects/my-project/locations/my-location/jobs/my-job', // TODO: Update placeholder value. + * const cloudscheduler = google.cloudscheduler('v1'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudScheduler.projects.locations.jobs.pause(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudscheduler.projects.locations.jobs.pause({ + * // Required. The job name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * name: 'projects/my-project/locations/my-location/jobs/my-job', * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpTarget": {}, + * // "attemptDeadline": "my_attemptDeadline", + * // "description": "my_description", + * // "httpTarget": {}, + * // "lastAttemptTime": "my_lastAttemptTime", + * // "name": "my_name", + * // "pubsubTarget": {}, + * // "retryConfig": {}, + * // "schedule": "my_schedule", + * // "scheduleTime": "my_scheduleTime", + * // "state": "my_state", + * // "status": {}, + * // "timeZone": "my_timeZone", + * // "userUpdateTime": "my_userUpdateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudscheduler.projects.locations.jobs.pause * @memberOf! () * @@ -1495,57 +1534,65 @@ export namespace cloudscheduler_v1 { * cloudscheduler.projects.locations.jobs.resume * @desc Resume a job. This method reenables a job after it has been Job.State.PAUSED. The state of a job is stored in Job.state; after calling this method it will be set to Job.State.ENABLED. A job must be in Job.State.PAUSED to be resumed. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Scheduler API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudscheduler - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudscheduler.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'); - * var cloudScheduler = google.cloudscheduler('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The job name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * name: 'projects/my-project/locations/my-location/jobs/my-job', // TODO: Update placeholder value. + * const cloudscheduler = google.cloudscheduler('v1'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudScheduler.projects.locations.jobs.resume(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudscheduler.projects.locations.jobs.resume({ + * // Required. The job name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * name: 'projects/my-project/locations/my-location/jobs/my-job', * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpTarget": {}, + * // "attemptDeadline": "my_attemptDeadline", + * // "description": "my_description", + * // "httpTarget": {}, + * // "lastAttemptTime": "my_lastAttemptTime", + * // "name": "my_name", + * // "pubsubTarget": {}, + * // "retryConfig": {}, + * // "schedule": "my_schedule", + * // "scheduleTime": "my_scheduleTime", + * // "state": "my_state", + * // "status": {}, + * // "timeZone": "my_timeZone", + * // "userUpdateTime": "my_userUpdateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudscheduler.projects.locations.jobs.resume * @memberOf! () * @@ -1618,57 +1665,65 @@ export namespace cloudscheduler_v1 { * cloudscheduler.projects.locations.jobs.run * @desc Forces a job to run now. When this method is called, Cloud Scheduler will dispatch the job, even if the job is already running. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Scheduler API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudscheduler - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudscheduler.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'); - * var cloudScheduler = google.cloudscheduler('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The job name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * name: 'projects/my-project/locations/my-location/jobs/my-job', // TODO: Update placeholder value. + * const cloudscheduler = google.cloudscheduler('v1'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudScheduler.projects.locations.jobs.run(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudscheduler.projects.locations.jobs.run({ + * // Required. The job name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * name: 'projects/my-project/locations/my-location/jobs/my-job', * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpTarget": {}, + * // "attemptDeadline": "my_attemptDeadline", + * // "description": "my_description", + * // "httpTarget": {}, + * // "lastAttemptTime": "my_lastAttemptTime", + * // "name": "my_name", + * // "pubsubTarget": {}, + * // "retryConfig": {}, + * // "schedule": "my_schedule", + * // "scheduleTime": "my_scheduleTime", + * // "state": "my_state", + * // "status": {}, + * // "timeZone": "my_timeZone", + * // "userUpdateTime": "my_userUpdateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudscheduler.projects.locations.jobs.run * @memberOf! () * diff --git a/src/apis/cloudscheduler/v1beta1.ts b/src/apis/cloudscheduler/v1beta1.ts index 6ec72ffbf09..fbf6f145ab6 100644 --- a/src/apis/cloudscheduler/v1beta1.ts +++ b/src/apis/cloudscheduler/v1beta1.ts @@ -444,51 +444,49 @@ export namespace cloudscheduler_v1beta1 { * cloudscheduler.projects.locations.get * @desc Gets information about a location. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Scheduler API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudscheduler - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudscheduler.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'); - * var cloudScheduler = google.cloudscheduler('v1beta1'); + * const cloudscheduler = google.cloudscheduler('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // Resource name for the location. - * name: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudScheduler.projects.locations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudscheduler.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudscheduler.projects.locations.get * @memberOf! () * @@ -560,64 +558,52 @@ export namespace cloudscheduler_v1beta1 { * cloudscheduler.projects.locations.list * @desc Lists information about the supported locations for this service. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Scheduler API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudscheduler - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudscheduler.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'); - * var cloudScheduler = google.cloudscheduler('v1beta1'); + * const cloudscheduler = google.cloudscheduler('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // The resource that owns the locations collection, if applicable. - * name: 'projects/my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var locationsPage = response['locations']; - * if (!locationsPage) { - * return; - * } - * for (var i = 0; i < locationsPage.length; i++) { - * // TODO: Change code below to process each resource in `locationsPage`: - * console.log(JSON.stringify(locationsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudScheduler.projects.locations.list(request, handlePage); - * } - * }; - * - * cloudScheduler.projects.locations.list(request, handlePage); - * }); + * 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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // Do the magic + * const res = await cloudscheduler.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudscheduler.projects.locations.list * @memberOf! () * @@ -743,57 +729,80 @@ export namespace cloudscheduler_v1beta1 { * cloudscheduler.projects.locations.jobs.create * @desc Creates a job. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Scheduler API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudscheduler - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudscheduler.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'); - * var cloudScheduler = google.cloudscheduler('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The location name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID`. - * parent: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. + * const cloudscheduler = google.cloudscheduler('v1beta1'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudScheduler.projects.locations.jobs.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudscheduler.projects.locations.jobs.create({ + * // Required. The location name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appEngineHttpTarget": {}, + * // "attemptDeadline": "my_attemptDeadline", + * // "description": "my_description", + * // "httpTarget": {}, + * // "lastAttemptTime": "my_lastAttemptTime", + * // "name": "my_name", + * // "pubsubTarget": {}, + * // "retryConfig": {}, + * // "schedule": "my_schedule", + * // "scheduleTime": "my_scheduleTime", + * // "state": "my_state", + * // "status": {}, + * // "timeZone": "my_timeZone", + * // "userUpdateTime": "my_userUpdateTime" + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpTarget": {}, + * // "attemptDeadline": "my_attemptDeadline", + * // "description": "my_description", + * // "httpTarget": {}, + * // "lastAttemptTime": "my_lastAttemptTime", + * // "name": "my_name", + * // "pubsubTarget": {}, + * // "retryConfig": {}, + * // "schedule": "my_schedule", + * // "scheduleTime": "my_scheduleTime", + * // "state": "my_state", + * // "status": {}, + * // "timeZone": "my_timeZone", + * // "userUpdateTime": "my_userUpdateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudscheduler.projects.locations.jobs.create * @memberOf! () * @@ -869,50 +878,44 @@ export namespace cloudscheduler_v1beta1 { * cloudscheduler.projects.locations.jobs.delete * @desc Deletes a job. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Scheduler API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudscheduler - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudscheduler.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'); - * var cloudScheduler = google.cloudscheduler('v1beta1'); + * const cloudscheduler = google.cloudscheduler('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The job name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * name: 'projects/my-project/locations/my-location/jobs/my-job', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudScheduler.projects.locations.jobs.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudscheduler.projects.locations.jobs.delete({ + * // Required. The job name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * name: 'projects/my-project/locations/my-location/jobs/my-job', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudscheduler.projects.locations.jobs.delete * @memberOf! () * @@ -984,53 +987,59 @@ export namespace cloudscheduler_v1beta1 { * cloudscheduler.projects.locations.jobs.get * @desc Gets a job. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Scheduler API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudscheduler - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudscheduler.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'); - * var cloudScheduler = google.cloudscheduler('v1beta1'); + * const cloudscheduler = google.cloudscheduler('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The job name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * name: 'projects/my-project/locations/my-location/jobs/my-job', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudScheduler.projects.locations.jobs.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudscheduler.projects.locations.jobs.get({ + * // Required. The job name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * name: 'projects/my-project/locations/my-location/jobs/my-job', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpTarget": {}, + * // "attemptDeadline": "my_attemptDeadline", + * // "description": "my_description", + * // "httpTarget": {}, + * // "lastAttemptTime": "my_lastAttemptTime", + * // "name": "my_name", + * // "pubsubTarget": {}, + * // "retryConfig": {}, + * // "schedule": "my_schedule", + * // "scheduleTime": "my_scheduleTime", + * // "state": "my_state", + * // "status": {}, + * // "timeZone": "my_timeZone", + * // "userUpdateTime": "my_userUpdateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudscheduler.projects.locations.jobs.get * @memberOf! () * @@ -1102,66 +1111,62 @@ export namespace cloudscheduler_v1beta1 { * cloudscheduler.projects.locations.jobs.list * @desc Lists jobs. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Scheduler API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudscheduler - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudscheduler.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'); - * var cloudScheduler = google.cloudscheduler('v1beta1'); + * const cloudscheduler = google.cloudscheduler('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The location name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID`. - * parent: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var jobsPage = response['jobs']; - * if (!jobsPage) { - * return; - * } - * for (var i = 0; i < jobsPage.length; i++) { - * // TODO: Change code below to process each resource in `jobsPage`: - * console.log(JSON.stringify(jobsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudScheduler.projects.locations.jobs.list(request, handlePage); - * } - * }; - * - * cloudScheduler.projects.locations.jobs.list(request, handlePage); - * }); + * 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/cloud-platform'], + * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 cloudscheduler.projects.locations.jobs.list({ + * // Requested page size. + * // + * // The maximum page size is 500. If unspecified, the page size will + * // be the maximum. Fewer jobs than requested might be returned, + * // even if more jobs exist; use next_page_token to determine if more + * // jobs exist. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server will return. To + * // request the first page results, page_token must be empty. To + * // request the next page of results, page_token must be the value of + * // next_page_token returned from + * // the previous call to ListJobs. It is an error to + * // switch the value of filter or + * // order_by while iterating through pages. + * pageToken: 'placeholder-value', + * // Required. The location name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID`. + * parent: 'projects/my-project/locations/my-location', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "jobs": [], + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudscheduler.projects.locations.jobs.list * @memberOf! () * @@ -1240,71 +1245,97 @@ export namespace cloudscheduler_v1beta1 { * cloudscheduler.projects.locations.jobs.patch * @desc Updates a job. If successful, the updated Job is returned. If the job does not exist, `NOT_FOUND` is returned. If UpdateJob does not successfully return, it is possible for the job to be in an Job.State.UPDATE_FAILED state. A job in this state may not be executed. If this happens, retry the UpdateJob request until a successful response is received. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Scheduler API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudscheduler - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudscheduler.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'); - * var cloudScheduler = google.cloudscheduler('v1beta1'); + * const cloudscheduler = google.cloudscheduler('v1beta1'); + * + * 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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 cloudscheduler.projects.locations.jobs.patch({ * // Optionally caller-specified in CreateJob, after * // which it becomes output only. + * // * // The job name. For example: * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * // * // * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * // hyphens (-), colons (:), or periods (.). - * // For more information, see - * // [Identifying - * // projects] - * // (https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * // hyphens (-), colons (:), or periods (.). + * // For more information, see + * // [Identifying + * // projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) * // * `LOCATION_ID` is the canonical ID for the job's location. - * // The list of available locations can be obtained by calling - * // ListLocations. - * // For more information, see https://cloud.google.com/about/locations/. + * // The list of available locations can be obtained by calling + * // ListLocations. + * // For more information, see https://cloud.google.com/about/locations/. * // * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - * // hyphens (-), or underscores (_). The maximum length is 500 characters. - * name: 'projects/my-project/locations/my-location/jobs/my-job', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * // hyphens (-), or underscores (_). The maximum length is 500 characters. + * name: 'projects/my-project/locations/my-location/jobs/my-job', + * // A mask used to specify which fields of the job are being updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appEngineHttpTarget": {}, + * // "attemptDeadline": "my_attemptDeadline", + * // "description": "my_description", + * // "httpTarget": {}, + * // "lastAttemptTime": "my_lastAttemptTime", + * // "name": "my_name", + * // "pubsubTarget": {}, + * // "retryConfig": {}, + * // "schedule": "my_schedule", + * // "scheduleTime": "my_scheduleTime", + * // "state": "my_state", + * // "status": {}, + * // "timeZone": "my_timeZone", + * // "userUpdateTime": "my_userUpdateTime" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudScheduler.projects.locations.jobs.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpTarget": {}, + * // "attemptDeadline": "my_attemptDeadline", + * // "description": "my_description", + * // "httpTarget": {}, + * // "lastAttemptTime": "my_lastAttemptTime", + * // "name": "my_name", + * // "pubsubTarget": {}, + * // "retryConfig": {}, + * // "schedule": "my_schedule", + * // "scheduleTime": "my_scheduleTime", + * // "state": "my_state", + * // "status": {}, + * // "timeZone": "my_timeZone", + * // "userUpdateTime": "my_userUpdateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudscheduler.projects.locations.jobs.patch * @memberOf! () * @@ -1378,57 +1409,65 @@ export namespace cloudscheduler_v1beta1 { * cloudscheduler.projects.locations.jobs.pause * @desc Pauses a job. If a job is paused then the system will stop executing the job until it is re-enabled via ResumeJob. The state of the job is stored in state; if paused it will be set to Job.State.PAUSED. A job must be in Job.State.ENABLED to be paused. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Scheduler API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudscheduler - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudscheduler.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'); - * var cloudScheduler = google.cloudscheduler('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The job name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * name: 'projects/my-project/locations/my-location/jobs/my-job', // TODO: Update placeholder value. + * const cloudscheduler = google.cloudscheduler('v1beta1'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudScheduler.projects.locations.jobs.pause(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudscheduler.projects.locations.jobs.pause({ + * // Required. The job name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * name: 'projects/my-project/locations/my-location/jobs/my-job', * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpTarget": {}, + * // "attemptDeadline": "my_attemptDeadline", + * // "description": "my_description", + * // "httpTarget": {}, + * // "lastAttemptTime": "my_lastAttemptTime", + * // "name": "my_name", + * // "pubsubTarget": {}, + * // "retryConfig": {}, + * // "schedule": "my_schedule", + * // "scheduleTime": "my_scheduleTime", + * // "state": "my_state", + * // "status": {}, + * // "timeZone": "my_timeZone", + * // "userUpdateTime": "my_userUpdateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudscheduler.projects.locations.jobs.pause * @memberOf! () * @@ -1504,57 +1543,65 @@ export namespace cloudscheduler_v1beta1 { * cloudscheduler.projects.locations.jobs.resume * @desc Resume a job. This method reenables a job after it has been Job.State.PAUSED. The state of a job is stored in Job.state; after calling this method it will be set to Job.State.ENABLED. A job must be in Job.State.PAUSED to be resumed. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Scheduler API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudscheduler - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudscheduler.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'); - * var cloudScheduler = google.cloudscheduler('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The job name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * name: 'projects/my-project/locations/my-location/jobs/my-job', // TODO: Update placeholder value. + * const cloudscheduler = google.cloudscheduler('v1beta1'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudScheduler.projects.locations.jobs.resume(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudscheduler.projects.locations.jobs.resume({ + * // Required. The job name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * name: 'projects/my-project/locations/my-location/jobs/my-job', * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpTarget": {}, + * // "attemptDeadline": "my_attemptDeadline", + * // "description": "my_description", + * // "httpTarget": {}, + * // "lastAttemptTime": "my_lastAttemptTime", + * // "name": "my_name", + * // "pubsubTarget": {}, + * // "retryConfig": {}, + * // "schedule": "my_schedule", + * // "scheduleTime": "my_scheduleTime", + * // "state": "my_state", + * // "status": {}, + * // "timeZone": "my_timeZone", + * // "userUpdateTime": "my_userUpdateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudscheduler.projects.locations.jobs.resume * @memberOf! () * @@ -1630,57 +1677,65 @@ export namespace cloudscheduler_v1beta1 { * cloudscheduler.projects.locations.jobs.run * @desc Forces a job to run now. When this method is called, Cloud Scheduler will dispatch the job, even if the job is already running. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Scheduler API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudscheduler - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudscheduler.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'); - * var cloudScheduler = google.cloudscheduler('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The job name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - * name: 'projects/my-project/locations/my-location/jobs/my-job', // TODO: Update placeholder value. + * const cloudscheduler = google.cloudscheduler('v1beta1'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudScheduler.projects.locations.jobs.run(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudscheduler.projects.locations.jobs.run({ + * // Required. The job name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * name: 'projects/my-project/locations/my-location/jobs/my-job', * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpTarget": {}, + * // "attemptDeadline": "my_attemptDeadline", + * // "description": "my_description", + * // "httpTarget": {}, + * // "lastAttemptTime": "my_lastAttemptTime", + * // "name": "my_name", + * // "pubsubTarget": {}, + * // "retryConfig": {}, + * // "schedule": "my_schedule", + * // "scheduleTime": "my_scheduleTime", + * // "state": "my_state", + * // "status": {}, + * // "timeZone": "my_timeZone", + * // "userUpdateTime": "my_userUpdateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudscheduler.projects.locations.jobs.run * @memberOf! () * diff --git a/src/apis/cloudsearch/v1.ts b/src/apis/cloudsearch/v1.ts index 84898c011e4..96f35c08d85 100644 --- a/src/apis/cloudsearch/v1.ts +++ b/src/apis/cloudsearch/v1.ts @@ -2191,6 +2191,63 @@ export namespace cloudsearch_v1 { /** * cloudsearch.debug.datasources.items.checkAccess * @desc Checks whether an item is accessible by specified principal. **Note:** This API requires an admin account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.debug', + * ], + * }); + * + * // 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 cloudsearch.debug.datasources.items.checkAccess({ + * // If you are asked by Google to help with debugging, set this field. + * // Otherwise, ignore this field. + * 'debugOptions.enableDebugging': 'placeholder-value', + * // Item name, format: + * // datasources/{source_id}/items/{item_id} + * name: 'datasources/my-datasource/items/my-item', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "groupResourceName": "my_groupResourceName", + * // "gsuitePrincipal": {}, + * // "userResourceName": "my_userResourceName" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "hasAccess": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.debug.datasources.items.checkAccess * @memberOf! () * @@ -2269,6 +2326,61 @@ export namespace cloudsearch_v1 { /** * cloudsearch.debug.datasources.items.searchByViewUrl * @desc Fetches the item whose viewUrl exactly matches that of the URL provided in the request. **Note:** This API requires an admin account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.debug', + * ], + * }); + * + * // 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 cloudsearch.debug.datasources.items.searchByViewUrl({ + * // Source name, format: + * // datasources/{source_id} + * name: 'datasources/my-datasource', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "debugOptions": {}, + * // "pageToken": "my_pageToken", + * // "viewUrl": "my_viewUrl" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.debug.datasources.items.searchByViewUrl * @memberOf! () * @@ -2399,6 +2511,59 @@ export namespace cloudsearch_v1 { /** * cloudsearch.debug.datasources.items.unmappedids.list * @desc List all unmapped identities for a specific item. **Note:** This API requires an admin account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.debug', + * ], + * }); + * + * // 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 cloudsearch.debug.datasources.items.unmappedids.list({ + * // If you are asked by Google to help with debugging, set this field. + * // Otherwise, ignore this field. + * 'debugOptions.enableDebugging': 'placeholder-value', + * // Maximum number of items to fetch in a request. + * // Defaults to 100. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // The name of the item, in the following format: + * // datasources/{source_id}/items/{ID} + * parent: 'datasources/my-datasource/items/my-item', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "unmappedIdentities": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.debug.datasources.items.unmappedids.list * @memberOf! () * @@ -2530,6 +2695,65 @@ export namespace cloudsearch_v1 { /** * cloudsearch.debug.identitysources.items.listForunmappedidentity * @desc Lists names of items associated with an unmapped identity. **Note:** This API requires an admin account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.debug', + * ], + * }); + * + * // 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 cloudsearch.debug.identitysources.items.listForunmappedidentity( + * { + * // If you are asked by Google to help with debugging, set this field. + * // Otherwise, ignore this field. + * 'debugOptions.enableDebugging': 'placeholder-value', + * + * groupResourceName: 'placeholder-value', + * // Maximum number of items to fetch in a request. + * // Defaults to 100. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // The name of the identity source, in the following format: + * // identitysources/{source_id}} + * parent: 'identitysources/my-identitysource', + * + * userResourceName: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "itemNames": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.debug.identitysources.items.listForunmappedidentity * @memberOf! () * @@ -2665,6 +2889,61 @@ export namespace cloudsearch_v1 { /** * cloudsearch.debug.identitysources.unmappedids.list * @desc Lists unmapped user identities for an identity source. **Note:** This API requires an admin account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.debug', + * ], + * }); + * + * // 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 cloudsearch.debug.identitysources.unmappedids.list({ + * // If you are asked by Google to help with debugging, set this field. + * // Otherwise, ignore this field. + * 'debugOptions.enableDebugging': 'placeholder-value', + * // Maximum number of items to fetch in a request. + * // Defaults to 100. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // The name of the identity source, in the following format: + * // identitysources/{source_id} + * parent: 'identitysources/my-identitysource', + * // Limit users selection to this status. + * resolutionStatusCode: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "unmappedIdentities": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.debug.identitysources.unmappedids.list * @memberOf! () * @@ -2799,6 +3078,58 @@ export namespace cloudsearch_v1 { /** * cloudsearch.indexing.datasources.deleteSchema * @desc Deletes the schema of a data source. **Note:** This API requires an admin or service account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.settings', + * 'https://www.googleapis.com/auth/cloud_search.settings.indexing', + * ], + * }); + * + * // 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 cloudsearch.indexing.datasources.deleteSchema({ + * // If you are asked by Google to help with debugging, set this field. + * // Otherwise, ignore this field. + * 'debugOptions.enableDebugging': 'placeholder-value', + * // Name of the data source to delete Schema. Format: + * // datasources/{source_id} + * name: 'datasources/my-datasource', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.indexing.datasources.deleteSchema * @memberOf! () * @@ -2874,6 +3205,55 @@ export namespace cloudsearch_v1 { /** * cloudsearch.indexing.datasources.getSchema * @desc Gets the schema of a data source. **Note:** This API requires an admin or service account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.settings', + * 'https://www.googleapis.com/auth/cloud_search.settings.indexing', + * ], + * }); + * + * // 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 cloudsearch.indexing.datasources.getSchema({ + * // If you are asked by Google to help with debugging, set this field. + * // Otherwise, ignore this field. + * 'debugOptions.enableDebugging': 'placeholder-value', + * // Name of the data source to get Schema. Format: + * // datasources/{source_id} + * name: 'datasources/my-datasource', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "objectDefinitions": [], + * // "operationIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.indexing.datasources.getSchema * @memberOf! () * @@ -2947,6 +3327,65 @@ export namespace cloudsearch_v1 { /** * cloudsearch.indexing.datasources.updateSchema * @desc Updates the schema of a data source. This method does not perform incremental updates to the schema. Instead, this method updates the schema by overwriting the entire schema. **Note:** This API requires an admin or service account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.settings', + * 'https://www.googleapis.com/auth/cloud_search.settings.indexing', + * ], + * }); + * + * // 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 cloudsearch.indexing.datasources.updateSchema({ + * // Name of the data source to update Schema. Format: + * // datasources/{source_id} + * name: 'datasources/my-datasource', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "debugOptions": {}, + * // "schema": {}, + * // "validateOnly": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.indexing.datasources.updateSchema * @memberOf! () * @@ -3079,6 +3518,72 @@ export namespace cloudsearch_v1 { /** * cloudsearch.indexing.datasources.items.delete * @desc Deletes Item resource for the specified resource name. This API requires an admin or service account to execute. The service account used is the one whitelisted in the corresponding data source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.indexing', + * ], + * }); + * + * // 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 cloudsearch.indexing.datasources.items.delete({ + * // Name of connector making this call. + * //
                          Format: datasources/{source_id}/connectors/{ID} + * connectorName: 'placeholder-value', + * // If you are asked by Google to help with debugging, set this field. + * // Otherwise, ignore this field. + * 'debugOptions.enableDebugging': 'placeholder-value', + * // Required. The RequestMode for this request. + * mode: 'placeholder-value', + * // Required. Name of the item to delete. + * // Format: datasources/{source_id}/items/{item_id} + * name: 'datasources/my-datasource/items/my-item', + * // Required. The incremented version of the item to delete from the index. + * // The indexing system stores the version from the datasource as a + * // byte string and compares the Item version in the index + * // to the version of the queued Item using lexical ordering. + * //

                          + * // Cloud Search Indexing won't delete any queued item with + * // a version value that is less than or equal to + * // the version of the currently indexed item. + * // The maximum length for this field is 1024 bytes. + * version: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.indexing.datasources.items.delete * @memberOf! () * @@ -3157,6 +3662,64 @@ export namespace cloudsearch_v1 { /** * cloudsearch.indexing.datasources.items.deleteQueueItems * @desc Deletes all items in a queue. This method is useful for deleting stale items. This API requires an admin or service account to execute. The service account used is the one whitelisted in the corresponding data source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.indexing', + * ], + * }); + * + * // 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 cloudsearch.indexing.datasources.items.deleteQueueItems({ + * // Name of the Data Source to delete items in a queue. + * // Format: datasources/{source_id} + * name: 'datasources/my-datasource', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "connectorName": "my_connectorName", + * // "debugOptions": {}, + * // "queue": "my_queue" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.indexing.datasources.items.deleteQueueItems * @memberOf! () * @@ -3231,6 +3794,65 @@ export namespace cloudsearch_v1 { /** * cloudsearch.indexing.datasources.items.get * @desc Gets Item resource by item name. This API requires an admin or service account to execute. The service account used is the one whitelisted in the corresponding data source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.indexing', + * ], + * }); + * + * // 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 cloudsearch.indexing.datasources.items.get({ + * // Name of connector making this call. + * //
                          Format: datasources/{source_id}/connectors/{ID} + * connectorName: 'placeholder-value', + * // If you are asked by Google to help with debugging, set this field. + * // Otherwise, ignore this field. + * 'debugOptions.enableDebugging': 'placeholder-value', + * // Name of the item to get info. + * // Format: datasources/{source_id}/items/{item_id} + * name: 'datasources/my-datasource/items/my-item', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": {}, + * // "content": {}, + * // "itemType": "my_itemType", + * // "metadata": {}, + * // "name": "my_name", + * // "payload": "my_payload", + * // "queue": "my_queue", + * // "status": {}, + * // "structuredData": {}, + * // "version": "my_version" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.indexing.datasources.items.get * @memberOf! () * @@ -3305,6 +3927,68 @@ export namespace cloudsearch_v1 { /** * cloudsearch.indexing.datasources.items.index * @desc Updates Item ACL, metadata, and content. It will insert the Item if it does not exist. This method does not support partial updates. Fields with no provided values are cleared out in the Cloud Search index. This API requires an admin or service account to execute. The service account used is the one whitelisted in the corresponding data source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.indexing', + * ], + * }); + * + * // 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 cloudsearch.indexing.datasources.items.index({ + * // Name of the Item. Format: + * // datasources/{source_id}/items/{item_id} + * //
                          This is a required field. + * // The maximum length is 1536 characters. + * name: 'datasources/my-datasource/items/my-item', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "connectorName": "my_connectorName", + * // "debugOptions": {}, + * // "indexItemOptions": {}, + * // "item": {}, + * // "mode": "my_mode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.indexing.datasources.items.index * @memberOf! () * @@ -3380,6 +4064,84 @@ export namespace cloudsearch_v1 { /** * cloudsearch.indexing.datasources.items.list * @desc Lists all or a subset of Item resources. This API requires an admin or service account to execute. The service account used is the one whitelisted in the corresponding data source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.indexing', + * ], + * }); + * + * // 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 cloudsearch.indexing.datasources.items.list({ + * // When set to true, the indexing system only populates the following fields: + * // name, + * // version, + * // queue. + * // metadata.hash, + * // metadata.title, + * // metadata.sourceRepositoryURL, + * // metadata.objectType, + * // metadata.createTime, + * // metadata.updateTime, + * // metadata.contentLanguage, + * // metadata.mimeType, + * // structured_data.hash, + * // content.hash, + * // itemType, + * // itemStatus.code, + * // itemStatus.processingError.code, + * // itemStatus.repositoryError.type, + * //
                          If this value is false, then all the fields are populated in Item. + * brief: 'placeholder-value', + * // Name of connector making this call. + * //
                          Format: datasources/{source_id}/connectors/{ID} + * connectorName: 'placeholder-value', + * // If you are asked by Google to help with debugging, set this field. + * // Otherwise, ignore this field. + * 'debugOptions.enableDebugging': 'placeholder-value', + * // Name of the Data Source to list Items. Format: + * // datasources/{source_id} + * name: 'datasources/my-datasource', + * // Maximum number of items to fetch in a request. + * // The max value is 1000 when brief is true. The max value is 10 if brief + * // is false. + * //
                          The default value is 10 + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.indexing.datasources.items.list * @memberOf! () * @@ -3459,6 +4221,62 @@ export namespace cloudsearch_v1 { /** * cloudsearch.indexing.datasources.items.poll * @desc Polls for unreserved items from the indexing queue and marks a set as reserved, starting with items that have the oldest timestamp from the highest priority ItemStatus. The priority order is as follows:
                          ERROR
                          MODIFIED
                          NEW_ITEM
                          ACCEPTED
                          Reserving items ensures that polling from other threads cannot create overlapping sets. After handling the reserved items, the client should put items back into the unreserved state, either by calling index, or by calling push with the type REQUEUE. Items automatically become available (unreserved) after 4 hours even if no update or push method is called. This API requires an admin or service account to execute. The service account used is the one whitelisted in the corresponding data source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.indexing', + * ], + * }); + * + * // 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 cloudsearch.indexing.datasources.items.poll({ + * // Name of the Data Source to poll items. + * // Format: datasources/{source_id} + * name: 'datasources/my-datasource', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "connectorName": "my_connectorName", + * // "debugOptions": {}, + * // "limit": 0, + * // "queue": "my_queue", + * // "statusCodes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.indexing.datasources.items.poll * @memberOf! () * @@ -3534,6 +4352,72 @@ export namespace cloudsearch_v1 { /** * cloudsearch.indexing.datasources.items.push * @desc Pushes an item onto a queue for later polling and updating. This API requires an admin or service account to execute. The service account used is the one whitelisted in the corresponding data source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.indexing', + * ], + * }); + * + * // 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 cloudsearch.indexing.datasources.items.push({ + * // Name of the item to + * // push into the indexing queue.
                          + * // Format: datasources/{source_id}/items/{ID} + * //
                          This is a required field. + * // The maximum length is 1536 characters. + * name: 'datasources/my-datasource/items/my-item', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "connectorName": "my_connectorName", + * // "debugOptions": {}, + * // "item": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": {}, + * // "content": {}, + * // "itemType": "my_itemType", + * // "metadata": {}, + * // "name": "my_name", + * // "payload": "my_payload", + * // "queue": "my_queue", + * // "status": {}, + * // "structuredData": {}, + * // "version": "my_version" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.indexing.datasources.items.push * @memberOf! () * @@ -3607,6 +4491,64 @@ export namespace cloudsearch_v1 { /** * cloudsearch.indexing.datasources.items.unreserve * @desc Unreserves all items from a queue, making them all eligible to be polled. This method is useful for resetting the indexing queue after a connector has been restarted. This API requires an admin or service account to execute. The service account used is the one whitelisted in the corresponding data source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.indexing', + * ], + * }); + * + * // 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 cloudsearch.indexing.datasources.items.unreserve({ + * // Name of the Data Source to unreserve all items. + * // Format: datasources/{source_id} + * name: 'datasources/my-datasource', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "connectorName": "my_connectorName", + * // "debugOptions": {}, + * // "queue": "my_queue" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.indexing.datasources.items.unreserve * @memberOf! () * @@ -3682,6 +4624,60 @@ export namespace cloudsearch_v1 { /** * cloudsearch.indexing.datasources.items.upload * @desc Creates an upload session for uploading item content. For items smaller than 100 KB, it's easier to embed the content inline within an index request. This API requires an admin or service account to execute. The service account used is the one whitelisted in the corresponding data source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.indexing', + * ], + * }); + * + * // 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 cloudsearch.indexing.datasources.items.upload({ + * // Name of the Item to start a resumable upload. + * // Format: datasources/{source_id}/items/{item_id}. + * // The maximum length is 1536 bytes. + * name: 'datasources/my-datasource/items/my-item', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "connectorName": "my_connectorName", + * // "debugOptions": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.indexing.datasources.items.upload * @memberOf! () * @@ -3947,6 +4943,62 @@ export namespace cloudsearch_v1 { /** * cloudsearch.media.upload * @desc Uploads media for indexing. The upload endpoint supports direct and resumable upload protocols and is intended for large items that can not be [inlined during index requests](https://developers.google.com/cloud-search/docs/reference/rest/v1/indexing.datasources.items#itemcontent). To index large content: 1. Call indexing.datasources.items.upload with the resource name to begin an upload session and retrieve the UploadItemRef. 1. Call media.upload to upload the content using the same resource name from step 1. 1. Call indexing.datasources.items.index to index the item. Populate the [ItemContent](/cloud-search/docs/reference/rest/v1/indexing.datasources.items#ItemContent) with the UploadItemRef from step 1. For additional information, see [Create a content connector using the REST API](https://developers.google.com/cloud-search/docs/guides/content-connector#rest). **Note:** This API requires a service account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.indexing', + * ], + * }); + * + * // 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 cloudsearch.media.upload({ + * // Name of the media that is being downloaded. See + * // ReadRequest.resource_name. + * resourceName: '.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourceName": "my_resourceName" + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "resourceName": "my_resourceName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.media.upload * @memberOf! () * @@ -4065,6 +5117,57 @@ export namespace cloudsearch_v1 { /** * cloudsearch.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.debug', + * 'https://www.googleapis.com/auth/cloud_search.indexing', + * 'https://www.googleapis.com/auth/cloud_search.settings', + * 'https://www.googleapis.com/auth/cloud_search.settings.indexing', + * 'https://www.googleapis.com/auth/cloud_search.settings.query', + * ], + * }); + * + * // 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 cloudsearch.operations.get({ + * // The name of the operation resource. + * name: 'operations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.operations.get * @memberOf! () * @@ -4156,6 +5259,71 @@ export namespace cloudsearch_v1 { /** * cloudsearch.query.search * @desc The Cloud Search Query API provides the search method, which returns the most relevant results from a user query. The results can come from G Suite Apps, such as Gmail or Google Drive, or they can come from data that you have indexed from a third party. **Note:** This API requires a standard end user account to execute. A service account can't perform Query API requests directly; to use a service account to perform queries, set up [G Suite domain-wide delegation of authority](https://developers.google.com/cloud-search/docs/guides/delegation/). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.query', + * ], + * }); + * + * // 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 cloudsearch.query.search({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dataSourceRestrictions": [], + * // "facetOptions": [], + * // "pageSize": 0, + * // "query": "my_query", + * // "queryInterpretationOptions": {}, + * // "requestOptions": {}, + * // "sortOptions": {}, + * // "start": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "debugInfo": {}, + * // "errorInfo": {}, + * // "facetResults": [], + * // "hasMoreResults": false, + * // "queryInterpretation": {}, + * // "resultCountEstimate": "my_resultCountEstimate", + * // "resultCountExact": "my_resultCountExact", + * // "resultCounts": {}, + * // "results": [], + * // "spellResults": [], + * // "structuredResults": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.query.search * @memberOf! () * @@ -4226,6 +5394,56 @@ export namespace cloudsearch_v1 { /** * cloudsearch.query.suggest * @desc Provides suggestions for autocompleting the query. **Note:** This API requires a standard end user account to execute. A service account can't perform Query API requests directly; to use a service account to perform queries, set up [G Suite domain-wide delegation of authority](https://developers.google.com/cloud-search/docs/guides/delegation/). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.query', + * ], + * }); + * + * // 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 cloudsearch.query.suggest({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dataSourceRestrictions": [], + * // "query": "my_query", + * // "requestOptions": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "suggestResults": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.query.suggest * @memberOf! () * @@ -4326,6 +5544,79 @@ export namespace cloudsearch_v1 { /** * cloudsearch.query.sources.list * @desc Returns list of sources that user can use for Search and Suggest APIs. **Note:** This API requires a standard end user account to execute. A service account can't perform Query API requests directly; to use a service account to perform queries, set up [G Suite domain-wide delegation of authority](https://developers.google.com/cloud-search/docs/guides/delegation/). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.query', + * ], + * }); + * + * // 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 cloudsearch.query.sources.list({ + * // Number of sources to return in the response. + * pageToken: 'placeholder-value', + * // If you are asked by Google to help with debugging, set this field. + * // Otherwise, ignore this field. + * 'requestOptions.debugOptions.enableDebugging': 'placeholder-value', + * // The BCP-47 language code, such as "en-US" or "sr-Latn". + * // For more information, see + * // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * // For translations. + * // + * // Set this field using the language set in browser or for the page. In the + * // event that the user's language preference is known, set this field to the + * // known user language. + * // + * // When specified, the documents in search results are biased towards the + * // specified language. + * // + * // The suggest API does not use this parameter. Instead, suggest autocompletes + * // only based on characters in the query. + * 'requestOptions.languageCode': 'placeholder-value', + * // The ID generated when you create a search application using the + * // [admin console](https://support.google.com/a/answer/9043922). + * 'requestOptions.searchApplicationId': 'placeholder-value', + * // Current user's time zone id, such as "America/Los_Angeles" or + * // "Australia/Sydney". These IDs are defined by + * // [Unicode Common Locale Data Repository (CLDR)](http://cldr.unicode.org/) + * // project, and currently available in the file + * // [timezone.xml](http://unicode.org/repos/cldr/trunk/common/bcp47/timezone.xml). + * // This field is used to correctly interpret date and time queries. + * // If this field is not specified, the default time zone (UTC) is used. + * 'requestOptions.timeZone': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "sources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.query.sources.list * @memberOf! () * @@ -4452,6 +5743,66 @@ export namespace cloudsearch_v1 { /** * cloudsearch.settings.datasources.create * @desc Creates a datasource. **Note:** This API requires an admin account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.settings', + * 'https://www.googleapis.com/auth/cloud_search.settings.indexing', + * ], + * }); + * + * // 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 cloudsearch.settings.datasources.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "disableModifications": false, + * // "disableServing": false, + * // "displayName": "my_displayName", + * // "indexingServiceAccounts": [], + * // "itemsVisibility": [], + * // "name": "my_name", + * // "operationIds": [], + * // "shortName": "my_shortName" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.settings.datasources.create * @memberOf! () * @@ -4526,6 +5877,58 @@ export namespace cloudsearch_v1 { /** * cloudsearch.settings.datasources.delete * @desc Deletes a datasource. **Note:** This API requires an admin account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.settings', + * 'https://www.googleapis.com/auth/cloud_search.settings.indexing', + * ], + * }); + * + * // 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 cloudsearch.settings.datasources.delete({ + * // If you are asked by Google to help with debugging, set this field. + * // Otherwise, ignore this field. + * 'debugOptions.enableDebugging': 'placeholder-value', + * // Name of the datasource. + * // Format: datasources/{source_id}. + * name: 'datasources/my-datasource', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.settings.datasources.delete * @memberOf! () * @@ -4601,6 +6004,61 @@ export namespace cloudsearch_v1 { /** * cloudsearch.settings.datasources.get * @desc Gets a datasource. **Note:** This API requires an admin account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.settings', + * 'https://www.googleapis.com/auth/cloud_search.settings.indexing', + * ], + * }); + * + * // 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 cloudsearch.settings.datasources.get({ + * // If you are asked by Google to help with debugging, set this field. + * // Otherwise, ignore this field. + * 'debugOptions.enableDebugging': 'placeholder-value', + * // Name of the datasource resource. + * // Format: datasources/{source_id}. + * name: 'datasources/my-datasource', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "disableModifications": false, + * // "disableServing": false, + * // "displayName": "my_displayName", + * // "indexingServiceAccounts": [], + * // "itemsVisibility": [], + * // "name": "my_name", + * // "operationIds": [], + * // "shortName": "my_shortName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.settings.datasources.get * @memberOf! () * @@ -4676,6 +6134,58 @@ export namespace cloudsearch_v1 { /** * cloudsearch.settings.datasources.list * @desc Lists datasources. **Note:** This API requires an admin account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.settings', + * 'https://www.googleapis.com/auth/cloud_search.settings.indexing', + * ], + * }); + * + * // 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 cloudsearch.settings.datasources.list({ + * // If you are asked by Google to help with debugging, set this field. + * // Otherwise, ignore this field. + * 'debugOptions.enableDebugging': 'placeholder-value', + * // Maximum number of datasources to fetch in a request. + * // The max value is 100. + * //
                          The default value is 10 + * pageSize: 'placeholder-value', + * // Starting index of the results. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "sources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.settings.datasources.list * @memberOf! () * @@ -4754,6 +6264,65 @@ export namespace cloudsearch_v1 { /** * cloudsearch.settings.datasources.update * @desc Updates a datasource. **Note:** This API requires an admin account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.settings', + * 'https://www.googleapis.com/auth/cloud_search.settings.indexing', + * ], + * }); + * + * // 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 cloudsearch.settings.datasources.update({ + * // Name of the datasource resource. + * // Format: datasources/{source_id}. + * //
                          The name is ignored when creating a datasource. + * name: 'datasources/my-datasource', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "debugOptions": {}, + * // "source": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.settings.datasources.update * @memberOf! () * @@ -4918,6 +6487,66 @@ export namespace cloudsearch_v1 { /** * cloudsearch.settings.searchapplications.create * @desc Creates a search application. **Note:** This API requires an admin account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.settings', + * 'https://www.googleapis.com/auth/cloud_search.settings.query', + * ], + * }); + * + * // 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 cloudsearch.settings.searchapplications.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dataSourceRestrictions": [], + * // "defaultFacetOptions": [], + * // "defaultSortOptions": {}, + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "operationIds": [], + * // "scoringConfig": {}, + * // "sourceConfig": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.settings.searchapplications.create * @memberOf! () * @@ -4992,6 +6621,58 @@ export namespace cloudsearch_v1 { /** * cloudsearch.settings.searchapplications.delete * @desc Deletes a search application. **Note:** This API requires an admin account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.settings', + * 'https://www.googleapis.com/auth/cloud_search.settings.query', + * ], + * }); + * + * // 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 cloudsearch.settings.searchapplications.delete({ + * // If you are asked by Google to help with debugging, set this field. + * // Otherwise, ignore this field. + * 'debugOptions.enableDebugging': 'placeholder-value', + * // The name of the search application to be deleted. + * //
                          Format: applications/{application_id}. + * name: 'searchapplications/my-searchapplication', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.settings.searchapplications.delete * @memberOf! () * @@ -5067,6 +6748,61 @@ export namespace cloudsearch_v1 { /** * cloudsearch.settings.searchapplications.get * @desc Gets the specified search application. **Note:** This API requires an admin account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.settings', + * 'https://www.googleapis.com/auth/cloud_search.settings.query', + * ], + * }); + * + * // 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 cloudsearch.settings.searchapplications.get({ + * // If you are asked by Google to help with debugging, set this field. + * // Otherwise, ignore this field. + * 'debugOptions.enableDebugging': 'placeholder-value', + * // Name of the search application. + * //
                          Format: applications/{application_id}. + * name: 'searchapplications/my-searchapplication', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dataSourceRestrictions": [], + * // "defaultFacetOptions": [], + * // "defaultSortOptions": {}, + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "operationIds": [], + * // "scoringConfig": {}, + * // "sourceConfig": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.settings.searchapplications.get * @memberOf! () * @@ -5142,6 +6878,57 @@ export namespace cloudsearch_v1 { /** * cloudsearch.settings.searchapplications.list * @desc Lists all search applications. **Note:** This API requires an admin account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.settings', + * 'https://www.googleapis.com/auth/cloud_search.settings.query', + * ], + * }); + * + * // 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 cloudsearch.settings.searchapplications.list({ + * // If you are asked by Google to help with debugging, set this field. + * // Otherwise, ignore this field. + * 'debugOptions.enableDebugging': 'placeholder-value', + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * //
                          The default value is 10 + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "searchApplications": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.settings.searchapplications.list * @memberOf! () * @@ -5227,6 +7014,63 @@ export namespace cloudsearch_v1 { /** * cloudsearch.settings.searchapplications.reset * @desc Resets a search application to default settings. This will return an empty response. **Note:** This API requires an admin account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.settings', + * 'https://www.googleapis.com/auth/cloud_search.settings.query', + * ], + * }); + * + * // 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 cloudsearch.settings.searchapplications.reset({ + * // The name of the search application to be reset. + * //
                          Format: applications/{application_id}. + * name: 'searchapplications/my-searchapplication', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "debugOptions": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.settings.searchapplications.reset * @memberOf! () * @@ -5302,6 +7146,70 @@ export namespace cloudsearch_v1 { /** * cloudsearch.settings.searchapplications.update * @desc Updates a search application. **Note:** This API requires an admin account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.settings', + * 'https://www.googleapis.com/auth/cloud_search.settings.query', + * ], + * }); + * + * // 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 cloudsearch.settings.searchapplications.update({ + * // Name of the Search Application. + * //
                          Format: searchapplications/{application_id}. + * name: 'searchapplications/my-searchapplication', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dataSourceRestrictions": [], + * // "defaultFacetOptions": [], + * // "defaultSortOptions": {}, + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "operationIds": [], + * // "scoringConfig": {}, + * // "sourceConfig": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.settings.searchapplications.update * @memberOf! () * @@ -5491,6 +7399,60 @@ export namespace cloudsearch_v1 { /** * cloudsearch.stats.getIndex * @desc Gets indexed item statistics aggreggated across all data sources. This API only returns statistics for previous dates; it doesn't return statistics for the current day. **Note:** This API requires a standard end user account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.stats', + * 'https://www.googleapis.com/auth/cloud_search.stats.indexing', + * ], + * }); + * + * // 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 cloudsearch.stats.getIndex({ + * // Day of month. Must be from 1 to 31 and valid for the year and month. + * 'fromDate.day': 'placeholder-value', + * // Month of date. Must be from 1 to 12. + * 'fromDate.month': 'placeholder-value', + * // Year of date. Must be from 1 to 9999. + * 'fromDate.year': 'placeholder-value', + * // Day of month. Must be from 1 to 31 and valid for the year and month. + * 'toDate.day': 'placeholder-value', + * // Month of date. Must be from 1 to 12. + * 'toDate.month': 'placeholder-value', + * // Year of date. Must be from 1 to 9999. + * 'toDate.year': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "stats": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.stats.getIndex * @memberOf! () * @@ -5575,6 +7537,60 @@ export namespace cloudsearch_v1 { /** * cloudsearch.stats.getQuery * @desc Get the query statistics for customer. **Note:** This API requires a standard end user account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.stats', + * 'https://www.googleapis.com/auth/cloud_search.stats.indexing', + * ], + * }); + * + * // 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 cloudsearch.stats.getQuery({ + * // Day of month. Must be from 1 to 31 and valid for the year and month. + * 'fromDate.day': 'placeholder-value', + * // Month of date. Must be from 1 to 12. + * 'fromDate.month': 'placeholder-value', + * // Year of date. Must be from 1 to 9999. + * 'fromDate.year': 'placeholder-value', + * // Day of month. Must be from 1 to 31 and valid for the year and month. + * 'toDate.day': 'placeholder-value', + * // Month of date. Must be from 1 to 12. + * 'toDate.month': 'placeholder-value', + * // Year of date. Must be from 1 to 9999. + * 'toDate.year': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "stats": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.stats.getQuery * @memberOf! () * @@ -5659,6 +7675,60 @@ export namespace cloudsearch_v1 { /** * cloudsearch.stats.getSession * @desc Get the # of search sessions, % of successful sessions with a click query statistics for customer. **Note:** This API requires a standard end user account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.stats', + * 'https://www.googleapis.com/auth/cloud_search.stats.indexing', + * ], + * }); + * + * // 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 cloudsearch.stats.getSession({ + * // Day of month. Must be from 1 to 31 and valid for the year and month. + * 'fromDate.day': 'placeholder-value', + * // Month of date. Must be from 1 to 12. + * 'fromDate.month': 'placeholder-value', + * // Year of date. Must be from 1 to 9999. + * 'fromDate.year': 'placeholder-value', + * // Day of month. Must be from 1 to 31 and valid for the year and month. + * 'toDate.day': 'placeholder-value', + * // Month of date. Must be from 1 to 12. + * 'toDate.month': 'placeholder-value', + * // Year of date. Must be from 1 to 9999. + * 'toDate.year': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "stats": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.stats.getSession * @memberOf! () * @@ -5743,6 +7813,60 @@ export namespace cloudsearch_v1 { /** * cloudsearch.stats.getUser * @desc Get the users statistics for customer. **Note:** This API requires a standard end user account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.stats', + * 'https://www.googleapis.com/auth/cloud_search.stats.indexing', + * ], + * }); + * + * // 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 cloudsearch.stats.getUser({ + * // Day of month. Must be from 1 to 31 and valid for the year and month. + * 'fromDate.day': 'placeholder-value', + * // Month of date. Must be from 1 to 12. + * 'fromDate.month': 'placeholder-value', + * // Year of date. Must be from 1 to 9999. + * 'fromDate.year': 'placeholder-value', + * // Day of month. Must be from 1 to 31 and valid for the year and month. + * 'toDate.day': 'placeholder-value', + * // Month of date. Must be from 1 to 12. + * 'toDate.month': 'placeholder-value', + * // Year of date. Must be from 1 to 9999. + * 'toDate.year': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "stats": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.stats.getUser * @memberOf! () * @@ -5968,6 +8092,63 @@ export namespace cloudsearch_v1 { /** * cloudsearch.stats.index.datasources.get * @desc Gets indexed item statistics for a single data source. **Note:** This API requires a standard end user account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.stats', + * 'https://www.googleapis.com/auth/cloud_search.stats.indexing', + * ], + * }); + * + * // 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 cloudsearch.stats.index.datasources.get({ + * // Day of month. Must be from 1 to 31 and valid for the year and month. + * 'fromDate.day': 'placeholder-value', + * // Month of date. Must be from 1 to 12. + * 'fromDate.month': 'placeholder-value', + * // Year of date. Must be from 1 to 9999. + * 'fromDate.year': 'placeholder-value', + * // The resource id of the data source to retrieve statistics for, + * // in the following format: "datasources/{source_id}" + * name: 'datasources/my-datasource', + * // Day of month. Must be from 1 to 31 and valid for the year and month. + * 'toDate.day': 'placeholder-value', + * // Month of date. Must be from 1 to 12. + * 'toDate.month': 'placeholder-value', + * // Year of date. Must be from 1 to 9999. + * 'toDate.year': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "stats": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.stats.index.datasources.get * @memberOf! () * @@ -6112,6 +8293,63 @@ export namespace cloudsearch_v1 { /** * cloudsearch.stats.query.searchapplications.get * @desc Get the query statistics for search application. **Note:** This API requires a standard end user account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.stats', + * 'https://www.googleapis.com/auth/cloud_search.stats.indexing', + * ], + * }); + * + * // 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 cloudsearch.stats.query.searchapplications.get({ + * // Day of month. Must be from 1 to 31 and valid for the year and month. + * 'fromDate.day': 'placeholder-value', + * // Month of date. Must be from 1 to 12. + * 'fromDate.month': 'placeholder-value', + * // Year of date. Must be from 1 to 9999. + * 'fromDate.year': 'placeholder-value', + * // The resource id of the search application query stats, in the following + * // format: searchapplications/{application_id} + * name: 'searchapplications/my-searchapplication', + * // Day of month. Must be from 1 to 31 and valid for the year and month. + * 'toDate.day': 'placeholder-value', + * // Month of date. Must be from 1 to 12. + * 'toDate.month': 'placeholder-value', + * // Year of date. Must be from 1 to 9999. + * 'toDate.year': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "stats": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.stats.query.searchapplications.get * @memberOf! () * @@ -6264,6 +8502,63 @@ export namespace cloudsearch_v1 { /** * cloudsearch.stats.session.searchapplications.get * @desc Get the # of search sessions, % of successful sessions with a click query statistics for search application. **Note:** This API requires a standard end user account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.stats', + * 'https://www.googleapis.com/auth/cloud_search.stats.indexing', + * ], + * }); + * + * // 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 cloudsearch.stats.session.searchapplications.get({ + * // Day of month. Must be from 1 to 31 and valid for the year and month. + * 'fromDate.day': 'placeholder-value', + * // Month of date. Must be from 1 to 12. + * 'fromDate.month': 'placeholder-value', + * // Year of date. Must be from 1 to 9999. + * 'fromDate.year': 'placeholder-value', + * // The resource id of the search application session stats, in the following + * // format: searchapplications/{application_id} + * name: 'searchapplications/my-searchapplication', + * // Day of month. Must be from 1 to 31 and valid for the year and month. + * 'toDate.day': 'placeholder-value', + * // Month of date. Must be from 1 to 12. + * 'toDate.month': 'placeholder-value', + * // Year of date. Must be from 1 to 9999. + * 'toDate.year': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "stats": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.stats.session.searchapplications.get * @memberOf! () * @@ -6416,6 +8711,63 @@ export namespace cloudsearch_v1 { /** * cloudsearch.stats.user.searchapplications.get * @desc Get the users statistics for search application. **Note:** This API requires a standard end user account to execute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudsearch.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 cloudsearch = google.cloudsearch('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/cloud_search', + * 'https://www.googleapis.com/auth/cloud_search.stats', + * 'https://www.googleapis.com/auth/cloud_search.stats.indexing', + * ], + * }); + * + * // 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 cloudsearch.stats.user.searchapplications.get({ + * // Day of month. Must be from 1 to 31 and valid for the year and month. + * 'fromDate.day': 'placeholder-value', + * // Month of date. Must be from 1 to 12. + * 'fromDate.month': 'placeholder-value', + * // Year of date. Must be from 1 to 9999. + * 'fromDate.year': 'placeholder-value', + * // The resource id of the search application session stats, in the following + * // format: searchapplications/{application_id} + * name: 'searchapplications/my-searchapplication', + * // Day of month. Must be from 1 to 31 and valid for the year and month. + * 'toDate.day': 'placeholder-value', + * // Month of date. Must be from 1 to 12. + * 'toDate.month': 'placeholder-value', + * // Year of date. Must be from 1 to 9999. + * 'toDate.year': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "stats": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudsearch.stats.user.searchapplications.get * @memberOf! () * diff --git a/src/apis/cloudshell/v1.ts b/src/apis/cloudshell/v1.ts index 24b9520ed8c..0d521fc9ac9 100644 --- a/src/apis/cloudshell/v1.ts +++ b/src/apis/cloudshell/v1.ts @@ -274,6 +274,50 @@ export namespace cloudshell_v1 { /** * cloudshell.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudshell.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 cloudshell = google.cloudshell('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/cloud-platform'], + * }); + * + * // 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 cloudshell.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'operations/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudshell.operations.cancel * @memberOf! () * @@ -344,6 +388,44 @@ export namespace cloudshell_v1 { /** * cloudshell.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudshell.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 cloudshell = google.cloudshell('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/cloud-platform'], + * }); + * + * // 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 cloudshell.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'operations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudshell.operations.delete * @memberOf! () * @@ -413,6 +495,50 @@ export namespace cloudshell_v1 { /** * cloudshell.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudshell.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 cloudshell = google.cloudshell('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/cloud-platform'], + * }); + * + * // 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 cloudshell.operations.get({ + * // The name of the operation resource. + * name: 'operations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudshell.operations.get * @memberOf! () * @@ -483,6 +609,53 @@ export namespace cloudshell_v1 { /** * cloudshell.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudshell.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 cloudshell = google.cloudshell('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/cloud-platform'], + * }); + * + * // 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 cloudshell.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudshell.operations.list * @memberOf! () * diff --git a/src/apis/cloudshell/v1alpha1.ts b/src/apis/cloudshell/v1alpha1.ts index f194125565b..670368dcd48 100644 --- a/src/apis/cloudshell/v1alpha1.ts +++ b/src/apis/cloudshell/v1alpha1.ts @@ -309,6 +309,56 @@ export namespace cloudshell_v1alpha1 { /** * cloudshell.users.environments.authorize * @desc Sends OAuth credentials to a running environment on behalf of a user. When this completes, the environment will be authorized to run various Google Cloud command line tools without requiring the user to manually authenticate. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudshell.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 cloudshell = google.cloudshell('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudshell.users.environments.authorize({ + * // Name of the resource that should receive the credentials, for example + * // `users/me/environments/default` or + * // `users/someone@example.com/environments/default`. + * name: 'users/my-user/environments/my-environment', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accessToken": "my_accessToken", + * // "expireTime": "my_expireTime", + * // "idToken": "my_idToken" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudshell.users.environments.authorize * @memberOf! () * @@ -382,6 +432,58 @@ export namespace cloudshell_v1alpha1 { /** * cloudshell.users.environments.get * @desc Gets an environment. Returns NOT_FOUND if the environment does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudshell.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 cloudshell = google.cloudshell('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudshell.users.environments.get({ + * // Name of the requested resource, for example `users/me/environments/default` + * // or `users/someone@example.com/environments/default`. + * name: 'users/my-user/environments/my-environment', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dockerImage": "my_dockerImage", + * // "id": "my_id", + * // "name": "my_name", + * // "publicKeys": [], + * // "size": "my_size", + * // "sshHost": "my_sshHost", + * // "sshPort": 0, + * // "sshUsername": "my_sshUsername", + * // "state": "my_state", + * // "vmSizeExpireTime": "my_vmSizeExpireTime", + * // "webHost": "my_webHost", + * // "webPorts": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudshell.users.environments.get * @memberOf! () * @@ -453,6 +555,80 @@ export namespace cloudshell_v1alpha1 { /** * cloudshell.users.environments.patch * @desc Updates an existing environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudshell.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 cloudshell = google.cloudshell('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudshell.users.environments.patch({ + * // Name of the resource to be updated, for example + * // `users/me/environments/default` or + * // `users/someone@example.com/environments/default`. + * name: 'users/my-user/environments/my-environment', + * // Mask specifying which fields in the environment should be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dockerImage": "my_dockerImage", + * // "id": "my_id", + * // "name": "my_name", + * // "publicKeys": [], + * // "size": "my_size", + * // "sshHost": "my_sshHost", + * // "sshPort": 0, + * // "sshUsername": "my_sshUsername", + * // "state": "my_state", + * // "vmSizeExpireTime": "my_vmSizeExpireTime", + * // "webHost": "my_webHost", + * // "webPorts": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dockerImage": "my_dockerImage", + * // "id": "my_id", + * // "name": "my_name", + * // "publicKeys": [], + * // "size": "my_size", + * // "sshHost": "my_sshHost", + * // "sshPort": 0, + * // "sshUsername": "my_sshUsername", + * // "state": "my_state", + * // "vmSizeExpireTime": "my_vmSizeExpireTime", + * // "webHost": "my_webHost", + * // "webPorts": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudshell.users.environments.patch * @memberOf! () * @@ -526,6 +702,61 @@ export namespace cloudshell_v1alpha1 { /** * cloudshell.users.environments.start * @desc Starts an existing environment, allowing clients to connect to it. The returned operation will contain an instance of StartEnvironmentMetadata in its metadata field. Users can wait for the environment to start by polling this operation via GetOperation. Once the environment has finished starting and is ready to accept connections, the operation will contain a StartEnvironmentResponse in its response field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudshell.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 cloudshell = google.cloudshell('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudshell.users.environments.start({ + * // Name of the resource that should be started, for example + * // `users/me/environments/default` or + * // `users/someone@example.com/environments/default`. + * name: 'users/my-user/environments/my-environment', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accessToken": "my_accessToken", + * // "publicKeys": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudshell.users.environments.start * @memberOf! () * @@ -676,6 +907,56 @@ export namespace cloudshell_v1alpha1 { /** * cloudshell.users.environments.publicKeys.create * @desc Adds a public SSH key to an environment, allowing clients with the corresponding private key to connect to that environment via SSH. If a key with the same format and content already exists, this will return the existing key. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudshell.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 cloudshell = google.cloudshell('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudshell.users.environments.publicKeys.create({ + * // Parent resource name, e.g. `users/me/environments/default`. + * parent: 'users/my-user/environments/my-environment', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "key": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "format": "my_format", + * // "key": "my_key", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudshell.users.environments.publicKeys.create * @memberOf! () * @@ -751,6 +1032,45 @@ export namespace cloudshell_v1alpha1 { /** * cloudshell.users.environments.publicKeys.delete * @desc Removes a public SSH key from an environment. Clients will no longer be able to connect to the environment using the corresponding private key. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudshell.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 cloudshell = google.cloudshell('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudshell.users.environments.publicKeys.delete({ + * // Name of the resource to be deleted, e.g. + * // `users/me/environments/default/publicKeys/my-key`. + * name: 'users/my-user/environments/my-environment/publicKeys/my-publicKey', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudshell.users.environments.publicKeys.delete * @memberOf! () * diff --git a/src/apis/cloudtasks/v2.ts b/src/apis/cloudtasks/v2.ts index 974ff430ffc..0f974e2fad6 100644 --- a/src/apis/cloudtasks/v2.ts +++ b/src/apis/cloudtasks/v2.ts @@ -609,51 +609,49 @@ export namespace cloudtasks_v2 { * cloudtasks.projects.locations.get * @desc Gets information about a location. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2'); + * const cloudtasks = google.cloudtasks('v2'); * - * authorize(function(authClient) { - * var request = { - * // Resource name for the location. - * name: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudTasks.projects.locations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudtasks.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.get * @memberOf! () * @@ -724,64 +722,52 @@ export namespace cloudtasks_v2 { * cloudtasks.projects.locations.list * @desc Lists information about the supported locations for this service. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2'); + * const cloudtasks = google.cloudtasks('v2'); * - * authorize(function(authClient) { - * var request = { - * // The resource that owns the locations collection, if applicable. - * name: 'projects/my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var locationsPage = response['locations']; - * if (!locationsPage) { - * return; - * } - * for (var i = 0; i < locationsPage.length; i++) { - * // TODO: Change code below to process each resource in `locationsPage`: - * console.log(JSON.stringify(locationsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudTasks.projects.locations.list(request, handlePage); - * } - * }; - * - * cloudTasks.projects.locations.list(request, handlePage); - * }); + * 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/cloud-platform'], + * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 cloudtasks.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtasks.projects.locations.list * @memberOf! () * @@ -908,60 +894,70 @@ export namespace cloudtasks_v2 { * cloudtasks.projects.locations.queues.create * @desc Creates a queue. Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2'); + * const cloudtasks = google.cloudtasks('v2'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The location name in which the queue will be created. + * 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/cloud-platform'], + * }); + * + * // 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 cloudtasks.projects.locations.queues.create({ + * // Required. The location name in which the queue will be created. * // For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * // * // The list of allowed locations can be obtained by calling Cloud * // Tasks' implementation of * // ListLocations. - * parent: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appEngineRoutingOverride": {}, + * // "name": "my_name", + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "stackdriverLoggingConfig": {}, + * // "state": "my_state" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineRoutingOverride": {}, + * // "name": "my_name", + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "stackdriverLoggingConfig": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.create * @memberOf! () * @@ -1036,50 +1032,44 @@ export namespace cloudtasks_v2 { * cloudtasks.projects.locations.queues.delete * @desc Deletes a queue. This command will delete the queue even if it has tasks in it. Note: If you delete a queue, a queue with the same name can't be created for 7 days. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2'); + * const cloudtasks = google.cloudtasks('v2'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudTasks.projects.locations.queues.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.delete({ + * // Required. The queue name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * name: 'projects/my-project/locations/my-location/queues/my-queue', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtasks.projects.locations.queues.delete * @memberOf! () * @@ -1150,53 +1140,52 @@ export namespace cloudtasks_v2 { * cloudtasks.projects.locations.queues.get * @desc Gets a queue. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The resource name of the queue. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. + * const cloudtasks = google.cloudtasks('v2'); * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudTasks.projects.locations.queues.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.get({ + * // Required. The resource name of the queue. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * name: 'projects/my-project/locations/my-location/queues/my-queue', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineRoutingOverride": {}, + * // "name": "my_name", + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "stackdriverLoggingConfig": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.get * @memberOf! () * @@ -1267,56 +1256,56 @@ export namespace cloudtasks_v2 { * cloudtasks.projects.locations.queues.getIamPolicy * @desc Gets the access control policy for a Queue. Returns an empty policy if the resource exists and does not have a policy set. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission on the specified resource parent: * `cloudtasks.queues.getIamPolicy` * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2'); + * const cloudtasks = google.cloudtasks('v2'); + * + * 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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 cloudtasks.projects.locations.queues.getIamPolicy({ * // REQUIRED: The resource for which the policy is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'projects/my-project/locations/my-location/queues/my-queue', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.getIamPolicy * @memberOf! () * @@ -1391,66 +1380,76 @@ export namespace cloudtasks_v2 { * cloudtasks.projects.locations.queues.list * @desc Lists queues. Queues are returned in lexicographical order. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2'); + * const cloudtasks = google.cloudtasks('v2'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The location name. - * // For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * parent: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var queuesPage = response['queues']; - * if (!queuesPage) { - * return; - * } - * for (var i = 0; i < queuesPage.length; i++) { - * // TODO: Change code below to process each resource in `queuesPage`: - * console.log(JSON.stringify(queuesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudTasks.projects.locations.queues.list(request, handlePage); - * } - * }; - * - * cloudTasks.projects.locations.queues.list(request, handlePage); - * }); + * 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/cloud-platform'], + * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 cloudtasks.projects.locations.queues.list({ + * // `filter` can be used to specify a subset of queues. Any Queue + * // field can be used as a filter and several operators as supported. + * // For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as + * // described in + * // [Stackdriver's Advanced Logs + * // Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * // + * // Sample filter "state: PAUSED". + * // + * // Note that using filters might cause fewer queues than the + * // requested page_size to be returned. + * filter: 'placeholder-value', + * // Requested page size. + * // + * // The maximum page size is 9800. If unspecified, the page size will + * // be the maximum. Fewer queues than requested might be returned, + * // even if more queues exist; use the + * // next_page_token in the + * // response to determine if more queues exist. + * pageSize: 'placeholder-value', + * // A token identifying the page of results to return. + * // + * // To request the first page results, page_token must be empty. To + * // request the next page of results, page_token must be the value of + * // next_page_token returned + * // from the previous call to ListQueues + * // method. It is an error to switch the value of the + * // filter while iterating through pages. + * pageToken: 'placeholder-value', + * // Required. The location name. + * // For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * parent: 'projects/my-project/locations/my-location', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "queues": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtasks.projects.locations.queues.list * @memberOf! () * @@ -1529,72 +1528,87 @@ export namespace cloudtasks_v2 { * cloudtasks.projects.locations.queues.patch * @desc Updates a queue. This method creates the queue if it does not exist and updates the queue if it does exist. Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2'); + * const cloudtasks = google.cloudtasks('v2'); + * + * 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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 cloudtasks.projects.locations.queues.patch({ * // Caller-specified and required in CreateQueue, * // after which it becomes output only. + * // * // The queue name. + * // * // The queue name must have the following format: * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * // * // * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * // hyphens (-), colons (:), or periods (.). - * // For more information, see - * // [Identifying - * // projects] - * // (https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * // hyphens (-), colons (:), or periods (.). + * // For more information, see + * // [Identifying + * // projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) * // * `LOCATION_ID` is the canonical ID for the queue's location. - * // The list of available locations can be obtained by calling - * // ListLocations. - * // For more information, see https://cloud.google.com/about/locations/. + * // The list of available locations can be obtained by calling + * // ListLocations. + * // For more information, see https://cloud.google.com/about/locations/. * // * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * // hyphens (-). The maximum length is 100 characters. - * name: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * // hyphens (-). The maximum length is 100 characters. + * name: 'projects/my-project/locations/my-location/queues/my-queue', + * // A mask used to specify which fields of the queue are being updated. + * // + * // If empty, then all fields will be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appEngineRoutingOverride": {}, + * // "name": "my_name", + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "stackdriverLoggingConfig": {}, + * // "state": "my_state" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineRoutingOverride": {}, + * // "name": "my_name", + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "stackdriverLoggingConfig": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.patch * @memberOf! () * @@ -1667,57 +1681,58 @@ export namespace cloudtasks_v2 { * cloudtasks.projects.locations.queues.pause * @desc Pauses the queue. If a queue is paused then the system will stop dispatching tasks until the queue is resumed via ResumeQueue. Tasks can still be added when the queue is paused. A queue is paused if its state is PAUSED. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2'); + * const cloudtasks = google.cloudtasks('v2'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudTasks.projects.locations.queues.pause(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.pause({ + * // Required. The queue name. For example: + * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * name: 'projects/my-project/locations/my-location/queues/my-queue', * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineRoutingOverride": {}, + * // "name": "my_name", + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "stackdriverLoggingConfig": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.pause * @memberOf! () * @@ -1789,57 +1804,58 @@ export namespace cloudtasks_v2 { * cloudtasks.projects.locations.queues.purge * @desc Purges a queue by deleting all of its tasks. All tasks created before this method is called are permanently deleted. Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. + * const cloudtasks = google.cloudtasks('v2'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudTasks.projects.locations.queues.purge(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.purge({ + * // Required. The queue name. For example: + * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * name: 'projects/my-project/locations/my-location/queues/my-queue', * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineRoutingOverride": {}, + * // "name": "my_name", + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "stackdriverLoggingConfig": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.purge * @memberOf! () * @@ -1911,57 +1927,58 @@ export namespace cloudtasks_v2 { * cloudtasks.projects.locations.queues.resume * @desc Resume a queue. This method resumes a queue after it has been PAUSED or DISABLED. The state of a queue is stored in the queue's state; after calling this method it will be set to RUNNING. WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS queues, follow the 500/50/5 pattern described in [Managing Cloud Tasks Scaling Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. + * const cloudtasks = google.cloudtasks('v2'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudTasks.projects.locations.queues.resume(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.resume({ + * // Required. The queue name. For example: + * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * name: 'projects/my-project/locations/my-location/queues/my-queue', * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineRoutingOverride": {}, + * // "name": "my_name", + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "stackdriverLoggingConfig": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.resume * @memberOf! () * @@ -2033,56 +2050,56 @@ export namespace cloudtasks_v2 { * cloudtasks.projects.locations.queues.setIamPolicy * @desc Sets the access control policy for a Queue. Replaces any existing policy. Note: The Cloud Console does not check queue-level IAM permissions yet. Project-level permissions are required to use the Cloud Console. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission on the specified resource parent: * `cloudtasks.queues.setIamPolicy` * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2'); + * const cloudtasks = google.cloudtasks('v2'); + * + * 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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.setIamPolicy({ * // REQUIRED: The resource for which the policy is being specified. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'projects/my-project/locations/my-location/queues/my-queue', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.setIamPolicy * @memberOf! () * @@ -2157,56 +2174,54 @@ export namespace cloudtasks_v2 { * cloudtasks.projects.locations.queues.testIamPermissions * @desc Returns permissions that a caller has on a Queue. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2'); + * const cloudtasks = google.cloudtasks('v2'); + * + * 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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.testIamPermissions({ * // REQUIRED: The resource for which the policy detail is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'projects/my-project/locations/my-location/queues/my-queue', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.testIamPermissions * @memberOf! () * @@ -2486,58 +2501,67 @@ export namespace cloudtasks_v2 { * cloudtasks.projects.locations.queues.tasks.create * @desc Creates a task and adds it to a queue. Tasks cannot be updated after creation; there is no UpdateTask command. * The maximum task size is 100KB. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2'); + * const cloudtasks = google.cloudtasks('v2'); + * + * 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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.tasks.create({ + * // Required. The queue name. For example: * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * // * // The queue must already exist. - * parent: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * parent: 'projects/my-project/locations/my-location/queues/my-queue', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "responseView": "my_responseView", + * // "task": {} + * // } * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.tasks.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpRequest": {}, + * // "createTime": "my_createTime", + * // "dispatchCount": 0, + * // "dispatchDeadline": "my_dispatchDeadline", + * // "firstAttempt": {}, + * // "httpRequest": {}, + * // "lastAttempt": {}, + * // "name": "my_name", + * // "responseCount": 0, + * // "scheduleTime": "my_scheduleTime", + * // "view": "my_view" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.tasks.create * @memberOf! () * @@ -2612,50 +2636,45 @@ export namespace cloudtasks_v2 { * cloudtasks.projects.locations.queues.tasks.delete * @desc Deletes a task. A task can be deleted if it is scheduled or dispatched. A task cannot be deleted if it has executed successfully or permanently failed. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2'); + * const cloudtasks = google.cloudtasks('v2'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The task name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudTasks.projects.locations.queues.tasks.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.tasks.delete({ + * // Required. The task name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * name: + * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtasks.projects.locations.queues.tasks.delete * @memberOf! () * @@ -2726,53 +2745,70 @@ export namespace cloudtasks_v2 { * cloudtasks.projects.locations.queues.tasks.get * @desc Gets a task. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2'); + * const cloudtasks = google.cloudtasks('v2'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The task name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudTasks.projects.locations.queues.tasks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.tasks.get({ + * // Required. The task name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * name: + * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', + * // The response_view specifies which subset of the Task will be + * // returned. + * // + * // By default response_view is BASIC; not all + * // information is retrieved by default because some data, such as + * // payloads, might be desirable to return only when needed because + * // of its large size or because of the sensitivity of data that it + * // contains. + * // + * // Authorization for FULL requires + * // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * // permission on the Task resource. + * responseView: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpRequest": {}, + * // "createTime": "my_createTime", + * // "dispatchCount": 0, + * // "dispatchDeadline": "my_dispatchDeadline", + * // "firstAttempt": {}, + * // "httpRequest": {}, + * // "lastAttempt": {}, + * // "name": "my_name", + * // "responseCount": 0, + * // "scheduleTime": "my_scheduleTime", + * // "view": "my_view" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.tasks.get * @memberOf! () * @@ -2844,66 +2880,79 @@ export namespace cloudtasks_v2 { * cloudtasks.projects.locations.queues.tasks.list * @desc Lists the tasks in a queue. By default, only the BASIC view is retrieved due to performance considerations; response_view controls the subset of information which is returned. The tasks may be returned in any order. The ordering may change at any time. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2'); + * const cloudtasks = google.cloudtasks('v2'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * parent: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var tasksPage = response['tasks']; - * if (!tasksPage) { - * return; - * } - * for (var i = 0; i < tasksPage.length; i++) { - * // TODO: Change code below to process each resource in `tasksPage`: - * console.log(JSON.stringify(tasksPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudTasks.projects.locations.queues.tasks.list(request, handlePage); - * } - * }; - * - * cloudTasks.projects.locations.queues.tasks.list(request, handlePage); - * }); + * 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/cloud-platform'], + * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 cloudtasks.projects.locations.queues.tasks.list({ + * // Maximum page size. + * // + * // Fewer tasks than requested might be returned, even if more tasks exist; use + * // next_page_token in the response to + * // determine if more tasks exist. + * // + * // The maximum page size is 1000. If unspecified, the page size will be the + * // maximum. + * pageSize: 'placeholder-value', + * // A token identifying the page of results to return. + * // + * // To request the first page results, page_token must be empty. To + * // request the next page of results, page_token must be the value of + * // next_page_token returned + * // from the previous call to ListTasks + * // method. + * // + * // The page token is valid for only 2 hours. + * pageToken: 'placeholder-value', + * // Required. The queue name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * parent: 'projects/my-project/locations/my-location/queues/my-queue', + * // The response_view specifies which subset of the Task will be + * // returned. + * // + * // By default response_view is BASIC; not all + * // information is retrieved by default because some data, such as + * // payloads, might be desirable to return only when needed because + * // of its large size or because of the sensitivity of data that it + * // contains. + * // + * // Authorization for FULL requires + * // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * // permission on the Task resource. + * responseView: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "tasks": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtasks.projects.locations.queues.tasks.list * @memberOf! () * @@ -2982,57 +3031,65 @@ export namespace cloudtasks_v2 { * cloudtasks.projects.locations.queues.tasks.run * @desc Forces a task to run now. When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its RateLimits or is PAUSED. This command is meant to be used for manual debugging. For example, RunTask can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now. The dispatched task is returned. That is, the task that is returned contains the status after the task is dispatched but before the task is received by its target. If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's schedule_time will be reset to the time that RunTask was called plus the retry delay specified in the queue's RetryConfig. RunTask returns NOT_FOUND when it is called on a task that has already succeeded or permanently failed. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2'); + * const cloudtasks = google.cloudtasks('v2'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The task name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudTasks.projects.locations.queues.tasks.run(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.tasks.run({ + * // Required. The task name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * name: + * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "responseView": "my_responseView" + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpRequest": {}, + * // "createTime": "my_createTime", + * // "dispatchCount": 0, + * // "dispatchDeadline": "my_dispatchDeadline", + * // "firstAttempt": {}, + * // "httpRequest": {}, + * // "lastAttempt": {}, + * // "name": "my_name", + * // "responseCount": 0, + * // "scheduleTime": "my_scheduleTime", + * // "view": "my_view" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.tasks.run * @memberOf! () * diff --git a/src/apis/cloudtasks/v2beta2.ts b/src/apis/cloudtasks/v2beta2.ts index b1940f0a4e7..1ce29776ca0 100644 --- a/src/apis/cloudtasks/v2beta2.ts +++ b/src/apis/cloudtasks/v2beta2.ts @@ -649,55 +649,49 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.get * @desc Gets information about a location. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Resource name for the location. - * name: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); * - * cloudTasks.projects.locations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudtasks.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias cloudtasks.projects.locations.get * @memberOf! () * @@ -768,68 +762,52 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.list * @desc Lists information about the supported locations for this service. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // The resource that owns the locations collection, if applicable. - * name: 'projects/my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var locationsPage = response['locations']; - * if (!locationsPage) { - * return; - * } - * for (var i = 0; i < locationsPage.length; i++) { - * // TODO: Change code below to process each resource in `locationsPage`: - * console.log(JSON.stringify(locationsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudTasks.projects.locations.list(request, handlePage); - * } - * }; - * - * cloudTasks.projects.locations.list(request, handlePage); - * }); + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); + * // 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 cloudtasks.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtasks.projects.locations.list * @memberOf! () * @@ -956,64 +934,70 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.queues.create * @desc Creates a queue. Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The location name in which the queue will be created. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudtasks.projects.locations.queues.create({ + * // Required. The location name in which the queue will be created. * // For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * // * // The list of allowed locations can be obtained by calling Cloud * // Tasks' implementation of - * // google.cloud.location.Locations.ListLocations. - * parent: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // ListLocations. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appEngineHttpTarget": {}, + * // "name": "my_name", + * // "pullTarget": {}, + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "state": "my_state" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpTarget": {}, + * // "name": "my_name", + * // "pullTarget": {}, + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias cloudtasks.projects.locations.queues.create * @memberOf! () * @@ -1088,54 +1072,44 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.queues.delete * @desc Deletes a queue. This command will delete the queue even if it has tasks in it. Note: If you delete a queue, a queue with the same name can't be created for 7 days. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudTasks.projects.locations.queues.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.delete({ + * // Required. The queue name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * name: 'projects/my-project/locations/my-location/queues/my-queue', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtasks.projects.locations.queues.delete * @memberOf! () * @@ -1206,57 +1180,55 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.queues.get * @desc Gets a queue. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The resource name of the queue. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); * - * cloudTasks.projects.locations.queues.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.get({ + * // Required. The resource name of the queue. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * name: 'projects/my-project/locations/my-location/queues/my-queue', + * // Optional. Read mask is used for a more granular control over what the API returns. By + * // it includes all fields in Queue except for stats. + * readMask: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpTarget": {}, + * // "name": "my_name", + * // "pullTarget": {}, + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias cloudtasks.projects.locations.queues.get * @memberOf! () * @@ -1328,60 +1300,56 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.queues.getIamPolicy * @desc Gets the access control policy for a Queue. Returns an empty policy if the resource exists and does not have a policy set. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission on the specified resource parent: * `cloudtasks.queues.getIamPolicy` * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudtasks.projects.locations.queues.getIamPolicy({ * // REQUIRED: The resource for which the policy is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'projects/my-project/locations/my-location/queues/my-queue', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias cloudtasks.projects.locations.queues.getIamPolicy * @memberOf! () * @@ -1456,70 +1424,76 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.queues.list * @desc Lists queues. Queues are returned in lexicographical order. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The location name. - * // For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * parent: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var queuesPage = response['queues']; - * if (!queuesPage) { - * return; - * } - * for (var i = 0; i < queuesPage.length; i++) { - * // TODO: Change code below to process each resource in `queuesPage`: - * console.log(JSON.stringify(queuesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudTasks.projects.locations.queues.list(request, handlePage); - * } - * }; - * - * cloudTasks.projects.locations.queues.list(request, handlePage); - * }); + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); + * // 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 cloudtasks.projects.locations.queues.list({ + * // `filter` can be used to specify a subset of queues. Any Queue + * // field can be used as a filter and several operators as supported. + * // For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as + * // described in + * // [Stackdriver's Advanced Logs + * // Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * // + * // Sample filter "app_engine_http_target: *". + * // + * // Note that using filters might cause fewer queues than the + * // requested_page size to be returned. + * filter: 'placeholder-value', + * // Requested page size. + * // + * // The maximum page size is 9800. If unspecified, the page size will + * // be the maximum. Fewer queues than requested might be returned, + * // even if more queues exist; use the + * // next_page_token in the + * // response to determine if more queues exist. + * pageSize: 'placeholder-value', + * // A token identifying the page of results to return. + * // + * // To request the first page results, page_token must be empty. To + * // request the next page of results, page_token must be the value of + * // next_page_token returned + * // from the previous call to ListQueues + * // method. It is an error to switch the value of the + * // filter while iterating through pages. + * pageToken: 'placeholder-value', + * // Required. The location name. + * // For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * parent: 'projects/my-project/locations/my-location', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "queues": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtasks.projects.locations.queues.list * @memberOf! () * @@ -1598,71 +1572,87 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.queues.patch * @desc Updates a queue. This method creates the queue if it does not exist and updates the queue if it does exist. Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudtasks.projects.locations.queues.patch({ + * // Caller-specified and required in CreateQueue, + * // after which it becomes output only. + * // * // The queue name. + * // * // The queue name must have the following format: * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * // * `PROJECT_ID` can contain uppercase and lowercase letters, - * // numbers, hyphens, colons, and periods; that is, it must match - * // the regular expression: `[a-zA-Z\\d-:\\.]+`. - * // * `QUEUE_ID` can contain uppercase and lowercase letters, - * // numbers, and hyphens; that is, it must match the regular - * // expression: `[a-zA-Z\\d-]+`. The maximum length is 100 - * // characters. - * // Caller-specified and required in CreateQueueRequest, after which - * // it becomes output only. - * name: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * // + * // * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + * // hyphens (-), colons (:), or periods (.). + * // For more information, see + * // [Identifying + * // projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * // * `LOCATION_ID` is the canonical ID for the queue's location. + * // The list of available locations can be obtained by calling + * // ListLocations. + * // For more information, see https://cloud.google.com/about/locations/. + * // * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + * // hyphens (-). The maximum length is 100 characters. + * name: 'projects/my-project/locations/my-location/queues/my-queue', + * // A mask used to specify which fields of the queue are being updated. + * // + * // If empty, then all fields will be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appEngineHttpTarget": {}, + * // "name": "my_name", + * // "pullTarget": {}, + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "state": "my_state" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpTarget": {}, + * // "name": "my_name", + * // "pullTarget": {}, + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias cloudtasks.projects.locations.queues.patch * @memberOf! () * @@ -1735,61 +1725,58 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.queues.pause * @desc Pauses the queue. If a queue is paused then the system will stop dispatching tasks until the queue is resumed via ResumeQueue. Tasks can still be added when the queue is paused. A queue is paused if its state is PAUSED. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudTasks.projects.locations.queues.pause(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.pause({ + * // Required. The queue name. For example: + * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * name: 'projects/my-project/locations/my-location/queues/my-queue', * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpTarget": {}, + * // "name": "my_name", + * // "pullTarget": {}, + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias cloudtasks.projects.locations.queues.pause * @memberOf! () * @@ -1864,61 +1851,58 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.queues.purge * @desc Purges a queue by deleting all of its tasks. All tasks created before this method is called are permanently deleted. Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudTasks.projects.locations.queues.purge(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.purge({ + * // Required. The queue name. For example: + * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * name: 'projects/my-project/locations/my-location/queues/my-queue', * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpTarget": {}, + * // "name": "my_name", + * // "pullTarget": {}, + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias cloudtasks.projects.locations.queues.purge * @memberOf! () * @@ -1993,61 +1977,58 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.queues.resume * @desc Resume a queue. This method resumes a queue after it has been PAUSED or DISABLED. The state of a queue is stored in the queue's state; after calling this method it will be set to RUNNING. WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS queues, follow the 500/50/5 pattern described in [Managing Cloud Tasks Scaling Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudTasks.projects.locations.queues.resume(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.resume({ + * // Required. The queue name. For example: + * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * name: 'projects/my-project/locations/my-location/queues/my-queue', * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpTarget": {}, + * // "name": "my_name", + * // "pullTarget": {}, + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias cloudtasks.projects.locations.queues.resume * @memberOf! () * @@ -2122,60 +2103,56 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.queues.setIamPolicy * @desc Sets the access control policy for a Queue. Replaces any existing policy. Note: The Cloud Console does not check queue-level IAM permissions yet. Project-level permissions are required to use the Cloud Console. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission on the specified resource parent: * `cloudtasks.queues.setIamPolicy` * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudtasks.projects.locations.queues.setIamPolicy({ * // REQUIRED: The resource for which the policy is being specified. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'projects/my-project/locations/my-location/queues/my-queue', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias cloudtasks.projects.locations.queues.setIamPolicy * @memberOf! () * @@ -2250,60 +2227,54 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.queues.testIamPermissions * @desc Returns permissions that a caller has on a Queue. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudtasks.projects.locations.queues.testIamPermissions({ * // REQUIRED: The resource for which the policy detail is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'projects/my-project/locations/my-location/queues/my-queue', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias cloudtasks.projects.locations.queues.testIamPermissions * @memberOf! () * @@ -2587,58 +2558,53 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.queues.tasks.acknowledge * @desc Acknowledges a pull task. The worker, that is, the entity that leased this task must call this method to indicate that the work associated with the task has finished. The worker must acknowledge a task within the lease_duration or the lease will expire and the task will become available to be leased again. After the task is acknowledged, it will not be returned by a later LeaseTasks, GetTask, or ListTasks. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The task name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.tasks.acknowledge({ + * // Required. The task name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * name: + * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "scheduleTime": "my_scheduleTime" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * cloudTasks.projects.locations.queues.tasks.acknowledge(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias cloudtasks.projects.locations.queues.tasks.acknowledge * @memberOf! () * @@ -2713,61 +2679,62 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.queues.tasks.cancelLease * @desc Cancel a pull task's lease. The worker can use this method to cancel a task's lease by setting its schedule_time to now. This will make the task available to be leased to the next caller of LeaseTasks. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The task name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); * - * cloudTasks.projects.locations.queues.tasks.cancelLease(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.tasks.cancelLease({ + * // Required. The task name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * name: + * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "responseView": "my_responseView", + * // "scheduleTime": "my_scheduleTime" + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpRequest": {}, + * // "createTime": "my_createTime", + * // "name": "my_name", + * // "pullMessage": {}, + * // "scheduleTime": "my_scheduleTime", + * // "status": {}, + * // "view": "my_view" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias cloudtasks.projects.locations.queues.tasks.cancelLease * @memberOf! () * @@ -2842,62 +2809,63 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.queues.tasks.create * @desc Creates a task and adds it to a queue. Tasks cannot be updated after creation; there is no UpdateTask command. * For App Engine queues, the maximum task size is 100KB. * For pull queues, the maximum task size is 1MB. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudtasks.projects.locations.queues.tasks.create({ + * // Required. The queue name. For example: * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * // * // The queue must already exist. - * parent: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * parent: 'projects/my-project/locations/my-location/queues/my-queue', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "responseView": "my_responseView", + * // "task": {} + * // } * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.tasks.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpRequest": {}, + * // "createTime": "my_createTime", + * // "name": "my_name", + * // "pullMessage": {}, + * // "scheduleTime": "my_scheduleTime", + * // "status": {}, + * // "view": "my_view" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias cloudtasks.projects.locations.queues.tasks.create * @memberOf! () * @@ -2972,54 +2940,45 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.queues.tasks.delete * @desc Deletes a task. A task can be deleted if it is scheduled or dispatched. A task cannot be deleted if it has completed successfully or permanently failed. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The task name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudTasks.projects.locations.queues.tasks.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.tasks.delete({ + * // Required. The task name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * name: + * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtasks.projects.locations.queues.tasks.delete * @memberOf! () * @@ -3090,57 +3049,66 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.queues.tasks.get * @desc Gets a task. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The task name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); * - * cloudTasks.projects.locations.queues.tasks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.tasks.get({ + * // Required. The task name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * name: + * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', + * // The response_view specifies which subset of the Task will be + * // returned. + * // + * // By default response_view is BASIC; not all + * // information is retrieved by default because some data, such as + * // payloads, might be desirable to return only when needed because + * // of its large size or because of the sensitivity of data that it + * // contains. + * // + * // Authorization for FULL requires + * // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * // permission on the Task resource. + * responseView: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpRequest": {}, + * // "createTime": "my_createTime", + * // "name": "my_name", + * // "pullMessage": {}, + * // "scheduleTime": "my_scheduleTime", + * // "status": {}, + * // "view": "my_view" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias cloudtasks.projects.locations.queues.tasks.get * @memberOf! () * @@ -3211,6 +3179,58 @@ export namespace cloudtasks_v2beta2 { /** * cloudtasks.projects.locations.queues.tasks.lease * @desc Leases tasks from a pull queue for lease_duration. This method is invoked by the worker to obtain a lease. The worker must acknowledge the task via AcknowledgeTask after they have performed the work associated with the task. The payload is intended to store data that the worker needs to perform the work associated with the task. To return the payloads in the response, set response_view to FULL. A maximum of 10 qps of LeaseTasks requests are allowed per queue. RESOURCE_EXHAUSTED is returned when this limit is exceeded. RESOURCE_EXHAUSTED is also returned when max_tasks_dispatched_per_second is exceeded. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 cloudtasks.projects.locations.queues.tasks.lease({ + * // Required. The queue name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * parent: 'projects/my-project/locations/my-location/queues/my-queue', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "filter": "my_filter", + * // "leaseDuration": "my_leaseDuration", + * // "maxTasks": 0, + * // "responseView": "my_responseView" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "tasks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtasks.projects.locations.queues.tasks.lease * @memberOf! () * @@ -3287,70 +3307,79 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.queues.tasks.list * @desc Lists the tasks in a queue. By default, only the BASIC view is retrieved due to performance considerations; response_view controls the subset of information which is returned. The tasks may be returned in any order. The ordering may change at any time. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * parent: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var tasksPage = response['tasks']; - * if (!tasksPage) { - * return; - * } - * for (var i = 0; i < tasksPage.length; i++) { - * // TODO: Change code below to process each resource in `tasksPage`: - * console.log(JSON.stringify(tasksPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudTasks.projects.locations.queues.tasks.list(request, handlePage); - * } - * }; - * - * cloudTasks.projects.locations.queues.tasks.list(request, handlePage); - * }); + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); + * // 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 cloudtasks.projects.locations.queues.tasks.list({ + * // Maximum page size. + * // + * // Fewer tasks than requested might be returned, even if more tasks exist; use + * // next_page_token in the response to + * // determine if more tasks exist. + * // + * // The maximum page size is 1000. If unspecified, the page size will be the + * // maximum. + * pageSize: 'placeholder-value', + * // A token identifying the page of results to return. + * // + * // To request the first page results, page_token must be empty. To + * // request the next page of results, page_token must be the value of + * // next_page_token returned + * // from the previous call to ListTasks + * // method. + * // + * // The page token is valid for only 2 hours. + * pageToken: 'placeholder-value', + * // Required. The queue name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * parent: 'projects/my-project/locations/my-location/queues/my-queue', + * // The response_view specifies which subset of the Task will be + * // returned. + * // + * // By default response_view is BASIC; not all + * // information is retrieved by default because some data, such as + * // payloads, might be desirable to return only when needed because + * // of its large size or because of the sensitivity of data that it + * // contains. + * // + * // Authorization for FULL requires + * // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * // permission on the Task resource. + * responseView: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "tasks": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtasks.projects.locations.queues.tasks.list * @memberOf! () * @@ -3429,61 +3458,63 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.queues.tasks.renewLease * @desc Renew the current lease of a pull task. The worker can use this method to extend the lease by a new duration, starting from now. The new task lease will be returned in the task's schedule_time. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The task name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); * - * cloudTasks.projects.locations.queues.tasks.renewLease(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.tasks.renewLease({ + * // Required. The task name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * name: + * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "leaseDuration": "my_leaseDuration", + * // "responseView": "my_responseView", + * // "scheduleTime": "my_scheduleTime" + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpRequest": {}, + * // "createTime": "my_createTime", + * // "name": "my_name", + * // "pullMessage": {}, + * // "scheduleTime": "my_scheduleTime", + * // "status": {}, + * // "view": "my_view" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias cloudtasks.projects.locations.queues.tasks.renewLease * @memberOf! () * @@ -3558,61 +3589,61 @@ export namespace cloudtasks_v2beta2 { * cloudtasks.projects.locations.queues.tasks.run * @desc Forces a task to run now. When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its RateLimits or is PAUSED. This command is meant to be used for manual debugging. For example, RunTask can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now. The dispatched task is returned. That is, the task that is returned contains the status after the task is dispatched but before the task is received by its target. If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's schedule_time will be reset to the time that RunTask was called plus the retry delay specified in the queue's RetryConfig. RunTask returns NOT_FOUND when it is called on a task that has already succeeded or permanently failed. RunTask cannot be called on a pull task. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The task name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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 cloudtasks = google.cloudtasks('v2beta2'); + * + * 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/cloud-platform'], + * }); * - * cloudTasks.projects.locations.queues.tasks.run(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.tasks.run({ + * // Required. The task name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * name: + * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "responseView": "my_responseView" + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpRequest": {}, + * // "createTime": "my_createTime", + * // "name": "my_name", + * // "pullMessage": {}, + * // "scheduleTime": "my_scheduleTime", + * // "status": {}, + * // "view": "my_view" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias cloudtasks.projects.locations.queues.tasks.run * @memberOf! () * diff --git a/src/apis/cloudtasks/v2beta3.ts b/src/apis/cloudtasks/v2beta3.ts index a4bd1f2f9d7..0fa95e0b69a 100644 --- a/src/apis/cloudtasks/v2beta3.ts +++ b/src/apis/cloudtasks/v2beta3.ts @@ -618,51 +618,49 @@ export namespace cloudtasks_v2beta3 { * cloudtasks.projects.locations.get * @desc Gets information about a location. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2beta3'); + * const cloudtasks = google.cloudtasks('v2beta3'); * - * authorize(function(authClient) { - * var request = { - * // Resource name for the location. - * name: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudTasks.projects.locations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudtasks.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.get * @memberOf! () * @@ -733,64 +731,52 @@ export namespace cloudtasks_v2beta3 { * cloudtasks.projects.locations.list * @desc Lists information about the supported locations for this service. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2beta3'); + * const cloudtasks = google.cloudtasks('v2beta3'); * - * authorize(function(authClient) { - * var request = { - * // The resource that owns the locations collection, if applicable. - * name: 'projects/my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var locationsPage = response['locations']; - * if (!locationsPage) { - * return; - * } - * for (var i = 0; i < locationsPage.length; i++) { - * // TODO: Change code below to process each resource in `locationsPage`: - * console.log(JSON.stringify(locationsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudTasks.projects.locations.list(request, handlePage); - * } - * }; - * - * cloudTasks.projects.locations.list(request, handlePage); - * }); + * 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/cloud-platform'], + * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 cloudtasks.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtasks.projects.locations.list * @memberOf! () * @@ -917,60 +903,70 @@ export namespace cloudtasks_v2beta3 { * cloudtasks.projects.locations.queues.create * @desc Creates a queue. Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2beta3'); + * const cloudtasks = google.cloudtasks('v2beta3'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The location name in which the queue will be created. + * 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/cloud-platform'], + * }); + * + * // 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 cloudtasks.projects.locations.queues.create({ + * // Required. The location name in which the queue will be created. * // For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * // * // The list of allowed locations can be obtained by calling Cloud * // Tasks' implementation of * // ListLocations. - * parent: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appEngineHttpQueue": {}, + * // "name": "my_name", + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "stackdriverLoggingConfig": {}, + * // "state": "my_state" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpQueue": {}, + * // "name": "my_name", + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "stackdriverLoggingConfig": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.create * @memberOf! () * @@ -1045,50 +1041,44 @@ export namespace cloudtasks_v2beta3 { * cloudtasks.projects.locations.queues.delete * @desc Deletes a queue. This command will delete the queue even if it has tasks in it. Note: If you delete a queue, a queue with the same name can't be created for 7 days. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2beta3'); + * const cloudtasks = google.cloudtasks('v2beta3'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudTasks.projects.locations.queues.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.delete({ + * // Required. The queue name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * name: 'projects/my-project/locations/my-location/queues/my-queue', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtasks.projects.locations.queues.delete * @memberOf! () * @@ -1159,53 +1149,52 @@ export namespace cloudtasks_v2beta3 { * cloudtasks.projects.locations.queues.get * @desc Gets a queue. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2beta3'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The resource name of the queue. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. + * const cloudtasks = google.cloudtasks('v2beta3'); * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudTasks.projects.locations.queues.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.get({ + * // Required. The resource name of the queue. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * name: 'projects/my-project/locations/my-location/queues/my-queue', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpQueue": {}, + * // "name": "my_name", + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "stackdriverLoggingConfig": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.get * @memberOf! () * @@ -1276,56 +1265,56 @@ export namespace cloudtasks_v2beta3 { * cloudtasks.projects.locations.queues.getIamPolicy * @desc Gets the access control policy for a Queue. Returns an empty policy if the resource exists and does not have a policy set. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission on the specified resource parent: * `cloudtasks.queues.getIamPolicy` * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2beta3'); + * const cloudtasks = google.cloudtasks('v2beta3'); + * + * 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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 cloudtasks.projects.locations.queues.getIamPolicy({ * // REQUIRED: The resource for which the policy is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'projects/my-project/locations/my-location/queues/my-queue', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.getIamPolicy * @memberOf! () * @@ -1400,66 +1389,76 @@ export namespace cloudtasks_v2beta3 { * cloudtasks.projects.locations.queues.list * @desc Lists queues. Queues are returned in lexicographical order. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2beta3'); + * const cloudtasks = google.cloudtasks('v2beta3'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The location name. - * // For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * parent: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var queuesPage = response['queues']; - * if (!queuesPage) { - * return; - * } - * for (var i = 0; i < queuesPage.length; i++) { - * // TODO: Change code below to process each resource in `queuesPage`: - * console.log(JSON.stringify(queuesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudTasks.projects.locations.queues.list(request, handlePage); - * } - * }; - * - * cloudTasks.projects.locations.queues.list(request, handlePage); - * }); + * 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/cloud-platform'], + * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 cloudtasks.projects.locations.queues.list({ + * // `filter` can be used to specify a subset of queues. Any Queue + * // field can be used as a filter and several operators as supported. + * // For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as + * // described in + * // [Stackdriver's Advanced Logs + * // Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * // + * // Sample filter "state: PAUSED". + * // + * // Note that using filters might cause fewer queues than the + * // requested page_size to be returned. + * filter: 'placeholder-value', + * // Requested page size. + * // + * // The maximum page size is 9800. If unspecified, the page size will + * // be the maximum. Fewer queues than requested might be returned, + * // even if more queues exist; use the + * // next_page_token in the + * // response to determine if more queues exist. + * pageSize: 'placeholder-value', + * // A token identifying the page of results to return. + * // + * // To request the first page results, page_token must be empty. To + * // request the next page of results, page_token must be the value of + * // next_page_token returned + * // from the previous call to ListQueues + * // method. It is an error to switch the value of the + * // filter while iterating through pages. + * pageToken: 'placeholder-value', + * // Required. The location name. + * // For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * parent: 'projects/my-project/locations/my-location', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "queues": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtasks.projects.locations.queues.list * @memberOf! () * @@ -1538,72 +1537,87 @@ export namespace cloudtasks_v2beta3 { * cloudtasks.projects.locations.queues.patch * @desc Updates a queue. This method creates the queue if it does not exist and updates the queue if it does exist. Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2beta3'); + * const cloudtasks = google.cloudtasks('v2beta3'); + * + * 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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 cloudtasks.projects.locations.queues.patch({ * // Caller-specified and required in CreateQueue, * // after which it becomes output only. + * // * // The queue name. + * // * // The queue name must have the following format: * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * // * // * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - * // hyphens (-), colons (:), or periods (.). - * // For more information, see - * // [Identifying - * // projects] - * // (https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + * // hyphens (-), colons (:), or periods (.). + * // For more information, see + * // [Identifying + * // projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) * // * `LOCATION_ID` is the canonical ID for the queue's location. - * // The list of available locations can be obtained by calling - * // ListLocations. - * // For more information, see https://cloud.google.com/about/locations/. + * // The list of available locations can be obtained by calling + * // ListLocations. + * // For more information, see https://cloud.google.com/about/locations/. * // * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - * // hyphens (-). The maximum length is 100 characters. - * name: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * // hyphens (-). The maximum length is 100 characters. + * name: 'projects/my-project/locations/my-location/queues/my-queue', + * // A mask used to specify which fields of the queue are being updated. + * // + * // If empty, then all fields will be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appEngineHttpQueue": {}, + * // "name": "my_name", + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "stackdriverLoggingConfig": {}, + * // "state": "my_state" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpQueue": {}, + * // "name": "my_name", + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "stackdriverLoggingConfig": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.patch * @memberOf! () * @@ -1676,57 +1690,58 @@ export namespace cloudtasks_v2beta3 { * cloudtasks.projects.locations.queues.pause * @desc Pauses the queue. If a queue is paused then the system will stop dispatching tasks until the queue is resumed via ResumeQueue. Tasks can still be added when the queue is paused. A queue is paused if its state is PAUSED. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2beta3'); + * const cloudtasks = google.cloudtasks('v2beta3'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudTasks.projects.locations.queues.pause(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.pause({ + * // Required. The queue name. For example: + * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * name: 'projects/my-project/locations/my-location/queues/my-queue', * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpQueue": {}, + * // "name": "my_name", + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "stackdriverLoggingConfig": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.pause * @memberOf! () * @@ -1801,57 +1816,58 @@ export namespace cloudtasks_v2beta3 { * cloudtasks.projects.locations.queues.purge * @desc Purges a queue by deleting all of its tasks. All tasks created before this method is called are permanently deleted. Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2beta3'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. + * const cloudtasks = google.cloudtasks('v2beta3'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudTasks.projects.locations.queues.purge(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.purge({ + * // Required. The queue name. For example: + * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * name: 'projects/my-project/locations/my-location/queues/my-queue', * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpQueue": {}, + * // "name": "my_name", + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "stackdriverLoggingConfig": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.purge * @memberOf! () * @@ -1926,57 +1942,58 @@ export namespace cloudtasks_v2beta3 { * cloudtasks.projects.locations.queues.resume * @desc Resume a queue. This method resumes a queue after it has been PAUSED or DISABLED. The state of a queue is stored in the queue's state; after calling this method it will be set to RUNNING. WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS queues, follow the 500/50/5 pattern described in [Managing Cloud Tasks Scaling Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2beta3'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. + * const cloudtasks = google.cloudtasks('v2beta3'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudTasks.projects.locations.queues.resume(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.resume({ + * // Required. The queue name. For example: + * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * name: 'projects/my-project/locations/my-location/queues/my-queue', * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpQueue": {}, + * // "name": "my_name", + * // "purgeTime": "my_purgeTime", + * // "rateLimits": {}, + * // "retryConfig": {}, + * // "stackdriverLoggingConfig": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.resume * @memberOf! () * @@ -2051,56 +2068,56 @@ export namespace cloudtasks_v2beta3 { * cloudtasks.projects.locations.queues.setIamPolicy * @desc Sets the access control policy for a Queue. Replaces any existing policy. Note: The Cloud Console does not check queue-level IAM permissions yet. Project-level permissions are required to use the Cloud Console. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission on the specified resource parent: * `cloudtasks.queues.setIamPolicy` * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2beta3'); + * const cloudtasks = google.cloudtasks('v2beta3'); + * + * 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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.setIamPolicy({ * // REQUIRED: The resource for which the policy is being specified. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'projects/my-project/locations/my-location/queues/my-queue', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.setIamPolicy * @memberOf! () * @@ -2175,56 +2192,54 @@ export namespace cloudtasks_v2beta3 { * cloudtasks.projects.locations.queues.testIamPermissions * @desc Returns permissions that a caller has on a Queue. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2beta3'); + * const cloudtasks = google.cloudtasks('v2beta3'); + * + * 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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.testIamPermissions({ * // REQUIRED: The resource for which the policy detail is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'projects/my-project/locations/my-location/queues/my-queue', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.testIamPermissions * @memberOf! () * @@ -2504,58 +2519,67 @@ export namespace cloudtasks_v2beta3 { * cloudtasks.projects.locations.queues.tasks.create * @desc Creates a task and adds it to a queue. Tasks cannot be updated after creation; there is no UpdateTask command. * The maximum task size is 100KB. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2beta3'); + * const cloudtasks = google.cloudtasks('v2beta3'); + * + * 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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.tasks.create({ + * // Required. The queue name. For example: * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * // * // The queue must already exist. - * parent: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * parent: 'projects/my-project/locations/my-location/queues/my-queue', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "responseView": "my_responseView", + * // "task": {} + * // } * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.tasks.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpRequest": {}, + * // "createTime": "my_createTime", + * // "dispatchCount": 0, + * // "dispatchDeadline": "my_dispatchDeadline", + * // "firstAttempt": {}, + * // "httpRequest": {}, + * // "lastAttempt": {}, + * // "name": "my_name", + * // "responseCount": 0, + * // "scheduleTime": "my_scheduleTime", + * // "view": "my_view" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.tasks.create * @memberOf! () * @@ -2630,50 +2654,45 @@ export namespace cloudtasks_v2beta3 { * cloudtasks.projects.locations.queues.tasks.delete * @desc Deletes a task. A task can be deleted if it is scheduled or dispatched. A task cannot be deleted if it has executed successfully or permanently failed. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2beta3'); + * const cloudtasks = google.cloudtasks('v2beta3'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The task name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudTasks.projects.locations.queues.tasks.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.tasks.delete({ + * // Required. The task name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * name: + * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtasks.projects.locations.queues.tasks.delete * @memberOf! () * @@ -2744,53 +2763,70 @@ export namespace cloudtasks_v2beta3 { * cloudtasks.projects.locations.queues.tasks.get * @desc Gets a task. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2beta3'); + * const cloudtasks = google.cloudtasks('v2beta3'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The task name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudTasks.projects.locations.queues.tasks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.tasks.get({ + * // Required. The task name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * name: + * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', + * // The response_view specifies which subset of the Task will be + * // returned. + * // + * // By default response_view is BASIC; not all + * // information is retrieved by default because some data, such as + * // payloads, might be desirable to return only when needed because + * // of its large size or because of the sensitivity of data that it + * // contains. + * // + * // Authorization for FULL requires + * // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * // permission on the Task resource. + * responseView: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpRequest": {}, + * // "createTime": "my_createTime", + * // "dispatchCount": 0, + * // "dispatchDeadline": "my_dispatchDeadline", + * // "firstAttempt": {}, + * // "httpRequest": {}, + * // "lastAttempt": {}, + * // "name": "my_name", + * // "responseCount": 0, + * // "scheduleTime": "my_scheduleTime", + * // "view": "my_view" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.tasks.get * @memberOf! () * @@ -2862,66 +2898,79 @@ export namespace cloudtasks_v2beta3 { * cloudtasks.projects.locations.queues.tasks.list * @desc Lists the tasks in a queue. By default, only the BASIC view is retrieved due to performance considerations; response_view controls the subset of information which is returned. The tasks may be returned in any order. The ordering may change at any time. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2beta3'); + * const cloudtasks = google.cloudtasks('v2beta3'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * parent: 'projects/my-project/locations/my-location/queues/my-queue', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var tasksPage = response['tasks']; - * if (!tasksPage) { - * return; - * } - * for (var i = 0; i < tasksPage.length; i++) { - * // TODO: Change code below to process each resource in `tasksPage`: - * console.log(JSON.stringify(tasksPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudTasks.projects.locations.queues.tasks.list(request, handlePage); - * } - * }; - * - * cloudTasks.projects.locations.queues.tasks.list(request, handlePage); - * }); + * 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/cloud-platform'], + * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 cloudtasks.projects.locations.queues.tasks.list({ + * // Maximum page size. + * // + * // Fewer tasks than requested might be returned, even if more tasks exist; use + * // next_page_token in the response to + * // determine if more tasks exist. + * // + * // The maximum page size is 1000. If unspecified, the page size will be the + * // maximum. + * pageSize: 'placeholder-value', + * // A token identifying the page of results to return. + * // + * // To request the first page results, page_token must be empty. To + * // request the next page of results, page_token must be the value of + * // next_page_token returned + * // from the previous call to ListTasks + * // method. + * // + * // The page token is valid for only 2 hours. + * pageToken: 'placeholder-value', + * // Required. The queue name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * parent: 'projects/my-project/locations/my-location/queues/my-queue', + * // The response_view specifies which subset of the Task will be + * // returned. + * // + * // By default response_view is BASIC; not all + * // information is retrieved by default because some data, such as + * // payloads, might be desirable to return only when needed because + * // of its large size or because of the sensitivity of data that it + * // contains. + * // + * // Authorization for FULL requires + * // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * // permission on the Task resource. + * responseView: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "tasks": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtasks.projects.locations.queues.tasks.list * @memberOf! () * @@ -3000,57 +3049,65 @@ export namespace cloudtasks_v2beta3 { * cloudtasks.projects.locations.queues.tasks.run * @desc Forces a task to run now. When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its RateLimits or is PAUSED. This command is meant to be used for manual debugging. For example, RunTask can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now. The dispatched task is returned. That is, the task that is returned contains the status after the task is dispatched but before the task is received by its target. If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's schedule_time will be reset to the time that RunTask was called plus the retry delay specified in the queue's RetryConfig. RunTask returns NOT_FOUND when it is called on a task that has already succeeded or permanently failed. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtasks.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'); - * var cloudTasks = google.cloudtasks('v2beta3'); + * const cloudtasks = google.cloudtasks('v2beta3'); * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The task name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudTasks.projects.locations.queues.tasks.run(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await cloudtasks.projects.locations.queues.tasks.run({ + * // Required. The task name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * name: + * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "responseView": "my_responseView" + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngineHttpRequest": {}, + * // "createTime": "my_createTime", + * // "dispatchCount": 0, + * // "dispatchDeadline": "my_dispatchDeadline", + * // "firstAttempt": {}, + * // "httpRequest": {}, + * // "lastAttempt": {}, + * // "name": "my_name", + * // "responseCount": 0, + * // "scheduleTime": "my_scheduleTime", + * // "view": "my_view" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtasks.projects.locations.queues.tasks.run * @memberOf! () * diff --git a/src/apis/cloudtrace/v1.ts b/src/apis/cloudtrace/v1.ts index 7c9862efcb1..ec384a6e945 100644 --- a/src/apis/cloudtrace/v1.ts +++ b/src/apis/cloudtrace/v1.ts @@ -202,53 +202,54 @@ export namespace cloudtrace_v1 { * cloudtrace.projects.patchTraces * @desc Sends new traces to Stackdriver Trace or updates existing traces. If the ID of a trace that you send matches that of an existing trace, any fields in the existing trace and its spans are overwritten by the provided values, and any new fields provided are merged with the existing trace data. If the ID does not match, a new trace is created. In this case, writing traces is not considered an active developer method since traces are machine generated. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Trace API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtrace - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtrace.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'); - * var cloudTrace = google.cloudtrace('v1'); + * const cloudtrace = google.cloudtrace('v1'); * - * authorize(function(authClient) { - * var request = { - * // ID of the Cloud project where the trace data is stored. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/trace.append', + * ], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. - * }, + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * auth: authClient, - * }; + * // Do the magic + * const res = await cloudtrace.projects.patchTraces({ + * // Required. ID of the Cloud project where the trace data is stored. + * projectId: 'placeholder-value', * - * cloudTrace.projects.patchTraces(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "traces": [] + * // } + * }, * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtrace.projects.patchTraces * @memberOf! () * @@ -348,54 +349,52 @@ export namespace cloudtrace_v1 { * cloudtrace.projects.traces.get * @desc Gets a single trace by its ID. In this case, getting for traces is considered an active developer method, even though it is technically a read-only method. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Trace API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtrace - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtrace.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'); - * var cloudTrace = google.cloudtrace('v1'); + * const cloudtrace = google.cloudtrace('v1'); * - * authorize(function(authClient) { - * var request = { - * // ID of the Cloud project where the trace data is stored. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/trace.readonly', + * ], + * }); * - * // ID of the trace to return. - * traceId: 'my-trace-id', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * auth: authClient, - * }; + * // Do the magic + * const res = await cloudtrace.projects.traces.get({ + * // Required. ID of the Cloud project where the trace data is stored. + * projectId: 'placeholder-value', + * // Required. ID of the trace to return. + * traceId: 'placeholder-value', + * }); + * console.log(res.data); * - * cloudTrace.projects.traces.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "projectId": "my_projectId", + * // "spans": [], + * // "traceId": "my_traceId" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtrace.projects.traces.get * @memberOf! () * @@ -469,64 +468,110 @@ export namespace cloudtrace_v1 { * cloudtrace.projects.traces.list * @desc Returns of a list of traces that match the specified filter conditions. In this case, listing for traces is considered an active developer method, even though it is technically a read-only method. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Trace API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtrace - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtrace.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'); - * var cloudTrace = google.cloudtrace('v1'); - * - * authorize(function(authClient) { - * var request = { - * // ID of the Cloud project where the trace data is stored. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * const cloudtrace = google.cloudtrace('v1'); * - * auth: authClient, - * }; + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/trace.readonly', + * ], + * }); * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * var tracesPage = response['traces']; - * if (!tracesPage) { - * return; - * } - * for (var i = 0; i < tracesPage.length; i++) { - * // TODO: Change code below to process each resource in `tracesPage`: - * console.log(JSON.stringify(tracesPage[i], null, 2)); - * } + * // Do the magic + * const res = await cloudtrace.projects.traces.list({ + * // End of the time interval (inclusive) during which the trace data was + * // collected from the application. + * endTime: 'placeholder-value', + * // Optional. A filter against labels for the request. + * // + * // By default, searches use prefix matching. To specify exact match, prepend + * // a plus symbol (`+`) to the search term. + * // Multiple terms are ANDed. Syntax: + * // + * // * `root:NAME_PREFIX` or `NAME_PREFIX`: Return traces where any root + * // span starts with `NAME_PREFIX`. + * // * `+root:NAME` or `+NAME`: Return traces where any root span's name is + * // exactly `NAME`. + * // * `span:NAME_PREFIX`: Return traces where any span starts with + * // `NAME_PREFIX`. + * // * `+span:NAME`: Return traces where any span's name is exactly + * // `NAME`. + * // * `latency:DURATION`: Return traces whose overall latency is + * // greater or equal to than `DURATION`. Accepted units are nanoseconds + * // (`ns`), milliseconds (`ms`), and seconds (`s`). Default is `ms`. For + * // example, `latency:24ms` returns traces whose overall latency + * // is greater than or equal to 24 milliseconds. + * // * `label:LABEL_KEY`: Return all traces containing the specified + * // label key (exact match, case-sensitive) regardless of the key:value + * // pair's value (including empty values). + * // * `LABEL_KEY:VALUE_PREFIX`: Return all traces containing the specified + * // label key (exact match, case-sensitive) whose value starts with + * // `VALUE_PREFIX`. Both a key and a value must be specified. + * // * `+LABEL_KEY:VALUE`: Return all traces containing a key:value pair + * // exactly matching the specified text. Both a key and a value must be + * // specified. + * // * `method:VALUE`: Equivalent to `/http/method:VALUE`. + * // * `url:VALUE`: Equivalent to `/http/url:VALUE`. + * filter: 'placeholder-value', + * // Optional. Field used to sort the returned traces. + * // Can be one of the following: + * // + * // * `trace_id` + * // * `name` (`name` field of root span in the trace) + * // * `duration` (difference between `end_time` and `start_time` fields of + * // the root span) + * // * `start` (`start_time` field of the root span) + * // + * // Descending order can be specified by appending `desc` to the sort field + * // (for example, `name desc`). + * // + * // Only one sort field is permitted. + * orderBy: 'placeholder-value', + * // Optional. Maximum number of traces to return. If not specified or <= 0, the + * // implementation selects a reasonable value. The implementation may + * // return fewer traces than the requested page size. + * pageSize: 'placeholder-value', + * // Token identifying the page of results to return. If provided, use the + * // value of the `next_page_token` field from a previous request. + * pageToken: 'placeholder-value', + * // Required. ID of the Cloud project where the trace data is stored. + * projectId: 'placeholder-value', + * // Start of the time interval (inclusive) during which the trace data was + * // collected from the application. + * startTime: 'placeholder-value', + * // Optional. Type of data returned for traces in the list. Default is + * // `MINIMAL`. + * view: 'placeholder-value', + * }); + * console.log(res.data); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudTrace.projects.traces.list(request, handlePage); - * } - * }; + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "traces": [] + * // } + * } * - * cloudTrace.projects.traces.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias cloudtrace.projects.traces.list * @memberOf! () * diff --git a/src/apis/cloudtrace/v2.ts b/src/apis/cloudtrace/v2.ts index 690faf9a070..ecb834daa20 100644 --- a/src/apis/cloudtrace/v2.ts +++ b/src/apis/cloudtrace/v2.ts @@ -442,6 +442,56 @@ export namespace cloudtrace_v2 { /** * cloudtrace.projects.traces.batchWrite * @desc Sends new spans to new or existing traces. You cannot update existing spans. In this case, writing traces is not considered an active developer method since traces are machine generated. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtrace.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 cloudtrace = google.cloudtrace('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/trace.append', + * ], + * }); + * + * // 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 cloudtrace.projects.traces.batchWrite({ + * // Required. The name of the project where the spans belong. The format is + * // `projects/[PROJECT_ID]`. + * name: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "spans": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtrace.projects.traces.batchWrite * @memberOf! () * @@ -540,6 +590,89 @@ export namespace cloudtrace_v2 { /** * cloudtrace.projects.traces.spans.createSpan * @desc Creates a new span. In this case, writing traces is not considered an active developer method since traces are machine generated. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtrace.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 cloudtrace = google.cloudtrace('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/trace.append', + * ], + * }); + * + * // 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 cloudtrace.projects.traces.spans.createSpan({ + * // The resource name of the span in the following format: + * // + * // projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project; + * // it is a 32-character hexadecimal encoding of a 16-byte array. + * // + * // [SPAN_ID] is a unique identifier for a span within a trace; it + * // is a 16-character hexadecimal encoding of an 8-byte array. + * name: 'projects/my-project/traces/my-trace/spans/my-span', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "attributes": {}, + * // "childSpanCount": 0, + * // "displayName": {}, + * // "endTime": "my_endTime", + * // "links": {}, + * // "name": "my_name", + * // "parentSpanId": "my_parentSpanId", + * // "sameProcessAsParentSpan": false, + * // "spanId": "my_spanId", + * // "spanKind": "my_spanKind", + * // "stackTrace": {}, + * // "startTime": "my_startTime", + * // "status": {}, + * // "timeEvents": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attributes": {}, + * // "childSpanCount": 0, + * // "displayName": {}, + * // "endTime": "my_endTime", + * // "links": {}, + * // "name": "my_name", + * // "parentSpanId": "my_parentSpanId", + * // "sameProcessAsParentSpan": false, + * // "spanId": "my_spanId", + * // "spanKind": "my_spanKind", + * // "stackTrace": {}, + * // "startTime": "my_startTime", + * // "status": {}, + * // "timeEvents": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtrace.projects.traces.spans.createSpan * @memberOf! () * diff --git a/src/apis/cloudtrace/v2beta1.ts b/src/apis/cloudtrace/v2beta1.ts index 33d1dfa0595..fd496ed518c 100644 --- a/src/apis/cloudtrace/v2beta1.ts +++ b/src/apis/cloudtrace/v2beta1.ts @@ -175,6 +175,66 @@ export namespace cloudtrace_v2beta1 { /** * cloudtrace.projects.traceSinks.create * @desc Creates a sink that exports trace spans to a destination. The export of newly-ingested traces begins immediately, unless the sink's `writer_identity` is not permitted to write to the destination. A sink can export traces only from the resource owning the sink (the 'parent'). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtrace.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 cloudtrace = google.cloudtrace('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/trace.append', + * ], + * }); + * + * // 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 cloudtrace.projects.traceSinks.create({ + * // Required. The resource in which to create the sink (currently only project + * // sinks are supported): + * // + * // "projects/[PROJECT_ID]" + * // + * // Examples: `"projects/my-trace-project"`, `"projects/123456789"`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name", + * // "outputConfig": {}, + * // "writerIdentity": "my_writerIdentity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "outputConfig": {}, + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtrace.projects.traceSinks.create * @memberOf! () * @@ -250,6 +310,52 @@ export namespace cloudtrace_v2beta1 { /** * cloudtrace.projects.traceSinks.delete * @desc Deletes a sink. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtrace.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 cloudtrace = google.cloudtrace('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/trace.append', + * ], + * }); + * + * // 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 cloudtrace.projects.traceSinks.delete({ + * // Required. The full resource name of the sink to delete, including the + * // parent resource and the sink identifier: + * // + * // "projects/[PROJECT_NUMBER]/traceSinks/[SINK_ID]" + * // + * // Example: `"projects/12345/traceSinks/my-sink-id"`. + * name: 'projects/my-project/traceSinks/my-traceSink', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtrace.projects.traceSinks.delete * @memberOf! () * @@ -319,6 +425,55 @@ export namespace cloudtrace_v2beta1 { /** * cloudtrace.projects.traceSinks.get * @desc Get a trace sink by name under the parent resource (GCP project). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtrace.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 cloudtrace = google.cloudtrace('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/trace.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 cloudtrace.projects.traceSinks.get({ + * // Required. The resource name of the sink: + * // + * // "projects/[PROJECT_NUMBER]/traceSinks/[SINK_ID]" + * // + * // Example: `"projects/12345/traceSinks/my-sink-id"`. + * name: 'projects/my-project/traceSinks/my-traceSink', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "outputConfig": {}, + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtrace.projects.traceSinks.get * @memberOf! () * @@ -390,6 +545,62 @@ export namespace cloudtrace_v2beta1 { /** * cloudtrace.projects.traceSinks.list * @desc List all sinks for the parent resource (GCP project). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtrace.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 cloudtrace = google.cloudtrace('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/trace.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 cloudtrace.projects.traceSinks.list({ + * // Optional. The maximum number of results to return from this request. + * // Non-positive values are ignored. The presence of `nextPageToken` in the + * // response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the + * // preceding call to this method. `pageToken` must be the value of + * // `nextPageToken` from the previous response. The values of other method + * // parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The parent resource whose sinks are to be listed (currently only + * // project parent resources are supported): + * // + * // "projects/[PROJECT_ID]" + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "sinks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtrace.projects.traceSinks.list * @memberOf! () * @@ -468,6 +679,77 @@ export namespace cloudtrace_v2beta1 { /** * cloudtrace.projects.traceSinks.patch * @desc Updates a sink. This method updates fields in the existing sink according to the provided update mask. The sink's name cannot be changed nor any output-only fields (e.g. the writer_identity). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/cloudtrace.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 cloudtrace = google.cloudtrace('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/trace.append', + * ], + * }); + * + * // 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 cloudtrace.projects.traceSinks.patch({ + * // Required. The full resource name of the sink to update, including the + * // parent resource and the sink identifier: + * // + * // "projects/[PROJECT_NUMBER]/traceSinks/[SINK_ID]" + * // + * // Example: `"projects/12345/traceSinks/my-sink-id"`. + * name: 'projects/my-project/traceSinks/my-traceSink', + * // Required. Field mask that specifies the fields in `trace_sink` that are to + * // be updated. A sink field is overwritten if, and only if, it is + * // in the update mask. `name` and `writer_identity` fields cannot be updated. + * // + * // An empty updateMask is considered an error. + * // + * // For a detailed `FieldMask` definition, see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * // + * // Example: `updateMask=output_config`. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name", + * // "outputConfig": {}, + * // "writerIdentity": "my_writerIdentity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "outputConfig": {}, + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias cloudtrace.projects.traceSinks.patch * @memberOf! () * diff --git a/src/apis/commentanalyzer/v1alpha1.ts b/src/apis/commentanalyzer/v1alpha1.ts index 699dfc52673..03728656ca9 100644 --- a/src/apis/commentanalyzer/v1alpha1.ts +++ b/src/apis/commentanalyzer/v1alpha1.ts @@ -327,6 +327,62 @@ export namespace commentanalyzer_v1alpha1 { /** * commentanalyzer.comments.analyze * @desc Analyzes the provided text and returns scores for requested attributes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/commentanalyzer.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 commentanalyzer = google.commentanalyzer('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 commentanalyzer.comments.analyze({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clientToken": "my_clientToken", + * // "comment": {}, + * // "communityId": "my_communityId", + * // "context": {}, + * // "doNotStore": false, + * // "languages": [], + * // "requestedAttributes": {}, + * // "sessionId": "my_sessionId", + * // "spanAnnotations": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attributeScores": {}, + * // "clientToken": "my_clientToken", + * // "detectedLanguages": [], + * // "languages": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias commentanalyzer.comments.analyze * @memberOf! () * @@ -405,6 +461,59 @@ export namespace commentanalyzer_v1alpha1 { /** * commentanalyzer.comments.suggestscore * @desc Suggest comment scores as training data. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/commentanalyzer.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 commentanalyzer = google.commentanalyzer('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 commentanalyzer.comments.suggestscore({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "attributeScores": {}, + * // "clientToken": "my_clientToken", + * // "comment": {}, + * // "communityId": "my_communityId", + * // "context": {}, + * // "languages": [], + * // "sessionId": "my_sessionId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientToken": "my_clientToken", + * // "detectedLanguages": [], + * // "requestedLanguages": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias commentanalyzer.comments.suggestscore * @memberOf! () * diff --git a/src/apis/composer/v1.ts b/src/apis/composer/v1.ts index 2ebc5323c1e..16609936afa 100644 --- a/src/apis/composer/v1.ts +++ b/src/apis/composer/v1.ts @@ -481,6 +481,65 @@ export namespace composer_v1 { /** * composer.projects.locations.environments.create * @desc Create a new environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/composer.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 composer = google.composer('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/cloud-platform'], + * }); + * + * // 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 composer.projects.locations.environments.create({ + * // The parent must be of the form + * // "projects/{projectId}/locations/{locationId}". + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "uuid": "my_uuid" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias composer.projects.locations.environments.create * @memberOf! () * @@ -556,6 +615,52 @@ export namespace composer_v1 { /** * composer.projects.locations.environments.delete * @desc Delete an environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/composer.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 composer = google.composer('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/cloud-platform'], + * }); + * + * // 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 composer.projects.locations.environments.delete({ + * // The environment to delete, in the form: + * // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * name: + * 'projects/my-project/locations/my-location/environments/my-environment', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias composer.projects.locations.environments.delete * @memberOf! () * @@ -627,6 +732,54 @@ export namespace composer_v1 { /** * composer.projects.locations.environments.get * @desc Get an existing environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/composer.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 composer = google.composer('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/cloud-platform'], + * }); + * + * // 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 composer.projects.locations.environments.get({ + * // The resource name of the environment to get, in the form: + * // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * name: + * 'projects/my-project/locations/my-location/environments/my-environment', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "config": {}, + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "uuid": "my_uuid" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias composer.projects.locations.environments.get * @memberOf! () * @@ -698,6 +851,52 @@ export namespace composer_v1 { /** * composer.projects.locations.environments.list * @desc List environments. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/composer.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 composer = google.composer('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/cloud-platform'], + * }); + * + * // 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 composer.projects.locations.environments.list({ + * // The maximum number of environments to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // List environments in the given project and location, in the form: + * // "projects/{projectId}/locations/{locationId}" + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "environments": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias composer.projects.locations.environments.list * @memberOf! () * @@ -776,6 +975,200 @@ export namespace composer_v1 { /** * composer.projects.locations.environments.patch * @desc Update an environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/composer.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 composer = google.composer('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/cloud-platform'], + * }); + * + * // 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 composer.projects.locations.environments.patch({ + * // The relative resource name of the environment to update, in the form: + * // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * name: + * 'projects/my-project/locations/my-location/environments/my-environment', + * // Required. A comma-separated list of paths, relative to `Environment`, of + * // fields to update. + * // For example, to set the version of scikit-learn to install in the + * // environment to 0.19.0 and to remove an existing installation of + * // numpy, the `updateMask` parameter would include the following two + * // `paths` values: "config.softwareConfig.pypiPackages.scikit-learn" and + * // "config.softwareConfig.pypiPackages.numpy". The included patch + * // environment would specify the scikit-learn version as follows: + * // + * // { + * // "config":{ + * // "softwareConfig":{ + * // "pypiPackages":{ + * // "scikit-learn":"==0.19.0" + * // } + * // } + * // } + * // } + * // + * // Note that in the above example, any existing PyPI packages + * // other than scikit-learn and numpy will be unaffected. + * // + * // Only one update type may be included in a single request's `updateMask`. + * // For example, one cannot update both the PyPI packages and + * // labels in the same request. However, it is possible to update multiple + * // members of a map field simultaneously in the same request. For example, + * // to set the labels "label1" and "label2" while clearing "label3" (assuming + * // it already exists), one can + * // provide the paths "labels.label1", "labels.label2", and "labels.label3" + * // and populate the patch environment as follows: + * // + * // { + * // "labels":{ + * // "label1":"new-label1-value" + * // "label2":"new-label2-value" + * // } + * // } + * // + * // Note that in the above example, any existing labels that are not + * // included in the `updateMask` will be unaffected. + * // + * // It is also possible to replace an entire map field by providing the + * // map field's path in the `updateMask`. The new value of the field will + * // be that which is provided in the patch environment. For example, to + * // delete all pre-existing user-specified PyPI packages and + * // install botocore at version 1.7.14, the `updateMask` would contain + * // the path "config.softwareConfig.pypiPackages", and + * // the patch environment would be the following: + * // + * // { + * // "config":{ + * // "softwareConfig":{ + * // "pypiPackages":{ + * // "botocore":"==1.7.14" + * // } + * // } + * // } + * // } + * // + * // **Note:** Only the following fields can be updated: + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * //
                          MaskPurpose
                          config.softwareConfig.pypiPackages + * // Replace all custom custom PyPI packages. If a replacement + * // package map is not included in `environment`, all custom + * // PyPI packages are cleared. It is an error to provide both this mask and a + * // mask specifying an individual package.
                          config.softwareConfig.pypiPackages.packagenameUpdate the custom PyPI package packagename, + * // preserving other packages. To delete the package, include it in + * // `updateMask`, and omit the mapping for it in + * // `environment.config.softwareConfig.pypiPackages`. It is an error + * // to provide both a mask of this form and the + * // "config.softwareConfig.pypiPackages" mask.
                          labelsReplace all environment labels. If a replacement labels map is not + * // included in `environment`, all labels are cleared. It is an error to + * // provide both this mask and a mask specifying one or more individual + * // labels.
                          labels.labelNameSet the label named labelName, while preserving other + * // labels. To delete the label, include it in `updateMask` and omit its + * // mapping in `environment.labels`. It is an error to provide both a + * // mask of this form and the "labels" mask.
                          config.nodeCountHorizontally scale the number of nodes in the environment. An integer + * // greater than or equal to 3 must be provided in the `config.nodeCount` + * // field. + * //
                          config.softwareConfig.airflowConfigOverridesReplace all Apache Airflow config overrides. If a replacement config + * // overrides map is not included in `environment`, all config overrides + * // are cleared. + * // It is an error to provide both this mask and a mask specifying one or + * // more individual config overrides.
                          config.softwareConfig.airflowConfigOverrides.section-name + * // Override the Apache Airflow config property name in the + * // section named section, preserving other properties. To delete + * // the property override, include it in `updateMask` and omit its mapping + * // in `environment.config.softwareConfig.airflowConfigOverrides`. + * // It is an error to provide both a mask of this form and the + * // "config.softwareConfig.airflowConfigOverrides" mask.
                          config.softwareConfig.envVariablesReplace all environment variables. If a replacement environment + * // variable map is not included in `environment`, all custom environment + * // variables are cleared. + * // It is an error to provide both this mask and a mask specifying one or + * // more individual environment variables.
                          + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "uuid": "my_uuid" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias composer.projects.locations.environments.patch * @memberOf! () * @@ -939,6 +1332,52 @@ export namespace composer_v1 { /** * composer.projects.locations.imageVersions.list * @desc List ImageVersions for provided location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/composer.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 composer = google.composer('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/cloud-platform'], + * }); + * + * // 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 composer.projects.locations.imageVersions.list({ + * // The maximum number of image_versions to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // List ImageVersions in the given project and location, in the form: + * // "projects/{projectId}/locations/{locationId}" + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "imageVersions": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias composer.projects.locations.imageVersions.list * @memberOf! () * @@ -1050,6 +1489,44 @@ export namespace composer_v1 { /** * composer.projects.locations.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/composer.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 composer = google.composer('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/cloud-platform'], + * }); + * + * // 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 composer.projects.locations.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias composer.projects.locations.operations.delete * @memberOf! () * @@ -1119,6 +1596,50 @@ export namespace composer_v1 { /** * composer.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/composer.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 composer = google.composer('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/cloud-platform'], + * }); + * + * // 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 composer.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias composer.projects.locations.operations.get * @memberOf! () * @@ -1190,6 +1711,53 @@ export namespace composer_v1 { /** * composer.projects.locations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/composer.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 composer = google.composer('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/cloud-platform'], + * }); + * + * // 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 composer.projects.locations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias composer.projects.locations.operations.list * @memberOf! () * diff --git a/src/apis/composer/v1beta1.ts b/src/apis/composer/v1beta1.ts index d2e49e48d2d..1eb379d75a5 100644 --- a/src/apis/composer/v1beta1.ts +++ b/src/apis/composer/v1beta1.ts @@ -507,6 +507,65 @@ export namespace composer_v1beta1 { /** * composer.projects.locations.environments.create * @desc Create a new environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/composer.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 composer = google.composer('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 composer.projects.locations.environments.create({ + * // The parent must be of the form + * // "projects/{projectId}/locations/{locationId}". + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "uuid": "my_uuid" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias composer.projects.locations.environments.create * @memberOf! () * @@ -582,6 +641,52 @@ export namespace composer_v1beta1 { /** * composer.projects.locations.environments.delete * @desc Delete an environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/composer.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 composer = google.composer('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 composer.projects.locations.environments.delete({ + * // The environment to delete, in the form: + * // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * name: + * 'projects/my-project/locations/my-location/environments/my-environment', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias composer.projects.locations.environments.delete * @memberOf! () * @@ -653,6 +758,54 @@ export namespace composer_v1beta1 { /** * composer.projects.locations.environments.get * @desc Get an existing environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/composer.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 composer = google.composer('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 composer.projects.locations.environments.get({ + * // The resource name of the environment to get, in the form: + * // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * name: + * 'projects/my-project/locations/my-location/environments/my-environment', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "config": {}, + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "uuid": "my_uuid" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias composer.projects.locations.environments.get * @memberOf! () * @@ -724,6 +877,52 @@ export namespace composer_v1beta1 { /** * composer.projects.locations.environments.list * @desc List environments. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/composer.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 composer = google.composer('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 composer.projects.locations.environments.list({ + * // The maximum number of environments to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // List environments in the given project and location, in the form: + * // "projects/{projectId}/locations/{locationId}" + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "environments": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias composer.projects.locations.environments.list * @memberOf! () * @@ -802,6 +1001,210 @@ export namespace composer_v1beta1 { /** * composer.projects.locations.environments.patch * @desc Update an environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/composer.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 composer = google.composer('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 composer.projects.locations.environments.patch({ + * // The relative resource name of the environment to update, in the form: + * // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * name: + * 'projects/my-project/locations/my-location/environments/my-environment', + * // Required. A comma-separated list of paths, relative to `Environment`, of + * // fields to update. + * // For example, to set the version of scikit-learn to install in the + * // environment to 0.19.0 and to remove an existing installation of + * // argparse, the `updateMask` parameter would include the following two + * // `paths` values: "config.softwareConfig.pypiPackages.scikit-learn" and + * // "config.softwareConfig.pypiPackages.argparse". The included patch + * // environment would specify the scikit-learn version as follows: + * // + * // { + * // "config":{ + * // "softwareConfig":{ + * // "pypiPackages":{ + * // "scikit-learn":"==0.19.0" + * // } + * // } + * // } + * // } + * // + * // Note that in the above example, any existing PyPI packages + * // other than scikit-learn and argparse will be unaffected. + * // + * // Only one update type may be included in a single request's `updateMask`. + * // For example, one cannot update both the PyPI packages and + * // labels in the same request. However, it is possible to update multiple + * // members of a map field simultaneously in the same request. For example, + * // to set the labels "label1" and "label2" while clearing "label3" (assuming + * // it already exists), one can + * // provide the paths "labels.label1", "labels.label2", and "labels.label3" + * // and populate the patch environment as follows: + * // + * // { + * // "labels":{ + * // "label1":"new-label1-value" + * // "label2":"new-label2-value" + * // } + * // } + * // + * // Note that in the above example, any existing labels that are not + * // included in the `updateMask` will be unaffected. + * // + * // It is also possible to replace an entire map field by providing the + * // map field's path in the `updateMask`. The new value of the field will + * // be that which is provided in the patch environment. For example, to + * // delete all pre-existing user-specified PyPI packages and + * // install botocore at version 1.7.14, the `updateMask` would contain + * // the path "config.softwareConfig.pypiPackages", and + * // the patch environment would be the following: + * // + * // { + * // "config":{ + * // "softwareConfig":{ + * // "pypiPackages":{ + * // "botocore":"==1.7.14" + * // } + * // } + * // } + * // } + * // + * // Note: Only the following fields can be updated: + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * //
                          MaskPurpose
                          config.softwareConfig.pypiPackages + * // Replace all custom custom PyPI packages. If a replacement + * // package map is not included in `environment`, all custom + * // PyPI packages are cleared. It is an error to provide both this mask and a + * // mask specifying an individual package.
                          config.softwareConfig.pypiPackages.packagenameUpdate the custom PyPI package packagename, + * // preserving other packages. To delete the package, include it in + * // `updateMask`, and omit the mapping for it in + * // `environment.config.softwareConfig.pypiPackages`. It is an error + * // to provide both a mask of this form and the + * // "config.softwareConfig.pypiPackages" mask.
                          labelsReplace all environment labels. If a replacement labels map is not + * // included in `environment`, all labels are cleared. It is an error to + * // provide both this mask and a mask specifying one or more individual + * // labels.
                          labels.labelNameSet the label named labelName, while preserving other + * // labels. To delete the label, include it in `updateMask` and omit its + * // mapping in `environment.labels`. It is an error to provide both a + * // mask of this form and the "labels" mask.
                          config.nodeCountHorizontally scale the number of nodes in the environment. An integer + * // greater than or equal to 3 must be provided in the `config.nodeCount` + * // field. + * //
                          config.softwareConfig.airflowConfigOverridesReplace all Apache Airflow config overrides. If a replacement config + * // overrides map is not included in `environment`, all config overrides + * // are cleared. + * // It is an error to provide both this mask and a mask specifying one or + * // more individual config overrides.
                          config.softwareConfig.airflowConfigOverrides.section-name + * // Override the Apache Airflow config property name in the + * // section named section, preserving other properties. To delete + * // the property override, include it in `updateMask` and omit its mapping + * // in `environment.config.softwareConfig.airflowConfigOverrides`. + * // It is an error to provide both a mask of this form and the + * // "config.softwareConfig.airflowConfigOverrides" mask.
                          config.softwareConfig.envVariablesReplace all environment variables. If a replacement environment + * // variable map is not included in `environment`, all custom environment + * // variables are cleared. + * // It is an error to provide both this mask and a mask specifying one or + * // more individual environment variables.
                          config.softwareConfig.imageVersionUpgrade the version of the environment in-place. Refer to + * // `SoftwareConfig.image_version` for information on how to format the new + * // image version. Additionally, the new image version cannot effect a version + * // downgrade and must match the current image version's Composer major + * // version and Airflow major and minor versions. Consult the + * // Cloud + * // Composer Version List for valid values.
                          + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "uuid": "my_uuid" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias composer.projects.locations.environments.patch * @memberOf! () * @@ -965,6 +1368,52 @@ export namespace composer_v1beta1 { /** * composer.projects.locations.imageVersions.list * @desc List ImageVersions for provided location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/composer.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 composer = google.composer('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 composer.projects.locations.imageVersions.list({ + * // The maximum number of image_versions to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // List ImageVersions in the given project and location, in the form: + * // "projects/{projectId}/locations/{locationId}" + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "imageVersions": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias composer.projects.locations.imageVersions.list * @memberOf! () * @@ -1076,6 +1525,44 @@ export namespace composer_v1beta1 { /** * composer.projects.locations.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/composer.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 composer = google.composer('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 composer.projects.locations.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias composer.projects.locations.operations.delete * @memberOf! () * @@ -1145,6 +1632,50 @@ export namespace composer_v1beta1 { /** * composer.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/composer.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 composer = google.composer('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 composer.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias composer.projects.locations.operations.get * @memberOf! () * @@ -1216,6 +1747,53 @@ export namespace composer_v1beta1 { /** * composer.projects.locations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/composer.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 composer = google.composer('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 composer.projects.locations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias composer.projects.locations.operations.list * @memberOf! () * diff --git a/src/apis/compute/alpha.ts b/src/apis/compute/alpha.ts index 173b992e055..b24e9afafe4 100644 --- a/src/apis/compute/alpha.ts +++ b/src/apis/compute/alpha.ts @@ -14798,6 +14798,79 @@ export namespace compute_alpha { /** * compute.acceleratorTypes.aggregatedList * @desc Retrieves an aggregated list of accelerator types. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.acceleratorTypes.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.acceleratorTypes.aggregatedList * @memberOf! () * @@ -14887,6 +14960,64 @@ export namespace compute_alpha { /** * compute.acceleratorTypes.get * @desc Returns the specified accelerator type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.acceleratorTypes.get({ + * // Name of the accelerator type to return. + * acceleratorType: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "maximumCardsPerInstance": 0, + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.acceleratorTypes.get * @memberOf! () * @@ -14963,6 +15094,78 @@ export namespace compute_alpha { /** * compute.acceleratorTypes.list * @desc Retrieves a list of accelerator types available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.acceleratorTypes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.acceleratorTypes.list * @memberOf! () * @@ -15143,6 +15346,79 @@ export namespace compute_alpha { /** * compute.addresses.aggregatedList * @desc Retrieves an aggregated list of addresses. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.addresses.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.addresses.aggregatedList * @memberOf! () * @@ -15226,6 +15502,83 @@ export namespace compute_alpha { /** * compute.addresses.delete * @desc Deletes the specified address resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.addresses.delete({ + * // Name of the address resource to delete. + * address: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.addresses.delete * @memberOf! () * @@ -15302,6 +15655,74 @@ export namespace compute_alpha { /** * compute.addresses.get * @desc Returns the specified address resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.addresses.get({ + * // Name of the address resource to return. + * address: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "addressType": "my_addressType", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "prefixLength": 0, + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "status": "my_status", + * // "subnetwork": "my_subnetwork", + * // "users": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.addresses.get * @memberOf! () * @@ -15375,6 +15796,108 @@ export namespace compute_alpha { /** * compute.addresses.insert * @desc Creates an address resource in the specified project by using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.addresses.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "addressType": "my_addressType", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "prefixLength": 0, + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "status": "my_status", + * // "subnetwork": "my_subnetwork", + * // "users": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.addresses.insert * @memberOf! () * @@ -15451,6 +15974,78 @@ export namespace compute_alpha { /** * compute.addresses.list * @desc Retrieves a list of addresses contained within the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.addresses.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.addresses.list * @memberOf! () * @@ -15530,6 +16125,92 @@ export namespace compute_alpha { /** * compute.addresses.setLabels * @desc Sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.addresses.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.addresses.setLabels * @memberOf! () * @@ -15608,6 +16289,63 @@ export namespace compute_alpha { /** * compute.addresses.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.addresses.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.addresses.testIamPermissions * @memberOf! () * @@ -15888,6 +16626,79 @@ export namespace compute_alpha { /** * compute.autoscalers.aggregatedList * @desc Retrieves an aggregated list of autoscalers. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.autoscalers.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.autoscalers.aggregatedList * @memberOf! () * @@ -15972,6 +16783,83 @@ export namespace compute_alpha { /** * compute.autoscalers.delete * @desc Deletes the specified autoscaler. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.autoscalers.delete({ + * // Name of the autoscaler to delete. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.autoscalers.delete * @memberOf! () * @@ -16049,6 +16937,68 @@ export namespace compute_alpha { /** * compute.autoscalers.get * @desc Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.autoscalers.get({ + * // Name of the autoscaler to return. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.autoscalers.get * @memberOf! () * @@ -16124,6 +17074,102 @@ export namespace compute_alpha { /** * compute.autoscalers.insert * @desc Creates an autoscaler in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.autoscalers.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.autoscalers.insert * @memberOf! () * @@ -16201,6 +17247,78 @@ export namespace compute_alpha { /** * compute.autoscalers.list * @desc Retrieves a list of autoscalers contained within the specified zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.autoscalers.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.autoscalers.list * @memberOf! () * @@ -16280,6 +17398,104 @@ export namespace compute_alpha { /** * compute.autoscalers.patch * @desc Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.autoscalers.patch({ + * // Name of the autoscaler to patch. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.autoscalers.patch * @memberOf! () * @@ -16358,6 +17574,63 @@ export namespace compute_alpha { /** * compute.autoscalers.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.autoscalers.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.autoscalers.testIamPermissions * @memberOf! () * @@ -16439,6 +17712,104 @@ export namespace compute_alpha { /** * compute.autoscalers.update * @desc Updates an autoscaler in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.autoscalers.update({ + * // Name of the autoscaler to update. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.autoscalers.update * @memberOf! () * @@ -16747,6 +18118,90 @@ export namespace compute_alpha { /** * compute.backendBuckets.addSignedUrlKey * @desc Adds a key for validating requests with signed URLs for this backend bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendBuckets.addSignedUrlKey({ + * // Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * backendBucket: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "keyName": "my_keyName", + * // "keyValue": "my_keyValue" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendBuckets.addSignedUrlKey * @memberOf! () * @@ -16824,6 +18279,81 @@ export namespace compute_alpha { /** * compute.backendBuckets.delete * @desc Deletes the specified BackendBucket resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendBuckets.delete({ + * // Name of the BackendBucket resource to delete. + * backendBucket: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendBuckets.delete * @memberOf! () * @@ -16900,6 +18430,83 @@ export namespace compute_alpha { /** * compute.backendBuckets.deleteSignedUrlKey * @desc Deletes a key for validating requests with signed URLs for this backend bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendBuckets.deleteSignedUrlKey({ + * // Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * backendBucket: 'placeholder-value', + * // The name of the Signed URL Key to delete. + * keyName: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendBuckets.deleteSignedUrlKey * @memberOf! () * @@ -16977,6 +18584,62 @@ export namespace compute_alpha { /** * compute.backendBuckets.get * @desc Returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendBuckets.get({ + * // Name of the BackendBucket resource to return. + * backendBucket: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucketName": "my_bucketName", + * // "cdnPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableCdn": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendBuckets.get * @memberOf! () * @@ -17052,6 +18715,60 @@ export namespace compute_alpha { /** * compute.backendBuckets.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendBuckets.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendBuckets.getIamPolicy * @memberOf! () * @@ -17126,6 +18843,96 @@ export namespace compute_alpha { /** * compute.backendBuckets.insert * @desc Creates a BackendBucket resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendBuckets.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucketName": "my_bucketName", + * // "cdnPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableCdn": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendBuckets.insert * @memberOf! () * @@ -17202,6 +19009,76 @@ export namespace compute_alpha { /** * compute.backendBuckets.list * @desc Retrieves the list of BackendBucket resources available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendBuckets.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendBuckets.list * @memberOf! () * @@ -17281,6 +19158,98 @@ export namespace compute_alpha { /** * compute.backendBuckets.patch * @desc Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendBuckets.patch({ + * // Name of the BackendBucket resource to patch. + * backendBucket: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucketName": "my_bucketName", + * // "cdnPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableCdn": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendBuckets.patch * @memberOf! () * @@ -17358,6 +19327,67 @@ export namespace compute_alpha { /** * compute.backendBuckets.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendBuckets.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendBuckets.setIamPolicy * @memberOf! () * @@ -17432,6 +19462,61 @@ export namespace compute_alpha { /** * compute.backendBuckets.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendBuckets.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendBuckets.testIamPermissions * @memberOf! () * @@ -17512,6 +19597,98 @@ export namespace compute_alpha { /** * compute.backendBuckets.update * @desc Updates the specified BackendBucket resource with the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendBuckets.update({ + * // Name of the BackendBucket resource to update. + * backendBucket: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucketName": "my_bucketName", + * // "cdnPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableCdn": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendBuckets.update * @memberOf! () * @@ -17847,6 +20024,90 @@ export namespace compute_alpha { /** * compute.backendServices.addSignedUrlKey * @desc Adds a key for validating requests with signed URLs for this backend service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.addSignedUrlKey({ + * // Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * backendService: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "keyName": "my_keyName", + * // "keyValue": "my_keyValue" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendServices.addSignedUrlKey * @memberOf! () * @@ -17924,6 +20185,79 @@ export namespace compute_alpha { /** * compute.backendServices.aggregatedList * @desc Retrieves the list of all BackendService resources, regional and global, available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendServices.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Name of the project scoping this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendServices.aggregatedList * @memberOf! () * @@ -18013,6 +20347,81 @@ export namespace compute_alpha { /** * compute.backendServices.delete * @desc Deletes the specified BackendService resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.delete({ + * // Name of the BackendService resource to delete. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendServices.delete * @memberOf! () * @@ -18089,6 +20498,83 @@ export namespace compute_alpha { /** * compute.backendServices.deleteSignedUrlKey * @desc Deletes a key for validating requests with signed URLs for this backend service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.deleteSignedUrlKey({ + * // Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * backendService: 'placeholder-value', + * // The name of the Signed URL Key to delete. + * keyName: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendServices.deleteSignedUrlKey * @memberOf! () * @@ -18166,6 +20652,84 @@ export namespace compute_alpha { /** * compute.backendServices.get * @desc Returns the specified BackendService resource. Gets a list of available backend services. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendServices.get({ + * // Name of the BackendService resource to return. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "securitySettings": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendServices.get * @memberOf! () * @@ -18241,6 +20805,63 @@ export namespace compute_alpha { /** * compute.backendServices.getHealth * @desc Gets the most recent health check results for this BackendService. Example request body: { "group": "/zones/us-east1-b/instanceGroups/lb-backend-example" } + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendServices.getHealth({ + * // Name of the BackendService resource to which the queried instance belongs. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "group": "my_group" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "annotations": {}, + * // "healthStatus": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendServices.getHealth * @memberOf! () * @@ -18324,6 +20945,118 @@ export namespace compute_alpha { /** * compute.backendServices.insert * @desc Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Understanding backend services for more information. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "securitySettings": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendServices.insert * @memberOf! () * @@ -18400,6 +21133,76 @@ export namespace compute_alpha { /** * compute.backendServices.list * @desc Retrieves the list of BackendService resources available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendServices.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendServices.list * @memberOf! () * @@ -18479,6 +21282,120 @@ export namespace compute_alpha { /** * compute.backendServices.patch * @desc Patches the specified BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.patch({ + * // Name of the BackendService resource to patch. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "securitySettings": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendServices.patch * @memberOf! () * @@ -18556,6 +21473,89 @@ export namespace compute_alpha { /** * compute.backendServices.setSecurityPolicy * @desc Sets the security policy for the specified backend service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.setSecurityPolicy({ + * // Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. + * backendService: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "securityPolicy": "my_securityPolicy" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendServices.setSecurityPolicy * @memberOf! () * @@ -18633,6 +21633,61 @@ export namespace compute_alpha { /** * compute.backendServices.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendServices.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendServices.testIamPermissions * @memberOf! () * @@ -18713,6 +21768,120 @@ export namespace compute_alpha { /** * compute.backendServices.update * @desc Updates the specified BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.update({ + * // Name of the BackendService resource to update. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "securitySettings": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendServices.update * @memberOf! () * @@ -19089,6 +22258,91 @@ export namespace compute_alpha { /** * compute.disks.addResourcePolicies * @desc Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.addResourcePolicies({ + * // The disk name for this request. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourcePolicies": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.addResourcePolicies * @memberOf! () * @@ -19167,6 +22421,79 @@ export namespace compute_alpha { /** * compute.disks.aggregatedList * @desc Retrieves an aggregated list of persistent disks. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.disks.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.aggregatedList * @memberOf! () * @@ -19248,6 +22575,115 @@ export namespace compute_alpha { /** * compute.disks.createSnapshot * @desc Creates a snapshot of a specified persistent disk. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.createSnapshot({ + * // Name of the persistent disk to snapshot. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // [Input Only] Specifies to create an application consistent snapshot by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS). + * guestFlush: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoCreated": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "downloadBytes": "my_downloadBytes", + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "snapshotEncryptionKey": {}, + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskEncryptionKey": {}, + * // "sourceDiskId": "my_sourceDiskId", + * // "status": "my_status", + * // "storageBytes": "my_storageBytes", + * // "storageBytesStatus": "my_storageBytesStatus", + * // "storageLocations": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.createSnapshot * @memberOf! () * @@ -19327,6 +22763,83 @@ export namespace compute_alpha { /** * compute.disks.delete * @desc Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.delete({ + * // Name of the persistent disk to delete. + * disk: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.delete * @memberOf! () * @@ -19403,6 +22916,93 @@ export namespace compute_alpha { /** * compute.disks.get * @desc Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.disks.get({ + * // Name of the persistent disk to return. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskEncryptionKey": {}, + * // "eraseWindowsVssSignature": false, + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "lastAttachTimestamp": "my_lastAttachTimestamp", + * // "lastDetachTimestamp": "my_lastDetachTimestamp", + * // "licenseCodes": [], + * // "licenses": [], + * // "multiWriter": false, + * // "name": "my_name", + * // "options": "my_options", + * // "physicalBlockSizeBytes": "my_physicalBlockSizeBytes", + * // "region": "my_region", + * // "replicaZones": [], + * // "resourcePolicies": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sizeGb": "my_sizeGb", + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskId": "my_sourceDiskId", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceInPlaceSnapshot": "my_sourceInPlaceSnapshot", + * // "sourceInPlaceSnapshotId": "my_sourceInPlaceSnapshotId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "sourceStorageObject": "my_sourceStorageObject", + * // "status": "my_status", + * // "storageType": "my_storageType", + * // "type": "my_type", + * // "users": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.get * @memberOf! () * @@ -19476,6 +23076,62 @@ export namespace compute_alpha { /** * compute.disks.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.disks.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.getIamPolicy * @memberOf! () * @@ -19551,6 +23207,129 @@ export namespace compute_alpha { /** * compute.disks.insert * @desc Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Optional. Source image to restore onto a disk. + * sourceImage: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskEncryptionKey": {}, + * // "eraseWindowsVssSignature": false, + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "lastAttachTimestamp": "my_lastAttachTimestamp", + * // "lastDetachTimestamp": "my_lastDetachTimestamp", + * // "licenseCodes": [], + * // "licenses": [], + * // "multiWriter": false, + * // "name": "my_name", + * // "options": "my_options", + * // "physicalBlockSizeBytes": "my_physicalBlockSizeBytes", + * // "region": "my_region", + * // "replicaZones": [], + * // "resourcePolicies": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sizeGb": "my_sizeGb", + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskId": "my_sourceDiskId", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceInPlaceSnapshot": "my_sourceInPlaceSnapshot", + * // "sourceInPlaceSnapshotId": "my_sourceInPlaceSnapshotId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "sourceStorageObject": "my_sourceStorageObject", + * // "status": "my_status", + * // "storageType": "my_storageType", + * // "type": "my_type", + * // "users": [], + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.insert * @memberOf! () * @@ -19627,6 +23406,78 @@ export namespace compute_alpha { /** * compute.disks.list * @desc Retrieves a list of persistent disks contained within the specified zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.disks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.list * @memberOf! () * @@ -19703,6 +23554,91 @@ export namespace compute_alpha { /** * compute.disks.removeResourcePolicies * @desc Removes resource policies from a disk. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.removeResourcePolicies({ + * // The disk name for this request. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourcePolicies": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.removeResourcePolicies * @memberOf! () * @@ -19783,6 +23719,91 @@ export namespace compute_alpha { /** * compute.disks.resize * @desc Resizes the specified persistent disk. You can only increase the size of the disk. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.resize({ + * // The name of the persistent disk. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sizeGb": "my_sizeGb" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.resize * @memberOf! () * @@ -19860,6 +23881,69 @@ export namespace compute_alpha { /** * compute.disks.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.setIamPolicy * @memberOf! () * @@ -19935,6 +24019,92 @@ export namespace compute_alpha { /** * compute.disks.setLabels * @desc Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.setLabels * @memberOf! () * @@ -20012,6 +24182,63 @@ export namespace compute_alpha { /** * compute.disks.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.disks.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.testIamPermissions * @memberOf! () * @@ -20463,6 +24690,79 @@ export namespace compute_alpha { /** * compute.diskTypes.aggregatedList * @desc Retrieves an aggregated list of disk types. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.diskTypes.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.diskTypes.aggregatedList * @memberOf! () * @@ -20546,6 +24846,66 @@ export namespace compute_alpha { /** * compute.diskTypes.get * @desc Returns the specified disk type. Gets a list of available disk types by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.diskTypes.get({ + * // Name of the disk type to return. + * diskType: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultDiskSizeGb": "my_defaultDiskSizeGb", + * // "deprecated": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "validDiskSize": "my_validDiskSize", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.diskTypes.get * @memberOf! () * @@ -20619,6 +24979,78 @@ export namespace compute_alpha { /** * compute.diskTypes.list * @desc Retrieves a list of disk types available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.diskTypes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.diskTypes.list * @memberOf! () * @@ -20796,6 +25228,81 @@ export namespace compute_alpha { /** * compute.externalVpnGateways.delete * @desc Deletes the specified externalVpnGateway. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.externalVpnGateways.delete({ + * // Name of the externalVpnGateways to delete. + * externalVpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.externalVpnGateways.delete * @memberOf! () * @@ -20872,6 +25379,62 @@ export namespace compute_alpha { /** * compute.externalVpnGateways.get * @desc Returns the specified externalVpnGateway. Get a list of available externalVpnGateways by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.externalVpnGateways.get({ + * // Name of the externalVpnGateway to return. + * externalVpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "redundancyType": "my_redundancyType", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.externalVpnGateways.get * @memberOf! () * @@ -20947,6 +25510,96 @@ export namespace compute_alpha { /** * compute.externalVpnGateways.insert * @desc Creates a ExternalVpnGateway in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.externalVpnGateways.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "redundancyType": "my_redundancyType", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.externalVpnGateways.insert * @memberOf! () * @@ -21023,6 +25676,77 @@ export namespace compute_alpha { /** * compute.externalVpnGateways.list * @desc Retrieves the list of ExternalVpnGateway available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.externalVpnGateways.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.externalVpnGateways.list * @memberOf! () * @@ -21104,6 +25828,84 @@ export namespace compute_alpha { /** * compute.externalVpnGateways.setLabels * @desc Sets the labels on an ExternalVpnGateway. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.externalVpnGateways.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.externalVpnGateways.setLabels * @memberOf! () * @@ -21180,6 +25982,61 @@ export namespace compute_alpha { /** * compute.externalVpnGateways.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.externalVpnGateways.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.externalVpnGateways.testIamPermissions * @memberOf! () * @@ -21399,6 +26256,81 @@ export namespace compute_alpha { /** * compute.firewalls.delete * @desc Deletes the specified firewall. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.firewalls.delete({ + * // Name of the firewall rule to delete. + * firewall: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.firewalls.delete * @memberOf! () * @@ -21474,6 +26406,73 @@ export namespace compute_alpha { /** * compute.firewalls.get * @desc Returns the specified firewall. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.firewalls.get({ + * // Name of the firewall rule to return. + * firewall: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "allowed": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "denied": [], + * // "description": "my_description", + * // "destinationRanges": [], + * // "direction": "my_direction", + * // "disabled": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "priority": 0, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sourceRanges": [], + * // "sourceServiceAccounts": [], + * // "sourceTags": [], + * // "targetServiceAccounts": [], + * // "targetTags": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.firewalls.get * @memberOf! () * @@ -21546,6 +26545,107 @@ export namespace compute_alpha { /** * compute.firewalls.insert * @desc Creates a firewall rule in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.firewalls.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "allowed": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "denied": [], + * // "description": "my_description", + * // "destinationRanges": [], + * // "direction": "my_direction", + * // "disabled": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "priority": 0, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sourceRanges": [], + * // "sourceServiceAccounts": [], + * // "sourceTags": [], + * // "targetServiceAccounts": [], + * // "targetTags": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.firewalls.insert * @memberOf! () * @@ -21620,6 +26720,76 @@ export namespace compute_alpha { /** * compute.firewalls.list * @desc Retrieves the list of firewall rules available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.firewalls.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.firewalls.list * @memberOf! () * @@ -21697,6 +26867,109 @@ export namespace compute_alpha { /** * compute.firewalls.patch * @desc Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.firewalls.patch({ + * // Name of the firewall rule to patch. + * firewall: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "allowed": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "denied": [], + * // "description": "my_description", + * // "destinationRanges": [], + * // "direction": "my_direction", + * // "disabled": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "priority": 0, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sourceRanges": [], + * // "sourceServiceAccounts": [], + * // "sourceTags": [], + * // "targetServiceAccounts": [], + * // "targetTags": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.firewalls.patch * @memberOf! () * @@ -21773,6 +27046,61 @@ export namespace compute_alpha { /** * compute.firewalls.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.firewalls.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.firewalls.testIamPermissions * @memberOf! () * @@ -21853,6 +27181,109 @@ export namespace compute_alpha { /** * compute.firewalls.update * @desc Updates the specified firewall rule with the data included in the request. Note that all fields will be updated if using PUT, even fields that are not specified. To update individual fields, please use PATCH instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.firewalls.update({ + * // Name of the firewall rule to update. + * firewall: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "allowed": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "denied": [], + * // "description": "my_description", + * // "destinationRanges": [], + * // "direction": "my_direction", + * // "disabled": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "priority": 0, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sourceRanges": [], + * // "sourceServiceAccounts": [], + * // "sourceTags": [], + * // "targetServiceAccounts": [], + * // "targetTags": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.firewalls.update * @memberOf! () * @@ -22091,6 +27522,79 @@ export namespace compute_alpha { /** * compute.forwardingRules.aggregatedList * @desc Retrieves an aggregated list of forwarding rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.forwardingRules.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.forwardingRules.aggregatedList * @memberOf! () * @@ -22180,6 +27684,83 @@ export namespace compute_alpha { /** * compute.forwardingRules.delete * @desc Deletes the specified ForwardingRule resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.forwardingRules.delete({ + * // Name of the ForwardingRule resource to delete. + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.forwardingRules.delete * @memberOf! () * @@ -22257,6 +27838,82 @@ export namespace compute_alpha { /** * compute.forwardingRules.get * @desc Returns the specified ForwardingRule resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.forwardingRules.get({ + * // Name of the ForwardingRule resource to return. + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "IPAddress": "my_IPAddress", + * // "IPProtocol": "my_IPProtocol", + * // "allPorts": false, + * // "allowGlobalAccess": false, + * // "backendService": "my_backendService", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "isMirroringCollector": false, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "metadataFilters": [], + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "portRange": "my_portRange", + * // "ports": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "serviceLabel": "my_serviceLabel", + * // "serviceName": "my_serviceName", + * // "subnetwork": "my_subnetwork", + * // "target": "my_target" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.forwardingRules.get * @memberOf! () * @@ -22333,6 +27990,116 @@ export namespace compute_alpha { /** * compute.forwardingRules.insert * @desc Creates a ForwardingRule resource in the specified project and region using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.forwardingRules.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "IPAddress": "my_IPAddress", + * // "IPProtocol": "my_IPProtocol", + * // "allPorts": false, + * // "allowGlobalAccess": false, + * // "backendService": "my_backendService", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "isMirroringCollector": false, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "metadataFilters": [], + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "portRange": "my_portRange", + * // "ports": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "serviceLabel": "my_serviceLabel", + * // "serviceName": "my_serviceName", + * // "subnetwork": "my_subnetwork", + * // "target": "my_target" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.forwardingRules.insert * @memberOf! () * @@ -22410,6 +28177,78 @@ export namespace compute_alpha { /** * compute.forwardingRules.list * @desc Retrieves a list of ForwardingRule resources available to the specified project and region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.forwardingRules.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.forwardingRules.list * @memberOf! () * @@ -22490,6 +28329,118 @@ export namespace compute_alpha { /** * compute.forwardingRules.patch * @desc Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.forwardingRules.patch({ + * // Name of the ForwardingRule resource to patch. + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "IPAddress": "my_IPAddress", + * // "IPProtocol": "my_IPProtocol", + * // "allPorts": false, + * // "allowGlobalAccess": false, + * // "backendService": "my_backendService", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "isMirroringCollector": false, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "metadataFilters": [], + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "portRange": "my_portRange", + * // "ports": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "serviceLabel": "my_serviceLabel", + * // "serviceName": "my_serviceName", + * // "subnetwork": "my_subnetwork", + * // "target": "my_target" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.forwardingRules.patch * @memberOf! () * @@ -22568,6 +28519,92 @@ export namespace compute_alpha { /** * compute.forwardingRules.setLabels * @desc Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.forwardingRules.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.forwardingRules.setLabels * @memberOf! () * @@ -22646,6 +28683,91 @@ export namespace compute_alpha { /** * compute.forwardingRules.setTarget * @desc Changes target URL for forwarding rule. The new target should be of the same type as the old target. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.forwardingRules.setTarget({ + * // Name of the ForwardingRule resource in which target is to be set. + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "target": "my_target" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.forwardingRules.setTarget * @memberOf! () * @@ -22724,6 +28846,63 @@ export namespace compute_alpha { /** * compute.forwardingRules.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.forwardingRules.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.forwardingRules.testIamPermissions * @memberOf! () * @@ -23066,6 +29245,81 @@ export namespace compute_alpha { /** * compute.globalAddresses.delete * @desc Deletes the specified address resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalAddresses.delete({ + * // Name of the address resource to delete. + * address: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalAddresses.delete * @memberOf! () * @@ -23142,6 +29396,72 @@ export namespace compute_alpha { /** * compute.globalAddresses.get * @desc Returns the specified address resource. Gets a list of available addresses by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalAddresses.get({ + * // Name of the address resource to return. + * address: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "addressType": "my_addressType", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "prefixLength": 0, + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "status": "my_status", + * // "subnetwork": "my_subnetwork", + * // "users": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalAddresses.get * @memberOf! () * @@ -23215,6 +29535,106 @@ export namespace compute_alpha { /** * compute.globalAddresses.insert * @desc Creates an address resource in the specified project by using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalAddresses.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "addressType": "my_addressType", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "prefixLength": 0, + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "status": "my_status", + * // "subnetwork": "my_subnetwork", + * // "users": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalAddresses.insert * @memberOf! () * @@ -23290,6 +29710,76 @@ export namespace compute_alpha { /** * compute.globalAddresses.list * @desc Retrieves a list of global addresses. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalAddresses.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalAddresses.list * @memberOf! () * @@ -23368,6 +29858,84 @@ export namespace compute_alpha { /** * compute.globalAddresses.setLabels * @desc Sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalAddresses.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalAddresses.setLabels * @memberOf! () * @@ -23444,6 +30012,61 @@ export namespace compute_alpha { /** * compute.globalAddresses.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalAddresses.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalAddresses.testIamPermissions * @memberOf! () * @@ -23663,6 +30286,81 @@ export namespace compute_alpha { /** * compute.globalForwardingRules.delete * @desc Deletes the specified GlobalForwardingRule resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalForwardingRules.delete({ + * // Name of the ForwardingRule resource to delete. + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalForwardingRules.delete * @memberOf! () * @@ -23739,6 +30437,80 @@ export namespace compute_alpha { /** * compute.globalForwardingRules.get * @desc Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalForwardingRules.get({ + * // Name of the ForwardingRule resource to return. + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "IPAddress": "my_IPAddress", + * // "IPProtocol": "my_IPProtocol", + * // "allPorts": false, + * // "allowGlobalAccess": false, + * // "backendService": "my_backendService", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "isMirroringCollector": false, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "metadataFilters": [], + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "portRange": "my_portRange", + * // "ports": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "serviceLabel": "my_serviceLabel", + * // "serviceName": "my_serviceName", + * // "subnetwork": "my_subnetwork", + * // "target": "my_target" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalForwardingRules.get * @memberOf! () * @@ -23814,6 +30586,114 @@ export namespace compute_alpha { /** * compute.globalForwardingRules.insert * @desc Creates a GlobalForwardingRule resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalForwardingRules.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "IPAddress": "my_IPAddress", + * // "IPProtocol": "my_IPProtocol", + * // "allPorts": false, + * // "allowGlobalAccess": false, + * // "backendService": "my_backendService", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "isMirroringCollector": false, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "metadataFilters": [], + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "portRange": "my_portRange", + * // "ports": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "serviceLabel": "my_serviceLabel", + * // "serviceName": "my_serviceName", + * // "subnetwork": "my_subnetwork", + * // "target": "my_target" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalForwardingRules.insert * @memberOf! () * @@ -23890,6 +30770,76 @@ export namespace compute_alpha { /** * compute.globalForwardingRules.list * @desc Retrieves a list of GlobalForwardingRule resources available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalForwardingRules.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalForwardingRules.list * @memberOf! () * @@ -23969,6 +30919,116 @@ export namespace compute_alpha { /** * compute.globalForwardingRules.patch * @desc Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalForwardingRules.patch({ + * // Name of the ForwardingRule resource to patch. + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "IPAddress": "my_IPAddress", + * // "IPProtocol": "my_IPProtocol", + * // "allPorts": false, + * // "allowGlobalAccess": false, + * // "backendService": "my_backendService", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "isMirroringCollector": false, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "metadataFilters": [], + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "portRange": "my_portRange", + * // "ports": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "serviceLabel": "my_serviceLabel", + * // "serviceName": "my_serviceName", + * // "subnetwork": "my_subnetwork", + * // "target": "my_target" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalForwardingRules.patch * @memberOf! () * @@ -24046,6 +31106,84 @@ export namespace compute_alpha { /** * compute.globalForwardingRules.setLabels * @desc Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalForwardingRules.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalForwardingRules.setLabels * @memberOf! () * @@ -24122,6 +31260,89 @@ export namespace compute_alpha { /** * compute.globalForwardingRules.setTarget * @desc Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalForwardingRules.setTarget({ + * // Name of the ForwardingRule resource in which target is to be set. + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "target": "my_target" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalForwardingRules.setTarget * @memberOf! () * @@ -24199,6 +31420,61 @@ export namespace compute_alpha { /** * compute.globalForwardingRules.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalForwardingRules.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalForwardingRules.testIamPermissions * @memberOf! () * @@ -24468,6 +31744,89 @@ export namespace compute_alpha { /** * compute.globalNetworkEndpointGroups.attachNetworkEndpoints * @desc Attach a network endpoint to the specified network endpoint group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalNetworkEndpointGroups.attachNetworkEndpoints({ + * // The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "networkEndpoints": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.attachNetworkEndpoints * @memberOf! () * @@ -24547,6 +31906,81 @@ export namespace compute_alpha { /** * compute.globalNetworkEndpointGroups.delete * @desc Deletes the specified network endpoint group.Note that the NEG cannot be deleted if there are backend services referencing it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalNetworkEndpointGroups.delete({ + * // The name of the network endpoint group to delete. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.delete * @memberOf! () * @@ -24623,6 +32057,89 @@ export namespace compute_alpha { /** * compute.globalNetworkEndpointGroups.detachNetworkEndpoints * @desc Detach the network endpoint from the specified network endpoint group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalNetworkEndpointGroups.detachNetworkEndpoints({ + * // The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "networkEndpoints": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.detachNetworkEndpoints * @memberOf! () * @@ -24702,6 +32219,72 @@ export namespace compute_alpha { /** * compute.globalNetworkEndpointGroups.get * @desc Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalNetworkEndpointGroups.get({ + * // The name of the network endpoint group. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "annotations": {}, + * // "appEngine": {}, + * // "cloudFunction": {}, + * // "cloudRun": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultPort": 0, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancer": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkEndpointType": "my_networkEndpointType", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "type": "my_type", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.get * @memberOf! () * @@ -24779,6 +32362,106 @@ export namespace compute_alpha { /** * compute.globalNetworkEndpointGroups.insert * @desc Creates a network endpoint group in the specified project using the parameters that are included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalNetworkEndpointGroups.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "annotations": {}, + * // "appEngine": {}, + * // "cloudFunction": {}, + * // "cloudRun": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultPort": 0, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancer": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkEndpointType": "my_networkEndpointType", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "type": "my_type", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.insert * @memberOf! () * @@ -24855,6 +32538,76 @@ export namespace compute_alpha { /** * compute.globalNetworkEndpointGroups.list * @desc Retrieves the list of network endpoint groups that are located in the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalNetworkEndpointGroups.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.list * @memberOf! () * @@ -24936,6 +32689,77 @@ export namespace compute_alpha { /** * compute.globalNetworkEndpointGroups.listNetworkEndpoints * @desc Lists the network endpoints in the specified network endpoint group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalNetworkEndpointGroups.listNetworkEndpoints({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.listNetworkEndpoints * @memberOf! () * @@ -25222,6 +33046,79 @@ export namespace compute_alpha { /** * compute.globalOperations.aggregatedList * @desc Retrieves an aggregated list of all operations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalOperations.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalOperations.aggregatedList * @memberOf! () * @@ -25306,6 +33203,47 @@ export namespace compute_alpha { /** * compute.globalOperations.delete * @desc Deletes the specified Operations resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalOperations.delete({ + * // Name of the Operations resource to delete. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalOperations.delete * @memberOf! () * @@ -25379,6 +33317,76 @@ export namespace compute_alpha { /** * compute.globalOperations.get * @desc Retrieves the specified Operations resource. Gets a list of operations by making a `list()` request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalOperations.get({ + * // Name of the Operations resource to return. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalOperations.get * @memberOf! () * @@ -25454,6 +33462,76 @@ export namespace compute_alpha { /** * compute.globalOperations.list * @desc Retrieves a list of Operation resources contained within the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalOperations.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalOperations.list * @memberOf! () * @@ -25532,6 +33610,76 @@ export namespace compute_alpha { /** * compute.globalOperations.wait * @desc Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalOperations.wait({ + * // Name of the Operations resource to return. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalOperations.wait * @memberOf! () * @@ -25731,6 +33879,46 @@ export namespace compute_alpha { /** * compute.globalOrganizationOperations.delete * @desc Deletes the specified Operations resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalOrganizationOperations.delete({ + * // Name of the Operations resource to delete. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Parent ID for this request. + * parentId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalOrganizationOperations.delete * @memberOf! () * @@ -25804,6 +33992,75 @@ export namespace compute_alpha { /** * compute.globalOrganizationOperations.get * @desc Retrieves the specified Operations resource. Gets a list of operations by making a `list()` request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalOrganizationOperations.get({ + * // Name of the Operations resource to return. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Parent ID for this request. + * parentId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalOrganizationOperations.get * @memberOf! () * @@ -25879,6 +34136,75 @@ export namespace compute_alpha { /** * compute.globalOrganizationOperations.list * @desc Retrieves a list of Operation resources contained within the specified organization. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalOrganizationOperations.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Parent ID for this request. + * parentId: 'placeholder-value', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalOrganizationOperations.list * @memberOf! () * @@ -26029,6 +34355,81 @@ export namespace compute_alpha { /** * compute.globalPublicDelegatedPrefixes.delete * @desc Deletes the specified global PublicDelegatedPrefix. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalPublicDelegatedPrefixes.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the PublicDelegatedPrefix resource to delete. + * publicDelegatedPrefix: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalPublicDelegatedPrefixes.delete * @memberOf! () * @@ -26105,6 +34506,65 @@ export namespace compute_alpha { /** * compute.globalPublicDelegatedPrefixes.get * @desc Returns the specified global PublicDelegatedPrefix resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalPublicDelegatedPrefixes.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the PublicDelegatedPrefix resource to return. + * publicDelegatedPrefix: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipCidrRange": "my_ipCidrRange", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentPrefix": "my_parentPrefix", + * // "publicDelegatedSubPrefixs": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalPublicDelegatedPrefixes.get * @memberOf! () * @@ -26182,6 +34642,99 @@ export namespace compute_alpha { /** * compute.globalPublicDelegatedPrefixes.insert * @desc Creates a global PublicDelegatedPrefix in the specified project using the parameters that are included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalPublicDelegatedPrefixes.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipCidrRange": "my_ipCidrRange", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentPrefix": "my_parentPrefix", + * // "publicDelegatedSubPrefixs": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "status": "my_status" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalPublicDelegatedPrefixes.insert * @memberOf! () * @@ -26258,6 +34811,76 @@ export namespace compute_alpha { /** * compute.globalPublicDelegatedPrefixes.list * @desc Lists the global PublicDelegatedPrefixes for a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalPublicDelegatedPrefixes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalPublicDelegatedPrefixes.list * @memberOf! () * @@ -26344,6 +34967,101 @@ export namespace compute_alpha { /** * compute.globalPublicDelegatedPrefixes.patch * @desc Patches the specified global PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalPublicDelegatedPrefixes.patch({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the PublicDelegatedPrefix resource to patch. + * publicDelegatedPrefix: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipCidrRange": "my_ipCidrRange", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentPrefix": "my_parentPrefix", + * // "publicDelegatedSubPrefixs": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "status": "my_status" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalPublicDelegatedPrefixes.patch * @memberOf! () * @@ -26543,6 +35261,79 @@ export namespace compute_alpha { /** * compute.healthChecks.aggregatedList * @desc Retrieves the list of all HealthCheck resources, regional and global, available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.healthChecks.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Name of the project scoping this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.healthChecks.aggregatedList * @memberOf! () * @@ -26630,6 +35421,81 @@ export namespace compute_alpha { /** * compute.healthChecks.delete * @desc Deletes the specified HealthCheck resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.healthChecks.delete({ + * // Name of the HealthCheck resource to delete. + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.healthChecks.delete * @memberOf! () * @@ -26706,6 +35572,73 @@ export namespace compute_alpha { /** * compute.healthChecks.get * @desc Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.healthChecks.get({ + * // Name of the HealthCheck resource to return. + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "grpcHealthCheck": {}, + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "udpHealthCheck": {}, + * // "unhealthyThreshold": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.healthChecks.get * @memberOf! () * @@ -26780,6 +35713,107 @@ export namespace compute_alpha { /** * compute.healthChecks.insert * @desc Creates a HealthCheck resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.healthChecks.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "grpcHealthCheck": {}, + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "udpHealthCheck": {}, + * // "unhealthyThreshold": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.healthChecks.insert * @memberOf! () * @@ -26855,6 +35889,76 @@ export namespace compute_alpha { /** * compute.healthChecks.list * @desc Retrieves the list of HealthCheck resources available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.healthChecks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.healthChecks.list * @memberOf! () * @@ -26933,6 +36037,109 @@ export namespace compute_alpha { /** * compute.healthChecks.patch * @desc Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.healthChecks.patch({ + * // Name of the HealthCheck resource to patch. + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "grpcHealthCheck": {}, + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "udpHealthCheck": {}, + * // "unhealthyThreshold": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.healthChecks.patch * @memberOf! () * @@ -27010,6 +36217,61 @@ export namespace compute_alpha { /** * compute.healthChecks.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.healthChecks.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.healthChecks.testIamPermissions * @memberOf! () * @@ -27090,6 +36352,109 @@ export namespace compute_alpha { /** * compute.healthChecks.update * @desc Updates a HealthCheck resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.healthChecks.update({ + * // Name of the HealthCheck resource to update. + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "grpcHealthCheck": {}, + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "udpHealthCheck": {}, + * // "unhealthyThreshold": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.healthChecks.update * @memberOf! () * @@ -27370,6 +36735,81 @@ export namespace compute_alpha { /** * compute.httpHealthChecks.delete * @desc Deletes the specified HttpHealthCheck resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpHealthChecks.delete({ + * // Name of the HttpHealthCheck resource to delete. + * httpHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.httpHealthChecks.delete * @memberOf! () * @@ -27446,6 +36886,66 @@ export namespace compute_alpha { /** * compute.httpHealthChecks.get * @desc Returns the specified HttpHealthCheck resource. Gets a list of available HTTP health checks by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.httpHealthChecks.get({ + * // Name of the HttpHealthCheck resource to return. + * httpHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.httpHealthChecks.get * @memberOf! () * @@ -27521,6 +37021,100 @@ export namespace compute_alpha { /** * compute.httpHealthChecks.insert * @desc Creates a HttpHealthCheck resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpHealthChecks.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.httpHealthChecks.insert * @memberOf! () * @@ -27597,6 +37191,76 @@ export namespace compute_alpha { /** * compute.httpHealthChecks.list * @desc Retrieves the list of HttpHealthCheck resources available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.httpHealthChecks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.httpHealthChecks.list * @memberOf! () * @@ -27676,6 +37340,102 @@ export namespace compute_alpha { /** * compute.httpHealthChecks.patch * @desc Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpHealthChecks.patch({ + * // Name of the HttpHealthCheck resource to patch. + * httpHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.httpHealthChecks.patch * @memberOf! () * @@ -27753,6 +37513,61 @@ export namespace compute_alpha { /** * compute.httpHealthChecks.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.httpHealthChecks.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.httpHealthChecks.testIamPermissions * @memberOf! () * @@ -27833,6 +37648,102 @@ export namespace compute_alpha { /** * compute.httpHealthChecks.update * @desc Updates a HttpHealthCheck resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpHealthChecks.update({ + * // Name of the HttpHealthCheck resource to update. + * httpHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.httpHealthChecks.update * @memberOf! () * @@ -28078,6 +37989,81 @@ export namespace compute_alpha { /** * compute.httpsHealthChecks.delete * @desc Deletes the specified HttpsHealthCheck resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpsHealthChecks.delete({ + * // Name of the HttpsHealthCheck resource to delete. + * httpsHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.httpsHealthChecks.delete * @memberOf! () * @@ -28154,6 +38140,66 @@ export namespace compute_alpha { /** * compute.httpsHealthChecks.get * @desc Returns the specified HttpsHealthCheck resource. Gets a list of available HTTPS health checks by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.httpsHealthChecks.get({ + * // Name of the HttpsHealthCheck resource to return. + * httpsHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.httpsHealthChecks.get * @memberOf! () * @@ -28229,6 +38275,100 @@ export namespace compute_alpha { /** * compute.httpsHealthChecks.insert * @desc Creates a HttpsHealthCheck resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpsHealthChecks.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.httpsHealthChecks.insert * @memberOf! () * @@ -28305,6 +38445,76 @@ export namespace compute_alpha { /** * compute.httpsHealthChecks.list * @desc Retrieves the list of HttpsHealthCheck resources available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.httpsHealthChecks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.httpsHealthChecks.list * @memberOf! () * @@ -28386,6 +38596,102 @@ export namespace compute_alpha { /** * compute.httpsHealthChecks.patch * @desc Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpsHealthChecks.patch({ + * // Name of the HttpsHealthCheck resource to patch. + * httpsHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.httpsHealthChecks.patch * @memberOf! () * @@ -28463,6 +38769,61 @@ export namespace compute_alpha { /** * compute.httpsHealthChecks.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.httpsHealthChecks.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.httpsHealthChecks.testIamPermissions * @memberOf! () * @@ -28543,6 +38904,102 @@ export namespace compute_alpha { /** * compute.httpsHealthChecks.update * @desc Updates a HttpsHealthCheck resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpsHealthChecks.update({ + * // Name of the HttpsHealthCheck resource to update. + * httpsHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.httpsHealthChecks.update * @memberOf! () * @@ -28788,6 +39245,81 @@ export namespace compute_alpha { /** * compute.images.delete * @desc Deletes the specified image. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.images.delete({ + * // Name of the image resource to delete. + * image: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.images.delete * @memberOf! () * @@ -28863,6 +39395,93 @@ export namespace compute_alpha { /** * compute.images.deprecate * @desc Sets the deprecation status of an image. If an empty request body is given, clears the deprecation status instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.images.deprecate({ + * // Image name. + * image: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deleted": "my_deleted", + * // "deprecated": "my_deprecated", + * // "obsolete": "my_obsolete", + * // "replacement": "my_replacement", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.images.deprecate * @memberOf! () * @@ -28939,6 +39558,83 @@ export namespace compute_alpha { /** * compute.images.get * @desc Returns the specified image. Gets a list of available images by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.images.get({ + * // Name of the image resource to return. + * image: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "archiveSizeBytes": "my_archiveSizeBytes", + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "family": "my_family", + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "imageEncryptionKey": {}, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "rawDisk": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "shieldedInstanceInitialState": {}, + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskEncryptionKey": {}, + * // "sourceDiskId": "my_sourceDiskId", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "sourceType": "my_sourceType", + * // "status": "my_status", + * // "storageLocations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.images.get * @memberOf! () * @@ -29011,6 +39707,83 @@ export namespace compute_alpha { /** * compute.images.getFromFamily * @desc Returns the latest image that is part of an image family and is not deprecated. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.images.getFromFamily({ + * // Name of the image family to search for. + * family: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "archiveSizeBytes": "my_archiveSizeBytes", + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "family": "my_family", + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "imageEncryptionKey": {}, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "rawDisk": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "shieldedInstanceInitialState": {}, + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskEncryptionKey": {}, + * // "sourceDiskId": "my_sourceDiskId", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "sourceType": "my_sourceType", + * // "status": "my_status", + * // "storageLocations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.images.getFromFamily * @memberOf! () * @@ -29084,6 +39857,60 @@ export namespace compute_alpha { /** * compute.images.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.images.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.images.getIamPolicy * @memberOf! () * @@ -29158,6 +39985,122 @@ export namespace compute_alpha { /** * compute.images.insert * @desc Creates an image in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 compute.images.insert({ + * // Force image creation if true. + * forceCreate: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "archiveSizeBytes": "my_archiveSizeBytes", + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "family": "my_family", + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "imageEncryptionKey": {}, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "rawDisk": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "shieldedInstanceInitialState": {}, + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskEncryptionKey": {}, + * // "sourceDiskId": "my_sourceDiskId", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "sourceType": "my_sourceType", + * // "status": "my_status", + * // "storageLocations": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.images.insert * @memberOf! () * @@ -29233,6 +40176,76 @@ export namespace compute_alpha { /** * compute.images.list * @desc Retrieves the list of custom images available to the specified project. Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.images.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.images.list * @memberOf! () * @@ -29310,6 +40323,119 @@ export namespace compute_alpha { /** * compute.images.patch * @desc Patches the specified image with the data included in the request. Only the following fields can be modified: family, description, deprecation status. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.images.patch({ + * // Name of the image resource to patch. + * image: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "archiveSizeBytes": "my_archiveSizeBytes", + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "family": "my_family", + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "imageEncryptionKey": {}, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "rawDisk": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "shieldedInstanceInitialState": {}, + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskEncryptionKey": {}, + * // "sourceDiskId": "my_sourceDiskId", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "sourceType": "my_sourceType", + * // "status": "my_status", + * // "storageLocations": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.images.patch * @memberOf! () * @@ -29386,6 +40512,67 @@ export namespace compute_alpha { /** * compute.images.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.images.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.images.setIamPolicy * @memberOf! () * @@ -29460,6 +40647,84 @@ export namespace compute_alpha { /** * compute.images.setLabels * @desc Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.images.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.images.setLabels * @memberOf! () * @@ -29535,6 +40800,61 @@ export namespace compute_alpha { /** * compute.images.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.images.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.images.testIamPermissions * @memberOf! () * @@ -29858,6 +41178,91 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.abandonInstances * @desc Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.abandonInstances({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the managed instance group is located. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.abandonInstances * @memberOf! () * @@ -29936,6 +41341,79 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.aggregatedList * @desc Retrieves the list of managed instance groups and groups them by zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroupManagers.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.aggregatedList * @memberOf! () * @@ -30025,6 +41503,88 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.applyUpdatesToInstances * @desc Applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.applyUpdatesToInstances({ + * // The name of the managed instance group, should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone where the managed instance group is located. Should conform to RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [], + * // "maximalAction": "my_maximalAction", + * // "minimalAction": "my_minimalAction", + * // "mostDisruptiveAllowedAction": "my_mostDisruptiveAllowedAction" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.applyUpdatesToInstances * @memberOf! () * @@ -30104,6 +41664,91 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.createInstances * @desc Creates instances with per-instance configs in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.createInstances({ + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the managed instance group is located. It should conform to RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.createInstances * @memberOf! () * @@ -30182,6 +41827,83 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.delete * @desc Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.delete({ + * // The name of the managed instance group to delete. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the managed instance group is located. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.delete * @memberOf! () * @@ -30259,6 +41981,91 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.deleteInstances * @desc Flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.deleteInstances({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the managed instance group is located. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.deleteInstances * @memberOf! () * @@ -30337,6 +42144,85 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.deletePerInstanceConfigs * @desc Deletes selected per-instance configs for the managed instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.deletePerInstanceConfigs({ + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone where the managed instance group is located. It should conform to RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "names": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.deletePerInstanceConfigs * @memberOf! () * @@ -30416,6 +42302,80 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.get * @desc Returns all of the details about the specified managed instance group. Gets a list of available managed instance groups by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroupManagers.get({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone where the managed instance group is located. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "failoverAction": "my_failoverAction", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "pendingActions": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "serviceAccount": "my_serviceAccount", + * // "statefulPolicy": {}, + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.get * @memberOf! () * @@ -30494,6 +42454,114 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.insert * @desc Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where you want to create the managed instance group. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "failoverAction": "my_failoverAction", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "pendingActions": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "serviceAccount": "my_serviceAccount", + * // "statefulPolicy": {}, + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.insert * @memberOf! () * @@ -30571,6 +42639,78 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.list * @desc Retrieves a list of managed instance groups that are contained within the specified project and zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroupManagers.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // The name of the zone where the managed instance group is located. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.list * @memberOf! () * @@ -30653,6 +42793,76 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.listErrors * @desc Lists all errors thrown by actions on instances for a given managed instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroupManagers.listErrors({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9][0-9]{0,19}. + * instanceGroupManager: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // The name of the zone where the managed instance group is located. It should conform to RFC1035. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.listErrors * @memberOf! () * @@ -30751,6 +42961,74 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.listManagedInstances * @desc Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroupManagers.listManagedInstances({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone where the managed instance group is located. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "managedInstances": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.listManagedInstances * @memberOf! () * @@ -30855,6 +43133,77 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.listPerInstanceConfigs * @desc Lists all of the per-instance configs defined for the managed instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroupManagers.listPerInstanceConfigs({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // The name of the zone where the managed instance group is located. It should conform to RFC1035. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "nextPageToken": "my_nextPageToken", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.listPerInstanceConfigs * @memberOf! () * @@ -30960,6 +43309,116 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.patch * @desc Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.patch({ + * // The name of the instance group manager. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where you want to create the managed instance group. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "failoverAction": "my_failoverAction", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "pendingActions": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "serviceAccount": "my_serviceAccount", + * // "statefulPolicy": {}, + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.patch * @memberOf! () * @@ -31038,6 +43497,91 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.patchPerInstanceConfigs * @desc Inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.patchPerInstanceConfigs({ + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the managed instance group is located. It should conform to RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "perInstanceConfigs": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.patchPerInstanceConfigs * @memberOf! () * @@ -31118,6 +43662,91 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.recreateInstances * @desc Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.recreateInstances({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the managed instance group is located. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.recreateInstances * @memberOf! () * @@ -31196,6 +43825,85 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.resize * @desc Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. When resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including: + The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance. This list is subject to change. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.resize({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. + * size: 'placeholder-value', + * // The name of the zone where the managed instance group is located. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.resize * @memberOf! () * @@ -31274,6 +43982,92 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.resizeAdvanced * @desc Resizes the managed instance group with advanced configuration options like disabling creation retries. This is an extended version of the resize method. If you increase the size of the instance group, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating, creatingWithoutRetries, or deleting actions with the get or listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.resizeAdvanced({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the managed instance group is located. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "noCreationRetries": false, + * // "targetSize": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.resizeAdvanced * @memberOf! () * @@ -31352,6 +44146,91 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.setAutoHealingPolicies * @desc Modifies the autohealing policies. [Deprecated] This method is deprecated. Please use Patch instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.setAutoHealingPolicies({ + * // The name of the instance group manager. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the managed instance group is located. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoHealingPolicies": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.setAutoHealingPolicies * @memberOf! () * @@ -31432,6 +44311,91 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.setInstanceTemplate * @desc Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.setInstanceTemplate({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the managed instance group is located. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instanceTemplate": "my_instanceTemplate" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.setInstanceTemplate * @memberOf! () * @@ -31510,6 +44474,92 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.setTargetPools * @desc Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.setTargetPools({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the managed instance group is located. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "targetPools": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.setTargetPools * @memberOf! () * @@ -31588,6 +44638,63 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroupManagers.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.testIamPermissions * @memberOf! () * @@ -31669,6 +44776,116 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.update * @desc Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is updated even if the instances in the group have not yet been updated. You must separately verify the status of the individual instances with the listManagedInstances method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.update({ + * // The name of the instance group manager. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where you want to create the managed instance group. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "failoverAction": "my_failoverAction", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "pendingActions": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "serviceAccount": "my_serviceAccount", + * // "statefulPolicy": {}, + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.update * @memberOf! () * @@ -31747,6 +44964,91 @@ export namespace compute_alpha { /** * compute.instanceGroupManagers.updatePerInstanceConfigs * @desc Inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.updatePerInstanceConfigs({ + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the managed instance group is located. It should conform to RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "perInstanceConfigs": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.updatePerInstanceConfigs * @memberOf! () * @@ -32543,6 +45845,91 @@ export namespace compute_alpha { /** * compute.instanceGroups.addInstances * @desc Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroups.addInstances({ + * // The name of the instance group where you are adding instances. + * instanceGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the instance group is located. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroups.addInstances * @memberOf! () * @@ -32621,6 +46008,79 @@ export namespace compute_alpha { /** * compute.instanceGroups.aggregatedList * @desc Retrieves the list of instance groups and sorts them by zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroups.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroups.aggregatedList * @memberOf! () * @@ -32708,6 +46168,83 @@ export namespace compute_alpha { /** * compute.instanceGroups.delete * @desc Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroups.delete({ + * // The name of the instance group to delete. + * instanceGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the instance group is located. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroups.delete * @memberOf! () * @@ -32785,6 +46322,68 @@ export namespace compute_alpha { /** * compute.instanceGroups.get * @desc Returns the specified instance group. Gets a list of available instance groups by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroups.get({ + * // The name of the instance group. + * instanceGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone where the instance group is located. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroups.get * @memberOf! () * @@ -32861,6 +46460,102 @@ export namespace compute_alpha { /** * compute.instanceGroups.insert * @desc Creates an instance group in the specified project using the parameters that are included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroups.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where you want to create the instance group. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroups.insert * @memberOf! () * @@ -32938,6 +46633,78 @@ export namespace compute_alpha { /** * compute.instanceGroups.list * @desc Retrieves the list of instance groups that are located in the specified project and zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroups.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // The name of the zone where the instance group is located. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroups.list * @memberOf! () * @@ -33018,6 +46785,88 @@ export namespace compute_alpha { /** * compute.instanceGroups.listInstances * @desc Lists the instances in the specified instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroups.listInstances({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The name of the instance group from which you want to generate a list of included instances. + * instanceGroup: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // The name of the zone where the instance group is located. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instanceState": "my_instanceState" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroups.listInstances * @memberOf! () * @@ -33107,6 +46956,91 @@ export namespace compute_alpha { /** * compute.instanceGroups.removeInstances * @desc Removes one or more instances from the specified instance group, but does not delete those instances. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroups.removeInstances({ + * // The name of the instance group where the specified instances will be removed. + * instanceGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the instance group is located. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroups.removeInstances * @memberOf! () * @@ -33185,6 +47119,92 @@ export namespace compute_alpha { /** * compute.instanceGroups.setNamedPorts * @desc Sets the named ports for the specified instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroups.setNamedPorts({ + * // The name of the instance group where the named ports are updated. + * instanceGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the instance group is located. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "namedPorts": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroups.setNamedPorts * @memberOf! () * @@ -33263,6 +47283,63 @@ export namespace compute_alpha { /** * compute.instanceGroups.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroups.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroups.testIamPermissions * @memberOf! () * @@ -33650,6 +47727,101 @@ export namespace compute_alpha { /** * compute.instances.addAccessConfig * @desc Adds an access config to an instance's network interface. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.addAccessConfig({ + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the network interface to add to this instance. + * networkInterface: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "name": "my_name", + * // "natIP": "my_natIP", + * // "networkTier": "my_networkTier", + * // "publicDnsName": "my_publicDnsName", + * // "publicPtrDomainName": "my_publicPtrDomainName", + * // "setPublicDns": false, + * // "setPublicPtr": false, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.addAccessConfig * @memberOf! () * @@ -33729,6 +47901,91 @@ export namespace compute_alpha { /** * compute.instances.addResourcePolicies * @desc Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.addResourcePolicies({ + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourcePolicies": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.addResourcePolicies * @memberOf! () * @@ -33807,6 +48064,79 @@ export namespace compute_alpha { /** * compute.instances.aggregatedList * @desc Retrieves aggregated list of all of the instances in your project across all regions and zones. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.aggregatedList * @memberOf! () * @@ -33890,6 +48220,108 @@ export namespace compute_alpha { /** * compute.instances.attachDisk * @desc Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.attachDisk({ + * // Whether to force attach the disk even if it's currently attached to another instance. + * forceAttach: 'placeholder-value', + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoDelete": false, + * // "boot": false, + * // "deviceName": "my_deviceName", + * // "diskEncryptionKey": {}, + * // "diskSizeGb": "my_diskSizeGb", + * // "guestOsFeatures": [], + * // "index": 0, + * // "initializeParams": {}, + * // "interface": "my_interface", + * // "kind": "my_kind", + * // "licenses": [], + * // "mode": "my_mode", + * // "savedState": "my_savedState", + * // "shieldedInstanceInitialState": {}, + * // "source": "my_source", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.attachDisk * @memberOf! () * @@ -33969,6 +48401,94 @@ export namespace compute_alpha { /** * compute.instances.bulkInsert * @desc Creates multiple instances. Count specifies the number of instances to create. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.bulkInsert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "count": "my_count", + * // "excludedZones": [], + * // "instance": {}, + * // "minCount": "my_minCount", + * // "predefinedNames": [], + * // "sourceInstanceTemplate": "my_sourceInstanceTemplate" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.bulkInsert * @memberOf! () * @@ -34046,6 +48566,83 @@ export namespace compute_alpha { /** * compute.instances.delete * @desc Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.delete({ + * // Name of the instance resource to delete. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.delete * @memberOf! () * @@ -34122,6 +48719,87 @@ export namespace compute_alpha { /** * compute.instances.deleteAccessConfig * @desc Deletes an access config from an instance's network interface. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.deleteAccessConfig({ + * // The name of the access config to delete. + * accessConfig: 'placeholder-value', + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the network interface. + * networkInterface: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.deleteAccessConfig * @memberOf! () * @@ -34207,6 +48885,85 @@ export namespace compute_alpha { /** * compute.instances.detachDisk * @desc Detaches a disk from an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.detachDisk({ + * // The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names. + * deviceName: 'placeholder-value', + * // Instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.detachDisk * @memberOf! () * @@ -34285,6 +49042,97 @@ export namespace compute_alpha { /** * compute.instances.get * @desc Returns the specified Instance resource. Gets a list of available instances by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.get({ + * // Name of the instance resource to return. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "canIpForward": false, + * // "confidentialInstanceConfig": {}, + * // "cpuPlatform": "my_cpuPlatform", + * // "creationTimestamp": "my_creationTimestamp", + * // "deletionProtection": false, + * // "description": "my_description", + * // "disks": [], + * // "displayDevice": {}, + * // "eraseWindowsVssSignature": false, + * // "fingerprint": "my_fingerprint", + * // "guestAccelerators": [], + * // "hostname": "my_hostname", + * // "id": "my_id", + * // "instanceEncryptionKey": {}, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "machineType": "my_machineType", + * // "metadata": {}, + * // "minCpuPlatform": "my_minCpuPlatform", + * // "name": "my_name", + * // "networkInterfaces": [], + * // "postKeyRevocationActionType": "my_postKeyRevocationActionType", + * // "preservedStateSizeGb": "my_preservedStateSizeGb", + * // "privateIpv6GoogleAccess": "my_privateIpv6GoogleAccess", + * // "reservationAffinity": {}, + * // "resourcePolicies": [], + * // "scheduling": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "serviceAccounts": [], + * // "shieldedInstanceConfig": {}, + * // "shieldedInstanceIntegrityPolicy": {}, + * // "shieldedVmConfig": {}, + * // "shieldedVmIntegrityPolicy": {}, + * // "sourceMachineImage": "my_sourceMachineImage", + * // "sourceMachineImageEncryptionKey": {}, + * // "startRestricted": false, + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "tags": {}, + * // "upcomingMaintenance": {}, + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.get * @memberOf! () * @@ -34358,6 +49206,58 @@ export namespace compute_alpha { /** * compute.instances.getEffectiveFirewalls * @desc Returns effective firewalls applied to an interface of the instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.getEffectiveFirewalls({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // The name of the network interface to get the effective firewalls. + * networkInterface: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "firewalls": [], + * // "organizationFirewalls": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.getEffectiveFirewalls * @memberOf! () * @@ -34452,6 +49352,64 @@ export namespace compute_alpha { /** * compute.instances.getGuestAttributes * @desc Returns the specified guest attributes entry. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.getGuestAttributes({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Specifies the guest attributes path to be queried. + * queryPath: 'placeholder-value', + * // Specifies the key for the guest attributes entry. + * variableKey: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "queryPath": "my_queryPath", + * // "queryValue": {}, + * // "selfLink": "my_selfLink", + * // "variableKey": "my_variableKey", + * // "variableValue": "my_variableValue" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.getGuestAttributes * @memberOf! () * @@ -34532,6 +49490,62 @@ export namespace compute_alpha { /** * compute.instances.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.getIamPolicy * @memberOf! () * @@ -34607,6 +49621,56 @@ export namespace compute_alpha { /** * compute.instances.getScreenshot * @desc Returns the screenshot from the specified instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.getScreenshot({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contents": "my_contents", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.getScreenshot * @memberOf! () * @@ -34683,6 +49747,63 @@ export namespace compute_alpha { /** * compute.instances.getSerialPortOutput * @desc Returns the last 1 MB of serial port output from the specified instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.getSerialPortOutput({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Specifies which COM or serial port to retrieve data from. + * port: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call. + * start: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contents": "my_contents", + * // "kind": "my_kind", + * // "next": "my_next", + * // "selfLink": "my_selfLink", + * // "start": "my_start" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.getSerialPortOutput * @memberOf! () * @@ -34763,6 +49884,57 @@ export namespace compute_alpha { /** * compute.instances.getShieldedInstanceIdentity * @desc Returns the Shielded Instance Identity of an instance + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.getShieldedInstanceIdentity({ + * // Name or id of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "encryptionKey": {}, + * // "kind": "my_kind", + * // "signingKey": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.getShieldedInstanceIdentity * @memberOf! () * @@ -34843,6 +50015,57 @@ export namespace compute_alpha { /** * compute.instances.getShieldedVmIdentity * @desc Returns the Shielded VM Identity of an instance + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.getShieldedVmIdentity({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "encryptionKey": {}, + * // "kind": "my_kind", + * // "signingKey": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.getShieldedVmIdentity * @memberOf! () * @@ -34921,6 +50144,145 @@ export namespace compute_alpha { /** * compute.instances.insert * @desc Creates an instance resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Specifies instance template to create the instance. + * // + * // This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: + * // - https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate + * // - projects/project/global/instanceTemplates/instanceTemplate + * // - global/instanceTemplates/instanceTemplate + * sourceInstanceTemplate: 'placeholder-value', + * // Specifies instance machine to create the instance. + * // + * // This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: + * // - https://www.googleapis.com/compute/v1/projects/project/global/global/machineImages/machineImage + * // - projects/project/global/global/machineImages/machineImage + * // - global/machineImages/machineImage + * sourceMachineImage: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "canIpForward": false, + * // "confidentialInstanceConfig": {}, + * // "cpuPlatform": "my_cpuPlatform", + * // "creationTimestamp": "my_creationTimestamp", + * // "deletionProtection": false, + * // "description": "my_description", + * // "disks": [], + * // "displayDevice": {}, + * // "eraseWindowsVssSignature": false, + * // "fingerprint": "my_fingerprint", + * // "guestAccelerators": [], + * // "hostname": "my_hostname", + * // "id": "my_id", + * // "instanceEncryptionKey": {}, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "machineType": "my_machineType", + * // "metadata": {}, + * // "minCpuPlatform": "my_minCpuPlatform", + * // "name": "my_name", + * // "networkInterfaces": [], + * // "postKeyRevocationActionType": "my_postKeyRevocationActionType", + * // "preservedStateSizeGb": "my_preservedStateSizeGb", + * // "privateIpv6GoogleAccess": "my_privateIpv6GoogleAccess", + * // "reservationAffinity": {}, + * // "resourcePolicies": [], + * // "scheduling": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "serviceAccounts": [], + * // "shieldedInstanceConfig": {}, + * // "shieldedInstanceIntegrityPolicy": {}, + * // "shieldedVmConfig": {}, + * // "shieldedVmIntegrityPolicy": {}, + * // "sourceMachineImage": "my_sourceMachineImage", + * // "sourceMachineImageEncryptionKey": {}, + * // "startRestricted": false, + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "tags": {}, + * // "upcomingMaintenance": {}, + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.insert * @memberOf! () * @@ -34999,6 +50361,78 @@ export namespace compute_alpha { /** * compute.instances.list * @desc Retrieves the list of instances contained within the specified zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.list * @memberOf! () * @@ -35078,6 +50512,80 @@ export namespace compute_alpha { /** * compute.instances.listReferrers * @desc Retrieves the list of referrers to instances contained within the specified zone. For more information, read Viewing Referrers to VM Instances. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.listReferrers({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. + * instance: '-|[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.listReferrers * @memberOf! () * @@ -35163,6 +50671,91 @@ export namespace compute_alpha { /** * compute.instances.removeResourcePolicies * @desc Removes resource policies from an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.removeResourcePolicies({ + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourcePolicies": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.removeResourcePolicies * @memberOf! () * @@ -35243,6 +50836,83 @@ export namespace compute_alpha { /** * compute.instances.reset * @desc Performs a reset on the instance. This is a hard reset the VM does not do a graceful shutdown. For more information, see Resetting an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.reset({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.reset * @memberOf! () * @@ -35319,6 +50989,92 @@ export namespace compute_alpha { /** * compute.instances.resume * @desc Resumes an instance that was suspended using the instances().suspend method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.resume({ + * // Name of the instance resource to resume. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "disks": [], + * // "instanceEncryptionKey": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.resume * @memberOf! () * @@ -35396,6 +51152,85 @@ export namespace compute_alpha { /** * compute.instances.setDeletionProtection * @desc Sets deletion protection on the instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setDeletionProtection({ + * // Whether the resource should be protected against deletion. + * deletionProtection: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.setDeletionProtection * @memberOf! () * @@ -35476,6 +51311,87 @@ export namespace compute_alpha { /** * compute.instances.setDiskAutoDelete * @desc Sets the auto-delete flag for a disk attached to an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setDiskAutoDelete({ + * // Whether to auto-delete the disk when the instance is deleted. + * autoDelete: 'placeholder-value', + * // The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names. + * deviceName: 'w[w.-]{0,254}', + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.setDiskAutoDelete * @memberOf! () * @@ -35561,6 +51477,69 @@ export namespace compute_alpha { /** * compute.instances.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.setIamPolicy * @memberOf! () * @@ -35636,6 +51615,92 @@ export namespace compute_alpha { /** * compute.instances.setLabels * @desc Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setLabels({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.setLabels * @memberOf! () * @@ -35714,6 +51779,91 @@ export namespace compute_alpha { /** * compute.instances.setMachineResources * @desc Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setMachineResources({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "guestAccelerators": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.setMachineResources * @memberOf! () * @@ -35792,6 +51942,91 @@ export namespace compute_alpha { /** * compute.instances.setMachineType * @desc Changes the machine type for a stopped instance to the machine type specified in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setMachineType({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "machineType": "my_machineType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.setMachineType * @memberOf! () * @@ -35870,6 +52105,93 @@ export namespace compute_alpha { /** * compute.instances.setMetadata * @desc Sets metadata for the specified instance to the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setMetadata({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "items": [], + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.setMetadata * @memberOf! () * @@ -35948,6 +52270,91 @@ export namespace compute_alpha { /** * compute.instances.setMinCpuPlatform * @desc Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setMinCpuPlatform({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "minCpuPlatform": "my_minCpuPlatform" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.setMinCpuPlatform * @memberOf! () * @@ -36026,6 +52433,92 @@ export namespace compute_alpha { /** * compute.instances.setName * @desc Sets name of an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setName({ + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "currentName": "my_currentName", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.setName * @memberOf! () * @@ -36104,6 +52597,98 @@ export namespace compute_alpha { /** * compute.instances.setScheduling * @desc Sets an instance's scheduling options. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setScheduling({ + * // Instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "automaticRestart": false, + * // "latencyTolerant": false, + * // "locationHint": "my_locationHint", + * // "longTermRelease": false, + * // "minNodeCpus": 0, + * // "nodeAffinities": [], + * // "onHostMaintenance": "my_onHostMaintenance", + * // "preemptible": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.setScheduling * @memberOf! () * @@ -36182,6 +52767,92 @@ export namespace compute_alpha { /** * compute.instances.setServiceAccount * @desc Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setServiceAccount({ + * // Name of the instance resource to start. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "email": "my_email", + * // "scopes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.setServiceAccount * @memberOf! () * @@ -36260,6 +52931,91 @@ export namespace compute_alpha { /** * compute.instances.setShieldedInstanceIntegrityPolicy * @desc Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setShieldedInstanceIntegrityPolicy({ + * // Name or id of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "updateAutoLearnPolicy": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.setShieldedInstanceIntegrityPolicy * @memberOf! () * @@ -36340,6 +53096,91 @@ export namespace compute_alpha { /** * compute.instances.setShieldedVmIntegrityPolicy * @desc Sets the Shielded VM integrity policy for a VM instance. You can only use this method on a running VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setShieldedVmIntegrityPolicy({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "updateAutoLearnPolicy": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.setShieldedVmIntegrityPolicy * @memberOf! () * @@ -36420,6 +53261,92 @@ export namespace compute_alpha { /** * compute.instances.setTags * @desc Sets network tags for the specified instance to the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setTags({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "items": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.setTags * @memberOf! () * @@ -36498,6 +53425,77 @@ export namespace compute_alpha { /** * compute.instances.simulateMaintenanceEvent * @desc Simulates a maintenance event on the instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.simulateMaintenanceEvent({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.simulateMaintenanceEvent * @memberOf! () * @@ -36576,6 +53574,83 @@ export namespace compute_alpha { /** * compute.instances.start * @desc Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.start({ + * // Name of the instance resource to start. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.start * @memberOf! () * @@ -36652,6 +53727,92 @@ export namespace compute_alpha { /** * compute.instances.startWithEncryptionKey * @desc Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.startWithEncryptionKey({ + * // Name of the instance resource to start. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "disks": [], + * // "instanceEncryptionKey": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.startWithEncryptionKey * @memberOf! () * @@ -36732,6 +53893,85 @@ export namespace compute_alpha { /** * compute.instances.stop * @desc Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.stop({ + * // If true, discard the contents of any attached localSSD partitions. Default value is false (== preserve localSSD data). + * discardLocalSsd: 'placeholder-value', + * // Name of the instance resource to stop. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.stop * @memberOf! () * @@ -36809,6 +54049,85 @@ export namespace compute_alpha { /** * compute.instances.suspend * @desc This method suspends a running instance, saving its state to persistent storage, and allows you to resume the instance at a later time. Suspended instances incur reduced per-minute, virtual machine usage charges while they are suspended. Any resources the virtual machine is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.suspend({ + * // If true, discard the contents of any attached localSSD partitions. Default value is false (== preserve localSSD data). + * discardLocalSsd: 'placeholder-value', + * // Name of the instance resource to suspend. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.suspend * @memberOf! () * @@ -36887,6 +54206,63 @@ export namespace compute_alpha { /** * compute.instances.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.testIamPermissions * @memberOf! () * @@ -36968,6 +54344,137 @@ export namespace compute_alpha { /** * compute.instances.update * @desc Updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.update({ + * // Name of the instance resource to update. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Specifies the action to take when updating an instance even if the updated properties do not require it. If not specified, then Compute Engine acts based on the minimum action that the updated properties require. + * minimalAction: 'placeholder-value', + * // Specifies the most disruptive action that can be taken on the instance as part of the update. Compute Engine returns an error if the instance properties require a more disruptive action as part of the instance update. Valid options from lowest to highest are NO_EFFECT, REFRESH, and RESTART. + * mostDisruptiveAllowedAction: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "canIpForward": false, + * // "confidentialInstanceConfig": {}, + * // "cpuPlatform": "my_cpuPlatform", + * // "creationTimestamp": "my_creationTimestamp", + * // "deletionProtection": false, + * // "description": "my_description", + * // "disks": [], + * // "displayDevice": {}, + * // "eraseWindowsVssSignature": false, + * // "fingerprint": "my_fingerprint", + * // "guestAccelerators": [], + * // "hostname": "my_hostname", + * // "id": "my_id", + * // "instanceEncryptionKey": {}, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "machineType": "my_machineType", + * // "metadata": {}, + * // "minCpuPlatform": "my_minCpuPlatform", + * // "name": "my_name", + * // "networkInterfaces": [], + * // "postKeyRevocationActionType": "my_postKeyRevocationActionType", + * // "preservedStateSizeGb": "my_preservedStateSizeGb", + * // "privateIpv6GoogleAccess": "my_privateIpv6GoogleAccess", + * // "reservationAffinity": {}, + * // "resourcePolicies": [], + * // "scheduling": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "serviceAccounts": [], + * // "shieldedInstanceConfig": {}, + * // "shieldedInstanceIntegrityPolicy": {}, + * // "shieldedVmConfig": {}, + * // "shieldedVmIntegrityPolicy": {}, + * // "sourceMachineImage": "my_sourceMachineImage", + * // "sourceMachineImageEncryptionKey": {}, + * // "startRestricted": false, + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "tags": {}, + * // "upcomingMaintenance": {}, + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.update * @memberOf! () * @@ -37047,6 +54554,101 @@ export namespace compute_alpha { /** * compute.instances.updateAccessConfig * @desc Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.updateAccessConfig({ + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the network interface where the access config is attached. + * networkInterface: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "name": "my_name", + * // "natIP": "my_natIP", + * // "networkTier": "my_networkTier", + * // "publicDnsName": "my_publicDnsName", + * // "publicPtrDomainName": "my_publicPtrDomainName", + * // "setPublicDns": false, + * // "setPublicPtr": false, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.updateAccessConfig * @memberOf! () * @@ -37126,6 +54728,91 @@ export namespace compute_alpha { /** * compute.instances.updateDisplayDevice * @desc Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.updateDisplayDevice({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "enableDisplay": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.updateDisplayDevice * @memberOf! () * @@ -37204,6 +54891,101 @@ export namespace compute_alpha { /** * compute.instances.updateNetworkInterface * @desc Updates an instance's network interface. This method follows PATCH semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.updateNetworkInterface({ + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the network interface to update. + * networkInterface: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accessConfigs": [], + * // "aliasIpRanges": [], + * // "fingerprint": "my_fingerprint", + * // "ipv6Address": "my_ipv6Address", + * // "kind": "my_kind", + * // "name": "my_name", + * // "network": "my_network", + * // "networkIP": "my_networkIP", + * // "subnetwork": "my_subnetwork" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.updateNetworkInterface * @memberOf! () * @@ -37285,6 +55067,93 @@ export namespace compute_alpha { /** * compute.instances.updateShieldedInstanceConfig * @desc Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.updateShieldedInstanceConfig({ + * // Name or id of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "enableIntegrityMonitoring": false, + * // "enableSecureBoot": false, + * // "enableVtpm": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.updateShieldedInstanceConfig * @memberOf! () * @@ -37365,6 +55234,93 @@ export namespace compute_alpha { /** * compute.instances.updateShieldedVmConfig * @desc Updates the Shielded VM config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.updateShieldedVmConfig({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "enableIntegrityMonitoring": false, + * // "enableSecureBoot": false, + * // "enableVtpm": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.updateShieldedVmConfig * @memberOf! () * @@ -38807,6 +56763,81 @@ export namespace compute_alpha { /** * compute.instanceTemplates.delete * @desc Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceTemplates.delete({ + * // The name of the instance template to delete. + * instanceTemplate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceTemplates.delete * @memberOf! () * @@ -38883,6 +56914,62 @@ export namespace compute_alpha { /** * compute.instanceTemplates.get * @desc Returns the specified instance template. Gets a list of available instance templates by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceTemplates.get({ + * // The name of the instance template. + * instanceTemplate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "properties": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sourceInstance": "my_sourceInstance", + * // "sourceInstanceParams": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceTemplates.get * @memberOf! () * @@ -38958,6 +57045,60 @@ export namespace compute_alpha { /** * compute.instanceTemplates.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceTemplates.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceTemplates.getIamPolicy * @memberOf! () * @@ -39032,6 +57173,96 @@ export namespace compute_alpha { /** * compute.instanceTemplates.insert * @desc Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceTemplates.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "properties": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sourceInstance": "my_sourceInstance", + * // "sourceInstanceParams": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceTemplates.insert * @memberOf! () * @@ -39108,6 +57339,76 @@ export namespace compute_alpha { /** * compute.instanceTemplates.list * @desc Retrieves a list of instance templates that are contained within the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceTemplates.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceTemplates.list * @memberOf! () * @@ -39189,6 +57490,67 @@ export namespace compute_alpha { /** * compute.instanceTemplates.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceTemplates.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceTemplates.setIamPolicy * @memberOf! () * @@ -39263,6 +57625,61 @@ export namespace compute_alpha { /** * compute.instanceTemplates.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceTemplates.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceTemplates.testIamPermissions * @memberOf! () * @@ -39502,6 +57919,79 @@ export namespace compute_alpha { /** * compute.interconnectAttachments.aggregatedList * @desc Retrieves an aggregated list of interconnect attachments. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnectAttachments.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnectAttachments.aggregatedList * @memberOf! () * @@ -39599,6 +58089,84 @@ export namespace compute_alpha { /** * compute.interconnectAttachments.delete * @desc Deletes the specified interconnect attachment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnectAttachments.delete({ + * // Name of the interconnect attachment to delete. + * interconnectAttachment: + * '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnectAttachments.delete * @memberOf! () * @@ -39676,6 +58244,83 @@ export namespace compute_alpha { /** * compute.interconnectAttachments.get * @desc Returns the specified interconnect attachment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnectAttachments.get({ + * // Name of the interconnect attachment to return. + * interconnectAttachment: + * '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adminEnabled": false, + * // "bandwidth": "my_bandwidth", + * // "candidateSubnets": [], + * // "cloudRouterIpAddress": "my_cloudRouterIpAddress", + * // "creationTimestamp": "my_creationTimestamp", + * // "customerRouterIpAddress": "my_customerRouterIpAddress", + * // "description": "my_description", + * // "edgeAvailabilityDomain": "my_edgeAvailabilityDomain", + * // "googleReferenceId": "my_googleReferenceId", + * // "id": "my_id", + * // "interconnect": "my_interconnect", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "mtu": 0, + * // "name": "my_name", + * // "operationalStatus": "my_operationalStatus", + * // "pairingKey": "my_pairingKey", + * // "partnerAsn": "my_partnerAsn", + * // "partnerMetadata": {}, + * // "privateInterconnectInfo": {}, + * // "region": "my_region", + * // "router": "my_router", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "state": "my_state", + * // "type": "my_type", + * // "vlanTag8021q": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnectAttachments.get * @memberOf! () * @@ -39754,6 +58399,62 @@ export namespace compute_alpha { /** * compute.interconnectAttachments.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnectAttachments.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnectAttachments.getIamPolicy * @memberOf! () * @@ -39829,6 +58530,118 @@ export namespace compute_alpha { /** * compute.interconnectAttachments.insert * @desc Creates an InterconnectAttachment in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnectAttachments.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // If true, the request will not be committed. + * validateOnly: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adminEnabled": false, + * // "bandwidth": "my_bandwidth", + * // "candidateSubnets": [], + * // "cloudRouterIpAddress": "my_cloudRouterIpAddress", + * // "creationTimestamp": "my_creationTimestamp", + * // "customerRouterIpAddress": "my_customerRouterIpAddress", + * // "description": "my_description", + * // "edgeAvailabilityDomain": "my_edgeAvailabilityDomain", + * // "googleReferenceId": "my_googleReferenceId", + * // "id": "my_id", + * // "interconnect": "my_interconnect", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "mtu": 0, + * // "name": "my_name", + * // "operationalStatus": "my_operationalStatus", + * // "pairingKey": "my_pairingKey", + * // "partnerAsn": "my_partnerAsn", + * // "partnerMetadata": {}, + * // "privateInterconnectInfo": {}, + * // "region": "my_region", + * // "router": "my_router", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "state": "my_state", + * // "type": "my_type", + * // "vlanTag8021q": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnectAttachments.insert * @memberOf! () * @@ -39907,6 +58720,78 @@ export namespace compute_alpha { /** * compute.interconnectAttachments.list * @desc Retrieves the list of interconnect attachments contained within the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnectAttachments.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnectAttachments.list * @memberOf! () * @@ -39994,6 +58879,119 @@ export namespace compute_alpha { /** * compute.interconnectAttachments.patch * @desc Updates the specified interconnect attachment with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnectAttachments.patch({ + * // Name of the interconnect attachment to patch. + * interconnectAttachment: + * '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adminEnabled": false, + * // "bandwidth": "my_bandwidth", + * // "candidateSubnets": [], + * // "cloudRouterIpAddress": "my_cloudRouterIpAddress", + * // "creationTimestamp": "my_creationTimestamp", + * // "customerRouterIpAddress": "my_customerRouterIpAddress", + * // "description": "my_description", + * // "edgeAvailabilityDomain": "my_edgeAvailabilityDomain", + * // "googleReferenceId": "my_googleReferenceId", + * // "id": "my_id", + * // "interconnect": "my_interconnect", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "mtu": 0, + * // "name": "my_name", + * // "operationalStatus": "my_operationalStatus", + * // "pairingKey": "my_pairingKey", + * // "partnerAsn": "my_partnerAsn", + * // "partnerMetadata": {}, + * // "privateInterconnectInfo": {}, + * // "region": "my_region", + * // "router": "my_router", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "state": "my_state", + * // "type": "my_type", + * // "vlanTag8021q": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnectAttachments.patch * @memberOf! () * @@ -40072,6 +59070,69 @@ export namespace compute_alpha { /** * compute.interconnectAttachments.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnectAttachments.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnectAttachments.setIamPolicy * @memberOf! () * @@ -40147,6 +59208,92 @@ export namespace compute_alpha { /** * compute.interconnectAttachments.setLabels * @desc Sets the labels on an InterconnectAttachment. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnectAttachments.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnectAttachments.setLabels * @memberOf! () * @@ -40225,6 +59372,63 @@ export namespace compute_alpha { /** * compute.interconnectAttachments.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnectAttachments.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnectAttachments.testIamPermissions * @memberOf! () * @@ -40591,6 +59795,68 @@ export namespace compute_alpha { /** * compute.interconnectLocations.get * @desc Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnectLocations.get({ + * // Name of the interconnect location to return. + * interconnectLocation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "availabilityZone": "my_availabilityZone", + * // "city": "my_city", + * // "continent": "my_continent", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "facilityProvider": "my_facilityProvider", + * // "facilityProviderFacilityId": "my_facilityProviderFacilityId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "peeringdbFacilityId": "my_peeringdbFacilityId", + * // "regionInfos": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnectLocations.get * @memberOf! () * @@ -40668,6 +59934,76 @@ export namespace compute_alpha { /** * compute.interconnectLocations.list * @desc Retrieves the list of interconnect locations available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnectLocations.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnectLocations.list * @memberOf! () * @@ -40749,6 +60085,61 @@ export namespace compute_alpha { /** * compute.interconnectLocations.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnectLocations.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnectLocations.testIamPermissions * @memberOf! () * @@ -40906,6 +60297,81 @@ export namespace compute_alpha { /** * compute.interconnects.delete * @desc Deletes the specified interconnect. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnects.delete({ + * // Name of the interconnect to delete. + * interconnect: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnects.delete * @memberOf! () * @@ -40982,6 +60448,77 @@ export namespace compute_alpha { /** * compute.interconnects.get * @desc Returns the specified interconnect. Get a list of available interconnects by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnects.get({ + * // Name of the interconnect to return. + * interconnect: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adminEnabled": false, + * // "circuitInfos": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "customerName": "my_customerName", + * // "description": "my_description", + * // "expectedOutages": [], + * // "googleIpAddress": "my_googleIpAddress", + * // "googleReferenceId": "my_googleReferenceId", + * // "id": "my_id", + * // "interconnectAttachments": [], + * // "interconnectType": "my_interconnectType", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "linkType": "my_linkType", + * // "location": "my_location", + * // "name": "my_name", + * // "nocContactEmail": "my_nocContactEmail", + * // "operationalStatus": "my_operationalStatus", + * // "peerIpAddress": "my_peerIpAddress", + * // "provisionedLinkCount": 0, + * // "requestedLinkCount": 0, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnects.get * @memberOf! () * @@ -41057,6 +60594,53 @@ export namespace compute_alpha { /** * compute.interconnects.getDiagnostics * @desc Returns the interconnectDiagnostics for the specified interconnect. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnects.getDiagnostics({ + * // Name of the interconnect resource to query. + * interconnect: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "result": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnects.getDiagnostics * @memberOf! () * @@ -41143,6 +60727,60 @@ export namespace compute_alpha { /** * compute.interconnects.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnects.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnects.getIamPolicy * @memberOf! () * @@ -41217,6 +60855,111 @@ export namespace compute_alpha { /** * compute.interconnects.insert * @desc Creates a Interconnect in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnects.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adminEnabled": false, + * // "circuitInfos": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "customerName": "my_customerName", + * // "description": "my_description", + * // "expectedOutages": [], + * // "googleIpAddress": "my_googleIpAddress", + * // "googleReferenceId": "my_googleReferenceId", + * // "id": "my_id", + * // "interconnectAttachments": [], + * // "interconnectType": "my_interconnectType", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "linkType": "my_linkType", + * // "location": "my_location", + * // "name": "my_name", + * // "nocContactEmail": "my_nocContactEmail", + * // "operationalStatus": "my_operationalStatus", + * // "peerIpAddress": "my_peerIpAddress", + * // "provisionedLinkCount": 0, + * // "requestedLinkCount": 0, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnects.insert * @memberOf! () * @@ -41292,6 +61035,76 @@ export namespace compute_alpha { /** * compute.interconnects.list * @desc Retrieves the list of interconnect available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnects.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnects.list * @memberOf! () * @@ -41370,6 +61183,113 @@ export namespace compute_alpha { /** * compute.interconnects.patch * @desc Updates the specified interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnects.patch({ + * // Name of the interconnect to update. + * interconnect: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adminEnabled": false, + * // "circuitInfos": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "customerName": "my_customerName", + * // "description": "my_description", + * // "expectedOutages": [], + * // "googleIpAddress": "my_googleIpAddress", + * // "googleReferenceId": "my_googleReferenceId", + * // "id": "my_id", + * // "interconnectAttachments": [], + * // "interconnectType": "my_interconnectType", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "linkType": "my_linkType", + * // "location": "my_location", + * // "name": "my_name", + * // "nocContactEmail": "my_nocContactEmail", + * // "operationalStatus": "my_operationalStatus", + * // "peerIpAddress": "my_peerIpAddress", + * // "provisionedLinkCount": 0, + * // "requestedLinkCount": 0, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnects.patch * @memberOf! () * @@ -41447,6 +61367,67 @@ export namespace compute_alpha { /** * compute.interconnects.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnects.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnects.setIamPolicy * @memberOf! () * @@ -41521,6 +61502,84 @@ export namespace compute_alpha { /** * compute.interconnects.setLabels * @desc Sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnects.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnects.setLabels * @memberOf! () * @@ -41597,6 +61656,61 @@ export namespace compute_alpha { /** * compute.interconnects.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnects.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnects.testIamPermissions * @memberOf! () * @@ -41898,6 +62012,61 @@ export namespace compute_alpha { /** * compute.licenseCodes.get * @desc Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.licenseCodes.get({ + * // Number corresponding to the License code resource to return. + * licenseCode: '[0-9]{0,61}?', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "licenseAlias": [], + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "state": "my_state", + * // "transferable": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenseCodes.get * @memberOf! () * @@ -41972,6 +62141,60 @@ export namespace compute_alpha { /** * compute.licenseCodes.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.licenseCodes.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenseCodes.getIamPolicy * @memberOf! () * @@ -42046,6 +62269,67 @@ export namespace compute_alpha { /** * compute.licenseCodes.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.licenseCodes.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenseCodes.setIamPolicy * @memberOf! () * @@ -42120,6 +62404,61 @@ export namespace compute_alpha { /** * compute.licenseCodes.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.licenseCodes.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenseCodes.testIamPermissions * @memberOf! () * @@ -42285,6 +62624,81 @@ export namespace compute_alpha { /** * compute.licenses.delete * @desc Deletes the specified license. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.licenses.delete({ + * // Name of the license resource to delete. + * license: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenses.delete * @memberOf! () * @@ -42360,6 +62774,63 @@ export namespace compute_alpha { /** * compute.licenses.get * @desc Returns the specified License resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.licenses.get({ + * // Name of the License resource to return. + * license: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "chargesUseFee": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "licenseCode": "my_licenseCode", + * // "name": "my_name", + * // "resourceRequirements": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "transferable": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenses.get * @memberOf! () * @@ -42432,6 +62903,60 @@ export namespace compute_alpha { /** * compute.licenses.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.licenses.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenses.getIamPolicy * @memberOf! () * @@ -42506,6 +63031,100 @@ export namespace compute_alpha { /** * compute.licenses.insert * @desc Create a License resource in the specified project. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 compute.licenses.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "chargesUseFee": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "licenseCode": "my_licenseCode", + * // "name": "my_name", + * // "resourceRequirements": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "transferable": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenses.insert * @memberOf! () * @@ -42580,6 +63199,75 @@ export namespace compute_alpha { /** * compute.licenses.list * @desc Retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.licenses.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenses.list * @memberOf! () * @@ -42659,6 +63347,67 @@ export namespace compute_alpha { /** * compute.licenses.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.licenses.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenses.setIamPolicy * @memberOf! () * @@ -42733,6 +63482,61 @@ export namespace compute_alpha { /** * compute.licenses.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.licenses.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenses.testIamPermissions * @memberOf! () * @@ -42968,6 +63772,81 @@ export namespace compute_alpha { /** * compute.machineImages.delete * @desc Deletes the specified machine image. Deleting a machine image is permanent and cannot be undone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.machineImages.delete({ + * // The name of the machine image to delete. + * machineImage: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.machineImages.delete * @memberOf! () * @@ -43044,6 +63923,67 @@ export namespace compute_alpha { /** * compute.machineImages.get * @desc Returns the specified machine image. Gets a list of available machine images by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.machineImages.get({ + * // The name of the machine image. + * machineImage: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "guestFlush": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "machineImageEncryptionKey": {}, + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sourceDiskEncryptionKeys": [], + * // "sourceInstance": "my_sourceInstance", + * // "sourceInstanceProperties": {}, + * // "status": "my_status", + * // "storageLocations": [], + * // "totalStorageBytes": "my_totalStorageBytes" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.machineImages.get * @memberOf! () * @@ -43119,6 +64059,60 @@ export namespace compute_alpha { /** * compute.machineImages.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.machineImages.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.machineImages.getIamPolicy * @memberOf! () * @@ -43193,6 +64187,103 @@ export namespace compute_alpha { /** * compute.machineImages.insert * @desc Creates a machine image in the specified project using the data that is included in the request. If you are creating a new machine image to update an existing instance, your new machine image should use the same network or, if applicable, the same subnetwork as the original instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.machineImages.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Required. Source instance that is used to create the machine image from. + * sourceInstance: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "guestFlush": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "machineImageEncryptionKey": {}, + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sourceDiskEncryptionKeys": [], + * // "sourceInstance": "my_sourceInstance", + * // "sourceInstanceProperties": {}, + * // "status": "my_status", + * // "storageLocations": [], + * // "totalStorageBytes": "my_totalStorageBytes" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.machineImages.insert * @memberOf! () * @@ -43269,6 +64360,76 @@ export namespace compute_alpha { /** * compute.machineImages.list * @desc Retrieves a list of machine images that are contained within the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.machineImages.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.machineImages.list * @memberOf! () * @@ -43347,6 +64508,67 @@ export namespace compute_alpha { /** * compute.machineImages.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.machineImages.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.machineImages.setIamPolicy * @memberOf! () * @@ -43421,6 +64643,61 @@ export namespace compute_alpha { /** * compute.machineImages.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.machineImages.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.machineImages.testIamPermissions * @memberOf! () * @@ -43664,6 +64941,79 @@ export namespace compute_alpha { /** * compute.machineTypes.aggregatedList * @desc Retrieves an aggregated list of machine types. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.machineTypes.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.machineTypes.aggregatedList * @memberOf! () * @@ -43751,6 +65101,69 @@ export namespace compute_alpha { /** * compute.machineTypes.get * @desc Returns the specified machine type. Gets a list of available machine types by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.machineTypes.get({ + * // Name of the machine type to return. + * machineType: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accelerators": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "guestCpus": 0, + * // "id": "my_id", + * // "isSharedCpu": false, + * // "kind": "my_kind", + * // "maximumPersistentDisks": 0, + * // "maximumPersistentDisksSizeGb": "my_maximumPersistentDisksSizeGb", + * // "memoryMb": 0, + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.machineTypes.get * @memberOf! () * @@ -43826,6 +65239,78 @@ export namespace compute_alpha { /** * compute.machineTypes.list * @desc Retrieves a list of machine types available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.machineTypes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.machineTypes.list * @memberOf! () * @@ -44005,6 +65490,79 @@ export namespace compute_alpha { /** * compute.networkEndpointGroups.aggregatedList * @desc Retrieves the list of network endpoint groups and sorts them by zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networkEndpointGroups.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.aggregatedList * @memberOf! () * @@ -44094,6 +65652,91 @@ export namespace compute_alpha { /** * compute.networkEndpointGroups.attachNetworkEndpoints * @desc Attach a list of network endpoints to the specified network endpoint group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networkEndpointGroups.attachNetworkEndpoints({ + * // The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "networkEndpoints": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.attachNetworkEndpoints * @memberOf! () * @@ -44174,6 +65817,83 @@ export namespace compute_alpha { /** * compute.networkEndpointGroups.delete * @desc Deletes the specified network endpoint group. The network endpoints in the NEG and the VM instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot be deleted if there are backend services referencing it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networkEndpointGroups.delete({ + * // The name of the network endpoint group to delete. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.delete * @memberOf! () * @@ -44251,6 +65971,91 @@ export namespace compute_alpha { /** * compute.networkEndpointGroups.detachNetworkEndpoints * @desc Detach a list of network endpoints from the specified network endpoint group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networkEndpointGroups.detachNetworkEndpoints({ + * // The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "networkEndpoints": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.detachNetworkEndpoints * @memberOf! () * @@ -44331,6 +66136,74 @@ export namespace compute_alpha { /** * compute.networkEndpointGroups.get * @desc Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networkEndpointGroups.get({ + * // The name of the network endpoint group. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "annotations": {}, + * // "appEngine": {}, + * // "cloudFunction": {}, + * // "cloudRun": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultPort": 0, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancer": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkEndpointType": "my_networkEndpointType", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "type": "my_type", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.get * @memberOf! () * @@ -44409,6 +66282,108 @@ export namespace compute_alpha { /** * compute.networkEndpointGroups.insert * @desc Creates a network endpoint group in the specified project using the parameters that are included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networkEndpointGroups.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where you want to create the network endpoint group. It should comply with RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "annotations": {}, + * // "appEngine": {}, + * // "cloudFunction": {}, + * // "cloudRun": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultPort": 0, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancer": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkEndpointType": "my_networkEndpointType", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "type": "my_type", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.insert * @memberOf! () * @@ -44486,6 +66461,78 @@ export namespace compute_alpha { /** * compute.networkEndpointGroups.list * @desc Retrieves the list of network endpoint groups that are located in the specified project and zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networkEndpointGroups.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.list * @memberOf! () * @@ -44568,6 +66615,88 @@ export namespace compute_alpha { /** * compute.networkEndpointGroups.listNetworkEndpoints * @desc Lists the network endpoints in the specified network endpoint group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networkEndpointGroups.listNetworkEndpoints({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "endpointFilters": [], + * // "healthStatus": "my_healthStatus" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.listNetworkEndpoints * @memberOf! () * @@ -44673,6 +66802,63 @@ export namespace compute_alpha { /** * compute.networkEndpointGroups.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networkEndpointGroups.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.testIamPermissions * @memberOf! () * @@ -45031,6 +67217,94 @@ export namespace compute_alpha { /** * compute.networks.addPeering * @desc Adds a peering to the specified network. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.addPeering({ + * // Name of the network resource to add peering to. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoCreateRoutes": false, + * // "exportCustomRoutes": false, + * // "importCustomRoutes": false, + * // "name": "my_name", + * // "networkPeering": {}, + * // "peerNetwork": "my_peerNetwork" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networks.addPeering * @memberOf! () * @@ -45108,6 +67382,81 @@ export namespace compute_alpha { /** * compute.networks.delete * @desc Deletes the specified network. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.delete({ + * // Name of the network to delete. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networks.delete * @memberOf! () * @@ -45183,6 +67532,66 @@ export namespace compute_alpha { /** * compute.networks.get * @desc Returns the specified network. Gets a list of available networks by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networks.get({ + * // Name of the network to return. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "IPv4Range": "my_IPv4Range", + * // "autoCreateSubnetworks": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "gatewayIPv4": "my_gatewayIPv4", + * // "id": "my_id", + * // "kind": "my_kind", + * // "mtu": 0, + * // "name": "my_name", + * // "peerings": [], + * // "routingConfig": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "subnetworks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networks.get * @memberOf! () * @@ -45255,6 +67664,54 @@ export namespace compute_alpha { /** * compute.networks.getEffectiveFirewalls * @desc Returns the effective firewalls on a given network. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networks.getEffectiveFirewalls({ + * // Name of the network for this request. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "firewalls": [], + * // "organizationFirewalls": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networks.getEffectiveFirewalls * @memberOf! () * @@ -45347,6 +67804,100 @@ export namespace compute_alpha { /** * compute.networks.insert * @desc Creates a network in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "IPv4Range": "my_IPv4Range", + * // "autoCreateSubnetworks": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "gatewayIPv4": "my_gatewayIPv4", + * // "id": "my_id", + * // "kind": "my_kind", + * // "mtu": 0, + * // "name": "my_name", + * // "peerings": [], + * // "routingConfig": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "subnetworks": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networks.insert * @memberOf! () * @@ -45421,6 +67972,76 @@ export namespace compute_alpha { /** * compute.networks.list * @desc Retrieves the list of networks available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networks.list * @memberOf! () * @@ -45498,6 +68119,80 @@ export namespace compute_alpha { /** * compute.networks.listIpAddresses * @desc Lists the internal IP addresses in the specified network. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networks.listIpAddresses({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Name of the network for this request. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // (Optional) types filter separate by comma, valid values are: SUBNETWORK, RESERVED, PEER_USED, PEER_RESERVED, REMOTE_USED, REMOTE_RESERVED. + * types: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networks.listIpAddresses * @memberOf! () * @@ -45581,6 +68276,88 @@ export namespace compute_alpha { /** * compute.networks.listIpOwners * @desc Lists the internal IP owners in the specified network. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networks.listIpOwners({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // (Optional) IP CIDR range filter, example: "10.128.10.0/30". + * ipCidrRange: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Name of the network to return. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // (Optional) Project IDs filter, example: "project-1,project-2". + * ownerProjects: 'placeholder-value', + * // (Optional) Owner types filter, example: "instance,forwardingRule". + * ownerTypes: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // (Optional) Subnetwork name filter. + * subnetName: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // (Optional) Subnetwork region filter. + * subnetRegion: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networks.listIpOwners * @memberOf! () * @@ -45666,6 +68443,84 @@ export namespace compute_alpha { /** * compute.networks.listPeeringRoutes * @desc Lists the peering routes exchanged over peering connection. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networks.listPeeringRoutes({ + * // The direction of the exchanged routes. + * direction: 'placeholder-value', + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Name of the network for this request. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The response will show routes exchanged over the given peering connection. + * peeringName: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The region of the request. The response will include all subnet routes, static routes and dynamic routes in the region. + * region: 'placeholder-value', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networks.listPeeringRoutes * @memberOf! () * @@ -45756,6 +68611,102 @@ export namespace compute_alpha { /** * compute.networks.patch * @desc Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.patch({ + * // Name of the network to update. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "IPv4Range": "my_IPv4Range", + * // "autoCreateSubnetworks": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "gatewayIPv4": "my_gatewayIPv4", + * // "id": "my_id", + * // "kind": "my_kind", + * // "mtu": 0, + * // "name": "my_name", + * // "peerings": [], + * // "routingConfig": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "subnetworks": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networks.patch * @memberOf! () * @@ -45832,6 +68783,89 @@ export namespace compute_alpha { /** * compute.networks.removePeering * @desc Removes a peering from the specified network. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.removePeering({ + * // Name of the network resource to remove peering from. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networks.removePeering * @memberOf! () * @@ -45909,6 +68943,81 @@ export namespace compute_alpha { /** * compute.networks.switchToCustomMode * @desc Switches the network mode from auto subnet mode to custom subnet mode. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.switchToCustomMode({ + * // Name of the network to be updated. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networks.switchToCustomMode * @memberOf! () * @@ -45985,6 +69094,61 @@ export namespace compute_alpha { /** * compute.networks.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networks.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networks.testIamPermissions * @memberOf! () * @@ -46065,6 +69229,89 @@ export namespace compute_alpha { /** * compute.networks.updatePeering * @desc Updates the specified network peering with the data included in the request Only the following fields can be modified: NetworkPeering.export_custom_routes, and NetworkPeering.import_custom_routes + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.updatePeering({ + * // Name of the network resource which the updated peering is belonging to. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "networkPeering": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networks.updatePeering * @memberOf! () * @@ -46535,6 +69782,91 @@ export namespace compute_alpha { /** * compute.nodeGroups.addNodes * @desc Adds specified number of nodes to the node group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.addNodes({ + * // Name of the NodeGroup resource. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "additionalNodeCount": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.addNodes * @memberOf! () * @@ -46613,6 +69945,79 @@ export namespace compute_alpha { /** * compute.nodeGroups.aggregatedList * @desc Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeGroups.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.aggregatedList * @memberOf! () * @@ -46697,6 +70102,83 @@ export namespace compute_alpha { /** * compute.nodeGroups.delete * @desc Deletes the specified NodeGroup resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.delete({ + * // Name of the NodeGroup resource to delete. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.delete * @memberOf! () * @@ -46774,6 +70256,91 @@ export namespace compute_alpha { /** * compute.nodeGroups.deleteNodes * @desc Deletes specified nodes from the node group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.deleteNodes({ + * // Name of the NodeGroup resource whose nodes will be deleted. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "nodes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.deleteNodes * @memberOf! () * @@ -46852,6 +70419,70 @@ export namespace compute_alpha { /** * compute.nodeGroups.get * @desc Returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request. Note: the "nodes" field should not be used. Use nodeGroups.listNodes instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeGroups.get({ + * // Name of the node group to return. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locationHint": "my_locationHint", + * // "maintenancePolicy": "my_maintenancePolicy", + * // "maintenanceWindow": {}, + * // "name": "my_name", + * // "nodeTemplate": "my_nodeTemplate", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "size": 0, + * // "status": "my_status", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.get * @memberOf! () * @@ -46927,6 +70558,62 @@ export namespace compute_alpha { /** * compute.nodeGroups.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeGroups.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.getIamPolicy * @memberOf! () * @@ -47002,6 +70689,106 @@ export namespace compute_alpha { /** * compute.nodeGroups.insert * @desc Creates a NodeGroup resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.insert({ + * // Initial count of nodes in the node group. + * initialNodeCount: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locationHint": "my_locationHint", + * // "maintenancePolicy": "my_maintenancePolicy", + * // "maintenanceWindow": {}, + * // "name": "my_name", + * // "nodeTemplate": "my_nodeTemplate", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "size": 0, + * // "status": "my_status", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.insert * @memberOf! () * @@ -47080,6 +70867,78 @@ export namespace compute_alpha { /** * compute.nodeGroups.list * @desc Retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeGroups.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.list * @memberOf! () * @@ -47159,6 +71018,80 @@ export namespace compute_alpha { /** * compute.nodeGroups.listNodes * @desc Lists nodes in the node group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeGroups.listNodes({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Name of the NodeGroup resource whose nodes you want to list. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.listNodes * @memberOf! () * @@ -47240,6 +71173,106 @@ export namespace compute_alpha { /** * compute.nodeGroups.patch * @desc Updates the specified node group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.patch({ + * // Name of the NodeGroup resource to update. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locationHint": "my_locationHint", + * // "maintenancePolicy": "my_maintenancePolicy", + * // "maintenanceWindow": {}, + * // "name": "my_name", + * // "nodeTemplate": "my_nodeTemplate", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "size": 0, + * // "status": "my_status", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.patch * @memberOf! () * @@ -47317,6 +71350,69 @@ export namespace compute_alpha { /** * compute.nodeGroups.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.setIamPolicy * @memberOf! () * @@ -47392,6 +71488,91 @@ export namespace compute_alpha { /** * compute.nodeGroups.setNodeTemplate * @desc Updates the node template of the node group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.setNodeTemplate({ + * // Name of the NodeGroup resource to update. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "nodeTemplate": "my_nodeTemplate" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.setNodeTemplate * @memberOf! () * @@ -47470,6 +71651,63 @@ export namespace compute_alpha { /** * compute.nodeGroups.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeGroups.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.testIamPermissions * @memberOf! () * @@ -47931,6 +72169,79 @@ export namespace compute_alpha { /** * compute.nodeTemplates.aggregatedList * @desc Retrieves an aggregated list of node templates. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTemplates.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.aggregatedList * @memberOf! () * @@ -48018,6 +72329,83 @@ export namespace compute_alpha { /** * compute.nodeTemplates.delete * @desc Deletes the specified NodeTemplate resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeTemplates.delete({ + * // Name of the NodeTemplate resource to delete. + * nodeTemplate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.delete * @memberOf! () * @@ -48095,6 +72483,71 @@ export namespace compute_alpha { /** * compute.nodeTemplates.get * @desc Returns the specified node template. Gets a list of available node templates by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTemplates.get({ + * // Name of the node template to return. + * nodeTemplate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accelerators": [], + * // "cpuOvercommitType": "my_cpuOvercommitType", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "disks": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "nodeAffinityLabels": {}, + * // "nodeType": "my_nodeType", + * // "nodeTypeFlexibility": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "serverBinding": {}, + * // "status": "my_status", + * // "statusMessage": "my_statusMessage" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.get * @memberOf! () * @@ -48171,6 +72624,62 @@ export namespace compute_alpha { /** * compute.nodeTemplates.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTemplates.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.getIamPolicy * @memberOf! () * @@ -48246,6 +72755,105 @@ export namespace compute_alpha { /** * compute.nodeTemplates.insert * @desc Creates a NodeTemplate resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeTemplates.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accelerators": [], + * // "cpuOvercommitType": "my_cpuOvercommitType", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "disks": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "nodeAffinityLabels": {}, + * // "nodeType": "my_nodeType", + * // "nodeTypeFlexibility": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "serverBinding": {}, + * // "status": "my_status", + * // "statusMessage": "my_statusMessage" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.insert * @memberOf! () * @@ -48323,6 +72931,78 @@ export namespace compute_alpha { /** * compute.nodeTemplates.list * @desc Retrieves a list of node templates available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTemplates.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.list * @memberOf! () * @@ -48403,6 +73083,69 @@ export namespace compute_alpha { /** * compute.nodeTemplates.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeTemplates.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.setIamPolicy * @memberOf! () * @@ -48478,6 +73221,63 @@ export namespace compute_alpha { /** * compute.nodeTemplates.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTemplates.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.testIamPermissions * @memberOf! () * @@ -48782,6 +73582,79 @@ export namespace compute_alpha { /** * compute.nodeTypes.aggregatedList * @desc Retrieves an aggregated list of node types. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTypes.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTypes.aggregatedList * @memberOf! () * @@ -48865,6 +73738,67 @@ export namespace compute_alpha { /** * compute.nodeTypes.get * @desc Returns the specified node type. Gets a list of available node types by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTypes.get({ + * // Name of the node type to return. + * nodeType: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cpuPlatform": "my_cpuPlatform", + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "guestCpus": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "localSsdGb": 0, + * // "memoryMb": 0, + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTypes.get * @memberOf! () * @@ -48938,6 +73872,78 @@ export namespace compute_alpha { /** * compute.nodeTypes.list * @desc Retrieves a list of node types available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTypes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTypes.list * @memberOf! () * @@ -49115,6 +74121,91 @@ export namespace compute_alpha { /** * compute.organizationSecurityPolicies.addAssociation * @desc Inserts an association for the specified security policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.addAssociation({ + * // Indicates whether or not to replace it if an association of the attachment already exists. This is false by default, in which case an error will be returned if an assocation already exists. + * replaceExistingAssociation: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to update. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "attachmentId": "my_attachmentId", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "securityPolicyId": "my_securityPolicyId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.addAssociation * @memberOf! () * @@ -49192,6 +74283,97 @@ export namespace compute_alpha { /** * compute.organizationSecurityPolicies.addRule * @desc Inserts a rule into a security policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.addRule({ + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to update. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "direction": "my_direction", + * // "enableLogging": false, + * // "kind": "my_kind", + * // "match": {}, + * // "preview": false, + * // "priority": 0, + * // "rateLimitOptions": {}, + * // "ruleTupleCount": 0, + * // "targetResources": [], + * // "targetServiceAccounts": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.addRule * @memberOf! () * @@ -49268,6 +74450,80 @@ export namespace compute_alpha { /** * compute.organizationSecurityPolicies.copyRules * @desc Copies rules to the specified security policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.copyRules({ + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to update. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * // The security policy from which to copy rules. + * sourceSecurityPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.copyRules * @memberOf! () * @@ -49344,6 +74600,78 @@ export namespace compute_alpha { /** * compute.organizationSecurityPolicies.delete * @desc Deletes the specified policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.delete({ + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to delete. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.delete * @memberOf! () * @@ -49419,6 +74747,66 @@ export namespace compute_alpha { /** * compute.organizationSecurityPolicies.get * @desc List all of the ordered rules present in a single specified policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.organizationSecurityPolicies.get({ + * // Name of the security policy to get. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "associations": [], + * // "cloudArmorConfig": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "parent": "my_parent", + * // "ruleTupleCount": 0, + * // "rules": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.get * @memberOf! () * @@ -49493,6 +74881,55 @@ export namespace compute_alpha { /** * compute.organizationSecurityPolicies.getAssociation * @desc Gets an association with the specified name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.organizationSecurityPolicies.getAssociation({ + * // The name of the association to get from the security policy. + * name: 'placeholder-value', + * // Name of the security policy to which the queried rule belongs. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attachmentId": "my_attachmentId", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "securityPolicyId": "my_securityPolicyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.getAssociation * @memberOf! () * @@ -49575,6 +75012,63 @@ export namespace compute_alpha { /** * compute.organizationSecurityPolicies.getRule * @desc Gets a rule at the specified priority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.organizationSecurityPolicies.getRule({ + * // The priority of the rule to get from the security policy. + * priority: 'placeholder-value', + * // Name of the security policy to which the queried rule belongs. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "direction": "my_direction", + * // "enableLogging": false, + * // "kind": "my_kind", + * // "match": {}, + * // "preview": false, + * // "priority": 0, + * // "rateLimitOptions": {}, + * // "ruleTupleCount": 0, + * // "targetResources": [], + * // "targetServiceAccounts": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.getRule * @memberOf! () * @@ -49650,6 +75144,102 @@ export namespace compute_alpha { /** * compute.organizationSecurityPolicies.insert * @desc Creates a new policy in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.insert({ + * // Parent ID for this request. + * parentId: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "associations": [], + * // "cloudArmorConfig": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "parent": "my_parent", + * // "ruleTupleCount": 0, + * // "rules": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.insert * @memberOf! () * @@ -49726,6 +75316,74 @@ export namespace compute_alpha { /** * compute.organizationSecurityPolicies.list * @desc List all the policies that have been configured for the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.organizationSecurityPolicies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Parent ID for this request. + * parentId: 'placeholder-value', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.list * @memberOf! () * @@ -49805,6 +75463,50 @@ export namespace compute_alpha { /** * compute.organizationSecurityPolicies.listAssociations * @desc Lists associations of a specified target, i.e., organization or folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.listAssociations({ + * // The target resource to list associations. It is an organization, or a folder. + * targetResource: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "associations": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.listAssociations * @memberOf! () * @@ -49905,6 +75607,80 @@ export namespace compute_alpha { /** * compute.organizationSecurityPolicies.move * @desc Moves the specified security policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.move({ + * // The new parent of the security policy. + * parentId: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to update. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.move * @memberOf! () * @@ -49981,6 +75757,102 @@ export namespace compute_alpha { /** * compute.organizationSecurityPolicies.patch * @desc Patches the specified policy with the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.patch({ + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to update. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "associations": [], + * // "cloudArmorConfig": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "parent": "my_parent", + * // "ruleTupleCount": 0, + * // "rules": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.patch * @memberOf! () * @@ -50057,6 +75929,99 @@ export namespace compute_alpha { /** * compute.organizationSecurityPolicies.patchRule * @desc Patches a rule at the specified priority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.patchRule({ + * // The priority of the rule to patch. + * priority: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to update. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "direction": "my_direction", + * // "enableLogging": false, + * // "kind": "my_kind", + * // "match": {}, + * // "preview": false, + * // "priority": 0, + * // "rateLimitOptions": {}, + * // "ruleTupleCount": 0, + * // "targetResources": [], + * // "targetServiceAccounts": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.patchRule * @memberOf! () * @@ -50134,6 +76099,80 @@ export namespace compute_alpha { /** * compute.organizationSecurityPolicies.removeAssociation * @desc Removes an association for the specified security policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.removeAssociation({ + * // Name for the attachment that will be removed. + * name: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to update. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.removeAssociation * @memberOf! () * @@ -50210,6 +76249,80 @@ export namespace compute_alpha { /** * compute.organizationSecurityPolicies.removeRule * @desc Deletes a rule at the specified priority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.removeRule({ + * // The priority of the rule to remove from the security policy. + * priority: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to update. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.removeRule * @memberOf! () * @@ -50591,6 +76704,79 @@ export namespace compute_alpha { /** * compute.packetMirrorings.aggregatedList * @desc Retrieves an aggregated list of packetMirrorings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.packetMirrorings.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.aggregatedList * @memberOf! () * @@ -50680,6 +76866,83 @@ export namespace compute_alpha { /** * compute.packetMirrorings.delete * @desc Deletes the specified PacketMirroring resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.packetMirrorings.delete({ + * // Name of the PacketMirroring resource to delete. + * packetMirroring: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.delete * @memberOf! () * @@ -50757,6 +77020,68 @@ export namespace compute_alpha { /** * compute.packetMirrorings.get * @desc Returns the specified PacketMirroring resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.packetMirrorings.get({ + * // Name of the PacketMirroring resource to return. + * packetMirroring: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "collectorIlb": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enable": "my_enable", + * // "filter": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mirroredResources": {}, + * // "name": "my_name", + * // "network": {}, + * // "priority": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.get * @memberOf! () * @@ -50833,6 +77158,102 @@ export namespace compute_alpha { /** * compute.packetMirrorings.insert * @desc Creates a PacketMirroring resource in the specified project and region using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.packetMirrorings.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "collectorIlb": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enable": "my_enable", + * // "filter": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mirroredResources": {}, + * // "name": "my_name", + * // "network": {}, + * // "priority": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.insert * @memberOf! () * @@ -50910,6 +77331,78 @@ export namespace compute_alpha { /** * compute.packetMirrorings.list * @desc Retrieves a list of PacketMirroring resources available to the specified project and region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.packetMirrorings.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.list * @memberOf! () * @@ -50990,6 +77483,104 @@ export namespace compute_alpha { /** * compute.packetMirrorings.patch * @desc Patches the specified PacketMirroring resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.packetMirrorings.patch({ + * // Name of the PacketMirroring resource to patch. + * packetMirroring: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "collectorIlb": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enable": "my_enable", + * // "filter": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mirroredResources": {}, + * // "name": "my_name", + * // "network": {}, + * // "priority": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.patch * @memberOf! () * @@ -51068,6 +77659,63 @@ export namespace compute_alpha { /** * compute.packetMirrorings.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.packetMirrorings.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.testIamPermissions * @memberOf! () * @@ -51352,6 +78000,79 @@ export namespace compute_alpha { /** * compute.projects.disableXpnHost * @desc Disable this project as a shared VPC host project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.disableXpnHost({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.projects.disableXpnHost * @memberOf! () * @@ -51426,6 +78147,87 @@ export namespace compute_alpha { /** * compute.projects.disableXpnResource * @desc Disable a service resource (also known as service project) associated with this host project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.disableXpnResource({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "xpnResource": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.projects.disableXpnResource * @memberOf! () * @@ -51501,6 +78303,79 @@ export namespace compute_alpha { /** * compute.projects.enableXpnHost * @desc Enable this project as a shared VPC host project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.enableXpnHost({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.projects.enableXpnHost * @memberOf! () * @@ -51575,6 +78450,87 @@ export namespace compute_alpha { /** * compute.projects.enableXpnResource * @desc Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.enableXpnResource({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "xpnResource": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.projects.enableXpnResource * @memberOf! () * @@ -51650,6 +78606,63 @@ export namespace compute_alpha { /** * compute.projects.get * @desc Returns the specified Project resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.projects.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "commonInstanceMetadata": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultNetworkTier": "my_defaultNetworkTier", + * // "defaultServiceAccount": "my_defaultServiceAccount", + * // "description": "my_description", + * // "enabledFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "quotas": [], + * // "selfLink": "my_selfLink", + * // "usageExportLocation": {}, + * // "xpnProjectStatus": "my_xpnProjectStatus" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.projects.get * @memberOf! () * @@ -51721,6 +78734,62 @@ export namespace compute_alpha { /** * compute.projects.getXpnHost * @desc Gets the shared VPC host project that this project links to. May be empty if no link exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.getXpnHost({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "commonInstanceMetadata": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultNetworkTier": "my_defaultNetworkTier", + * // "defaultServiceAccount": "my_defaultServiceAccount", + * // "description": "my_description", + * // "enabledFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "quotas": [], + * // "selfLink": "my_selfLink", + * // "usageExportLocation": {}, + * // "xpnProjectStatus": "my_xpnProjectStatus" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.projects.getXpnHost * @memberOf! () * @@ -51792,6 +78861,70 @@ export namespace compute_alpha { /** * compute.projects.getXpnResources * @desc Gets service resources (a.k.a service project) associated with this host project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.getXpnResources({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.projects.getXpnResources * @memberOf! () * @@ -51873,6 +79006,81 @@ export namespace compute_alpha { /** * compute.projects.listXpnHosts * @desc Lists all shared VPC host projects visible to the user in an organization. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.listXpnHosts({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "organization": "my_organization" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.projects.listXpnHosts * @memberOf! () * @@ -51951,6 +79159,88 @@ export namespace compute_alpha { /** * compute.projects.moveDisk * @desc Moves a persistent disk from one zone to another. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.moveDisk({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destinationZone": "my_destinationZone", + * // "targetDisk": "my_targetDisk" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.projects.moveDisk * @memberOf! () * @@ -52026,6 +79316,88 @@ export namespace compute_alpha { /** * compute.projects.moveInstance * @desc Moves an instance and its attached persistent disks from one zone to another. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.moveInstance({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destinationZone": "my_destinationZone", + * // "targetInstance": "my_targetInstance" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.projects.moveInstance * @memberOf! () * @@ -52101,6 +79473,89 @@ export namespace compute_alpha { /** * compute.projects.setCommonInstanceMetadata * @desc Sets metadata common to all instances within the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.setCommonInstanceMetadata({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "items": [], + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.projects.setCommonInstanceMetadata * @memberOf! () * @@ -52179,6 +79634,87 @@ export namespace compute_alpha { /** * compute.projects.setDefaultNetworkTier * @desc Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.setDefaultNetworkTier({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "networkTier": "my_networkTier" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.projects.setDefaultNetworkTier * @memberOf! () * @@ -52257,6 +79793,87 @@ export namespace compute_alpha { /** * compute.projects.setDefaultServiceAccount * @desc Sets the default service account of the project. The default service account is used when a VM instance is created with the service account email address set to "default". + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.setDefaultServiceAccount({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "email": "my_email" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.projects.setDefaultServiceAccount * @memberOf! () * @@ -52335,6 +79952,91 @@ export namespace compute_alpha { /** * compute.projects.setUsageExportBucket * @desc Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 compute.projects.setUsageExportBucket({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucketName": "my_bucketName", + * // "reportNamePrefix": "my_reportNamePrefix" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.projects.setUsageExportBucket * @memberOf! () * @@ -52704,6 +80406,82 @@ export namespace compute_alpha { /** * compute.publicAdvertisedPrefixes.delete * @desc Deletes the specified PublicAdvertisedPrefix + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.publicAdvertisedPrefixes.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the PublicAdvertisedPrefix resource to delete. + * publicAdvertisedPrefix: + * '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.publicAdvertisedPrefixes.delete * @memberOf! () * @@ -52780,6 +80558,66 @@ export namespace compute_alpha { /** * compute.publicAdvertisedPrefixes.get * @desc Returns the specified PublicAdvertisedPrefix resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.publicAdvertisedPrefixes.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the PublicAdvertisedPrefix resource to return. + * publicAdvertisedPrefix: + * '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "dnsVerificationIp": "my_dnsVerificationIp", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipCidrRange": "my_ipCidrRange", + * // "kind": "my_kind", + * // "name": "my_name", + * // "publicDelegatedPrefixs": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sharedSecret": "my_sharedSecret", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.publicAdvertisedPrefixes.get * @memberOf! () * @@ -52857,6 +80695,99 @@ export namespace compute_alpha { /** * compute.publicAdvertisedPrefixes.insert * @desc Creates a PublicAdvertisedPrefix in the specified project using the parameters that are included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.publicAdvertisedPrefixes.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "dnsVerificationIp": "my_dnsVerificationIp", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipCidrRange": "my_ipCidrRange", + * // "kind": "my_kind", + * // "name": "my_name", + * // "publicDelegatedPrefixs": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sharedSecret": "my_sharedSecret", + * // "status": "my_status" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.publicAdvertisedPrefixes.insert * @memberOf! () * @@ -52933,6 +80864,76 @@ export namespace compute_alpha { /** * compute.publicAdvertisedPrefixes.list * @desc Lists the PublicAdvertisedPrefixes for a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.publicAdvertisedPrefixes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.publicAdvertisedPrefixes.list * @memberOf! () * @@ -53019,6 +81020,102 @@ export namespace compute_alpha { /** * compute.publicAdvertisedPrefixes.patch * @desc Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.publicAdvertisedPrefixes.patch({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the PublicAdvertisedPrefix resource to patch. + * publicAdvertisedPrefix: + * '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "dnsVerificationIp": "my_dnsVerificationIp", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipCidrRange": "my_ipCidrRange", + * // "kind": "my_kind", + * // "name": "my_name", + * // "publicDelegatedPrefixs": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sharedSecret": "my_sharedSecret", + * // "status": "my_status" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.publicAdvertisedPrefixes.patch * @memberOf! () * @@ -53218,6 +81315,79 @@ export namespace compute_alpha { /** * compute.publicDelegatedPrefixes.aggregatedList * @desc Lists all PublicDelegatedPrefix resources owned by the specific project across all scopes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.publicDelegatedPrefixes.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Name of the project scoping this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.publicDelegatedPrefixes.aggregatedList * @memberOf! () * @@ -53309,6 +81479,83 @@ export namespace compute_alpha { /** * compute.publicDelegatedPrefixes.delete * @desc Deletes the specified PublicDelegatedPrefix in the given region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.publicDelegatedPrefixes.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the PublicDelegatedPrefix resource to delete. + * publicDelegatedPrefix: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Name of the region of this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.publicDelegatedPrefixes.delete * @memberOf! () * @@ -53386,6 +81633,67 @@ export namespace compute_alpha { /** * compute.publicDelegatedPrefixes.get * @desc Returns the specified PublicDelegatedPrefix resource in the given region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.publicDelegatedPrefixes.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the PublicDelegatedPrefix resource to return. + * publicDelegatedPrefix: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Name of the region of this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipCidrRange": "my_ipCidrRange", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentPrefix": "my_parentPrefix", + * // "publicDelegatedSubPrefixs": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.publicDelegatedPrefixes.get * @memberOf! () * @@ -53464,6 +81772,101 @@ export namespace compute_alpha { /** * compute.publicDelegatedPrefixes.insert * @desc Creates a PublicDelegatedPrefix in the specified project in the given region using the parameters that are included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.publicDelegatedPrefixes.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region of this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipCidrRange": "my_ipCidrRange", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentPrefix": "my_parentPrefix", + * // "publicDelegatedSubPrefixs": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "status": "my_status" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.publicDelegatedPrefixes.insert * @memberOf! () * @@ -53541,6 +81944,78 @@ export namespace compute_alpha { /** * compute.publicDelegatedPrefixes.list * @desc Lists the PublicDelegatedPrefixes for a project in the given region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.publicDelegatedPrefixes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region of this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.publicDelegatedPrefixes.list * @memberOf! () * @@ -53628,6 +82103,103 @@ export namespace compute_alpha { /** * compute.publicDelegatedPrefixes.patch * @desc Patches the specified PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.publicDelegatedPrefixes.patch({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the PublicDelegatedPrefix resource to patch. + * publicDelegatedPrefix: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipCidrRange": "my_ipCidrRange", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentPrefix": "my_parentPrefix", + * // "publicDelegatedSubPrefixs": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "status": "my_status" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.publicDelegatedPrefixes.patch * @memberOf! () * @@ -53884,6 +82456,83 @@ export namespace compute_alpha { /** * compute.regionAutoscalers.delete * @desc Deletes the specified autoscaler. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionAutoscalers.delete({ + * // Name of the autoscaler to delete. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionAutoscalers.delete * @memberOf! () * @@ -53961,6 +82610,68 @@ export namespace compute_alpha { /** * compute.regionAutoscalers.get * @desc Returns the specified autoscaler. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionAutoscalers.get({ + * // Name of the autoscaler to return. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionAutoscalers.get * @memberOf! () * @@ -54037,6 +82748,102 @@ export namespace compute_alpha { /** * compute.regionAutoscalers.insert * @desc Creates an autoscaler in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionAutoscalers.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionAutoscalers.insert * @memberOf! () * @@ -54114,6 +82921,78 @@ export namespace compute_alpha { /** * compute.regionAutoscalers.list * @desc Retrieves a list of autoscalers contained within the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionAutoscalers.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionAutoscalers.list * @memberOf! () * @@ -54196,6 +83075,104 @@ export namespace compute_alpha { /** * compute.regionAutoscalers.patch * @desc Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionAutoscalers.patch({ + * // Name of the autoscaler to patch. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionAutoscalers.patch * @memberOf! () * @@ -54274,6 +83251,63 @@ export namespace compute_alpha { /** * compute.regionAutoscalers.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionAutoscalers.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionAutoscalers.testIamPermissions * @memberOf! () * @@ -54355,6 +83389,104 @@ export namespace compute_alpha { /** * compute.regionAutoscalers.update * @desc Updates an autoscaler in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionAutoscalers.update({ + * // Name of the autoscaler to update. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionAutoscalers.update * @memberOf! () * @@ -54629,6 +83761,83 @@ export namespace compute_alpha { /** * compute.regionBackendServices.delete * @desc Deletes the specified regional BackendService resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionBackendServices.delete({ + * // Name of the BackendService resource to delete. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionBackendServices.delete * @memberOf! () * @@ -54706,6 +83915,86 @@ export namespace compute_alpha { /** * compute.regionBackendServices.get * @desc Returns the specified regional BackendService resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionBackendServices.get({ + * // Name of the BackendService resource to return. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "securitySettings": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionBackendServices.get * @memberOf! () * @@ -54782,6 +84071,65 @@ export namespace compute_alpha { /** * compute.regionBackendServices.getHealth * @desc Gets the most recent health check results for this regional BackendService. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionBackendServices.getHealth({ + * // Name of the BackendService resource for which to get health. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "group": "my_group" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "annotations": {}, + * // "healthStatus": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionBackendServices.getHealth * @memberOf! () * @@ -54866,6 +84214,120 @@ export namespace compute_alpha { /** * compute.regionBackendServices.insert * @desc Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Understanding backend services for more information. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionBackendServices.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "securitySettings": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionBackendServices.insert * @memberOf! () * @@ -54943,6 +84405,78 @@ export namespace compute_alpha { /** * compute.regionBackendServices.list * @desc Retrieves the list of regional BackendService resources available to the specified project in the given region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionBackendServices.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionBackendServices.list * @memberOf! () * @@ -55023,6 +84557,122 @@ export namespace compute_alpha { /** * compute.regionBackendServices.patch * @desc Updates the specified regional BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionBackendServices.patch({ + * // Name of the BackendService resource to patch. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "securitySettings": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionBackendServices.patch * @memberOf! () * @@ -55101,6 +84751,63 @@ export namespace compute_alpha { /** * compute.regionBackendServices.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionBackendServices.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionBackendServices.testIamPermissions * @memberOf! () * @@ -55182,6 +84889,122 @@ export namespace compute_alpha { /** * compute.regionBackendServices.update * @desc Updates the specified regional BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionBackendServices.update({ + * // Name of the BackendService resource to update. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "securitySettings": {}, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionBackendServices.update * @memberOf! () * @@ -55481,6 +85304,79 @@ export namespace compute_alpha { /** * compute.regionCommitments.aggregatedList * @desc Retrieves an aggregated list of commitments. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionCommitments.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionCommitments.aggregatedList * @memberOf! () * @@ -55565,6 +85461,72 @@ export namespace compute_alpha { /** * compute.regionCommitments.get * @desc Returns the specified commitment resource. Gets a list of available commitments by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionCommitments.get({ + * // Name of the commitment to return. + * commitment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "category": "my_category", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTimestamp": "my_endTimestamp", + * // "id": "my_id", + * // "kind": "my_kind", + * // "licenseResource": {}, + * // "name": "my_name", + * // "plan": "my_plan", + * // "region": "my_region", + * // "reservations": [], + * // "resources": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTimestamp": "my_startTimestamp", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionCommitments.get * @memberOf! () * @@ -55641,6 +85603,106 @@ export namespace compute_alpha { /** * compute.regionCommitments.insert * @desc Creates a commitment in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionCommitments.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "category": "my_category", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTimestamp": "my_endTimestamp", + * // "id": "my_id", + * // "kind": "my_kind", + * // "licenseResource": {}, + * // "name": "my_name", + * // "plan": "my_plan", + * // "region": "my_region", + * // "reservations": [], + * // "resources": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTimestamp": "my_startTimestamp", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionCommitments.insert * @memberOf! () * @@ -55718,6 +85780,78 @@ export namespace compute_alpha { /** * compute.regionCommitments.list * @desc Retrieves a list of commitments contained within the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionCommitments.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionCommitments.list * @memberOf! () * @@ -55798,6 +85932,63 @@ export namespace compute_alpha { /** * compute.regionCommitments.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionCommitments.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionCommitments.testIamPermissions * @memberOf! () * @@ -55879,6 +86070,91 @@ export namespace compute_alpha { /** * compute.regionCommitments.updateReservations * @desc Transfers GPUs or local SSDs between reservations within commitments. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionCommitments.updateReservations({ + * // Name of the commitment for which the reservation is being updated. + * commitment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "reservations": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionCommitments.updateReservations * @memberOf! () * @@ -56136,6 +86412,91 @@ export namespace compute_alpha { /** * compute.regionDisks.addResourcePolicies * @desc Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.addResourcePolicies({ + * // The disk name for this request. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourcePolicies": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.addResourcePolicies * @memberOf! () * @@ -56214,6 +86575,115 @@ export namespace compute_alpha { /** * compute.regionDisks.createSnapshot * @desc Creates a snapshot of this regional disk. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.createSnapshot({ + * // Name of the regional persistent disk to snapshot. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // [Input Only] Specifies to create an application consistent snapshot by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS). + * guestFlush: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoCreated": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "downloadBytes": "my_downloadBytes", + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "snapshotEncryptionKey": {}, + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskEncryptionKey": {}, + * // "sourceDiskId": "my_sourceDiskId", + * // "status": "my_status", + * // "storageBytes": "my_storageBytes", + * // "storageBytesStatus": "my_storageBytesStatus", + * // "storageLocations": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.createSnapshot * @memberOf! () * @@ -56293,6 +86763,83 @@ export namespace compute_alpha { /** * compute.regionDisks.delete * @desc Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.delete({ + * // Name of the regional persistent disk to delete. + * disk: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.delete * @memberOf! () * @@ -56370,6 +86917,93 @@ export namespace compute_alpha { /** * compute.regionDisks.get * @desc Returns a specified regional persistent disk. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionDisks.get({ + * // Name of the regional persistent disk to return. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskEncryptionKey": {}, + * // "eraseWindowsVssSignature": false, + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "lastAttachTimestamp": "my_lastAttachTimestamp", + * // "lastDetachTimestamp": "my_lastDetachTimestamp", + * // "licenseCodes": [], + * // "licenses": [], + * // "multiWriter": false, + * // "name": "my_name", + * // "options": "my_options", + * // "physicalBlockSizeBytes": "my_physicalBlockSizeBytes", + * // "region": "my_region", + * // "replicaZones": [], + * // "resourcePolicies": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sizeGb": "my_sizeGb", + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskId": "my_sourceDiskId", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceInPlaceSnapshot": "my_sourceInPlaceSnapshot", + * // "sourceInPlaceSnapshotId": "my_sourceInPlaceSnapshotId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "sourceStorageObject": "my_sourceStorageObject", + * // "status": "my_status", + * // "storageType": "my_storageType", + * // "type": "my_type", + * // "users": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.get * @memberOf! () * @@ -56443,6 +87077,62 @@ export namespace compute_alpha { /** * compute.regionDisks.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionDisks.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.getIamPolicy * @memberOf! () * @@ -56518,6 +87208,129 @@ export namespace compute_alpha { /** * compute.regionDisks.insert * @desc Creates a persistent regional disk in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Optional. Source image to restore onto a disk. + * sourceImage: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskEncryptionKey": {}, + * // "eraseWindowsVssSignature": false, + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "lastAttachTimestamp": "my_lastAttachTimestamp", + * // "lastDetachTimestamp": "my_lastDetachTimestamp", + * // "licenseCodes": [], + * // "licenses": [], + * // "multiWriter": false, + * // "name": "my_name", + * // "options": "my_options", + * // "physicalBlockSizeBytes": "my_physicalBlockSizeBytes", + * // "region": "my_region", + * // "replicaZones": [], + * // "resourcePolicies": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sizeGb": "my_sizeGb", + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskId": "my_sourceDiskId", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceInPlaceSnapshot": "my_sourceInPlaceSnapshot", + * // "sourceInPlaceSnapshotId": "my_sourceInPlaceSnapshotId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "sourceStorageObject": "my_sourceStorageObject", + * // "status": "my_status", + * // "storageType": "my_storageType", + * // "type": "my_type", + * // "users": [], + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.insert * @memberOf! () * @@ -56596,6 +87409,78 @@ export namespace compute_alpha { /** * compute.regionDisks.list * @desc Retrieves the list of persistent disks contained within the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionDisks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.list * @memberOf! () * @@ -56673,6 +87558,91 @@ export namespace compute_alpha { /** * compute.regionDisks.removeResourcePolicies * @desc Removes resource policies from a regional disk. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.removeResourcePolicies({ + * // The disk name for this request. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourcePolicies": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.removeResourcePolicies * @memberOf! () * @@ -56753,6 +87723,91 @@ export namespace compute_alpha { /** * compute.regionDisks.resize * @desc Resizes the specified regional persistent disk. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.resize({ + * // Name of the regional persistent disk. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sizeGb": "my_sizeGb" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.resize * @memberOf! () * @@ -56831,6 +87886,69 @@ export namespace compute_alpha { /** * compute.regionDisks.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.setIamPolicy * @memberOf! () * @@ -56906,6 +88024,92 @@ export namespace compute_alpha { /** * compute.regionDisks.setLabels * @desc Sets the labels on the target regional disk. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.setLabels * @memberOf! () * @@ -56984,6 +88188,63 @@ export namespace compute_alpha { /** * compute.regionDisks.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionDisks.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.testIamPermissions * @memberOf! () * @@ -57403,6 +88664,66 @@ export namespace compute_alpha { /** * compute.regionDiskTypes.get * @desc Returns the specified regional disk type. Gets a list of available disk types by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionDiskTypes.get({ + * // Name of the disk type to return. + * diskType: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultDiskSizeGb": "my_defaultDiskSizeGb", + * // "deprecated": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "validDiskSize": "my_validDiskSize", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDiskTypes.get * @memberOf! () * @@ -57477,6 +88798,78 @@ export namespace compute_alpha { /** * compute.regionDiskTypes.list * @desc Retrieves a list of regional disk types available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionDiskTypes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDiskTypes.list * @memberOf! () * @@ -57621,6 +89014,83 @@ export namespace compute_alpha { /** * compute.regionHealthChecks.delete * @desc Deletes the specified HealthCheck resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionHealthChecks.delete({ + * // Name of the HealthCheck resource to delete. + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthChecks.delete * @memberOf! () * @@ -57698,6 +89168,75 @@ export namespace compute_alpha { /** * compute.regionHealthChecks.get * @desc Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionHealthChecks.get({ + * // Name of the HealthCheck resource to return. + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "grpcHealthCheck": {}, + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "udpHealthCheck": {}, + * // "unhealthyThreshold": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthChecks.get * @memberOf! () * @@ -57774,6 +89313,109 @@ export namespace compute_alpha { /** * compute.regionHealthChecks.insert * @desc Creates a HealthCheck resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionHealthChecks.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "grpcHealthCheck": {}, + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "udpHealthCheck": {}, + * // "unhealthyThreshold": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthChecks.insert * @memberOf! () * @@ -57851,6 +89493,78 @@ export namespace compute_alpha { /** * compute.regionHealthChecks.list * @desc Retrieves the list of HealthCheck resources available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionHealthChecks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthChecks.list * @memberOf! () * @@ -57931,6 +89645,111 @@ export namespace compute_alpha { /** * compute.regionHealthChecks.patch * @desc Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionHealthChecks.patch({ + * // Name of the HealthCheck resource to patch. + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "grpcHealthCheck": {}, + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "udpHealthCheck": {}, + * // "unhealthyThreshold": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthChecks.patch * @memberOf! () * @@ -58009,6 +89828,63 @@ export namespace compute_alpha { /** * compute.regionHealthChecks.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionHealthChecks.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthChecks.testIamPermissions * @memberOf! () * @@ -58090,6 +89966,111 @@ export namespace compute_alpha { /** * compute.regionHealthChecks.update * @desc Updates a HealthCheck resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionHealthChecks.update({ + * // Name of the HealthCheck resource to update. + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "grpcHealthCheck": {}, + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "udpHealthCheck": {}, + * // "unhealthyThreshold": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthChecks.update * @memberOf! () * @@ -58364,6 +90345,83 @@ export namespace compute_alpha { /** * compute.regionHealthCheckServices.delete * @desc Deletes the specified regional HealthCheckService. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionHealthCheckServices.delete({ + * // Name of the HealthCheckService to delete. The name must be 1-63 characters long, and comply with RFC1035. + * healthCheckService: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthCheckServices.delete * @memberOf! () * @@ -58441,6 +90499,68 @@ export namespace compute_alpha { /** * compute.regionHealthCheckServices.get * @desc Returns the specified regional HealthCheckService resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionHealthCheckServices.get({ + * // Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. + * healthCheckService: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "healthStatusAggregationPolicy": "my_healthStatusAggregationPolicy", + * // "healthStatusAggregationStrategy": "my_healthStatusAggregationStrategy", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networkEndpointGroups": [], + * // "notificationEndpoints": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthCheckServices.get * @memberOf! () * @@ -58517,6 +90637,102 @@ export namespace compute_alpha { /** * compute.regionHealthCheckServices.insert * @desc Creates a regional HealthCheckService resource in the specified project and region using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionHealthCheckServices.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "healthStatusAggregationPolicy": "my_healthStatusAggregationPolicy", + * // "healthStatusAggregationStrategy": "my_healthStatusAggregationStrategy", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networkEndpointGroups": [], + * // "notificationEndpoints": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthCheckServices.insert * @memberOf! () * @@ -58594,6 +90810,78 @@ export namespace compute_alpha { /** * compute.regionHealthCheckServices.list * @desc Lists all the HealthCheckService resources that have been configured for the specified project in the given region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionHealthCheckServices.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthCheckServices.list * @memberOf! () * @@ -58676,6 +90964,104 @@ export namespace compute_alpha { /** * compute.regionHealthCheckServices.patch * @desc Updates the specified regional HealthCheckService resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionHealthCheckServices.patch({ + * // Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. + * healthCheckService: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "healthStatusAggregationPolicy": "my_healthStatusAggregationPolicy", + * // "healthStatusAggregationStrategy": "my_healthStatusAggregationStrategy", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networkEndpointGroups": [], + * // "notificationEndpoints": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthCheckServices.patch * @memberOf! () * @@ -58754,6 +91140,63 @@ export namespace compute_alpha { /** * compute.regionHealthCheckServices.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionHealthCheckServices.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthCheckServices.testIamPermissions * @memberOf! () * @@ -59002,6 +91445,83 @@ export namespace compute_alpha { /** * compute.regionInPlaceSnapshots.delete * @desc Deletes the specified InPlaceSnapshot resource. Keep in mind that deleting a single inPlaceSnapshot might not necessarily delete all the data on that inPlaceSnapshot. If any data on the inPlaceSnapshot that is marked for deletion is needed for subsequent inPlaceSnapshots, the data will be moved to the next corresponding inPlaceSnapshot. For more information, see Deleting inPlaceSnapshots. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInPlaceSnapshots.delete({ + * // Name of the InPlaceSnapshot resource to delete. + * inPlaceSnapshot: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInPlaceSnapshots.delete * @memberOf! () * @@ -59079,6 +91599,70 @@ export namespace compute_alpha { /** * compute.regionInPlaceSnapshots.get * @desc Returns the specified InPlaceSnapshot resource in the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInPlaceSnapshots.get({ + * // Name of the InPlaceSnapshot resource to return. + * inPlaceSnapshot: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "guestFlush": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskId": "my_sourceDiskId", + * // "status": "my_status", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInPlaceSnapshots.get * @memberOf! () * @@ -59155,6 +91739,62 @@ export namespace compute_alpha { /** * compute.regionInPlaceSnapshots.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInPlaceSnapshots.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInPlaceSnapshots.getIamPolicy * @memberOf! () * @@ -59230,6 +91870,104 @@ export namespace compute_alpha { /** * compute.regionInPlaceSnapshots.insert * @desc Creates an in-place snapshot in the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInPlaceSnapshots.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "guestFlush": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskId": "my_sourceDiskId", + * // "status": "my_status", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInPlaceSnapshots.insert * @memberOf! () * @@ -59307,6 +92045,78 @@ export namespace compute_alpha { /** * compute.regionInPlaceSnapshots.list * @desc Retrieves the list of InPlaceSnapshot resources contained within the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInPlaceSnapshots.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInPlaceSnapshots.list * @memberOf! () * @@ -59387,6 +92197,69 @@ export namespace compute_alpha { /** * compute.regionInPlaceSnapshots.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInPlaceSnapshots.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInPlaceSnapshots.setIamPolicy * @memberOf! () * @@ -59462,6 +92335,92 @@ export namespace compute_alpha { /** * compute.regionInPlaceSnapshots.setLabels * @desc Sets the labels on a inPlaceSnapshot in the given region. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInPlaceSnapshots.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInPlaceSnapshots.setLabels * @memberOf! () * @@ -59540,6 +92499,63 @@ export namespace compute_alpha { /** * compute.regionInPlaceSnapshots.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInPlaceSnapshots.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInPlaceSnapshots.testIamPermissions * @memberOf! () * @@ -59837,6 +92853,91 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.abandonInstances * @desc Flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.abandonInstances({ + * // Name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.abandonInstances * @memberOf! () * @@ -59915,6 +93016,90 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.applyUpdatesToInstances * @desc Apply updates to selected instances the managed instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.applyUpdatesToInstances( + * { + * // The name of the managed instance group, should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request, should conform to RFC1035. + * region: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [], + * // "maximalAction": "my_maximalAction", + * // "minimalAction": "my_minimalAction", + * // "mostDisruptiveAllowedAction": "my_mostDisruptiveAllowedAction" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.applyUpdatesToInstances * @memberOf! () * @@ -59994,6 +93179,91 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.createInstances * @desc Creates instances with per-instance configs in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.createInstances({ + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region where the managed instance group is located. It should conform to RFC1035. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.createInstances * @memberOf! () * @@ -60072,6 +93342,83 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.delete * @desc Deletes the specified managed instance group and all of the instances in that group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.delete({ + * // Name of the managed instance group to delete. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.delete * @memberOf! () * @@ -60149,6 +93496,91 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.deleteInstances * @desc Flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.deleteInstances({ + * // Name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.deleteInstances * @memberOf! () * @@ -60227,6 +93659,87 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.deletePerInstanceConfigs * @desc Deletes selected per-instance configs for the managed instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.deletePerInstanceConfigs( + * { + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request, should conform to RFC1035. + * region: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "names": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.deletePerInstanceConfigs * @memberOf! () * @@ -60306,6 +93819,80 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.get * @desc Returns all of the details about the specified managed instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroupManagers.get({ + * // Name of the managed instance group to return. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "failoverAction": "my_failoverAction", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "pendingActions": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "serviceAccount": "my_serviceAccount", + * // "statefulPolicy": {}, + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.get * @memberOf! () * @@ -60384,6 +93971,114 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.insert * @desc Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. A regional managed instance group can contain up to 2000 instances. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "failoverAction": "my_failoverAction", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "pendingActions": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "serviceAccount": "my_serviceAccount", + * // "statefulPolicy": {}, + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.insert * @memberOf! () * @@ -60461,6 +94156,78 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.list * @desc Retrieves the list of managed instance groups that are contained within the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroupManagers.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: 'placeholder-value', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.list * @memberOf! () * @@ -60550,6 +94317,76 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.listErrors * @desc Lists all errors thrown by actions on instances for a given regional managed instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroupManagers.listErrors({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9][0-9]{0,19}. + * instanceGroupManager: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. This should conform to RFC1035. + * region: 'placeholder-value', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.listErrors * @memberOf! () * @@ -60656,6 +94493,74 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.listManagedInstances * @desc Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroupManagers.listManagedInstances({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "managedInstances": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.listManagedInstances * @memberOf! () * @@ -60760,6 +94665,77 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.listPerInstanceConfigs * @desc Lists all of the per-instance configs defined for the managed instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroupManagers.listPerInstanceConfigs({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request, should conform to RFC1035. + * region: 'placeholder-value', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "nextPageToken": "my_nextPageToken", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.listPerInstanceConfigs * @memberOf! () * @@ -60865,6 +94841,116 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.patch * @desc Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.patch({ + * // The name of the instance group manager. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "failoverAction": "my_failoverAction", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "pendingActions": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "serviceAccount": "my_serviceAccount", + * // "statefulPolicy": {}, + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.patch * @memberOf! () * @@ -60943,6 +95029,93 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.patchPerInstanceConfigs * @desc Insert or patch (for the ones that already exist) per-instance configs for the managed instance group. perInstanceConfig.instance serves as a key used to distinguish whether to perform insert or patch. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.patchPerInstanceConfigs( + * { + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request, should conform to RFC1035. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "perInstanceConfigs": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.patchPerInstanceConfigs * @memberOf! () * @@ -61023,6 +95196,91 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.recreateInstances * @desc Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.recreateInstances({ + * // Name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.recreateInstances * @memberOf! () * @@ -61101,6 +95359,85 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.resize * @desc Changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances. The resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.resize({ + * // Name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Number of instances that should exist in this instance group manager. + * size: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.resize * @memberOf! () * @@ -61179,6 +95516,91 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.setAutoHealingPolicies * @desc Modifies the autohealing policy for the instances in this managed instance group. [Deprecated] This method is deprecated. Please use Patch instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.setAutoHealingPolicies({ + * // Name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoHealingPolicies": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.setAutoHealingPolicies * @memberOf! () * @@ -61259,6 +95681,91 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.setInstanceTemplate * @desc Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.setInstanceTemplate({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instanceTemplate": "my_instanceTemplate" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.setInstanceTemplate * @memberOf! () * @@ -61337,6 +95844,92 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.setTargetPools * @desc Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.setTargetPools({ + * // Name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "targetPools": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.setTargetPools * @memberOf! () * @@ -61415,6 +96008,63 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroupManagers.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.testIamPermissions * @memberOf! () * @@ -61496,6 +96146,116 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.update * @desc Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is updated even if the instances in the group have not yet been updated. You must separately verify the status of the individual instances with the listmanagedinstances method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.update({ + * // The name of the instance group manager. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "failoverAction": "my_failoverAction", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "pendingActions": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "serviceAccount": "my_serviceAccount", + * // "statefulPolicy": {}, + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.update * @memberOf! () * @@ -61574,6 +96334,93 @@ export namespace compute_alpha { /** * compute.regionInstanceGroupManagers.updatePerInstanceConfigs * @desc Insert or update (for the ones that already exist) per-instance configs for the managed instance group. perInstanceConfig.instance serves as a key used to distinguish whether to perform insert or patch. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.updatePerInstanceConfigs( + * { + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request, should conform to RFC1035. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "perInstanceConfigs": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.updatePerInstanceConfigs * @memberOf! () * @@ -62305,6 +97152,68 @@ export namespace compute_alpha { /** * compute.regionInstanceGroups.get * @desc Returns the specified instance group resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroups.get({ + * // Name of the instance group resource to return. + * instanceGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroups.get * @memberOf! () * @@ -62381,6 +97290,78 @@ export namespace compute_alpha { /** * compute.regionInstanceGroups.list * @desc Retrieves the list of instance group resources contained within the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroups.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: 'placeholder-value', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroups.list * @memberOf! () * @@ -62463,6 +97444,89 @@ export namespace compute_alpha { /** * compute.regionInstanceGroups.listInstances * @desc Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroups.listInstances({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Name of the regional instance group for which we want to list the instances. + * instanceGroup: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: 'placeholder-value', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instanceState": "my_instanceState", + * // "portName": "my_portName" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroups.listInstances * @memberOf! () * @@ -62554,6 +97618,92 @@ export namespace compute_alpha { /** * compute.regionInstanceGroups.setNamedPorts * @desc Sets the named ports for the specified regional instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroups.setNamedPorts({ + * // The name of the regional instance group where the named ports are updated. + * instanceGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "namedPorts": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroups.setNamedPorts * @memberOf! () * @@ -62632,6 +97782,63 @@ export namespace compute_alpha { /** * compute.regionInstanceGroups.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroups.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroups.testIamPermissions * @memberOf! () * @@ -62876,6 +98083,94 @@ export namespace compute_alpha { /** * compute.regionInstances.bulkInsert * @desc Creates multiple instances in a given region. Count specifies the number of instances to create. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstances.bulkInsert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "count": "my_count", + * // "excludedZones": [], + * // "instance": {}, + * // "minCount": "my_minCount", + * // "predefinedNames": [], + * // "sourceInstanceTemplate": "my_sourceInstanceTemplate" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstances.bulkInsert * @memberOf! () * @@ -62986,6 +98281,83 @@ export namespace compute_alpha { /** * compute.regionNetworkEndpointGroups.delete * @desc Deletes the specified network endpoint group. Note that the NEG cannot be deleted if it is configured as a backend of a backend service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionNetworkEndpointGroups.delete({ + * // The name of the network endpoint group to delete. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region where the network endpoint group is located. It should comply with RFC1035. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionNetworkEndpointGroups.delete * @memberOf! () * @@ -63063,6 +98435,74 @@ export namespace compute_alpha { /** * compute.regionNetworkEndpointGroups.get * @desc Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionNetworkEndpointGroups.get({ + * // The name of the network endpoint group. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region where the network endpoint group is located. It should comply with RFC1035. + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "annotations": {}, + * // "appEngine": {}, + * // "cloudFunction": {}, + * // "cloudRun": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultPort": 0, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancer": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkEndpointType": "my_networkEndpointType", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "type": "my_type", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionNetworkEndpointGroups.get * @memberOf! () * @@ -63141,6 +98581,108 @@ export namespace compute_alpha { /** * compute.regionNetworkEndpointGroups.insert * @desc Creates a network endpoint group in the specified project using the parameters that are included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionNetworkEndpointGroups.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region where you want to create the network endpoint group. It should comply with RFC1035. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "annotations": {}, + * // "appEngine": {}, + * // "cloudFunction": {}, + * // "cloudRun": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultPort": 0, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancer": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkEndpointType": "my_networkEndpointType", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "type": "my_type", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionNetworkEndpointGroups.insert * @memberOf! () * @@ -63218,6 +98760,78 @@ export namespace compute_alpha { /** * compute.regionNetworkEndpointGroups.list * @desc Retrieves the list of regional network endpoint groups available to the specified project in the given region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionNetworkEndpointGroups.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region where the network endpoint group is located. It should comply with RFC1035. + * region: 'placeholder-value', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionNetworkEndpointGroups.list * @memberOf! () * @@ -63413,6 +99027,83 @@ export namespace compute_alpha { /** * compute.regionNotificationEndpoints.delete * @desc Deletes the specified NotificationEndpoint in the given region + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionNotificationEndpoints.delete({ + * // Name of the NotificationEndpoint resource to delete. + * notificationEndpoint: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionNotificationEndpoints.delete * @memberOf! () * @@ -63490,6 +99181,62 @@ export namespace compute_alpha { /** * compute.regionNotificationEndpoints.get * @desc Returns the specified NotificationEndpoint resource in the given region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionNotificationEndpoints.get({ + * // Name of the NotificationEndpoint resource to return. + * notificationEndpoint: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "grpcSettings": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionNotificationEndpoints.get * @memberOf! () * @@ -63568,6 +99315,96 @@ export namespace compute_alpha { /** * compute.regionNotificationEndpoints.insert * @desc Create a NotificationEndpoint in the specified project in the given region using the parameters that are included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionNotificationEndpoints.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "grpcSettings": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionNotificationEndpoints.insert * @memberOf! () * @@ -63645,6 +99482,78 @@ export namespace compute_alpha { /** * compute.regionNotificationEndpoints.list * @desc Lists the NotificationEndpoints for a project in the given region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionNotificationEndpoints.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionNotificationEndpoints.list * @memberOf! () * @@ -63727,6 +99636,63 @@ export namespace compute_alpha { /** * compute.regionNotificationEndpoints.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionNotificationEndpoints.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionNotificationEndpoints.testIamPermissions * @memberOf! () * @@ -63946,6 +99912,49 @@ export namespace compute_alpha { /** * compute.regionOperations.delete * @desc Deletes the specified region-specific Operations resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionOperations.delete({ + * // Name of the Operations resource to delete. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionOperations.delete * @memberOf! () * @@ -64020,6 +100029,78 @@ export namespace compute_alpha { /** * compute.regionOperations.get * @desc Retrieves the specified region-specific Operations resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionOperations.get({ + * // Name of the Operations resource to return. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionOperations.get * @memberOf! () * @@ -64096,6 +100177,78 @@ export namespace compute_alpha { /** * compute.regionOperations.list * @desc Retrieves a list of Operation resources contained within the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionOperations.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionOperations.list * @memberOf! () * @@ -64176,6 +100329,78 @@ export namespace compute_alpha { /** * compute.regionOperations.wait * @desc Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionOperations.wait({ + * // Name of the Operations resource to return. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionOperations.wait * @memberOf! () * @@ -64356,6 +100581,63 @@ export namespace compute_alpha { /** * compute.regions.get * @desc Returns the specified Region resource. Gets a list of available regions by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regions.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region resource to return. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "quotas": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "status": "my_status", + * // "zones": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regions.get * @memberOf! () * @@ -64427,6 +100709,76 @@ export namespace compute_alpha { /** * compute.regions.list * @desc Retrieves the list of region resources available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regions.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regions.list * @memberOf! () * @@ -64558,6 +100910,83 @@ export namespace compute_alpha { /** * compute.regionSslCertificates.delete * @desc Deletes the specified SslCertificate resource in the region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionSslCertificates.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the SslCertificate resource to delete. + * sslCertificate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionSslCertificates.delete * @memberOf! () * @@ -64635,6 +101064,69 @@ export namespace compute_alpha { /** * compute.regionSslCertificates.get * @desc Returns the specified SslCertificate resource in the specified region. Get a list of available SSL certificates by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionSslCertificates.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the SslCertificate resource to return. + * sslCertificate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificate": "my_certificate", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "managed": {}, + * // "name": "my_name", + * // "privateKey": "my_privateKey", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "selfManaged": {}, + * // "subjectAlternativeNames": [], + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionSslCertificates.get * @memberOf! () * @@ -64711,6 +101203,103 @@ export namespace compute_alpha { /** * compute.regionSslCertificates.insert * @desc Creates a SslCertificate resource in the specified project and region using the data included in the request + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionSslCertificates.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "certificate": "my_certificate", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "managed": {}, + * // "name": "my_name", + * // "privateKey": "my_privateKey", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "selfManaged": {}, + * // "subjectAlternativeNames": [], + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionSslCertificates.insert * @memberOf! () * @@ -64788,6 +101377,78 @@ export namespace compute_alpha { /** * compute.regionSslCertificates.list * @desc Retrieves the list of SslCertificate resources available to the specified project in the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionSslCertificates.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionSslCertificates.list * @memberOf! () * @@ -64868,6 +101529,63 @@ export namespace compute_alpha { /** * compute.regionSslCertificates.testIamPermissions * @desc Returns permissions that a caller has on the specified resource and region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionSslCertificates.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionSslCertificates.testIamPermissions * @memberOf! () * @@ -65087,6 +101805,83 @@ export namespace compute_alpha { /** * compute.regionTargetHttpProxies.delete * @desc Deletes the specified TargetHttpProxy resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpProxies.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpProxy resource to delete. + * targetHttpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpProxies.delete * @memberOf! () * @@ -65164,6 +101959,65 @@ export namespace compute_alpha { /** * compute.regionTargetHttpProxies.get * @desc Returns the specified TargetHttpProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionTargetHttpProxies.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the TargetHttpProxy resource to return. + * targetHttpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "httpFilters": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyBind": false, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "urlMap": "my_urlMap" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpProxies.get * @memberOf! () * @@ -65240,6 +102094,99 @@ export namespace compute_alpha { /** * compute.regionTargetHttpProxies.insert * @desc Creates a TargetHttpProxy resource in the specified project and region using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpProxies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "httpFilters": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyBind": false, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "urlMap": "my_urlMap" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpProxies.insert * @memberOf! () * @@ -65317,6 +102264,78 @@ export namespace compute_alpha { /** * compute.regionTargetHttpProxies.list * @desc Retrieves the list of TargetHttpProxy resources available to the specified project in the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionTargetHttpProxies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpProxies.list * @memberOf! () * @@ -65397,6 +102416,91 @@ export namespace compute_alpha { /** * compute.regionTargetHttpProxies.setUrlMap * @desc Changes the URL map for TargetHttpProxy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpProxies.setUrlMap({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpProxy to set a URL map for. + * targetHttpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "urlMap": "my_urlMap" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpProxies.setUrlMap * @memberOf! () * @@ -65475,6 +102579,63 @@ export namespace compute_alpha { /** * compute.regionTargetHttpProxies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionTargetHttpProxies.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpProxies.testIamPermissions * @memberOf! () * @@ -65723,6 +102884,83 @@ export namespace compute_alpha { /** * compute.regionTargetHttpsProxies.delete * @desc Deletes the specified TargetHttpsProxy resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpsProxies.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpsProxy resource to delete. + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpsProxies.delete * @memberOf! () * @@ -65800,6 +103038,70 @@ export namespace compute_alpha { /** * compute.regionTargetHttpsProxies.get * @desc Returns the specified TargetHttpsProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionTargetHttpsProxies.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the TargetHttpsProxy resource to return. + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authentication": "my_authentication", + * // "authorization": "my_authorization", + * // "certificateMap": "my_certificateMap", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyBind": false, + * // "quicOverride": "my_quicOverride", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sslCertificates": [], + * // "sslPolicy": "my_sslPolicy", + * // "urlMap": "my_urlMap" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpsProxies.get * @memberOf! () * @@ -65876,6 +103178,104 @@ export namespace compute_alpha { /** * compute.regionTargetHttpsProxies.insert * @desc Creates a TargetHttpsProxy resource in the specified project and region using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpsProxies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "authentication": "my_authentication", + * // "authorization": "my_authorization", + * // "certificateMap": "my_certificateMap", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyBind": false, + * // "quicOverride": "my_quicOverride", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sslCertificates": [], + * // "sslPolicy": "my_sslPolicy", + * // "urlMap": "my_urlMap" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpsProxies.insert * @memberOf! () * @@ -65953,6 +103353,78 @@ export namespace compute_alpha { /** * compute.regionTargetHttpsProxies.list * @desc Retrieves the list of TargetHttpsProxy resources available to the specified project in the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionTargetHttpsProxies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpsProxies.list * @memberOf! () * @@ -66035,6 +103507,91 @@ export namespace compute_alpha { /** * compute.regionTargetHttpsProxies.setSslCertificates * @desc Replaces SslCertificates for TargetHttpsProxy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpsProxies.setSslCertificates({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sslCertificates": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpsProxies.setSslCertificates * @memberOf! () * @@ -66113,6 +103670,91 @@ export namespace compute_alpha { /** * compute.regionTargetHttpsProxies.setUrlMap * @desc Changes the URL map for TargetHttpsProxy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpsProxies.setUrlMap({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpsProxy to set a URL map for. + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "urlMap": "my_urlMap" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpsProxies.setUrlMap * @memberOf! () * @@ -66191,6 +103833,63 @@ export namespace compute_alpha { /** * compute.regionTargetHttpsProxies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionTargetHttpsProxies.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpsProxies.testIamPermissions * @memberOf! () * @@ -66468,6 +104167,79 @@ export namespace compute_alpha { /** * compute.regionUrlMaps.delete * @desc Deletes the specified UrlMap resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionUrlMaps.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * requestId: 'placeholder-value', + * // Name of the UrlMap resource to delete. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.delete * @memberOf! () * @@ -66545,6 +104317,69 @@ export namespace compute_alpha { /** * compute.regionUrlMaps.get * @desc Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionUrlMaps.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the UrlMap resource to return. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.get * @memberOf! () * @@ -66619,6 +104454,99 @@ export namespace compute_alpha { /** * compute.regionUrlMaps.insert * @desc Creates a UrlMap resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionUrlMaps.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.insert * @memberOf! () * @@ -66696,6 +104624,88 @@ export namespace compute_alpha { /** * compute.regionUrlMaps.invalidateCache * @desc Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionUrlMaps.invalidateCache({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * requestId: 'placeholder-value', + * // Name of the UrlMap scoping this request. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "host": "my_host", + * // "path": "my_path" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.invalidateCache * @memberOf! () * @@ -66774,6 +104784,78 @@ export namespace compute_alpha { /** * compute.regionUrlMaps.list * @desc Retrieves the list of UrlMap resources available to the specified project in the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionUrlMaps.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.list * @memberOf! () * @@ -66854,6 +104936,101 @@ export namespace compute_alpha { /** * compute.regionUrlMaps.patch * @desc Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionUrlMaps.patch({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * requestId: 'placeholder-value', + * // Name of the UrlMap resource to patch. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.patch * @memberOf! () * @@ -66932,6 +105109,63 @@ export namespace compute_alpha { /** * compute.regionUrlMaps.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionUrlMaps.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.testIamPermissions * @memberOf! () * @@ -67013,6 +105247,101 @@ export namespace compute_alpha { /** * compute.regionUrlMaps.update * @desc Updates the specified UrlMap resource with the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionUrlMaps.update({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * requestId: 'placeholder-value', + * // Name of the UrlMap resource to update. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.update * @memberOf! () * @@ -67091,6 +105420,62 @@ export namespace compute_alpha { /** * compute.regionUrlMaps.validate * @desc Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionUrlMaps.validate({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the UrlMap resource to be validated as. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resource": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "result": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.validate * @memberOf! () * @@ -67422,6 +105807,79 @@ export namespace compute_alpha { /** * compute.reservations.aggregatedList * @desc Retrieves an aggregated list of reservations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.reservations.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.aggregatedList * @memberOf! () * @@ -67509,6 +105967,83 @@ export namespace compute_alpha { /** * compute.reservations.delete * @desc Deletes the specified reservation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.reservations.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the reservation to delete. + * reservation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.delete * @memberOf! () * @@ -67586,6 +106121,66 @@ export namespace compute_alpha { /** * compute.reservations.get * @desc Retrieves information about the specified reservation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.reservations.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the reservation to retrieve. + * reservation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "commitment": "my_commitment", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "specificReservation": {}, + * // "specificReservationRequired": false, + * // "status": "my_status", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.get * @memberOf! () * @@ -67661,6 +106256,62 @@ export namespace compute_alpha { /** * compute.reservations.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.reservations.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.getIamPolicy * @memberOf! () * @@ -67736,6 +106387,100 @@ export namespace compute_alpha { /** * compute.reservations.insert * @desc Creates a new reservation. For more information, read Reserving zonal resources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.reservations.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "commitment": "my_commitment", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "specificReservation": {}, + * // "specificReservationRequired": false, + * // "status": "my_status", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.insert * @memberOf! () * @@ -67813,6 +106558,78 @@ export namespace compute_alpha { /** * compute.reservations.list * @desc A list of all the reservations that have been configured for the specified project in specified zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.reservations.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.list * @memberOf! () * @@ -67893,6 +106710,91 @@ export namespace compute_alpha { /** * compute.reservations.resize * @desc Resizes the reservation (applicable to standalone reservations only). For more information, read Modifying reservations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.reservations.resize({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the reservation to update. + * reservation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "specificSkuCount": "my_specificSkuCount" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.resize * @memberOf! () * @@ -67971,6 +106873,69 @@ export namespace compute_alpha { /** * compute.reservations.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.reservations.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.setIamPolicy * @memberOf! () * @@ -68046,6 +107011,63 @@ export namespace compute_alpha { /** * compute.reservations.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.reservations.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.testIamPermissions * @memberOf! () * @@ -68378,6 +107400,80 @@ export namespace compute_alpha { /** * compute.resourcePolicies.aggregatedList * @desc Retrieves an aggregated list of resource policies. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.resourcePolicies.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.aggregatedList * @memberOf! () * @@ -68467,6 +107563,83 @@ export namespace compute_alpha { /** * compute.resourcePolicies.delete * @desc Deletes the specified resource policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.resourcePolicies.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the resource policy to delete. + * resourcePolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.delete * @memberOf! () * @@ -68544,6 +107717,66 @@ export namespace compute_alpha { /** * compute.resourcePolicies.get * @desc Retrieves all information of the specified resource policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.resourcePolicies.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the resource policy to retrieve. + * resourcePolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "groupPlacementPolicy": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "snapshotSchedulePolicy": {}, + * // "status": "my_status", + * // "vmMaintenancePolicy": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.get * @memberOf! () * @@ -68620,6 +107853,62 @@ export namespace compute_alpha { /** * compute.resourcePolicies.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.resourcePolicies.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.getIamPolicy * @memberOf! () * @@ -68695,6 +107984,100 @@ export namespace compute_alpha { /** * compute.resourcePolicies.insert * @desc Creates a new resource policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.resourcePolicies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "groupPlacementPolicy": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "snapshotSchedulePolicy": {}, + * // "status": "my_status", + * // "vmMaintenancePolicy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.insert * @memberOf! () * @@ -68772,6 +108155,79 @@ export namespace compute_alpha { /** * compute.resourcePolicies.list * @desc A list all the resource policies that have been configured for the specified project in specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.resourcePolicies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.list * @memberOf! () * @@ -68852,6 +108308,69 @@ export namespace compute_alpha { /** * compute.resourcePolicies.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.resourcePolicies.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.setIamPolicy * @memberOf! () * @@ -68927,6 +108446,63 @@ export namespace compute_alpha { /** * compute.resourcePolicies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.resourcePolicies.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.testIamPermissions * @memberOf! () * @@ -69231,6 +108807,79 @@ export namespace compute_alpha { /** * compute.routers.aggregatedList * @desc Retrieves an aggregated list of routers. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routers.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.routers.aggregatedList * @memberOf! () * @@ -69314,6 +108963,83 @@ export namespace compute_alpha { /** * compute.routers.delete * @desc Deletes the specified Router resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.routers.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the Router resource to delete. + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.routers.delete * @memberOf! () * @@ -69390,6 +109116,67 @@ export namespace compute_alpha { /** * compute.routers.get * @desc Returns the specified Router resource. Gets a list of available routers by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routers.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the Router resource to return. + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bgp": {}, + * // "bgpPeers": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "nats": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.routers.get * @memberOf! () * @@ -69463,6 +109250,82 @@ export namespace compute_alpha { /** * compute.routers.getNatMappingInfo * @desc Retrieves runtime Nat mapping information of VM endpoints. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routers.getNatMappingInfo({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Name of the nat service to filter the Nat Mapping information. If it is omitted, all nats for this router will be returned. Name should conform to RFC1035. + * natName: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // Name of the Router resource to query for Nat Mapping information of VM endpoints. + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "result": [], + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.routers.getNatMappingInfo * @memberOf! () * @@ -69552,6 +109415,56 @@ export namespace compute_alpha { /** * compute.routers.getRouterStatus * @desc Retrieves runtime information of the specified router. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routers.getRouterStatus({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the Router resource to query. + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "result": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.routers.getRouterStatus * @memberOf! () * @@ -69632,6 +109545,101 @@ export namespace compute_alpha { /** * compute.routers.insert * @desc Creates a Router resource in the specified project and region using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.routers.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bgp": {}, + * // "bgpPeers": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "nats": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.routers.insert * @memberOf! () * @@ -69708,6 +109716,78 @@ export namespace compute_alpha { /** * compute.routers.list * @desc Retrieves a list of Router resources available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routers.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.routers.list * @memberOf! () * @@ -69787,6 +109867,103 @@ export namespace compute_alpha { /** * compute.routers.patch * @desc Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.routers.patch({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the Router resource to patch. + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bgp": {}, + * // "bgpPeers": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "nats": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.routers.patch * @memberOf! () * @@ -69864,6 +110041,75 @@ export namespace compute_alpha { /** * compute.routers.preview * @desc Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routers.preview({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the Router resource to query. + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bgp": {}, + * // "bgpPeers": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "nats": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "resource": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.routers.preview * @memberOf! () * @@ -69944,6 +110190,63 @@ export namespace compute_alpha { /** * compute.routers.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routers.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.routers.testIamPermissions * @memberOf! () * @@ -70025,6 +110328,103 @@ export namespace compute_alpha { /** * compute.routers.update * @desc Updates the specified Router resource with the data included in the request. This method conforms to PUT semantics, which requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.routers.update({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the Router resource to update. + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bgp": {}, + * // "bgpPeers": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "nats": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.routers.update * @memberOf! () * @@ -70416,6 +110816,81 @@ export namespace compute_alpha { /** * compute.routes.delete * @desc Deletes the specified Route resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.routes.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the Route resource to delete. + * route: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.routes.delete * @memberOf! () * @@ -70491,6 +110966,72 @@ export namespace compute_alpha { /** * compute.routes.get * @desc Returns the specified Route resource. Gets a list of available routes by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routes.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the Route resource to return. + * route: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "destRange": "my_destRange", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "network": "my_network", + * // "nextHopGateway": "my_nextHopGateway", + * // "nextHopIlb": "my_nextHopIlb", + * // "nextHopInstance": "my_nextHopInstance", + * // "nextHopInterconnectAttachment": "my_nextHopInterconnectAttachment", + * // "nextHopIp": "my_nextHopIp", + * // "nextHopNetwork": "my_nextHopNetwork", + * // "nextHopPeering": "my_nextHopPeering", + * // "nextHopVpnTunnel": "my_nextHopVpnTunnel", + * // "priority": 0, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "tags": [], + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.routes.get * @memberOf! () * @@ -70563,6 +111104,106 @@ export namespace compute_alpha { /** * compute.routes.insert * @desc Creates a Route resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.routes.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "destRange": "my_destRange", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "network": "my_network", + * // "nextHopGateway": "my_nextHopGateway", + * // "nextHopIlb": "my_nextHopIlb", + * // "nextHopInstance": "my_nextHopInstance", + * // "nextHopInterconnectAttachment": "my_nextHopInterconnectAttachment", + * // "nextHopIp": "my_nextHopIp", + * // "nextHopNetwork": "my_nextHopNetwork", + * // "nextHopPeering": "my_nextHopPeering", + * // "nextHopVpnTunnel": "my_nextHopVpnTunnel", + * // "priority": 0, + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "tags": [], + * // "warnings": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.routes.insert * @memberOf! () * @@ -70637,6 +111278,76 @@ export namespace compute_alpha { /** * compute.routes.list * @desc Retrieves the list of Route resources available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.routes.list * @memberOf! () * @@ -70714,6 +111425,61 @@ export namespace compute_alpha { /** * compute.routes.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routes.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.routes.testIamPermissions * @memberOf! () * @@ -70908,6 +111674,96 @@ export namespace compute_alpha { /** * compute.securityPolicies.addRule * @desc Inserts a rule into a security policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.addRule({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the security policy to update. + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // If true, the request will not be committed. + * validateOnly: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "direction": "my_direction", + * // "enableLogging": false, + * // "kind": "my_kind", + * // "match": {}, + * // "preview": false, + * // "priority": 0, + * // "rateLimitOptions": {}, + * // "ruleTupleCount": 0, + * // "targetResources": [], + * // "targetServiceAccounts": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.addRule * @memberOf! () * @@ -70985,6 +111841,81 @@ export namespace compute_alpha { /** * compute.securityPolicies.delete * @desc Deletes the specified policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to delete. + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.delete * @memberOf! () * @@ -71061,6 +111992,69 @@ export namespace compute_alpha { /** * compute.securityPolicies.get * @desc List all of the ordered rules present in a single specified policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.securityPolicies.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the security policy to get. + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "associations": [], + * // "cloudArmorConfig": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "parent": "my_parent", + * // "ruleTupleCount": 0, + * // "rules": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.get * @memberOf! () * @@ -71136,6 +112130,66 @@ export namespace compute_alpha { /** * compute.securityPolicies.getRule * @desc Gets a rule at the specified priority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.securityPolicies.getRule({ + * // The priority of the rule to get from the security policy. + * priority: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the security policy to which the queried rule belongs. + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "direction": "my_direction", + * // "enableLogging": false, + * // "kind": "my_kind", + * // "match": {}, + * // "preview": false, + * // "priority": 0, + * // "rateLimitOptions": {}, + * // "ruleTupleCount": 0, + * // "targetResources": [], + * // "targetServiceAccounts": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.getRule * @memberOf! () * @@ -71212,6 +112266,105 @@ export namespace compute_alpha { /** * compute.securityPolicies.insert * @desc Creates a new policy in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // If true, the request will not be committed. + * validateOnly: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "associations": [], + * // "cloudArmorConfig": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "parent": "my_parent", + * // "ruleTupleCount": 0, + * // "rules": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.insert * @memberOf! () * @@ -71289,6 +112442,75 @@ export namespace compute_alpha { /** * compute.securityPolicies.list * @desc List all the policies that have been configured for the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.securityPolicies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.list * @memberOf! () * @@ -71368,6 +112590,70 @@ export namespace compute_alpha { /** * compute.securityPolicies.listPreconfiguredExpressionSets * @desc Gets the current list of preconfigured Web Application Firewall (WAF) expressions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.listPreconfiguredExpressionSets({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "preconfiguredExpressionSets": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.listPreconfiguredExpressionSets * @memberOf! () * @@ -71473,6 +112759,105 @@ export namespace compute_alpha { /** * compute.securityPolicies.patch * @desc Patches the specified policy with the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.patch({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to update. + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "associations": [], + * // "cloudArmorConfig": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "parent": "my_parent", + * // "ruleTupleCount": 0, + * // "rules": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.patch * @memberOf! () * @@ -71550,6 +112935,98 @@ export namespace compute_alpha { /** * compute.securityPolicies.patchRule * @desc Patches a rule at the specified priority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.patchRule({ + * // The priority of the rule to patch. + * priority: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the security policy to update. + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // If true, the request will not be committed. + * validateOnly: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "direction": "my_direction", + * // "enableLogging": false, + * // "kind": "my_kind", + * // "match": {}, + * // "preview": false, + * // "priority": 0, + * // "rateLimitOptions": {}, + * // "ruleTupleCount": 0, + * // "targetResources": [], + * // "targetServiceAccounts": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.patchRule * @memberOf! () * @@ -71628,6 +113105,77 @@ export namespace compute_alpha { /** * compute.securityPolicies.removeRule * @desc Deletes a rule at the specified priority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.removeRule({ + * // The priority of the rule to remove from the security policy. + * priority: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the security policy to update. + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.removeRule * @memberOf! () * @@ -71704,6 +113252,84 @@ export namespace compute_alpha { /** * compute.securityPolicies.setLabels * @desc Sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.setLabels * @memberOf! () * @@ -71780,6 +113406,61 @@ export namespace compute_alpha { /** * compute.securityPolicies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.securityPolicies.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.testIamPermissions * @memberOf! () * @@ -72154,6 +113835,83 @@ export namespace compute_alpha { /** * compute.serviceAttachments.delete * @desc Deletes the specified ServiceAttachment in the given scope + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.serviceAttachments.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region of this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the ServiceAttachment resource to delete. + * serviceAttachment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.serviceAttachments.delete * @memberOf! () * @@ -72231,6 +113989,65 @@ export namespace compute_alpha { /** * compute.serviceAttachments.get * @desc Returns the specified ServiceAttachment resource in the given scope. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.serviceAttachments.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region of this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the ServiceAttachment resource to return. + * serviceAttachment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "connectionPreference": "my_connectionPreference", + * // "consumerForwardingRules": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "natIpCidrRanges": [], + * // "producerForwardingRule": "my_producerForwardingRule", + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.serviceAttachments.get * @memberOf! () * @@ -72307,6 +114124,62 @@ export namespace compute_alpha { /** * compute.serviceAttachments.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.serviceAttachments.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.serviceAttachments.getIamPolicy * @memberOf! () * @@ -72382,6 +114255,99 @@ export namespace compute_alpha { /** * compute.serviceAttachments.insert * @desc Creates a ServiceAttachment in the specified project in the given scope using the parameters that are included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.serviceAttachments.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region of this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "connectionPreference": "my_connectionPreference", + * // "consumerForwardingRules": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "natIpCidrRanges": [], + * // "producerForwardingRule": "my_producerForwardingRule", + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.serviceAttachments.insert * @memberOf! () * @@ -72459,6 +114425,78 @@ export namespace compute_alpha { /** * compute.serviceAttachments.list * @desc Lists the ServiceAttachments for a project in the given scope. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.serviceAttachments.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region of this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.serviceAttachments.list * @memberOf! () * @@ -72541,6 +114579,69 @@ export namespace compute_alpha { /** * compute.serviceAttachments.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.serviceAttachments.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.serviceAttachments.setIamPolicy * @memberOf! () * @@ -72616,6 +114717,63 @@ export namespace compute_alpha { /** * compute.serviceAttachments.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.serviceAttachments.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.serviceAttachments.testIamPermissions * @memberOf! () * @@ -72884,6 +115042,81 @@ export namespace compute_alpha { /** * compute.snapshots.delete * @desc Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. For more information, see Deleting snapshots. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.snapshots.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the Snapshot resource to delete. + * snapshot: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.snapshots.delete * @memberOf! () * @@ -72959,6 +115192,75 @@ export namespace compute_alpha { /** * compute.snapshots.get * @desc Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.snapshots.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the Snapshot resource to return. + * snapshot: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoCreated": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "downloadBytes": "my_downloadBytes", + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "snapshotEncryptionKey": {}, + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskEncryptionKey": {}, + * // "sourceDiskId": "my_sourceDiskId", + * // "status": "my_status", + * // "storageBytes": "my_storageBytes", + * // "storageBytesStatus": "my_storageBytesStatus", + * // "storageLocations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.snapshots.get * @memberOf! () * @@ -73031,6 +115333,60 @@ export namespace compute_alpha { /** * compute.snapshots.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.snapshots.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.snapshots.getIamPolicy * @memberOf! () * @@ -73105,6 +115461,76 @@ export namespace compute_alpha { /** * compute.snapshots.list * @desc Retrieves the list of Snapshot resources contained within the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.snapshots.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.snapshots.list * @memberOf! () * @@ -73182,6 +115608,67 @@ export namespace compute_alpha { /** * compute.snapshots.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.snapshots.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.snapshots.setIamPolicy * @memberOf! () * @@ -73256,6 +115743,84 @@ export namespace compute_alpha { /** * compute.snapshots.setLabels * @desc Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.snapshots.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.snapshots.setLabels * @memberOf! () * @@ -73332,6 +115897,61 @@ export namespace compute_alpha { /** * compute.snapshots.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.snapshots.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.snapshots.testIamPermissions * @memberOf! () * @@ -73568,6 +116188,79 @@ export namespace compute_alpha { /** * compute.sslCertificates.aggregatedList * @desc Retrieves the list of all SslCertificate resources, regional and global, available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslCertificates.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Name of the project scoping this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslCertificates.aggregatedList * @memberOf! () * @@ -73657,6 +116350,81 @@ export namespace compute_alpha { /** * compute.sslCertificates.delete * @desc Deletes the specified SslCertificate resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.sslCertificates.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the SslCertificate resource to delete. + * sslCertificate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslCertificates.delete * @memberOf! () * @@ -73733,6 +116501,67 @@ export namespace compute_alpha { /** * compute.sslCertificates.get * @desc Returns the specified SslCertificate resource. Gets a list of available SSL certificates by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslCertificates.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the SslCertificate resource to return. + * sslCertificate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificate": "my_certificate", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "managed": {}, + * // "name": "my_name", + * // "privateKey": "my_privateKey", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "selfManaged": {}, + * // "subjectAlternativeNames": [], + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslCertificates.get * @memberOf! () * @@ -73808,6 +116637,101 @@ export namespace compute_alpha { /** * compute.sslCertificates.insert * @desc Creates a SslCertificate resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.sslCertificates.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "certificate": "my_certificate", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "managed": {}, + * // "name": "my_name", + * // "privateKey": "my_privateKey", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "selfManaged": {}, + * // "subjectAlternativeNames": [], + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslCertificates.insert * @memberOf! () * @@ -73884,6 +116808,76 @@ export namespace compute_alpha { /** * compute.sslCertificates.list * @desc Retrieves the list of SslCertificate resources available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslCertificates.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslCertificates.list * @memberOf! () * @@ -73963,6 +116957,61 @@ export namespace compute_alpha { /** * compute.sslCertificates.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslCertificates.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslCertificates.testIamPermissions * @memberOf! () * @@ -74197,6 +117246,81 @@ export namespace compute_alpha { /** * compute.sslPolicies.delete * @desc Deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.sslPolicies.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. + * sslPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslPolicies.delete * @memberOf! () * @@ -74273,6 +117397,66 @@ export namespace compute_alpha { /** * compute.sslPolicies.get * @desc Lists all of the ordered rules present in a single specified policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslPolicies.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * sslPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "customFeatures": [], + * // "description": "my_description", + * // "enabledFeatures": [], + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "minTlsVersion": "my_minTlsVersion", + * // "name": "my_name", + * // "profile": "my_profile", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "tlsSettings": {}, + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslPolicies.get * @memberOf! () * @@ -74347,6 +117531,100 @@ export namespace compute_alpha { /** * compute.sslPolicies.insert * @desc Returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.sslPolicies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "customFeatures": [], + * // "description": "my_description", + * // "enabledFeatures": [], + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "minTlsVersion": "my_minTlsVersion", + * // "name": "my_name", + * // "profile": "my_profile", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "tlsSettings": {}, + * // "warnings": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslPolicies.insert * @memberOf! () * @@ -74422,6 +117700,76 @@ export namespace compute_alpha { /** * compute.sslPolicies.list * @desc Lists all the SSL policies that have been configured for the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslPolicies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslPolicies.list * @memberOf! () * @@ -74499,6 +117847,71 @@ export namespace compute_alpha { /** * compute.sslPolicies.listAvailableFeatures * @desc Lists all features that can be specified in the SSL policy when using custom profile. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslPolicies.listAvailableFeatures({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "features": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslPolicies.listAvailableFeatures * @memberOf! () * @@ -74595,6 +118008,102 @@ export namespace compute_alpha { /** * compute.sslPolicies.patch * @desc Patches the specified SSL policy with the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.sslPolicies.patch({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * sslPolicy: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "customFeatures": [], + * // "description": "my_description", + * // "enabledFeatures": [], + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "minTlsVersion": "my_minTlsVersion", + * // "name": "my_name", + * // "profile": "my_profile", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "tlsSettings": {}, + * // "warnings": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslPolicies.patch * @memberOf! () * @@ -74672,6 +118181,61 @@ export namespace compute_alpha { /** * compute.sslPolicies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslPolicies.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslPolicies.testIamPermissions * @memberOf! () * @@ -74925,6 +118489,79 @@ export namespace compute_alpha { /** * compute.subnetworks.aggregatedList * @desc Retrieves an aggregated list of subnetworks. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.subnetworks.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.subnetworks.aggregatedList * @memberOf! () * @@ -75009,6 +118646,83 @@ export namespace compute_alpha { /** * compute.subnetworks.delete * @desc Deletes the specified subnetwork. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.subnetworks.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the Subnetwork resource to delete. + * subnetwork: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.subnetworks.delete * @memberOf! () * @@ -75086,6 +118800,91 @@ export namespace compute_alpha { /** * compute.subnetworks.expandIpCidrRange * @desc Expands the IP CIDR range of the subnetwork to a specified value. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.subnetworks.expandIpCidrRange({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the Subnetwork resource to update. + * subnetwork: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ipCidrRange": "my_ipCidrRange" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.subnetworks.expandIpCidrRange * @memberOf! () * @@ -75164,6 +118963,81 @@ export namespace compute_alpha { /** * compute.subnetworks.get * @desc Returns the specified subnetwork. Gets a list of available subnetworks list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.subnetworks.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the Subnetwork resource to return. + * subnetwork: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "aggregationInterval": "my_aggregationInterval", + * // "allowSubnetCidrRoutesOverlap": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableFlowLogs": false, + * // "enablePrivateV6Access": false, + * // "fingerprint": "my_fingerprint", + * // "flowSampling": {}, + * // "gatewayAddress": "my_gatewayAddress", + * // "id": "my_id", + * // "ipCidrRange": "my_ipCidrRange", + * // "ipv6CidrRange": "my_ipv6CidrRange", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "metadata": "my_metadata", + * // "name": "my_name", + * // "network": "my_network", + * // "privateIpGoogleAccess": false, + * // "privateIpv6GoogleAccess": "my_privateIpv6GoogleAccess", + * // "privateIpv6GoogleAccessServiceAccounts": [], + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "role": "my_role", + * // "secondaryIpRanges": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.subnetworks.get * @memberOf! () * @@ -75239,6 +119113,62 @@ export namespace compute_alpha { /** * compute.subnetworks.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.subnetworks.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.subnetworks.getIamPolicy * @memberOf! () * @@ -75314,6 +119244,115 @@ export namespace compute_alpha { /** * compute.subnetworks.insert * @desc Creates a subnetwork in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.subnetworks.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "aggregationInterval": "my_aggregationInterval", + * // "allowSubnetCidrRoutesOverlap": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableFlowLogs": false, + * // "enablePrivateV6Access": false, + * // "fingerprint": "my_fingerprint", + * // "flowSampling": {}, + * // "gatewayAddress": "my_gatewayAddress", + * // "id": "my_id", + * // "ipCidrRange": "my_ipCidrRange", + * // "ipv6CidrRange": "my_ipv6CidrRange", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "metadata": "my_metadata", + * // "name": "my_name", + * // "network": "my_network", + * // "privateIpGoogleAccess": false, + * // "privateIpv6GoogleAccess": "my_privateIpv6GoogleAccess", + * // "privateIpv6GoogleAccessServiceAccounts": [], + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "role": "my_role", + * // "secondaryIpRanges": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.subnetworks.insert * @memberOf! () * @@ -75391,6 +119430,78 @@ export namespace compute_alpha { /** * compute.subnetworks.list * @desc Retrieves a list of subnetworks available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.subnetworks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.subnetworks.list * @memberOf! () * @@ -75470,6 +119581,76 @@ export namespace compute_alpha { /** * compute.subnetworks.listUsable * @desc Retrieves an aggregated list of all usable subnetworks in the project. The list contains all of the subnetworks in the project and the subnetworks that were shared by a Shared VPC host project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.subnetworks.listUsable({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.subnetworks.listUsable * @memberOf! () * @@ -75558,6 +119739,119 @@ export namespace compute_alpha { /** * compute.subnetworks.patch * @desc Patches the specified subnetwork with the data included in the request. Only certain fields can up updated with a patch request as indicated in the field descriptions. You must specify the current fingerprint of the subnetwork resource being patched. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.subnetworks.patch({ + * // The drain timeout specifies the upper bound in seconds on the amount of time allowed to drain connections from the current ACTIVE subnetwork to the current BACKUP subnetwork. The drain timeout is only applicable when the following conditions are true: - the subnetwork being patched has purpose = INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role = BACKUP - the patch request is setting the role to ACTIVE. Note that after this patch operation the roles of the ACTIVE and BACKUP subnetworks will be swapped. + * drainTimeoutSeconds: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the Subnetwork resource to patch. + * subnetwork: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "aggregationInterval": "my_aggregationInterval", + * // "allowSubnetCidrRoutesOverlap": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableFlowLogs": false, + * // "enablePrivateV6Access": false, + * // "fingerprint": "my_fingerprint", + * // "flowSampling": {}, + * // "gatewayAddress": "my_gatewayAddress", + * // "id": "my_id", + * // "ipCidrRange": "my_ipCidrRange", + * // "ipv6CidrRange": "my_ipv6CidrRange", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "metadata": "my_metadata", + * // "name": "my_name", + * // "network": "my_network", + * // "privateIpGoogleAccess": false, + * // "privateIpv6GoogleAccess": "my_privateIpv6GoogleAccess", + * // "privateIpv6GoogleAccessServiceAccounts": [], + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "role": "my_role", + * // "secondaryIpRanges": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.subnetworks.patch * @memberOf! () * @@ -75637,6 +119931,69 @@ export namespace compute_alpha { /** * compute.subnetworks.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.subnetworks.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.subnetworks.setIamPolicy * @memberOf! () * @@ -75712,6 +120069,91 @@ export namespace compute_alpha { /** * compute.subnetworks.setPrivateIpGoogleAccess * @desc Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.subnetworks.setPrivateIpGoogleAccess({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the Subnetwork resource. + * subnetwork: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "privateIpGoogleAccess": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.subnetworks.setPrivateIpGoogleAccess * @memberOf! () * @@ -75792,6 +120234,63 @@ export namespace compute_alpha { /** * compute.subnetworks.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.subnetworks.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.subnetworks.testIamPermissions * @memberOf! () * @@ -76217,6 +120716,81 @@ export namespace compute_alpha { /** * compute.targetGrpcProxies.delete * @desc Deletes the specified TargetGrpcProxy in the given scope + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetGrpcProxies.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetGrpcProxy resource to delete. + * targetGrpcProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetGrpcProxies.delete * @memberOf! () * @@ -76293,6 +120867,61 @@ export namespace compute_alpha { /** * compute.targetGrpcProxies.get * @desc Returns the specified TargetGrpcProxy resource in the given scope. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetGrpcProxies.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the TargetGrpcProxy resource to return. + * targetGrpcProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "urlMap": "my_urlMap", + * // "validateForProxyless": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetGrpcProxies.get * @memberOf! () * @@ -76368,6 +120997,95 @@ export namespace compute_alpha { /** * compute.targetGrpcProxies.insert * @desc Creates a TargetGrpcProxy in the specified project in the given scope using the parameters that are included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetGrpcProxies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "urlMap": "my_urlMap", + * // "validateForProxyless": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetGrpcProxies.insert * @memberOf! () * @@ -76444,6 +121162,76 @@ export namespace compute_alpha { /** * compute.targetGrpcProxies.list * @desc Lists the TargetGrpcProxies for a project in the given scope. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetGrpcProxies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetGrpcProxies.list * @memberOf! () * @@ -76523,6 +121311,61 @@ export namespace compute_alpha { /** * compute.targetGrpcProxies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetGrpcProxies.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetGrpcProxies.testIamPermissions * @memberOf! () * @@ -76721,6 +121564,79 @@ export namespace compute_alpha { /** * compute.targetHttpProxies.aggregatedList * @desc Retrieves the list of all TargetHttpProxy resources, regional and global, available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpProxies.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Name of the project scoping this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpProxies.aggregatedList * @memberOf! () * @@ -76810,6 +121726,81 @@ export namespace compute_alpha { /** * compute.targetHttpProxies.delete * @desc Deletes the specified TargetHttpProxy resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpProxies.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpProxy resource to delete. + * targetHttpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpProxies.delete * @memberOf! () * @@ -76886,6 +121877,63 @@ export namespace compute_alpha { /** * compute.targetHttpProxies.get * @desc Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpProxies.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the TargetHttpProxy resource to return. + * targetHttpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "httpFilters": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyBind": false, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "urlMap": "my_urlMap" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpProxies.get * @memberOf! () * @@ -76961,6 +122009,97 @@ export namespace compute_alpha { /** * compute.targetHttpProxies.insert * @desc Creates a TargetHttpProxy resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpProxies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "httpFilters": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyBind": false, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "urlMap": "my_urlMap" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpProxies.insert * @memberOf! () * @@ -77037,6 +122176,76 @@ export namespace compute_alpha { /** * compute.targetHttpProxies.list * @desc Retrieves the list of TargetHttpProxy resources available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpProxies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpProxies.list * @memberOf! () * @@ -77116,6 +122325,89 @@ export namespace compute_alpha { /** * compute.targetHttpProxies.setUrlMap * @desc Changes the URL map for TargetHttpProxy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpProxies.setUrlMap({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpProxy to set a URL map for. + * targetHttpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "urlMap": "my_urlMap" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpProxies.setUrlMap * @memberOf! () * @@ -77193,6 +122485,61 @@ export namespace compute_alpha { /** * compute.targetHttpProxies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpProxies.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpProxies.testIamPermissions * @memberOf! () * @@ -77452,6 +122799,79 @@ export namespace compute_alpha { /** * compute.targetHttpsProxies.aggregatedList * @desc Retrieves the list of all TargetHttpsProxy resources, regional and global, available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpsProxies.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Name of the project scoping this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpsProxies.aggregatedList * @memberOf! () * @@ -77541,6 +122961,81 @@ export namespace compute_alpha { /** * compute.targetHttpsProxies.delete * @desc Deletes the specified TargetHttpsProxy resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpsProxies.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpsProxy resource to delete. + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpsProxies.delete * @memberOf! () * @@ -77617,6 +123112,68 @@ export namespace compute_alpha { /** * compute.targetHttpsProxies.get * @desc Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpsProxies.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the TargetHttpsProxy resource to return. + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authentication": "my_authentication", + * // "authorization": "my_authorization", + * // "certificateMap": "my_certificateMap", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyBind": false, + * // "quicOverride": "my_quicOverride", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sslCertificates": [], + * // "sslPolicy": "my_sslPolicy", + * // "urlMap": "my_urlMap" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpsProxies.get * @memberOf! () * @@ -77692,6 +123249,102 @@ export namespace compute_alpha { /** * compute.targetHttpsProxies.insert * @desc Creates a TargetHttpsProxy resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpsProxies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "authentication": "my_authentication", + * // "authorization": "my_authorization", + * // "certificateMap": "my_certificateMap", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyBind": false, + * // "quicOverride": "my_quicOverride", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sslCertificates": [], + * // "sslPolicy": "my_sslPolicy", + * // "urlMap": "my_urlMap" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpsProxies.insert * @memberOf! () * @@ -77768,6 +123421,76 @@ export namespace compute_alpha { /** * compute.targetHttpsProxies.list * @desc Retrieves the list of TargetHttpsProxy resources available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpsProxies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpsProxies.list * @memberOf! () * @@ -77849,6 +123572,89 @@ export namespace compute_alpha { /** * compute.targetHttpsProxies.setQuicOverride * @desc Sets the QUIC override policy for TargetHttpsProxy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpsProxies.setQuicOverride({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035. + * targetHttpsProxy: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "quicOverride": "my_quicOverride" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpsProxies.setQuicOverride * @memberOf! () * @@ -77926,6 +123732,89 @@ export namespace compute_alpha { /** * compute.targetHttpsProxies.setSslCertificates * @desc Replaces SslCertificates for TargetHttpsProxy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpsProxies.setSslCertificates({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sslCertificates": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpsProxies.setSslCertificates * @memberOf! () * @@ -78003,6 +123892,89 @@ export namespace compute_alpha { /** * compute.targetHttpsProxies.setSslPolicy * @desc Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the HTTPS proxy load balancer. They do not affect the connection between the load balancer and the backends. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpsProxies.setSslPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * targetHttpsProxy: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sslPolicy": "my_sslPolicy" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpsProxies.setSslPolicy * @memberOf! () * @@ -78080,6 +124052,89 @@ export namespace compute_alpha { /** * compute.targetHttpsProxies.setUrlMap * @desc Changes the URL map for TargetHttpsProxy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpsProxies.setUrlMap({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpsProxy resource whose URL map is to be set. + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "urlMap": "my_urlMap" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpsProxies.setUrlMap * @memberOf! () * @@ -78157,6 +124212,61 @@ export namespace compute_alpha { /** * compute.targetHttpsProxies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpsProxies.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpsProxies.testIamPermissions * @memberOf! () * @@ -78491,6 +124601,79 @@ export namespace compute_alpha { /** * compute.targetInstances.aggregatedList * @desc Retrieves an aggregated list of target instances. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetInstances.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetInstances.aggregatedList * @memberOf! () * @@ -78580,6 +124763,83 @@ export namespace compute_alpha { /** * compute.targetInstances.delete * @desc Deletes the specified TargetInstance resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetInstances.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetInstance resource to delete. + * targetInstance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Name of the zone scoping this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetInstances.delete * @memberOf! () * @@ -78657,6 +124917,65 @@ export namespace compute_alpha { /** * compute.targetInstances.get * @desc Returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetInstances.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the TargetInstance resource to return. + * targetInstance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Name of the zone scoping this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "name": "my_name", + * // "natPolicy": "my_natPolicy", + * // "network": "my_network", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetInstances.get * @memberOf! () * @@ -78733,6 +125052,99 @@ export namespace compute_alpha { /** * compute.targetInstances.insert * @desc Creates a TargetInstance resource in the specified project and zone using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetInstances.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the zone scoping this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "name": "my_name", + * // "natPolicy": "my_natPolicy", + * // "network": "my_network", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetInstances.insert * @memberOf! () * @@ -78810,6 +125222,78 @@ export namespace compute_alpha { /** * compute.targetInstances.list * @desc Retrieves a list of TargetInstance resources available to the specified project and zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetInstances.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // Name of the zone scoping this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetInstances.list * @memberOf! () * @@ -78890,6 +125374,63 @@ export namespace compute_alpha { /** * compute.targetInstances.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetInstances.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetInstances.testIamPermissions * @memberOf! () * @@ -79145,6 +125686,91 @@ export namespace compute_alpha { /** * compute.targetPools.addHealthCheck * @desc Adds health check URLs to a target pool. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.addHealthCheck({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the target pool to add a health check to. + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "healthChecks": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetPools.addHealthCheck * @memberOf! () * @@ -79223,6 +125849,91 @@ export namespace compute_alpha { /** * compute.targetPools.addInstance * @desc Adds an instance to a target pool. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.addInstance({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetPool resource to add instances to. + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetPools.addInstance * @memberOf! () * @@ -79301,6 +126012,79 @@ export namespace compute_alpha { /** * compute.targetPools.aggregatedList * @desc Retrieves an aggregated list of target pools. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetPools.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetPools.aggregatedList * @memberOf! () * @@ -79385,6 +126169,83 @@ export namespace compute_alpha { /** * compute.targetPools.delete * @desc Deletes the specified target pool. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetPool resource to delete. + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetPools.delete * @memberOf! () * @@ -79462,6 +126323,67 @@ export namespace compute_alpha { /** * compute.targetPools.get * @desc Returns the specified target pool. Gets a list of available target pools by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetPools.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the TargetPool resource to return. + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backupPool": "my_backupPool", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "failoverRatio": {}, + * // "healthChecks": [], + * // "id": "my_id", + * // "instances": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sessionAffinity": "my_sessionAffinity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetPools.get * @memberOf! () * @@ -79537,6 +126459,64 @@ export namespace compute_alpha { /** * compute.targetPools.getHealth * @desc Gets the most recent health check results for each IP for the instance that is referenced by the given target pool. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetPools.getHealth({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the TargetPool resource to which the queried instance belongs. + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instance": "my_instance" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "healthStatus": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetPools.getHealth * @memberOf! () * @@ -79618,6 +126598,101 @@ export namespace compute_alpha { /** * compute.targetPools.insert * @desc Creates a target pool in the specified project and region using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "backupPool": "my_backupPool", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "failoverRatio": {}, + * // "healthChecks": [], + * // "id": "my_id", + * // "instances": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sessionAffinity": "my_sessionAffinity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetPools.insert * @memberOf! () * @@ -79695,6 +126770,78 @@ export namespace compute_alpha { /** * compute.targetPools.list * @desc Retrieves a list of target pools available to the specified project and region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetPools.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetPools.list * @memberOf! () * @@ -79774,6 +126921,91 @@ export namespace compute_alpha { /** * compute.targetPools.removeHealthCheck * @desc Removes health check URL from a target pool. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.removeHealthCheck({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the target pool to remove health checks from. + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "healthChecks": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetPools.removeHealthCheck * @memberOf! () * @@ -79852,6 +127084,91 @@ export namespace compute_alpha { /** * compute.targetPools.removeInstance * @desc Removes instance URL from a target pool. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.removeInstance({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetPool resource to remove instances from. + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetPools.removeInstance * @memberOf! () * @@ -79930,6 +127247,93 @@ export namespace compute_alpha { /** * compute.targetPools.setBackup * @desc Changes a backup target pool's configurations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.setBackup({ + * // New failoverRatio value for the target pool. + * failoverRatio: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetPool resource to set a backup pool for. + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "target": "my_target" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetPools.setBackup * @memberOf! () * @@ -80009,6 +127413,63 @@ export namespace compute_alpha { /** * compute.targetPools.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetPools.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetPools.testIamPermissions * @memberOf! () * @@ -80436,6 +127897,81 @@ export namespace compute_alpha { /** * compute.targetSslProxies.delete * @desc Deletes the specified TargetSslProxy resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetSslProxies.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetSslProxy resource to delete. + * targetSslProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetSslProxies.delete * @memberOf! () * @@ -80512,6 +128048,63 @@ export namespace compute_alpha { /** * compute.targetSslProxies.get * @desc Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetSslProxies.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the TargetSslProxy resource to return. + * targetSslProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificateMap": "my_certificateMap", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyHeader": "my_proxyHeader", + * // "selfLink": "my_selfLink", + * // "service": "my_service", + * // "sslCertificates": [], + * // "sslPolicy": "my_sslPolicy" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetSslProxies.get * @memberOf! () * @@ -80587,6 +128180,97 @@ export namespace compute_alpha { /** * compute.targetSslProxies.insert * @desc Creates a TargetSslProxy resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetSslProxies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "certificateMap": "my_certificateMap", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyHeader": "my_proxyHeader", + * // "selfLink": "my_selfLink", + * // "service": "my_service", + * // "sslCertificates": [], + * // "sslPolicy": "my_sslPolicy" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetSslProxies.insert * @memberOf! () * @@ -80663,6 +128347,76 @@ export namespace compute_alpha { /** * compute.targetSslProxies.list * @desc Retrieves the list of TargetSslProxy resources available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetSslProxies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetSslProxies.list * @memberOf! () * @@ -80742,6 +128496,89 @@ export namespace compute_alpha { /** * compute.targetSslProxies.setBackendService * @desc Changes the BackendService for TargetSslProxy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetSslProxies.setBackendService({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetSslProxy resource whose BackendService resource is to be set. + * targetSslProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "service": "my_service" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetSslProxies.setBackendService * @memberOf! () * @@ -80819,6 +128656,89 @@ export namespace compute_alpha { /** * compute.targetSslProxies.setProxyHeader * @desc Changes the ProxyHeaderType for TargetSslProxy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetSslProxies.setProxyHeader({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetSslProxy resource whose ProxyHeader is to be set. + * targetSslProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "proxyHeader": "my_proxyHeader" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetSslProxies.setProxyHeader * @memberOf! () * @@ -80896,6 +128816,89 @@ export namespace compute_alpha { /** * compute.targetSslProxies.setSslCertificates * @desc Changes SslCertificates for TargetSslProxy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetSslProxies.setSslCertificates({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetSslProxy resource whose SslCertificate resource is to be set. + * targetSslProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sslCertificates": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetSslProxies.setSslCertificates * @memberOf! () * @@ -80973,6 +128976,89 @@ export namespace compute_alpha { /** * compute.targetSslProxies.setSslPolicy * @desc Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the SSL proxy load balancer. They do not affect the connection between the load balancer and the backends. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetSslProxies.setSslPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * targetSslProxy: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sslPolicy": "my_sslPolicy" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetSslProxies.setSslPolicy * @memberOf! () * @@ -81050,6 +129136,61 @@ export namespace compute_alpha { /** * compute.targetSslProxies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetSslProxies.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetSslProxies.testIamPermissions * @memberOf! () * @@ -81348,6 +129489,81 @@ export namespace compute_alpha { /** * compute.targetTcpProxies.delete * @desc Deletes the specified TargetTcpProxy resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetTcpProxies.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetTcpProxy resource to delete. + * targetTcpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetTcpProxies.delete * @memberOf! () * @@ -81424,6 +129640,60 @@ export namespace compute_alpha { /** * compute.targetTcpProxies.get * @desc Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetTcpProxies.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the TargetTcpProxy resource to return. + * targetTcpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyHeader": "my_proxyHeader", + * // "selfLink": "my_selfLink", + * // "service": "my_service" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetTcpProxies.get * @memberOf! () * @@ -81499,6 +129769,94 @@ export namespace compute_alpha { /** * compute.targetTcpProxies.insert * @desc Creates a TargetTcpProxy resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetTcpProxies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyHeader": "my_proxyHeader", + * // "selfLink": "my_selfLink", + * // "service": "my_service" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetTcpProxies.insert * @memberOf! () * @@ -81575,6 +129933,76 @@ export namespace compute_alpha { /** * compute.targetTcpProxies.list * @desc Retrieves the list of TargetTcpProxy resources available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetTcpProxies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetTcpProxies.list * @memberOf! () * @@ -81654,6 +130082,89 @@ export namespace compute_alpha { /** * compute.targetTcpProxies.setBackendService * @desc Changes the BackendService for TargetTcpProxy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetTcpProxies.setBackendService({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetTcpProxy resource whose BackendService resource is to be set. + * targetTcpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "service": "my_service" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetTcpProxies.setBackendService * @memberOf! () * @@ -81731,6 +130242,89 @@ export namespace compute_alpha { /** * compute.targetTcpProxies.setProxyHeader * @desc Changes the ProxyHeaderType for TargetTcpProxy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetTcpProxies.setProxyHeader({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetTcpProxy resource whose ProxyHeader is to be set. + * targetTcpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "proxyHeader": "my_proxyHeader" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetTcpProxies.setProxyHeader * @memberOf! () * @@ -81808,6 +130402,61 @@ export namespace compute_alpha { /** * compute.targetTcpProxies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetTcpProxies.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetTcpProxies.testIamPermissions * @memberOf! () * @@ -82056,6 +130705,79 @@ export namespace compute_alpha { /** * compute.targetVpnGateways.aggregatedList * @desc Retrieves an aggregated list of target VPN gateways. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetVpnGateways.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetVpnGateways.aggregatedList * @memberOf! () * @@ -82145,6 +130867,83 @@ export namespace compute_alpha { /** * compute.targetVpnGateways.delete * @desc Deletes the specified target VPN gateway. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetVpnGateways.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the target VPN gateway to delete. + * targetVpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetVpnGateways.delete * @memberOf! () * @@ -82222,6 +131021,67 @@ export namespace compute_alpha { /** * compute.targetVpnGateways.get * @desc Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetVpnGateways.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the target VPN gateway to return. + * targetVpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "forwardingRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "tunnels": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetVpnGateways.get * @memberOf! () * @@ -82298,6 +131158,101 @@ export namespace compute_alpha { /** * compute.targetVpnGateways.insert * @desc Creates a target VPN gateway in the specified project and region using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetVpnGateways.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "forwardingRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "tunnels": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetVpnGateways.insert * @memberOf! () * @@ -82375,6 +131330,78 @@ export namespace compute_alpha { /** * compute.targetVpnGateways.list * @desc Retrieves a list of target VPN gateways available to the specified project and region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetVpnGateways.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetVpnGateways.list * @memberOf! () * @@ -82457,6 +131484,92 @@ export namespace compute_alpha { /** * compute.targetVpnGateways.setLabels * @desc Sets the labels on a TargetVpnGateway. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetVpnGateways.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetVpnGateways.setLabels * @memberOf! () * @@ -82535,6 +131648,63 @@ export namespace compute_alpha { /** * compute.targetVpnGateways.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetVpnGateways.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetVpnGateways.testIamPermissions * @memberOf! () * @@ -82819,6 +131989,79 @@ export namespace compute_alpha { /** * compute.urlMaps.aggregatedList * @desc Retrieves the list of all UrlMap resources, regional and global, available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.urlMaps.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Name of the project scoping this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.urlMaps.aggregatedList * @memberOf! () * @@ -82902,6 +132145,81 @@ export namespace compute_alpha { /** * compute.urlMaps.delete * @desc Deletes the specified UrlMap resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.urlMaps.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the UrlMap resource to delete. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.urlMaps.delete * @memberOf! () * @@ -82977,6 +132295,67 @@ export namespace compute_alpha { /** * compute.urlMaps.get * @desc Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.urlMaps.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the UrlMap resource to return. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.urlMaps.get * @memberOf! () * @@ -83049,6 +132428,101 @@ export namespace compute_alpha { /** * compute.urlMaps.insert * @desc Creates a UrlMap resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.urlMaps.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.urlMaps.insert * @memberOf! () * @@ -83123,6 +132597,90 @@ export namespace compute_alpha { /** * compute.urlMaps.invalidateCache * @desc Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.urlMaps.invalidateCache({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the UrlMap scoping this request. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "host": "my_host", + * // "path": "my_path" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.urlMaps.invalidateCache * @memberOf! () * @@ -83200,6 +132758,76 @@ export namespace compute_alpha { /** * compute.urlMaps.list * @desc Retrieves the list of UrlMap resources available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.urlMaps.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.urlMaps.list * @memberOf! () * @@ -83277,6 +132905,103 @@ export namespace compute_alpha { /** * compute.urlMaps.patch * @desc Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.urlMaps.patch({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the UrlMap resource to patch. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.urlMaps.patch * @memberOf! () * @@ -83353,6 +133078,61 @@ export namespace compute_alpha { /** * compute.urlMaps.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.urlMaps.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.urlMaps.testIamPermissions * @memberOf! () * @@ -83433,6 +133213,103 @@ export namespace compute_alpha { /** * compute.urlMaps.update * @desc Updates the specified UrlMap resource with the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.urlMaps.update({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the UrlMap resource to update. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.urlMaps.update * @memberOf! () * @@ -83509,6 +133386,60 @@ export namespace compute_alpha { /** * compute.urlMaps.validate * @desc Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.urlMaps.validate({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the UrlMap resource to be validated as. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resource": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "result": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.urlMaps.validate * @memberOf! () * @@ -83831,6 +133762,79 @@ export namespace compute_alpha { /** * compute.vpnGateways.aggregatedList * @desc Retrieves an aggregated list of VPN gateways. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnGateways.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.aggregatedList * @memberOf! () * @@ -83915,6 +133919,83 @@ export namespace compute_alpha { /** * compute.vpnGateways.delete * @desc Deletes the specified VPN gateway. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.vpnGateways.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the VPN gateway to delete. + * vpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.delete * @memberOf! () * @@ -83992,6 +134073,65 @@ export namespace compute_alpha { /** * compute.vpnGateways.get * @desc Returns the specified VPN gateway. Gets a list of available VPN gateways by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnGateways.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the VPN gateway to return. + * vpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "vpnInterfaces": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.get * @memberOf! () * @@ -84067,6 +134207,55 @@ export namespace compute_alpha { /** * compute.vpnGateways.getStatus * @desc Returns the status for the specified VPN gateway. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnGateways.getStatus({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the VPN gateway to return. + * vpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "result": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.getStatus * @memberOf! () * @@ -84152,6 +134341,99 @@ export namespace compute_alpha { /** * compute.vpnGateways.insert * @desc Creates a VPN gateway in the specified project and region using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.vpnGateways.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "vpnInterfaces": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.insert * @memberOf! () * @@ -84229,6 +134511,78 @@ export namespace compute_alpha { /** * compute.vpnGateways.list * @desc Retrieves a list of VPN gateways available to the specified project and region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnGateways.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.list * @memberOf! () * @@ -84308,6 +134662,92 @@ export namespace compute_alpha { /** * compute.vpnGateways.setLabels * @desc Sets the labels on a VpnGateway. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.vpnGateways.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.setLabels * @memberOf! () * @@ -84386,6 +134826,63 @@ export namespace compute_alpha { /** * compute.vpnGateways.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnGateways.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.testIamPermissions * @memberOf! () * @@ -84688,6 +135185,79 @@ export namespace compute_alpha { /** * compute.vpnTunnels.aggregatedList * @desc Retrieves an aggregated list of VPN tunnels. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnTunnels.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "unreachables": [], + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnTunnels.aggregatedList * @memberOf! () * @@ -84772,6 +135342,83 @@ export namespace compute_alpha { /** * compute.vpnTunnels.delete * @desc Deletes the specified VpnTunnel resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.vpnTunnels.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the VpnTunnel resource to delete. + * vpnTunnel: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnTunnels.delete * @memberOf! () * @@ -84849,6 +135496,78 @@ export namespace compute_alpha { /** * compute.vpnTunnels.get * @desc Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnTunnels.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the VpnTunnel resource to return. + * vpnTunnel: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "detailedStatus": "my_detailedStatus", + * // "id": "my_id", + * // "ikeVersion": 0, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "localTrafficSelector": [], + * // "name": "my_name", + * // "peerExternalGateway": "my_peerExternalGateway", + * // "peerExternalGatewayInterface": 0, + * // "peerGcpGateway": "my_peerGcpGateway", + * // "peerIp": "my_peerIp", + * // "region": "my_region", + * // "remoteTrafficSelector": [], + * // "router": "my_router", + * // "selfLink": "my_selfLink", + * // "sharedSecret": "my_sharedSecret", + * // "sharedSecretHash": "my_sharedSecretHash", + * // "status": "my_status", + * // "targetVpnGateway": "my_targetVpnGateway", + * // "vpnGateway": "my_vpnGateway", + * // "vpnGatewayInterface": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnTunnels.get * @memberOf! () * @@ -84924,6 +135643,112 @@ export namespace compute_alpha { /** * compute.vpnTunnels.insert * @desc Creates a VpnTunnel resource in the specified project and region using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.vpnTunnels.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "detailedStatus": "my_detailedStatus", + * // "id": "my_id", + * // "ikeVersion": 0, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "localTrafficSelector": [], + * // "name": "my_name", + * // "peerExternalGateway": "my_peerExternalGateway", + * // "peerExternalGatewayInterface": 0, + * // "peerGcpGateway": "my_peerGcpGateway", + * // "peerIp": "my_peerIp", + * // "region": "my_region", + * // "remoteTrafficSelector": [], + * // "router": "my_router", + * // "selfLink": "my_selfLink", + * // "sharedSecret": "my_sharedSecret", + * // "sharedSecretHash": "my_sharedSecretHash", + * // "status": "my_status", + * // "targetVpnGateway": "my_targetVpnGateway", + * // "vpnGateway": "my_vpnGateway", + * // "vpnGatewayInterface": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnTunnels.insert * @memberOf! () * @@ -85001,6 +135826,78 @@ export namespace compute_alpha { /** * compute.vpnTunnels.list * @desc Retrieves a list of VpnTunnel resources contained in the specified project and region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnTunnels.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnTunnels.list * @memberOf! () * @@ -85080,6 +135977,92 @@ export namespace compute_alpha { /** * compute.vpnTunnels.setLabels * @desc Sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.vpnTunnels.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnTunnels.setLabels * @memberOf! () * @@ -85158,6 +136141,63 @@ export namespace compute_alpha { /** * compute.vpnTunnels.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnTunnels.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnTunnels.testIamPermissions * @memberOf! () * @@ -85440,6 +136480,83 @@ export namespace compute_alpha { /** * compute.zoneInPlaceSnapshots.delete * @desc Deletes the specified InPlaceSnapshot resource. Keep in mind that deleting a single inPlaceSnapshot might not necessarily delete all the data on that inPlaceSnapshot. If any data on the inPlaceSnapshot that is marked for deletion is needed for subsequent inPlaceSnapshots, the data will be moved to the next corresponding inPlaceSnapshot. For more information, see Deleting inPlaceSnapshots. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.zoneInPlaceSnapshots.delete({ + * // Name of the InPlaceSnapshot resource to delete. + * inPlaceSnapshot: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.zoneInPlaceSnapshots.delete * @memberOf! () * @@ -85517,6 +136634,70 @@ export namespace compute_alpha { /** * compute.zoneInPlaceSnapshots.get * @desc Returns the specified InPlaceSnapshot resource in the specified zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.zoneInPlaceSnapshots.get({ + * // Name of the InPlaceSnapshot resource to return. + * inPlaceSnapshot: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "guestFlush": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskId": "my_sourceDiskId", + * // "status": "my_status", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.zoneInPlaceSnapshots.get * @memberOf! () * @@ -85593,6 +136774,62 @@ export namespace compute_alpha { /** * compute.zoneInPlaceSnapshots.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.zoneInPlaceSnapshots.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.zoneInPlaceSnapshots.getIamPolicy * @memberOf! () * @@ -85668,6 +136905,104 @@ export namespace compute_alpha { /** * compute.zoneInPlaceSnapshots.insert * @desc Creates an in-place snapshot in the specified zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.zoneInPlaceSnapshots.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "guestFlush": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskId": "my_sourceDiskId", + * // "status": "my_status", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.zoneInPlaceSnapshots.insert * @memberOf! () * @@ -85745,6 +137080,78 @@ export namespace compute_alpha { /** * compute.zoneInPlaceSnapshots.list * @desc Retrieves the list of InPlaceSnapshot resources contained within the specified zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.zoneInPlaceSnapshots.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.zoneInPlaceSnapshots.list * @memberOf! () * @@ -85825,6 +137232,69 @@ export namespace compute_alpha { /** * compute.zoneInPlaceSnapshots.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.zoneInPlaceSnapshots.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.zoneInPlaceSnapshots.setIamPolicy * @memberOf! () * @@ -85900,6 +137370,92 @@ export namespace compute_alpha { /** * compute.zoneInPlaceSnapshots.setLabels * @desc Sets the labels on a inPlaceSnapshot in the given zone. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.zoneInPlaceSnapshots.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.zoneInPlaceSnapshots.setLabels * @memberOf! () * @@ -85978,6 +137534,63 @@ export namespace compute_alpha { /** * compute.zoneInPlaceSnapshots.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.zoneInPlaceSnapshots.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.zoneInPlaceSnapshots.testIamPermissions * @memberOf! () * @@ -86275,6 +137888,49 @@ export namespace compute_alpha { /** * compute.zoneOperations.delete * @desc Deletes the specified zone-specific Operations resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.zoneOperations.delete({ + * // Name of the Operations resource to delete. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.zoneOperations.delete * @memberOf! () * @@ -86349,6 +138005,78 @@ export namespace compute_alpha { /** * compute.zoneOperations.get * @desc Retrieves the specified zone-specific Operations resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.zoneOperations.get({ + * // Name of the Operations resource to return. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.zoneOperations.get * @memberOf! () * @@ -86425,6 +138153,78 @@ export namespace compute_alpha { /** * compute.zoneOperations.list * @desc Retrieves a list of Operation resources contained within the specified zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.zoneOperations.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * // Name of the zone for request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.zoneOperations.list * @memberOf! () * @@ -86505,6 +138305,78 @@ export namespace compute_alpha { /** * compute.zoneOperations.wait * @desc Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.zoneOperations.wait({ + * // Name of the Operations resource to return. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.zoneOperations.wait * @memberOf! () * @@ -86685,6 +138557,62 @@ export namespace compute_alpha { /** * compute.zones.get * @desc Returns the specified Zone resource. Gets a list of available zones by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.zones.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the zone resource to return. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "availableCpuPlatforms": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.zones.get * @memberOf! () * @@ -86756,6 +138684,76 @@ export namespace compute_alpha { /** * compute.zones.list * @desc Retrieves the list of Zone resources available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.zones.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. + * returnPartialSuccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.zones.list * @memberOf! () * diff --git a/src/apis/compute/beta.ts b/src/apis/compute/beta.ts index b6ab790f703..c99597abead 100644 --- a/src/apis/compute/beta.ts +++ b/src/apis/compute/beta.ts @@ -12755,68 +12755,75 @@ export namespace compute_beta { * compute.acceleratorTypes.aggregatedList * @desc Retrieves an aggregated list of accelerator types. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.acceleratorTypes.aggregatedList(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.acceleratorTypes.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.acceleratorTypes.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.acceleratorTypes.aggregatedList * @memberOf! () * @@ -12906,61 +12913,62 @@ export namespace compute_beta { * compute.acceleratorTypes.get * @desc Returns the specified accelerator type. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.acceleratorTypes.get({ + * // Name of the accelerator type to return. + * acceleratorType: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the accelerator type to return. - * acceleratorType: 'my-accelerator-type', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.acceleratorTypes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "maximumCardsPerInstance": 0, + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.acceleratorTypes.get * @memberOf! () * @@ -13038,71 +13046,75 @@ export namespace compute_beta { * compute.acceleratorTypes.list * @desc Retrieves a list of accelerator types available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.acceleratorTypes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.acceleratorTypes.list(request, handlePage); - * } - * }; + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.acceleratorTypes.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.acceleratorTypes.list * @memberOf! () * @@ -13275,68 +13287,75 @@ export namespace compute_beta { * compute.addresses.aggregatedList * @desc Retrieves an aggregated list of addresses. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.addresses.aggregatedList(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.addresses.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.addresses.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.addresses.aggregatedList * @memberOf! () * @@ -13420,61 +13439,81 @@ export namespace compute_beta { * compute.addresses.delete * @desc Deletes the specified address resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.addresses.delete({ + * // Name of the address resource to delete. + * address: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the address resource to delete. - * address: 'my-address', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.addresses.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.addresses.delete * @memberOf! () * @@ -13552,61 +13591,72 @@ export namespace compute_beta { * compute.addresses.get * @desc Returns the specified address resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.addresses.get({ + * // Name of the address resource to return. + * address: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the address resource to return. - * address: 'my-address', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.addresses.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "addressType": "my_addressType", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "prefixLength": 0, + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "subnetwork": "my_subnetwork", + * // "users": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.addresses.get * @memberOf! () * @@ -13681,62 +13731,105 @@ export namespace compute_beta { * compute.addresses.insert * @desc Creates an address resource in the specified project by using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.addresses.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "addressType": "my_addressType", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "prefixLength": 0, + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "subnetwork": "my_subnetwork", + * // "users": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.addresses.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.addresses.insert * @memberOf! () * @@ -13814,71 +13907,75 @@ export namespace compute_beta { * compute.addresses.list * @desc Retrieves a list of addresses contained within the specified region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.addresses.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.addresses.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.addresses.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.addresses.list * @memberOf! () * @@ -13958,65 +14055,90 @@ export namespace compute_beta { * compute.addresses.setLabels * @desc Sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.addresses.setLabels({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } * }, - * - * auth: authClient, - * }; - * - * compute.addresses.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.addresses.setLabels * @memberOf! () * @@ -14096,65 +14218,62 @@ export namespace compute_beta { * compute.addresses.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.addresses.testIamPermissions({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.addresses.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.addresses.testIamPermissions * @memberOf! () * @@ -14428,68 +14547,75 @@ export namespace compute_beta { * compute.autoscalers.aggregatedList * @desc Retrieves an aggregated list of autoscalers. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.autoscalers.aggregatedList(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.autoscalers.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.autoscalers.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.autoscalers.aggregatedList * @memberOf! () * @@ -14574,61 +14700,81 @@ export namespace compute_beta { * compute.autoscalers.delete * @desc Deletes the specified autoscaler. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.autoscalers.delete({ + * // Name of the autoscaler to delete. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the autoscaler to delete. - * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.autoscalers.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.autoscalers.delete * @memberOf! () * @@ -14707,61 +14853,66 @@ export namespace compute_beta { * compute.autoscalers.get * @desc Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.autoscalers.get({ + * // Name of the autoscaler to return. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the autoscaler to return. - * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.autoscalers.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.autoscalers.get * @memberOf! () * @@ -14838,62 +14989,99 @@ export namespace compute_beta { * compute.autoscalers.insert * @desc Creates an autoscaler in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.autoscalers.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.autoscalers.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.autoscalers.insert * @memberOf! () * @@ -14972,71 +15160,75 @@ export namespace compute_beta { * compute.autoscalers.list * @desc Retrieves a list of autoscalers contained within the specified zone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.autoscalers.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.autoscalers.list(request, handlePage); - * } - * }; + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.autoscalers.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.autoscalers.list * @memberOf! () * @@ -15116,63 +15308,101 @@ export namespace compute_beta { * compute.autoscalers.patch * @desc Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.autoscalers.patch({ + * // Name of the autoscaler to patch. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.autoscalers.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.autoscalers.patch * @memberOf! () * @@ -15252,65 +15482,62 @@ export namespace compute_beta { * compute.autoscalers.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.autoscalers.testIamPermissions({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.autoscalers.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.autoscalers.testIamPermissions * @memberOf! () * @@ -15393,63 +15620,101 @@ export namespace compute_beta { * compute.autoscalers.update * @desc Updates an autoscaler in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.autoscalers.update({ + * // Name of the autoscaler to update. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.autoscalers.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.autoscalers.update * @memberOf! () * @@ -15750,6 +16015,89 @@ export namespace compute_beta { /** * compute.backendBuckets.addSignedUrlKey * @desc Adds a key for validating requests with signed URLs for this backend bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendBuckets.addSignedUrlKey({ + * // Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * backendBucket: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "keyName": "my_keyName", + * // "keyValue": "my_keyValue" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendBuckets.addSignedUrlKey * @memberOf! () * @@ -15828,58 +16176,79 @@ export namespace compute_beta { * compute.backendBuckets.delete * @desc Deletes the specified BackendBucket resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendBuckets.delete({ * // Name of the BackendBucket resource to delete. - * backendBucket: 'my-backend-bucket', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.backendBuckets.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * backendBucket: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendBuckets.delete * @memberOf! () * @@ -15956,6 +16325,82 @@ export namespace compute_beta { /** * compute.backendBuckets.deleteSignedUrlKey * @desc Deletes a key for validating requests with signed URLs for this backend bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendBuckets.deleteSignedUrlKey({ + * // Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * backendBucket: 'placeholder-value', + * // The name of the Signed URL Key to delete. + * keyName: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendBuckets.deleteSignedUrlKey * @memberOf! () * @@ -16034,58 +16479,60 @@ export namespace compute_beta { * compute.backendBuckets.get * @desc Returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendBuckets.get({ * // Name of the BackendBucket resource to return. - * backendBucket: 'my-backend-bucket', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.backendBuckets.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * backendBucket: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucketName": "my_bucketName", + * // "cdnPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableCdn": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "selfLink": "my_selfLink" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendBuckets.get * @memberOf! () * @@ -16162,59 +16609,93 @@ export namespace compute_beta { * compute.backendBuckets.insert * @desc Creates a BackendBucket resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendBuckets.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucketName": "my_bucketName", + * // "cdnPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableCdn": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.backendBuckets.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendBuckets.insert * @memberOf! () * @@ -16291,68 +16772,73 @@ export namespace compute_beta { * compute.backendBuckets.list * @desc Retrieves the list of BackendBucket resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.backendBuckets.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendBuckets.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.backendBuckets.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendBuckets.list * @memberOf! () * @@ -16431,63 +16917,95 @@ export namespace compute_beta { * compute.backendBuckets.patch * @desc Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendBuckets.patch({ * // Name of the BackendBucket resource to patch. - * backendBucket: 'my-backend-bucket', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * backendBucket: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucketName": "my_bucketName", + * // "cdnPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableCdn": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.backendBuckets.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendBuckets.patch * @memberOf! () * @@ -16566,63 +17084,95 @@ export namespace compute_beta { * compute.backendBuckets.update * @desc Updates the specified BackendBucket resource with the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendBuckets.update({ * // Name of the BackendBucket resource to update. - * backendBucket: 'my-backend-bucket', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * backendBucket: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucketName": "my_bucketName", + * // "cdnPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableCdn": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.backendBuckets.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendBuckets.update * @memberOf! () * @@ -16892,6 +17442,89 @@ export namespace compute_beta { /** * compute.backendServices.addSignedUrlKey * @desc Adds a key for validating requests with signed URLs for this backend service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.addSignedUrlKey({ + * // Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * backendService: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "keyName": "my_keyName", + * // "keyValue": "my_keyValue" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendServices.addSignedUrlKey * @memberOf! () * @@ -16970,68 +17603,75 @@ export namespace compute_beta { * compute.backendServices.aggregatedList * @desc Retrieves the list of all BackendService resources, regional and global, available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendServices.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Name of the project scoping this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.backendServices.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.backendServices.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendServices.aggregatedList * @memberOf! () * @@ -17121,58 +17761,79 @@ export namespace compute_beta { * compute.backendServices.delete * @desc Deletes the specified BackendService resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.delete({ * // Name of the BackendService resource to delete. - * backendService: 'my-backend-service', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.backendServices.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendServices.delete * @memberOf! () * @@ -17249,6 +17910,82 @@ export namespace compute_beta { /** * compute.backendServices.deleteSignedUrlKey * @desc Deletes a key for validating requests with signed URLs for this backend service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.deleteSignedUrlKey({ + * // Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * backendService: 'placeholder-value', + * // The name of the Signed URL Key to delete. + * keyName: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendServices.deleteSignedUrlKey * @memberOf! () * @@ -17327,58 +18064,82 @@ export namespace compute_beta { * compute.backendServices.get * @desc Returns the specified BackendService resource. Gets a list of available backend services. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendServices.get({ * // Name of the BackendService resource to return. - * backendService: 'my-backend-service', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.backendServices.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "securitySettings": {}, + * // "selfLink": "my_selfLink", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendServices.get * @memberOf! () * @@ -17455,61 +18216,62 @@ export namespace compute_beta { * compute.backendServices.getHealth * @desc Gets the most recent health check results for this BackendService. Example request body: { "group": "/zones/us-east1-b/instanceGroups/lb-backend-example" } * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendServices.getHealth({ * // Name of the BackendService resource to which the queried instance belongs. - * backendService: 'my-backend-service', // TODO: Update placeholder value. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * - * auth: authClient, - * }; + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "group": "my_group" + * // } + * }, + * }); + * console.log(res.data); * - * compute.backendServices.getHealth(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "annotations": {}, + * // "healthStatus": [], + * // "kind": "my_kind" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendServices.getHealth * @memberOf! () * @@ -17594,59 +18356,115 @@ export namespace compute_beta { * compute.backendServices.insert * @desc Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Understanding backend services for more information. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "securitySettings": {}, + * // "selfLink": "my_selfLink", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.backendServices.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendServices.insert * @memberOf! () * @@ -17724,68 +18542,73 @@ export namespace compute_beta { * compute.backendServices.list * @desc Retrieves the list of BackendService resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.backendServices.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendServices.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.backendServices.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendServices.list * @memberOf! () * @@ -17865,63 +18688,117 @@ export namespace compute_beta { * compute.backendServices.patch * @desc Patches the specified BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.patch({ * // Name of the BackendService resource to patch. - * backendService: 'my-backend-service', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "securitySettings": {}, + * // "selfLink": "my_selfLink", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.backendServices.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendServices.patch * @memberOf! () * @@ -18000,63 +18877,87 @@ export namespace compute_beta { * compute.backendServices.setSecurityPolicy * @desc Sets the security policy for the specified backend service. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to which the security policy should be set. The name should - * // conform to RFC1035. - * backendService: 'my-backend-service', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.setSecurityPolicy({ + * // Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. + * backendService: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "securityPolicy": "my_securityPolicy" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.backendServices.setSecurityPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendServices.setSecurityPolicy * @memberOf! () * @@ -18135,62 +19036,60 @@ export namespace compute_beta { * compute.backendServices.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendServices.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.backendServices.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendServices.testIamPermissions * @memberOf! () * @@ -18272,63 +19171,117 @@ export namespace compute_beta { * compute.backendServices.update * @desc Updates the specified BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.update({ * // Name of the BackendService resource to update. - * backendService: 'my-backend-service', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "securitySettings": {}, + * // "selfLink": "my_selfLink", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.backendServices.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendServices.update * @memberOf! () * @@ -18697,6 +19650,90 @@ export namespace compute_beta { /** * compute.disks.addResourcePolicies * @desc Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.addResourcePolicies({ + * // The disk name for this request. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourcePolicies": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.addResourcePolicies * @memberOf! () * @@ -18776,68 +19813,75 @@ export namespace compute_beta { * compute.disks.aggregatedList * @desc Retrieves an aggregated list of persistent disks. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.disks.aggregatedList(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.disks.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.disks.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.disks.aggregatedList * @memberOf! () * @@ -18919,65 +19963,111 @@ export namespace compute_beta { * compute.disks.createSnapshot * @desc Creates a snapshot of a specified persistent disk. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.createSnapshot({ + * // Name of the persistent disk to snapshot. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // [Input Only] Specifies to create an application consistent snapshot by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS). + * guestFlush: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the persistent disk to snapshot. - * disk: 'my-disk', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoCreated": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "downloadBytes": "my_downloadBytes", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "snapshotEncryptionKey": {}, + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskEncryptionKey": {}, + * // "sourceDiskId": "my_sourceDiskId", + * // "status": "my_status", + * // "storageBytes": "my_storageBytes", + * // "storageBytesStatus": "my_storageBytesStatus", + * // "storageLocations": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.disks.createSnapshot(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.disks.createSnapshot * @memberOf! () * @@ -19058,61 +20148,81 @@ export namespace compute_beta { * compute.disks.delete * @desc Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.delete({ + * // Name of the persistent disk to delete. + * disk: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the persistent disk to delete. - * disk: 'my-disk', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.disks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.disks.delete * @memberOf! () * @@ -19190,61 +20300,85 @@ export namespace compute_beta { * compute.disks.get * @desc Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.disks.get({ + * // Name of the persistent disk to return. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the persistent disk to return. - * disk: 'my-disk', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.disks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskEncryptionKey": {}, + * // "eraseWindowsVssSignature": false, + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "lastAttachTimestamp": "my_lastAttachTimestamp", + * // "lastDetachTimestamp": "my_lastDetachTimestamp", + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "options": "my_options", + * // "physicalBlockSizeBytes": "my_physicalBlockSizeBytes", + * // "region": "my_region", + * // "replicaZones": [], + * // "resourcePolicies": [], + * // "selfLink": "my_selfLink", + * // "sizeGb": "my_sizeGb", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "status": "my_status", + * // "storageType": "my_storageType", + * // "type": "my_type", + * // "users": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.disks.get * @memberOf! () * @@ -19318,6 +20452,62 @@ export namespace compute_beta { /** * compute.disks.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.disks.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.getIamPolicy * @memberOf! () * @@ -19394,62 +20584,120 @@ export namespace compute_beta { * compute.disks.insert * @desc Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Optional. Source image to restore onto a disk. + * sourceImage: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskEncryptionKey": {}, + * // "eraseWindowsVssSignature": false, + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "lastAttachTimestamp": "my_lastAttachTimestamp", + * // "lastDetachTimestamp": "my_lastDetachTimestamp", + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "options": "my_options", + * // "physicalBlockSizeBytes": "my_physicalBlockSizeBytes", + * // "region": "my_region", + * // "replicaZones": [], + * // "resourcePolicies": [], + * // "selfLink": "my_selfLink", + * // "sizeGb": "my_sizeGb", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "status": "my_status", + * // "storageType": "my_storageType", + * // "type": "my_type", + * // "users": [], + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.disks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.disks.insert * @memberOf! () * @@ -19527,71 +20775,75 @@ export namespace compute_beta { * compute.disks.list * @desc Retrieves a list of persistent disks contained within the specified zone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.disks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.disks.list(request, handlePage); - * } - * }; + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.disks.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.disks.list * @memberOf! () * @@ -19667,6 +20919,90 @@ export namespace compute_beta { /** * compute.disks.removeResourcePolicies * @desc Removes resource policies from a disk. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.removeResourcePolicies({ + * // The disk name for this request. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourcePolicies": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.removeResourcePolicies * @memberOf! () * @@ -19748,65 +21084,89 @@ export namespace compute_beta { * compute.disks.resize * @desc Resizes the specified persistent disk. You can only increase the size of the disk. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.resize({ + * // The name of the persistent disk. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the persistent disk. - * disk: 'my-disk', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sizeGb": "my_sizeGb" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.disks.resize(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.disks.resize * @memberOf! () * @@ -19884,6 +21244,69 @@ export namespace compute_beta { /** * compute.disks.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.setIamPolicy * @memberOf! () * @@ -19960,65 +21383,90 @@ export namespace compute_beta { * compute.disks.setLabels * @desc Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.setLabels({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } * }, - * - * auth: authClient, - * }; - * - * compute.disks.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.disks.setLabels * @memberOf! () * @@ -20097,65 +21545,62 @@ export namespace compute_beta { * compute.disks.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.disks.testIamPermissions({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.disks.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.disks.testIamPermissions * @memberOf! () * @@ -20600,68 +22045,75 @@ export namespace compute_beta { * compute.diskTypes.aggregatedList * @desc Retrieves an aggregated list of disk types. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.diskTypes.aggregatedList(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.diskTypes.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.diskTypes.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.diskTypes.aggregatedList * @memberOf! () * @@ -20745,61 +22197,64 @@ export namespace compute_beta { * compute.diskTypes.get * @desc Returns the specified disk type. Gets a list of available disk types by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.diskTypes.get({ + * // Name of the disk type to return. + * diskType: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the disk type to return. - * diskType: 'my-disk-type', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.diskTypes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultDiskSizeGb": "my_defaultDiskSizeGb", + * // "deprecated": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "validDiskSize": "my_validDiskSize", + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.diskTypes.get * @memberOf! () * @@ -20874,71 +22329,75 @@ export namespace compute_beta { * compute.diskTypes.list * @desc Retrieves a list of disk types available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.diskTypes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.diskTypes.list(request, handlePage); - * } - * }; + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.diskTypes.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.diskTypes.list * @memberOf! () * @@ -21107,6 +22566,80 @@ export namespace compute_beta { /** * compute.externalVpnGateways.delete * @desc Deletes the specified externalVpnGateway. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.externalVpnGateways.delete({ + * // Name of the externalVpnGateways to delete. + * externalVpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.externalVpnGateways.delete * @memberOf! () * @@ -21183,6 +22716,62 @@ export namespace compute_beta { /** * compute.externalVpnGateways.get * @desc Returns the specified externalVpnGateway. Get a list of available externalVpnGateways by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.externalVpnGateways.get({ + * // Name of the externalVpnGateway to return. + * externalVpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "redundancyType": "my_redundancyType", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.externalVpnGateways.get * @memberOf! () * @@ -21258,6 +22847,95 @@ export namespace compute_beta { /** * compute.externalVpnGateways.insert * @desc Creates a ExternalVpnGateway in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.externalVpnGateways.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "redundancyType": "my_redundancyType", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.externalVpnGateways.insert * @memberOf! () * @@ -21334,6 +23012,75 @@ export namespace compute_beta { /** * compute.externalVpnGateways.list * @desc Retrieves the list of ExternalVpnGateway available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.externalVpnGateways.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.externalVpnGateways.list * @memberOf! () * @@ -21414,6 +23161,83 @@ export namespace compute_beta { /** * compute.externalVpnGateways.setLabels * @desc Sets the labels on an ExternalVpnGateway. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.externalVpnGateways.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.externalVpnGateways.setLabels * @memberOf! () * @@ -21490,6 +23314,61 @@ export namespace compute_beta { /** * compute.externalVpnGateways.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.externalVpnGateways.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.externalVpnGateways.testIamPermissions * @memberOf! () * @@ -21706,58 +23585,79 @@ export namespace compute_beta { * compute.firewalls.delete * @desc Deletes the specified firewall. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.firewalls.delete({ * // Name of the firewall rule to delete. - * firewall: 'my-firewall', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.firewalls.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * firewall: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.firewalls.delete * @memberOf! () * @@ -21834,58 +23734,71 @@ export namespace compute_beta { * compute.firewalls.get * @desc Returns the specified firewall. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.firewalls.get({ * // Name of the firewall rule to return. - * firewall: 'my-firewall', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.firewalls.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * firewall: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "allowed": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "denied": [], + * // "description": "my_description", + * // "destinationRanges": [], + * // "direction": "my_direction", + * // "disabled": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "priority": 0, + * // "selfLink": "my_selfLink", + * // "sourceRanges": [], + * // "sourceServiceAccounts": [], + * // "sourceTags": [], + * // "targetServiceAccounts": [], + * // "targetTags": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.firewalls.get * @memberOf! () * @@ -21959,59 +23872,104 @@ export namespace compute_beta { * compute.firewalls.insert * @desc Creates a firewall rule in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.firewalls.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "allowed": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "denied": [], + * // "description": "my_description", + * // "destinationRanges": [], + * // "direction": "my_direction", + * // "disabled": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "priority": 0, + * // "selfLink": "my_selfLink", + * // "sourceRanges": [], + * // "sourceServiceAccounts": [], + * // "sourceTags": [], + * // "targetServiceAccounts": [], + * // "targetTags": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.firewalls.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.firewalls.insert * @memberOf! () * @@ -22087,68 +24045,73 @@ export namespace compute_beta { * compute.firewalls.list * @desc Retrieves the list of firewall rules available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.firewalls.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.firewalls.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.firewalls.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.firewalls.list * @memberOf! () * @@ -22226,63 +24189,106 @@ export namespace compute_beta { * compute.firewalls.patch * @desc Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.firewalls.patch({ * // Name of the firewall rule to patch. - * firewall: 'my-firewall', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * firewall: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "allowed": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "denied": [], + * // "description": "my_description", + * // "destinationRanges": [], + * // "direction": "my_direction", + * // "disabled": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "priority": 0, + * // "selfLink": "my_selfLink", + * // "sourceRanges": [], + * // "sourceServiceAccounts": [], + * // "sourceTags": [], + * // "targetServiceAccounts": [], + * // "targetTags": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.firewalls.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.firewalls.patch * @memberOf! () * @@ -22360,62 +24366,60 @@ export namespace compute_beta { * compute.firewalls.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.firewalls.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.firewalls.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.firewalls.testIamPermissions * @memberOf! () * @@ -22497,63 +24501,106 @@ export namespace compute_beta { * compute.firewalls.update * @desc Updates the specified firewall rule with the data included in the request. Note that all fields will be updated if using PUT, even fields that are not specified. To update individual fields, please use PATCH instead. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.firewalls.update({ * // Name of the firewall rule to update. - * firewall: 'my-firewall', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * firewall: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "allowed": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "denied": [], + * // "description": "my_description", + * // "destinationRanges": [], + * // "direction": "my_direction", + * // "disabled": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "priority": 0, + * // "selfLink": "my_selfLink", + * // "sourceRanges": [], + * // "sourceServiceAccounts": [], + * // "sourceTags": [], + * // "targetServiceAccounts": [], + * // "targetTags": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.firewalls.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.firewalls.update * @memberOf! () * @@ -22789,68 +24836,75 @@ export namespace compute_beta { * compute.forwardingRules.aggregatedList * @desc Retrieves an aggregated list of forwarding rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.forwardingRules.aggregatedList(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.forwardingRules.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.forwardingRules.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.forwardingRules.aggregatedList * @memberOf! () * @@ -22940,61 +24994,81 @@ export namespace compute_beta { * compute.forwardingRules.delete * @desc Deletes the specified ForwardingRule resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.forwardingRules.delete({ + * // Name of the ForwardingRule resource to delete. + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the ForwardingRule resource to delete. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.forwardingRules.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.forwardingRules.delete * @memberOf! () * @@ -23073,61 +25147,80 @@ export namespace compute_beta { * compute.forwardingRules.get * @desc Returns the specified ForwardingRule resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.forwardingRules.get({ + * // Name of the ForwardingRule resource to return. + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the ForwardingRule resource to return. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.forwardingRules.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "IPAddress": "my_IPAddress", + * // "IPProtocol": "my_IPProtocol", + * // "allPorts": false, + * // "allowGlobalAccess": false, + * // "backendService": "my_backendService", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "isMirroringCollector": false, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "metadataFilters": [], + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "portRange": "my_portRange", + * // "ports": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serviceLabel": "my_serviceLabel", + * // "serviceName": "my_serviceName", + * // "subnetwork": "my_subnetwork", + * // "target": "my_target" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.forwardingRules.get * @memberOf! () * @@ -23205,62 +25298,113 @@ export namespace compute_beta { * compute.forwardingRules.insert * @desc Creates a ForwardingRule resource in the specified project and region using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.forwardingRules.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "IPAddress": "my_IPAddress", + * // "IPProtocol": "my_IPProtocol", + * // "allPorts": false, + * // "allowGlobalAccess": false, + * // "backendService": "my_backendService", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "isMirroringCollector": false, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "metadataFilters": [], + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "portRange": "my_portRange", + * // "ports": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serviceLabel": "my_serviceLabel", + * // "serviceName": "my_serviceName", + * // "subnetwork": "my_subnetwork", + * // "target": "my_target" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.forwardingRules.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.forwardingRules.insert * @memberOf! () * @@ -23339,71 +25483,75 @@ export namespace compute_beta { * compute.forwardingRules.list * @desc Retrieves a list of ForwardingRule resources available to the specified project and region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.forwardingRules.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.forwardingRules.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.forwardingRules.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.forwardingRules.list * @memberOf! () * @@ -23483,6 +25631,116 @@ export namespace compute_beta { /** * compute.forwardingRules.patch * @desc Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.forwardingRules.patch({ + * // Name of the ForwardingRule resource to patch. + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "IPAddress": "my_IPAddress", + * // "IPProtocol": "my_IPProtocol", + * // "allPorts": false, + * // "allowGlobalAccess": false, + * // "backendService": "my_backendService", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "isMirroringCollector": false, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "metadataFilters": [], + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "portRange": "my_portRange", + * // "ports": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serviceLabel": "my_serviceLabel", + * // "serviceName": "my_serviceName", + * // "subnetwork": "my_subnetwork", + * // "target": "my_target" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.forwardingRules.patch * @memberOf! () * @@ -23562,65 +25820,90 @@ export namespace compute_beta { * compute.forwardingRules.setLabels * @desc Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.forwardingRules.setLabels({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } * }, - * - * auth: authClient, - * }; - * - * compute.forwardingRules.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.forwardingRules.setLabels * @memberOf! () * @@ -23700,65 +25983,89 @@ export namespace compute_beta { * compute.forwardingRules.setTarget * @desc Changes target URL for forwarding rule. The new target should be of the same type as the old target. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.forwardingRules.setTarget({ + * // Name of the ForwardingRule resource in which target is to be set. + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the ForwardingRule resource in which target is to be set. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "target": "my_target" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.forwardingRules.setTarget(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.forwardingRules.setTarget * @memberOf! () * @@ -23838,65 +26145,62 @@ export namespace compute_beta { * compute.forwardingRules.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.forwardingRules.testIamPermissions({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.forwardingRules.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.forwardingRules.testIamPermissions * @memberOf! () * @@ -24232,58 +26536,79 @@ export namespace compute_beta { * compute.globalAddresses.delete * @desc Deletes the specified address resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalAddresses.delete({ * // Name of the address resource to delete. - * address: 'my-address', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.globalAddresses.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * address: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalAddresses.delete * @memberOf! () * @@ -24361,58 +26686,70 @@ export namespace compute_beta { * compute.globalAddresses.get * @desc Returns the specified address resource. Gets a list of available addresses by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalAddresses.get({ * // Name of the address resource to return. - * address: 'my-address', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.globalAddresses.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * address: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "addressType": "my_addressType", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "prefixLength": 0, + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "subnetwork": "my_subnetwork", + * // "users": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalAddresses.get * @memberOf! () * @@ -24487,59 +26824,103 @@ export namespace compute_beta { * compute.globalAddresses.insert * @desc Creates an address resource in the specified project by using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalAddresses.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "addressType": "my_addressType", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "prefixLength": 0, + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "subnetwork": "my_subnetwork", + * // "users": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.globalAddresses.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalAddresses.insert * @memberOf! () * @@ -24616,68 +26997,73 @@ export namespace compute_beta { * compute.globalAddresses.list * @desc Retrieves a list of global addresses. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.globalAddresses.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalAddresses.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.globalAddresses.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalAddresses.list * @memberOf! () * @@ -24756,62 +27142,82 @@ export namespace compute_beta { * compute.globalAddresses.setLabels * @desc Sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalAddresses.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } * }, - * - * auth: authClient, - * }; - * - * compute.globalAddresses.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalAddresses.setLabels * @memberOf! () * @@ -24889,62 +27295,60 @@ export namespace compute_beta { * compute.globalAddresses.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalAddresses.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.globalAddresses.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalAddresses.testIamPermissions * @memberOf! () * @@ -25161,58 +27565,79 @@ export namespace compute_beta { * compute.globalForwardingRules.delete * @desc Deletes the specified GlobalForwardingRule resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalForwardingRules.delete({ * // Name of the ForwardingRule resource to delete. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.globalForwardingRules.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalForwardingRules.delete * @memberOf! () * @@ -25290,58 +27715,78 @@ export namespace compute_beta { * compute.globalForwardingRules.get * @desc Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalForwardingRules.get({ * // Name of the ForwardingRule resource to return. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.globalForwardingRules.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "IPAddress": "my_IPAddress", + * // "IPProtocol": "my_IPProtocol", + * // "allPorts": false, + * // "allowGlobalAccess": false, + * // "backendService": "my_backendService", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "isMirroringCollector": false, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "metadataFilters": [], + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "portRange": "my_portRange", + * // "ports": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serviceLabel": "my_serviceLabel", + * // "serviceName": "my_serviceName", + * // "subnetwork": "my_subnetwork", + * // "target": "my_target" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalForwardingRules.get * @memberOf! () * @@ -25418,59 +27863,111 @@ export namespace compute_beta { * compute.globalForwardingRules.insert * @desc Creates a GlobalForwardingRule resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalForwardingRules.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "IPAddress": "my_IPAddress", + * // "IPProtocol": "my_IPProtocol", + * // "allPorts": false, + * // "allowGlobalAccess": false, + * // "backendService": "my_backendService", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "isMirroringCollector": false, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "metadataFilters": [], + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "portRange": "my_portRange", + * // "ports": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serviceLabel": "my_serviceLabel", + * // "serviceName": "my_serviceName", + * // "subnetwork": "my_subnetwork", + * // "target": "my_target" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.globalForwardingRules.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalForwardingRules.insert * @memberOf! () * @@ -25548,68 +28045,73 @@ export namespace compute_beta { * compute.globalForwardingRules.list * @desc Retrieves a list of GlobalForwardingRule resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.globalForwardingRules.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalForwardingRules.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.globalForwardingRules.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalForwardingRules.list * @memberOf! () * @@ -25688,6 +28190,114 @@ export namespace compute_beta { /** * compute.globalForwardingRules.patch * @desc Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalForwardingRules.patch({ + * // Name of the ForwardingRule resource to patch. + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "IPAddress": "my_IPAddress", + * // "IPProtocol": "my_IPProtocol", + * // "allPorts": false, + * // "allowGlobalAccess": false, + * // "backendService": "my_backendService", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "isMirroringCollector": false, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "metadataFilters": [], + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "portRange": "my_portRange", + * // "ports": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serviceLabel": "my_serviceLabel", + * // "serviceName": "my_serviceName", + * // "subnetwork": "my_subnetwork", + * // "target": "my_target" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalForwardingRules.patch * @memberOf! () * @@ -25766,62 +28376,82 @@ export namespace compute_beta { * compute.globalForwardingRules.setLabels * @desc Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalForwardingRules.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } * }, - * - * auth: authClient, - * }; - * - * compute.globalForwardingRules.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalForwardingRules.setLabels * @memberOf! () * @@ -25899,62 +28529,87 @@ export namespace compute_beta { * compute.globalForwardingRules.setTarget * @desc Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalForwardingRules.setTarget({ * // Name of the ForwardingRule resource in which target is to be set. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "target": "my_target" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.globalForwardingRules.setTarget(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalForwardingRules.setTarget * @memberOf! () * @@ -26033,62 +28688,60 @@ export namespace compute_beta { * compute.globalForwardingRules.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalForwardingRules.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.globalForwardingRules.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalForwardingRules.testIamPermissions * @memberOf! () * @@ -26354,6 +29007,88 @@ export namespace compute_beta { /** * compute.globalNetworkEndpointGroups.attachNetworkEndpoints * @desc Attach a network endpoint to the specified network endpoint group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalNetworkEndpointGroups.attachNetworkEndpoints({ + * // The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "networkEndpoints": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.attachNetworkEndpoints * @memberOf! () * @@ -26433,6 +29168,80 @@ export namespace compute_beta { /** * compute.globalNetworkEndpointGroups.delete * @desc Deletes the specified network endpoint group.Note that the NEG cannot be deleted if there are backend services referencing it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalNetworkEndpointGroups.delete({ + * // The name of the network endpoint group to delete. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.delete * @memberOf! () * @@ -26509,6 +29318,88 @@ export namespace compute_beta { /** * compute.globalNetworkEndpointGroups.detachNetworkEndpoints * @desc Detach the network endpoint from the specified network endpoint group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalNetworkEndpointGroups.detachNetworkEndpoints({ + * // The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "networkEndpoints": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.detachNetworkEndpoints * @memberOf! () * @@ -26588,6 +29479,66 @@ export namespace compute_beta { /** * compute.globalNetworkEndpointGroups.get * @desc Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalNetworkEndpointGroups.get({ + * // The name of the network endpoint group. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "annotations": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultPort": 0, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancer": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkEndpointType": "my_networkEndpointType", + * // "selfLink": "my_selfLink", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.get * @memberOf! () * @@ -26665,6 +29616,99 @@ export namespace compute_beta { /** * compute.globalNetworkEndpointGroups.insert * @desc Creates a network endpoint group in the specified project using the parameters that are included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalNetworkEndpointGroups.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "annotations": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultPort": 0, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancer": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkEndpointType": "my_networkEndpointType", + * // "selfLink": "my_selfLink", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.insert * @memberOf! () * @@ -26741,6 +29785,74 @@ export namespace compute_beta { /** * compute.globalNetworkEndpointGroups.list * @desc Retrieves the list of network endpoint groups that are located in the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalNetworkEndpointGroups.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.list * @memberOf! () * @@ -26821,6 +29933,75 @@ export namespace compute_beta { /** * compute.globalNetworkEndpointGroups.listNetworkEndpoints * @desc Lists the network endpoints in the specified network endpoint group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalNetworkEndpointGroups.listNetworkEndpoints({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.listNetworkEndpoints * @memberOf! () * @@ -27099,68 +30280,75 @@ export namespace compute_beta { * compute.globalOperations.aggregatedList * @desc Retrieves an aggregated list of all operations. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.globalOperations.aggregatedList(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalOperations.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.globalOperations.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalOperations.aggregatedList * @memberOf! () * @@ -27244,55 +30432,46 @@ export namespace compute_beta { * compute.globalOperations.delete * @desc Deletes the specified Operations resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalOperations.delete({ * // Name of the Operations resource to delete. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.globalOperations.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalOperations.delete * @memberOf! () * @@ -27367,58 +30546,74 @@ export namespace compute_beta { * compute.globalOperations.get * @desc Retrieves the specified Operations resource. Gets a list of operations by making a `list()` request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalOperations.get({ * // Name of the Operations resource to return. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.globalOperations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalOperations.get * @memberOf! () * @@ -27495,68 +30690,73 @@ export namespace compute_beta { * compute.globalOperations.list * @desc Retrieves a list of Operation resources contained within the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.globalOperations.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalOperations.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.globalOperations.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalOperations.list * @memberOf! () * @@ -27634,6 +30834,75 @@ export namespace compute_beta { /** * compute.globalOperations.wait * @desc Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalOperations.wait({ + * // Name of the Operations resource to return. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalOperations.wait * @memberOf! () * @@ -27825,6 +31094,46 @@ export namespace compute_beta { /** * compute.globalOrganizationOperations.delete * @desc Deletes the specified Operations resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalOrganizationOperations.delete({ + * // Name of the Operations resource to delete. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Parent ID for this request. + * parentId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalOrganizationOperations.delete * @memberOf! () * @@ -27898,6 +31207,74 @@ export namespace compute_beta { /** * compute.globalOrganizationOperations.get * @desc Retrieves the specified Operations resource. Gets a list of operations by making a `list()` request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalOrganizationOperations.get({ + * // Name of the Operations resource to return. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Parent ID for this request. + * parentId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalOrganizationOperations.get * @memberOf! () * @@ -27973,6 +31350,73 @@ export namespace compute_beta { /** * compute.globalOrganizationOperations.list * @desc Retrieves a list of Operation resources contained within the specified organization. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalOrganizationOperations.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Parent ID for this request. + * parentId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalOrganizationOperations.list * @memberOf! () * @@ -28118,6 +31562,76 @@ export namespace compute_beta { /** * compute.healthChecks.aggregatedList * @desc Retrieves the list of all HealthCheck resources, regional and global, available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.healthChecks.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Name of the project scoping this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.healthChecks.aggregatedList * @memberOf! () * @@ -28205,58 +31719,79 @@ export namespace compute_beta { * compute.healthChecks.delete * @desc Deletes the specified HealthCheck resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.healthChecks.delete({ * // Name of the HealthCheck resource to delete. - * healthCheck: 'my-health-check', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.healthChecks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.healthChecks.delete * @memberOf! () * @@ -28334,58 +31869,69 @@ export namespace compute_beta { * compute.healthChecks.get * @desc Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.healthChecks.get({ * // Name of the HealthCheck resource to return. - * healthCheck: 'my-health-check', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.healthChecks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "unhealthyThreshold": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.healthChecks.get * @memberOf! () * @@ -28461,59 +32007,102 @@ export namespace compute_beta { * compute.healthChecks.insert * @desc Creates a HealthCheck resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.healthChecks.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "unhealthyThreshold": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.healthChecks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.healthChecks.insert * @memberOf! () * @@ -28590,68 +32179,73 @@ export namespace compute_beta { * compute.healthChecks.list * @desc Retrieves the list of HealthCheck resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.healthChecks.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.healthChecks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.healthChecks.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.healthChecks.list * @memberOf! () * @@ -28730,63 +32324,104 @@ export namespace compute_beta { * compute.healthChecks.patch * @desc Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.healthChecks.patch({ * // Name of the HealthCheck resource to patch. - * healthCheck: 'my-health-check', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "unhealthyThreshold": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.healthChecks.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.healthChecks.patch * @memberOf! () * @@ -28865,62 +32500,60 @@ export namespace compute_beta { * compute.healthChecks.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.healthChecks.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.healthChecks.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.healthChecks.testIamPermissions * @memberOf! () * @@ -29002,63 +32635,104 @@ export namespace compute_beta { * compute.healthChecks.update * @desc Updates a HealthCheck resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.healthChecks.update({ * // Name of the HealthCheck resource to update. - * healthCheck: 'my-health-check', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "unhealthyThreshold": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.healthChecks.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.healthChecks.update * @memberOf! () * @@ -29332,58 +33006,79 @@ export namespace compute_beta { * compute.httpHealthChecks.delete * @desc Deletes the specified HttpHealthCheck resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpHealthChecks.delete({ * // Name of the HttpHealthCheck resource to delete. - * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * httpHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpHealthChecks.delete * @memberOf! () * @@ -29461,58 +33156,64 @@ export namespace compute_beta { * compute.httpHealthChecks.get * @desc Returns the specified HttpHealthCheck resource. Gets a list of available HTTP health checks by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.httpHealthChecks.get({ * // Name of the HttpHealthCheck resource to return. - * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * httpHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpHealthChecks.get * @memberOf! () * @@ -29589,59 +33290,97 @@ export namespace compute_beta { * compute.httpHealthChecks.insert * @desc Creates a HttpHealthCheck resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpHealthChecks.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpHealthChecks.insert * @memberOf! () * @@ -29719,68 +33458,73 @@ export namespace compute_beta { * compute.httpHealthChecks.list * @desc Retrieves the list of HttpHealthCheck resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.httpHealthChecks.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.httpHealthChecks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.httpHealthChecks.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpHealthChecks.list * @memberOf! () * @@ -29860,63 +33604,99 @@ export namespace compute_beta { * compute.httpHealthChecks.patch * @desc Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpHealthChecks.patch({ * // Name of the HttpHealthCheck resource to patch. - * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * httpHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpHealthChecks.patch * @memberOf! () * @@ -29995,62 +33775,60 @@ export namespace compute_beta { * compute.httpHealthChecks.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.httpHealthChecks.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpHealthChecks.testIamPermissions * @memberOf! () * @@ -30132,63 +33910,99 @@ export namespace compute_beta { * compute.httpHealthChecks.update * @desc Updates a HttpHealthCheck resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpHealthChecks.update({ * // Name of the HttpHealthCheck resource to update. - * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * httpHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpHealthChecks.update * @memberOf! () * @@ -30431,58 +34245,79 @@ export namespace compute_beta { * compute.httpsHealthChecks.delete * @desc Deletes the specified HttpsHealthCheck resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpsHealthChecks.delete({ * // Name of the HttpsHealthCheck resource to delete. - * httpsHealthCheck: 'my-https-health-check', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * httpsHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpsHealthChecks.delete * @memberOf! () * @@ -30560,58 +34395,64 @@ export namespace compute_beta { * compute.httpsHealthChecks.get * @desc Returns the specified HttpsHealthCheck resource. Gets a list of available HTTPS health checks by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.httpsHealthChecks.get({ * // Name of the HttpsHealthCheck resource to return. - * httpsHealthCheck: 'my-https-health-check', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * httpsHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpsHealthChecks.get * @memberOf! () * @@ -30688,59 +34529,97 @@ export namespace compute_beta { * compute.httpsHealthChecks.insert * @desc Creates a HttpsHealthCheck resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpsHealthChecks.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpsHealthChecks.insert * @memberOf! () * @@ -30818,68 +34697,73 @@ export namespace compute_beta { * compute.httpsHealthChecks.list * @desc Retrieves the list of HttpsHealthCheck resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.httpsHealthChecks.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.httpsHealthChecks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.httpsHealthChecks.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpsHealthChecks.list * @memberOf! () * @@ -30961,63 +34845,99 @@ export namespace compute_beta { * compute.httpsHealthChecks.patch * @desc Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpsHealthChecks.patch({ * // Name of the HttpsHealthCheck resource to patch. - * httpsHealthCheck: 'my-https-health-check', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * httpsHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpsHealthChecks.patch * @memberOf! () * @@ -31096,62 +35016,60 @@ export namespace compute_beta { * compute.httpsHealthChecks.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.httpsHealthChecks.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpsHealthChecks.testIamPermissions * @memberOf! () * @@ -31233,63 +35151,99 @@ export namespace compute_beta { * compute.httpsHealthChecks.update * @desc Updates a HttpsHealthCheck resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpsHealthChecks.update({ * // Name of the HttpsHealthCheck resource to update. - * httpsHealthCheck: 'my-https-health-check', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * httpsHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpsHealthChecks.update * @memberOf! () * @@ -31532,58 +35486,79 @@ export namespace compute_beta { * compute.images.delete * @desc Deletes the specified image. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.images.delete({ * // Name of the image resource to delete. - * image: 'my-image', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.images.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * image: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.images.delete * @memberOf! () * @@ -31659,62 +35634,91 @@ export namespace compute_beta { * compute.images.deprecate * @desc Sets the deprecation status of an image. If an empty request body is given, clears the deprecation status instead. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.images.deprecate({ * // Image name. - * image: 'my-image', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * image: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deleted": "my_deleted", + * // "deprecated": "my_deprecated", + * // "obsolete": "my_obsolete", + * // "replacement": "my_replacement", + * // "state": "my_state" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.images.deprecate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.images.deprecate * @memberOf! () * @@ -31792,58 +35796,81 @@ export namespace compute_beta { * compute.images.get * @desc Returns the specified image. Gets a list of available images by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.images.get({ * // Name of the image resource to return. - * image: 'my-image', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.images.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * image: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "archiveSizeBytes": "my_archiveSizeBytes", + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "family": "my_family", + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "imageEncryptionKey": {}, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "rawDisk": {}, + * // "selfLink": "my_selfLink", + * // "shieldedInstanceInitialState": {}, + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskEncryptionKey": {}, + * // "sourceDiskId": "my_sourceDiskId", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "sourceType": "my_sourceType", + * // "status": "my_status", + * // "storageLocations": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.images.get * @memberOf! () * @@ -31916,58 +35943,81 @@ export namespace compute_beta { * compute.images.getFromFamily * @desc Returns the latest image that is part of an image family and is not deprecated. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.images.getFromFamily({ * // Name of the image family to search for. - * family: 'my-family', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.images.getFromFamily(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * family: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "archiveSizeBytes": "my_archiveSizeBytes", + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "family": "my_family", + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "imageEncryptionKey": {}, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "rawDisk": {}, + * // "selfLink": "my_selfLink", + * // "shieldedInstanceInitialState": {}, + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskEncryptionKey": {}, + * // "sourceDiskId": "my_sourceDiskId", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "sourceType": "my_sourceType", + * // "status": "my_status", + * // "storageLocations": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.images.getFromFamily * @memberOf! () * @@ -32041,6 +36091,60 @@ export namespace compute_beta { /** * compute.images.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.images.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.images.getIamPolicy * @memberOf! () * @@ -32116,59 +36220,119 @@ export namespace compute_beta { * compute.images.insert * @desc Creates an image in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 compute.images.insert({ + * // Force image creation if true. + * forceCreate: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "archiveSizeBytes": "my_archiveSizeBytes", + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "family": "my_family", + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "imageEncryptionKey": {}, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "rawDisk": {}, + * // "selfLink": "my_selfLink", + * // "shieldedInstanceInitialState": {}, + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskEncryptionKey": {}, + * // "sourceDiskId": "my_sourceDiskId", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "sourceType": "my_sourceType", + * // "status": "my_status", + * // "storageLocations": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.images.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.images.insert * @memberOf! () * @@ -32245,68 +36409,73 @@ export namespace compute_beta { * compute.images.list * @desc Retrieves the list of custom images available to the specified project. Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.images.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.images.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.images.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.images.list * @memberOf! () * @@ -32383,6 +36552,67 @@ export namespace compute_beta { /** * compute.images.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.images.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.images.setIamPolicy * @memberOf! () * @@ -32458,62 +36688,82 @@ export namespace compute_beta { * compute.images.setLabels * @desc Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.images.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } * }, - * - * auth: authClient, - * }; - * - * compute.images.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.images.setLabels * @memberOf! () * @@ -32590,62 +36840,60 @@ export namespace compute_beta { * compute.images.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.images.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.images.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.images.testIamPermissions * @memberOf! () * @@ -32942,65 +37190,89 @@ export namespace compute_beta { * compute.instanceGroupManagers.abandonInstances * @desc Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.abandonInstances({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.abandonInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.abandonInstances * @memberOf! () * @@ -33080,68 +37352,75 @@ export namespace compute_beta { * compute.instanceGroupManagers.aggregatedList * @desc Retrieves the list of managed instance groups and groups them by zone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroupManagers.aggregatedList(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroupManagers.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.instanceGroupManagers.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.aggregatedList * @memberOf! () * @@ -33230,6 +37509,86 @@ export namespace compute_beta { /** * compute.instanceGroupManagers.applyUpdatesToInstances * @desc Applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.applyUpdatesToInstances({ + * // The name of the managed instance group, should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone where the managed instance group is located. Should conform to RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [], + * // "minimalAction": "my_minimalAction", + * // "mostDisruptiveAllowedAction": "my_mostDisruptiveAllowedAction" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.applyUpdatesToInstances * @memberOf! () * @@ -33309,6 +37668,90 @@ export namespace compute_beta { /** * compute.instanceGroupManagers.createInstances * @desc Creates instances with per-instance configs in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.createInstances({ + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the managed instance group is located. It should conform to RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.createInstances * @memberOf! () * @@ -33388,61 +37831,81 @@ export namespace compute_beta { * compute.instanceGroupManagers.delete * @desc Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.delete({ + * // The name of the managed instance group to delete. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group to delete. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.delete * @memberOf! () * @@ -33521,65 +37984,89 @@ export namespace compute_beta { * compute.instanceGroupManagers.deleteInstances * @desc Flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.deleteInstances({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.deleteInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.deleteInstances * @memberOf! () * @@ -33658,6 +38145,84 @@ export namespace compute_beta { /** * compute.instanceGroupManagers.deletePerInstanceConfigs * @desc Deletes selected per-instance configs for the managed instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.deletePerInstanceConfigs({ + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone where the managed instance group is located. It should conform to RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "names": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.deletePerInstanceConfigs * @memberOf! () * @@ -33738,61 +38303,78 @@ export namespace compute_beta { * compute.instanceGroupManagers.get * @desc Returns all of the details about the specified managed instance group. Gets a list of available managed instance groups by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroupManagers.get({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "failoverAction": "my_failoverAction", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "pendingActions": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serviceAccount": "my_serviceAccount", + * // "statefulPolicy": {}, + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.get * @memberOf! () * @@ -33872,62 +38454,111 @@ export namespace compute_beta { * compute.instanceGroupManagers.insert * @desc Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where you want to create the managed instance group. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "failoverAction": "my_failoverAction", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "pendingActions": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serviceAccount": "my_serviceAccount", + * // "statefulPolicy": {}, + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.insert * @memberOf! () * @@ -34006,71 +38637,75 @@ export namespace compute_beta { * compute.instanceGroupManagers.list * @desc Retrieves a list of managed instance groups that are contained within the specified project and zone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroupManagers.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroupManagers.list(request, handlePage); - * } - * }; + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.instanceGroupManagers.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.list * @memberOf! () * @@ -34152,6 +38787,74 @@ export namespace compute_beta { /** * compute.instanceGroupManagers.listErrors * @desc Lists all errors thrown by actions on instances for a given managed instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroupManagers.listErrors({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9][0-9]{0,19}. + * instanceGroupManager: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone where the managed instance group is located. It should conform to RFC1035. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.listErrors * @memberOf! () * @@ -34250,74 +38953,73 @@ export namespace compute_beta { * compute.instanceGroupManagers.listManagedInstances * @desc Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroupManagers.listManagedInstances({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var managedInstancesPage = response['managedInstances']; - * if (!managedInstancesPage) { - * return; - * } - * for (var i = 0; i < managedInstancesPage.length; i++) { - * // TODO: Change code below to process each resource in `managedInstancesPage`: - * console.log(JSON.stringify(managedInstancesPage[i], null, 2)); - * } + * zone: 'placeholder-value', + * }); + * console.log(res.data); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroupManagers.listManagedInstances(request, handlePage); - * } - * }; + * // Example response + * // { + * // "managedInstances": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } * - * compute.instanceGroupManagers.listManagedInstances(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.listManagedInstances * @memberOf! () * @@ -34422,6 +39124,75 @@ export namespace compute_beta { /** * compute.instanceGroupManagers.listPerInstanceConfigs * @desc Lists all of the per-instance configs defined for the managed instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroupManagers.listPerInstanceConfigs({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone where the managed instance group is located. It should conform to RFC1035. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "nextPageToken": "my_nextPageToken", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.listPerInstanceConfigs * @memberOf! () * @@ -34527,66 +39298,113 @@ export namespace compute_beta { * compute.instanceGroupManagers.patch * @desc Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.patch({ + * // The name of the instance group manager. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where you want to create the managed instance group. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group manager. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "failoverAction": "my_failoverAction", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "pendingActions": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serviceAccount": "my_serviceAccount", + * // "statefulPolicy": {}, + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.patch * @memberOf! () * @@ -34665,6 +39483,90 @@ export namespace compute_beta { /** * compute.instanceGroupManagers.patchPerInstanceConfigs * @desc Inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.patchPerInstanceConfigs({ + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the managed instance group is located. It should conform to RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "perInstanceConfigs": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.patchPerInstanceConfigs * @memberOf! () * @@ -34746,65 +39648,89 @@ export namespace compute_beta { * compute.instanceGroupManagers.recreateInstances * @desc Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.recreateInstances({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.recreateInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.recreateInstances * @memberOf! () * @@ -34884,66 +39810,83 @@ export namespace compute_beta { * compute.instanceGroupManagers.resize * @desc Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. When resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including: + The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance. This list is subject to change. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.resize({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. + * size: 'placeholder-value', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * // The number of running instances that the managed instance group should maintain at any given time. - * // The group automatically adds or removes instances to maintain the number of instances specified by - * // this parameter. - * size: 0, // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.resize(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.resize * @memberOf! () * @@ -35023,65 +39966,90 @@ export namespace compute_beta { * compute.instanceGroupManagers.resizeAdvanced * @desc Resizes the managed instance group with advanced configuration options like disabling creation retries. This is an extended version of the resize method. If you increase the size of the instance group, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating, creatingWithoutRetries, or deleting actions with the get or listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.resizeAdvanced({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "noCreationRetries": false, + * // "targetSize": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.resizeAdvanced(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.resizeAdvanced * @memberOf! () * @@ -35161,65 +40129,89 @@ export namespace compute_beta { * compute.instanceGroupManagers.setAutoHealingPolicies * @desc Modifies the autohealing policies. [Deprecated] This method is deprecated. Please use Patch instead. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.setAutoHealingPolicies({ + * // The name of the instance group manager. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group manager. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoHealingPolicies": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.setAutoHealingPolicies(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.setAutoHealingPolicies * @memberOf! () * @@ -35301,65 +40293,89 @@ export namespace compute_beta { * compute.instanceGroupManagers.setInstanceTemplate * @desc Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.setInstanceTemplate({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instanceTemplate": "my_instanceTemplate" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.setInstanceTemplate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.setInstanceTemplate * @memberOf! () * @@ -35439,65 +40455,90 @@ export namespace compute_beta { * compute.instanceGroupManagers.setTargetPools * @desc Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.setTargetPools({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "targetPools": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.setTargetPools(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.setTargetPools * @memberOf! () * @@ -35577,65 +40618,62 @@ export namespace compute_beta { * compute.instanceGroupManagers.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroupManagers.testIamPermissions({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.testIamPermissions * @memberOf! () * @@ -35718,66 +40756,113 @@ export namespace compute_beta { * compute.instanceGroupManagers.update * @desc Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is updated even if the instances in the group have not yet been updated. You must separately verify the status of the individual instances with the listManagedInstances method. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.update({ + * // The name of the instance group manager. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where you want to create the managed instance group. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group manager. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "failoverAction": "my_failoverAction", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "pendingActions": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serviceAccount": "my_serviceAccount", + * // "statefulPolicy": {}, + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.update * @memberOf! () * @@ -35856,6 +40941,90 @@ export namespace compute_beta { /** * compute.instanceGroupManagers.updatePerInstanceConfigs * @desc Inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.updatePerInstanceConfigs({ + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the managed instance group is located. It should conform to RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "perInstanceConfigs": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.updatePerInstanceConfigs * @memberOf! () * @@ -36637,65 +41806,89 @@ export namespace compute_beta { * compute.instanceGroups.addInstances * @desc Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroups.addInstances({ + * // The name of the instance group where you are adding instances. + * instanceGroup: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group where you are adding instances. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroups.addInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroups.addInstances * @memberOf! () * @@ -36775,68 +41968,75 @@ export namespace compute_beta { * compute.instanceGroups.aggregatedList * @desc Retrieves the list of instance groups and sorts them by zone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroups.aggregatedList(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroups.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.instanceGroups.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroups.aggregatedList * @memberOf! () * @@ -36924,61 +42124,81 @@ export namespace compute_beta { * compute.instanceGroups.delete * @desc Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroups.delete({ + * // The name of the instance group to delete. + * instanceGroup: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group to delete. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroups.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroups.delete * @memberOf! () * @@ -37057,61 +42277,66 @@ export namespace compute_beta { * compute.instanceGroups.get * @desc Returns the specified instance group. Gets a list of available instance groups by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroups.get({ + * // The name of the instance group. + * instanceGroup: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroups.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroups.get * @memberOf! () * @@ -37189,62 +42414,99 @@ export namespace compute_beta { * compute.instanceGroups.insert * @desc Creates an instance group in the specified project using the parameters that are included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroups.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where you want to create the instance group. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroups.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroups.insert * @memberOf! () * @@ -37323,71 +42585,75 @@ export namespace compute_beta { * compute.instanceGroups.list * @desc Retrieves the list of instance groups that are located in the specified project and zone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroups.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroups.list(request, handlePage); - * } - * }; + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.instanceGroups.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroups.list * @memberOf! () * @@ -37468,78 +42734,85 @@ export namespace compute_beta { * compute.instanceGroups.listInstances * @desc Lists the instances in the specified instance group. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroups.listInstances({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The name of the instance group from which you want to generate a list of included instances. + * instanceGroup: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group from which you want to generate a list of included instances. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instanceState": "my_instanceState" + * // } * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroups.listInstances(request, handlePage); - * } - * }; - * - * compute.instanceGroups.listInstances(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroups.listInstances * @memberOf! () * @@ -37629,65 +42902,89 @@ export namespace compute_beta { * compute.instanceGroups.removeInstances * @desc Removes one or more instances from the specified instance group, but does not delete those instances. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroups.removeInstances({ + * // The name of the instance group where the specified instances will be removed. + * instanceGroup: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group where the specified instances will be removed. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroups.removeInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroups.removeInstances * @memberOf! () * @@ -37767,65 +43064,90 @@ export namespace compute_beta { * compute.instanceGroups.setNamedPorts * @desc Sets the named ports for the specified instance group. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroups.setNamedPorts({ + * // The name of the instance group where the named ports are updated. + * instanceGroup: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group where the named ports are updated. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "namedPorts": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroups.setNamedPorts(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroups.setNamedPorts * @memberOf! () * @@ -37905,65 +43227,62 @@ export namespace compute_beta { * compute.instanceGroups.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroups.testIamPermissions({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.instanceGroups.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroups.testIamPermissions * @memberOf! () * @@ -38340,68 +43659,97 @@ export namespace compute_beta { * compute.instances.addAccessConfig * @desc Adds an access config to an instance's network interface. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.addAccessConfig({ * // The instance name for this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // The name of the network interface to add to this instance. - * networkInterface: '', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * networkInterface: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "name": "my_name", + * // "natIP": "my_natIP", + * // "networkTier": "my_networkTier", + * // "publicPtrDomainName": "my_publicPtrDomainName", + * // "setPublicPtr": false, + * // "type": "my_type" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.addAccessConfig(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.addAccessConfig * @memberOf! () * @@ -38481,6 +43829,90 @@ export namespace compute_beta { /** * compute.instances.addResourcePolicies * @desc Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.addResourcePolicies({ + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourcePolicies": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.addResourcePolicies * @memberOf! () * @@ -38560,68 +43992,75 @@ export namespace compute_beta { * compute.instances.aggregatedList * @desc Retrieves aggregated list of all of the instances in your project across all regions and zones. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instances.aggregatedList(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.instances.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.aggregatedList * @memberOf! () * @@ -38705,65 +44144,105 @@ export namespace compute_beta { * compute.instances.attachDisk * @desc Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.attachDisk({ + * // Whether to force attach the disk even if it's currently attached to another instance. + * forceAttach: 'placeholder-value', + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The instance name for this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoDelete": false, + * // "boot": false, + * // "deviceName": "my_deviceName", + * // "diskEncryptionKey": {}, + * // "diskSizeGb": "my_diskSizeGb", + * // "guestOsFeatures": [], + * // "index": 0, + * // "initializeParams": {}, + * // "interface": "my_interface", + * // "kind": "my_kind", + * // "licenses": [], + * // "mode": "my_mode", + * // "shieldedInstanceInitialState": {}, + * // "source": "my_source", + * // "type": "my_type" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.attachDisk(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.attachDisk * @memberOf! () * @@ -38844,61 +44323,81 @@ export namespace compute_beta { * compute.instances.delete * @desc Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.delete({ + * // Name of the instance resource to delete. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to delete. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.delete * @memberOf! () * @@ -38976,67 +44475,85 @@ export namespace compute_beta { * compute.instances.deleteAccessConfig * @desc Deletes an access config from an instance's network interface. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The instance name for this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.deleteAccessConfig({ * // The name of the access config to delete. - * accessConfig: '', // TODO: Update placeholder value. - * + * accessConfig: 'placeholder-value', + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // The name of the network interface. - * networkInterface: '', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.deleteAccessConfig(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * networkInterface: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.deleteAccessConfig * @memberOf! () * @@ -39123,64 +44640,83 @@ export namespace compute_beta { * compute.instances.detachDisk * @desc Detaches a disk from an instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.detachDisk({ + * // The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names. + * deviceName: 'placeholder-value', + * // Instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Instance name. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * // Disk device name to detach. - * deviceName: '', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.detachDisk(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.detachDisk * @memberOf! () * @@ -39260,61 +44796,90 @@ export namespace compute_beta { * compute.instances.get * @desc Returns the specified Instance resource. Gets a list of available instances by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.get({ + * // Name of the instance resource to return. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to return. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "canIpForward": false, + * // "cpuPlatform": "my_cpuPlatform", + * // "creationTimestamp": "my_creationTimestamp", + * // "deletionProtection": false, + * // "description": "my_description", + * // "disks": [], + * // "displayDevice": {}, + * // "eraseWindowsVssSignature": false, + * // "fingerprint": "my_fingerprint", + * // "guestAccelerators": [], + * // "hostname": "my_hostname", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "machineType": "my_machineType", + * // "metadata": {}, + * // "minCpuPlatform": "my_minCpuPlatform", + * // "name": "my_name", + * // "networkInterfaces": [], + * // "privateIpv6GoogleAccess": "my_privateIpv6GoogleAccess", + * // "reservationAffinity": {}, + * // "resourcePolicies": [], + * // "scheduling": {}, + * // "selfLink": "my_selfLink", + * // "serviceAccounts": [], + * // "shieldedInstanceConfig": {}, + * // "shieldedInstanceIntegrityPolicy": {}, + * // "shieldedVmConfig": {}, + * // "shieldedVmIntegrityPolicy": {}, + * // "sourceMachineImage": "my_sourceMachineImage", + * // "sourceMachineImageEncryptionKey": {}, + * // "startRestricted": false, + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "tags": {}, + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.get * @memberOf! () * @@ -39388,6 +44953,58 @@ export namespace compute_beta { /** * compute.instances.getEffectiveFirewalls * @desc Returns effective firewalls applied to an interface of the instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.getEffectiveFirewalls({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // The name of the network interface to get the effective firewalls. + * networkInterface: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "firewalls": [], + * // "organizationFirewalls": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.getEffectiveFirewalls * @memberOf! () * @@ -39482,6 +45099,64 @@ export namespace compute_beta { /** * compute.instances.getGuestAttributes * @desc Returns the specified guest attributes entry. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.getGuestAttributes({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Specifies the guest attributes path to be queried. + * queryPath: 'placeholder-value', + * // Specifies the key for the guest attributes entry. + * variableKey: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "queryPath": "my_queryPath", + * // "queryValue": {}, + * // "selfLink": "my_selfLink", + * // "variableKey": "my_variableKey", + * // "variableValue": "my_variableValue" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.getGuestAttributes * @memberOf! () * @@ -39562,6 +45237,62 @@ export namespace compute_beta { /** * compute.instances.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.getIamPolicy * @memberOf! () * @@ -39637,6 +45368,56 @@ export namespace compute_beta { /** * compute.instances.getScreenshot * @desc Returns the screenshot from the specified instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.getScreenshot({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contents": "my_contents", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.getScreenshot * @memberOf! () * @@ -39714,61 +45495,62 @@ export namespace compute_beta { * compute.instances.getSerialPortOutput * @desc Returns the last 1 MB of serial port output from the specified instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.getSerialPortOutput({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Specifies which COM or serial port to retrieve data from. + * port: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call. + * start: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.getSerialPortOutput(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contents": "my_contents", + * // "kind": "my_kind", + * // "next": "my_next", + * // "selfLink": "my_selfLink", + * // "start": "my_start" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.getSerialPortOutput * @memberOf! () * @@ -39849,6 +45631,57 @@ export namespace compute_beta { /** * compute.instances.getShieldedInstanceIdentity * @desc Returns the Shielded Instance Identity of an instance + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.getShieldedInstanceIdentity({ + * // Name or id of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "encryptionKey": {}, + * // "kind": "my_kind", + * // "signingKey": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.getShieldedInstanceIdentity * @memberOf! () * @@ -39929,6 +45762,57 @@ export namespace compute_beta { /** * compute.instances.getShieldedVmIdentity * @desc Returns the Shielded VM Identity of an instance + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.getShieldedVmIdentity({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "encryptionKey": {}, + * // "kind": "my_kind", + * // "signingKey": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.getShieldedVmIdentity * @memberOf! () * @@ -40008,62 +45892,137 @@ export namespace compute_beta { * compute.instances.insert * @desc Creates an instance resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Specifies instance template to create the instance. + * // + * // This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: + * // - https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate + * // - projects/project/global/instanceTemplates/instanceTemplate + * // - global/instanceTemplates/instanceTemplate + * sourceInstanceTemplate: 'placeholder-value', + * // Specifies instance machine to create the instance. + * // + * // This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: + * // - https://www.googleapis.com/compute/v1/projects/project/global/global/machineImages/machineImage + * // - projects/project/global/global/machineImages/machineImage + * // - global/machineImages/machineImage + * sourceMachineImage: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "canIpForward": false, + * // "cpuPlatform": "my_cpuPlatform", + * // "creationTimestamp": "my_creationTimestamp", + * // "deletionProtection": false, + * // "description": "my_description", + * // "disks": [], + * // "displayDevice": {}, + * // "eraseWindowsVssSignature": false, + * // "fingerprint": "my_fingerprint", + * // "guestAccelerators": [], + * // "hostname": "my_hostname", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "machineType": "my_machineType", + * // "metadata": {}, + * // "minCpuPlatform": "my_minCpuPlatform", + * // "name": "my_name", + * // "networkInterfaces": [], + * // "privateIpv6GoogleAccess": "my_privateIpv6GoogleAccess", + * // "reservationAffinity": {}, + * // "resourcePolicies": [], + * // "scheduling": {}, + * // "selfLink": "my_selfLink", + * // "serviceAccounts": [], + * // "shieldedInstanceConfig": {}, + * // "shieldedInstanceIntegrityPolicy": {}, + * // "shieldedVmConfig": {}, + * // "shieldedVmIntegrityPolicy": {}, + * // "sourceMachineImage": "my_sourceMachineImage", + * // "sourceMachineImageEncryptionKey": {}, + * // "startRestricted": false, + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "tags": {}, + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.insert * @memberOf! () * @@ -40143,71 +46102,75 @@ export namespace compute_beta { * compute.instances.list * @desc Retrieves the list of instances contained within the specified zone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instances.list(request, handlePage); - * } - * }; + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.instances.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.list * @memberOf! () * @@ -40287,75 +46250,77 @@ export namespace compute_beta { * compute.instances.listReferrers * @desc Retrieves the list of referrers to instances contained within the specified zone. For more information, read Viewing Referrers to VM Instances. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.listReferrers({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. + * instance: '-|[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the target instance scoping this request, or '-' if the request should span over all - * // instances in the container. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instances.listReferrers(request, handlePage); - * } - * }; + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.instances.listReferrers(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.listReferrers * @memberOf! () * @@ -40440,6 +46405,90 @@ export namespace compute_beta { /** * compute.instances.removeResourcePolicies * @desc Removes resource policies from an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.removeResourcePolicies({ + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourcePolicies": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.removeResourcePolicies * @memberOf! () * @@ -40521,61 +46570,81 @@ export namespace compute_beta { * compute.instances.reset * @desc Performs a reset on the instance. This is a hard reset the VM does not do a graceful shutdown. For more information, see Resetting an instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.reset({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.reset(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.reset * @memberOf! () * @@ -40652,6 +46721,91 @@ export namespace compute_beta { /** * compute.instances.resume * @desc Resumes an instance that was suspended using the instances().suspend method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.resume({ + * // Name of the instance resource to resume. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "disks": [], + * // "instanceEncryptionKey": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.resume * @memberOf! () * @@ -40730,61 +46884,83 @@ export namespace compute_beta { * compute.instances.setDeletionProtection * @desc Sets deletion protection on the instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setDeletionProtection({ + * // Whether the resource should be protected against deletion. + * deletionProtection: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.setDeletionProtection(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.setDeletionProtection * @memberOf! () * @@ -40866,67 +47042,85 @@ export namespace compute_beta { * compute.instances.setDiskAutoDelete * @desc Sets the auto-delete flag for a disk attached to an instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setDiskAutoDelete({ + * // Whether to auto-delete the disk when the instance is deleted. + * autoDelete: 'placeholder-value', + * // The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names. + * deviceName: 'w[w.-]{0,254}', + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The instance name. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * // Whether to auto-delete the disk when the instance is deleted. - * autoDelete: false, // TODO: Update placeholder value. - * - * // The device name of the disk to modify. - * deviceName: '', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.setDiskAutoDelete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.setDiskAutoDelete * @memberOf! () * @@ -41012,6 +47206,69 @@ export namespace compute_beta { /** * compute.instances.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.setIamPolicy * @memberOf! () * @@ -41088,65 +47345,90 @@ export namespace compute_beta { * compute.instances.setLabels * @desc Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setLabels({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.setLabels * @memberOf! () * @@ -41226,65 +47508,89 @@ export namespace compute_beta { * compute.instances.setMachineResources * @desc Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setMachineResources({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "guestAccelerators": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.setMachineResources(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.setMachineResources * @memberOf! () * @@ -41364,65 +47670,89 @@ export namespace compute_beta { * compute.instances.setMachineType * @desc Changes the machine type for a stopped instance to the machine type specified in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setMachineType({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "machineType": "my_machineType" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.setMachineType(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.setMachineType * @memberOf! () * @@ -41502,65 +47832,91 @@ export namespace compute_beta { * compute.instances.setMetadata * @desc Sets metadata for the specified instance to the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setMetadata({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "items": [], + * // "kind": "my_kind" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.setMetadata(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.setMetadata * @memberOf! () * @@ -41640,65 +47996,89 @@ export namespace compute_beta { * compute.instances.setMinCpuPlatform * @desc Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setMinCpuPlatform({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "minCpuPlatform": "my_minCpuPlatform" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.setMinCpuPlatform(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.setMinCpuPlatform * @memberOf! () * @@ -41778,65 +48158,93 @@ export namespace compute_beta { * compute.instances.setScheduling * @desc Sets an instance's scheduling options. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setScheduling({ + * // Instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Instance name. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "automaticRestart": false, + * // "minNodeCpus": 0, + * // "nodeAffinities": [], + * // "onHostMaintenance": "my_onHostMaintenance", + * // "preemptible": false + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.setScheduling(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.setScheduling * @memberOf! () * @@ -41916,65 +48324,90 @@ export namespace compute_beta { * compute.instances.setServiceAccount * @desc Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setServiceAccount({ + * // Name of the instance resource to start. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to start. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "email": "my_email", + * // "scopes": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.setServiceAccount(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.setServiceAccount * @memberOf! () * @@ -42053,6 +48486,90 @@ export namespace compute_beta { /** * compute.instances.setShieldedInstanceIntegrityPolicy * @desc Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setShieldedInstanceIntegrityPolicy({ + * // Name or id of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "updateAutoLearnPolicy": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.setShieldedInstanceIntegrityPolicy * @memberOf! () * @@ -42133,6 +48650,90 @@ export namespace compute_beta { /** * compute.instances.setShieldedVmIntegrityPolicy * @desc Sets the Shielded VM integrity policy for a VM instance. You can only use this method on a running VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setShieldedVmIntegrityPolicy({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "updateAutoLearnPolicy": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.setShieldedVmIntegrityPolicy * @memberOf! () * @@ -42214,65 +48815,90 @@ export namespace compute_beta { * compute.instances.setTags * @desc Sets network tags for the specified instance to the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setTags({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "items": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.setTags(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.setTags * @memberOf! () * @@ -42351,6 +48977,76 @@ export namespace compute_beta { /** * compute.instances.simulateMaintenanceEvent * @desc Simulates a maintenance event on the instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.simulateMaintenanceEvent({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.simulateMaintenanceEvent * @memberOf! () * @@ -42430,61 +49126,81 @@ export namespace compute_beta { * compute.instances.start * @desc Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.start({ + * // Name of the instance resource to start. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to start. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.start(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.start * @memberOf! () * @@ -42562,65 +49278,89 @@ export namespace compute_beta { * compute.instances.startWithEncryptionKey * @desc Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.startWithEncryptionKey({ + * // Name of the instance resource to start. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to start. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "disks": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.startWithEncryptionKey(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.startWithEncryptionKey * @memberOf! () * @@ -42702,61 +49442,81 @@ export namespace compute_beta { * compute.instances.stop * @desc Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.stop({ + * // Name of the instance resource to stop. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to stop. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.stop(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.stop * @memberOf! () * @@ -42833,6 +49593,84 @@ export namespace compute_beta { /** * compute.instances.suspend * @desc This method suspends a running instance, saving its state to persistent storage, and allows you to resume the instance at a later time. Suspended instances incur reduced per-minute, virtual machine usage charges while they are suspended. Any resources the virtual machine is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.suspend({ + * // If true, discard the contents of any attached localSSD partitions. Default value is false (== preserve localSSD data). + * discardLocalSsd: 'placeholder-value', + * // Name of the instance resource to suspend. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.suspend * @memberOf! () * @@ -42912,65 +49750,62 @@ export namespace compute_beta { * compute.instances.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.testIamPermissions({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.instances.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.testIamPermissions * @memberOf! () * @@ -43052,6 +49887,130 @@ export namespace compute_beta { /** * compute.instances.update * @desc Updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.update({ + * // Name of the instance resource to update. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Specifies the action to take when updating an instance even if the updated properties do not require it. If not specified, then Compute Engine acts based on the minimum action that the updated properties require. + * minimalAction: 'placeholder-value', + * // Specifies the most disruptive action that can be taken on the instance as part of the update. Compute Engine returns an error if the instance properties require a more disruptive action as part of the instance update. Valid options from lowest to highest are NO_EFFECT, REFRESH, and RESTART. + * mostDisruptiveAllowedAction: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "canIpForward": false, + * // "cpuPlatform": "my_cpuPlatform", + * // "creationTimestamp": "my_creationTimestamp", + * // "deletionProtection": false, + * // "description": "my_description", + * // "disks": [], + * // "displayDevice": {}, + * // "eraseWindowsVssSignature": false, + * // "fingerprint": "my_fingerprint", + * // "guestAccelerators": [], + * // "hostname": "my_hostname", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "machineType": "my_machineType", + * // "metadata": {}, + * // "minCpuPlatform": "my_minCpuPlatform", + * // "name": "my_name", + * // "networkInterfaces": [], + * // "privateIpv6GoogleAccess": "my_privateIpv6GoogleAccess", + * // "reservationAffinity": {}, + * // "resourcePolicies": [], + * // "scheduling": {}, + * // "selfLink": "my_selfLink", + * // "serviceAccounts": [], + * // "shieldedInstanceConfig": {}, + * // "shieldedInstanceIntegrityPolicy": {}, + * // "shieldedVmConfig": {}, + * // "shieldedVmIntegrityPolicy": {}, + * // "sourceMachineImage": "my_sourceMachineImage", + * // "sourceMachineImageEncryptionKey": {}, + * // "startRestricted": false, + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "tags": {}, + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.update * @memberOf! () * @@ -43132,68 +50091,97 @@ export namespace compute_beta { * compute.instances.updateAccessConfig * @desc Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.updateAccessConfig({ * // The instance name for this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // The name of the network interface where the access config is attached. - * networkInterface: '', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * networkInterface: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "name": "my_name", + * // "natIP": "my_natIP", + * // "networkTier": "my_networkTier", + * // "publicPtrDomainName": "my_publicPtrDomainName", + * // "setPublicPtr": false, + * // "type": "my_type" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.updateAccessConfig(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.updateAccessConfig * @memberOf! () * @@ -43273,6 +50261,90 @@ export namespace compute_beta { /** * compute.instances.updateDisplayDevice * @desc Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.updateDisplayDevice({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "enableDisplay": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.updateDisplayDevice * @memberOf! () * @@ -43352,69 +50424,99 @@ export namespace compute_beta { * compute.instances.updateNetworkInterface * @desc Updates an instance's network interface. This method follows PATCH semantics. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.updateNetworkInterface({ * // The instance name for this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // The name of the network interface to update. - * networkInterface: '', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * networkInterface: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accessConfigs": [], + * // "aliasIpRanges": [], + * // "fingerprint": "my_fingerprint", + * // "ipv6Address": "my_ipv6Address", + * // "kind": "my_kind", + * // "name": "my_name", + * // "network": "my_network", + * // "networkIP": "my_networkIP", + * // "subnetwork": "my_subnetwork" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.updateNetworkInterface(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.updateNetworkInterface * @memberOf! () * @@ -43496,6 +50598,92 @@ export namespace compute_beta { /** * compute.instances.updateShieldedInstanceConfig * @desc Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.updateShieldedInstanceConfig({ + * // Name or id of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "enableIntegrityMonitoring": false, + * // "enableSecureBoot": false, + * // "enableVtpm": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.updateShieldedInstanceConfig * @memberOf! () * @@ -43576,6 +50764,92 @@ export namespace compute_beta { /** * compute.instances.updateShieldedVmConfig * @desc Updates the Shielded VM config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.updateShieldedVmConfig({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "enableIntegrityMonitoring": false, + * // "enableSecureBoot": false, + * // "enableVtpm": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.updateShieldedVmConfig * @memberOf! () * @@ -44949,58 +52223,79 @@ export namespace compute_beta { * compute.instanceTemplates.delete * @desc Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceTemplates.delete({ * // The name of the instance template to delete. - * instanceTemplate: 'my-instance-template', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceTemplates.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * instanceTemplate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceTemplates.delete * @memberOf! () * @@ -45078,58 +52373,60 @@ export namespace compute_beta { * compute.instanceTemplates.get * @desc Returns the specified instance template. Gets a list of available instance templates by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceTemplates.get({ * // The name of the instance template. - * instanceTemplate: 'my-instance-template', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceTemplates.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * instanceTemplate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "properties": {}, + * // "selfLink": "my_selfLink", + * // "sourceInstance": "my_sourceInstance", + * // "sourceInstanceParams": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceTemplates.get * @memberOf! () * @@ -45205,6 +52502,60 @@ export namespace compute_beta { /** * compute.instanceTemplates.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceTemplates.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceTemplates.getIamPolicy * @memberOf! () * @@ -45280,59 +52631,93 @@ export namespace compute_beta { * compute.instanceTemplates.insert * @desc Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceTemplates.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "properties": {}, + * // "selfLink": "my_selfLink", + * // "sourceInstance": "my_sourceInstance", + * // "sourceInstanceParams": {} + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceTemplates.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceTemplates.insert * @memberOf! () * @@ -45410,68 +52795,73 @@ export namespace compute_beta { * compute.instanceTemplates.list * @desc Retrieves a list of instance templates that are contained within the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceTemplates.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceTemplates.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.instanceTemplates.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceTemplates.list * @memberOf! () * @@ -45552,6 +52942,67 @@ export namespace compute_beta { /** * compute.instanceTemplates.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceTemplates.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceTemplates.setIamPolicy * @memberOf! () * @@ -45627,62 +53078,60 @@ export namespace compute_beta { * compute.instanceTemplates.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceTemplates.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.instanceTemplates.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceTemplates.testIamPermissions * @memberOf! () * @@ -45919,68 +53368,75 @@ export namespace compute_beta { * compute.interconnectAttachments.aggregatedList * @desc Retrieves an aggregated list of interconnect attachments. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.interconnectAttachments.aggregatedList(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnectAttachments.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.interconnectAttachments.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnectAttachments.aggregatedList * @memberOf! () * @@ -46078,61 +53534,82 @@ export namespace compute_beta { * compute.interconnectAttachments.delete * @desc Deletes the specified interconnect attachment. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnectAttachments.delete({ + * // Name of the interconnect attachment to delete. + * interconnectAttachment: + * '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the interconnect attachment to delete. - * interconnectAttachment: 'my-interconnect-attachment', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.interconnectAttachments.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnectAttachments.delete * @memberOf! () * @@ -46211,61 +53688,80 @@ export namespace compute_beta { * compute.interconnectAttachments.get * @desc Returns the specified interconnect attachment. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnectAttachments.get({ + * // Name of the interconnect attachment to return. + * interconnectAttachment: + * '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the interconnect attachment to return. - * interconnectAttachment: 'my-interconnect-attachment', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.interconnectAttachments.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adminEnabled": false, + * // "bandwidth": "my_bandwidth", + * // "candidateSubnets": [], + * // "cloudRouterIpAddress": "my_cloudRouterIpAddress", + * // "creationTimestamp": "my_creationTimestamp", + * // "customerRouterIpAddress": "my_customerRouterIpAddress", + * // "description": "my_description", + * // "edgeAvailabilityDomain": "my_edgeAvailabilityDomain", + * // "googleReferenceId": "my_googleReferenceId", + * // "id": "my_id", + * // "interconnect": "my_interconnect", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "operationalStatus": "my_operationalStatus", + * // "pairingKey": "my_pairingKey", + * // "partnerAsn": "my_partnerAsn", + * // "partnerMetadata": {}, + * // "privateInterconnectInfo": {}, + * // "region": "my_region", + * // "router": "my_router", + * // "selfLink": "my_selfLink", + * // "state": "my_state", + * // "type": "my_type", + * // "vlanTag8021q": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnectAttachments.get * @memberOf! () * @@ -46345,62 +53841,114 @@ export namespace compute_beta { * compute.interconnectAttachments.insert * @desc Creates an InterconnectAttachment in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnectAttachments.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // If true, the request will not be committed. + * validateOnly: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adminEnabled": false, + * // "bandwidth": "my_bandwidth", + * // "candidateSubnets": [], + * // "cloudRouterIpAddress": "my_cloudRouterIpAddress", + * // "creationTimestamp": "my_creationTimestamp", + * // "customerRouterIpAddress": "my_customerRouterIpAddress", + * // "description": "my_description", + * // "edgeAvailabilityDomain": "my_edgeAvailabilityDomain", + * // "googleReferenceId": "my_googleReferenceId", + * // "id": "my_id", + * // "interconnect": "my_interconnect", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "operationalStatus": "my_operationalStatus", + * // "pairingKey": "my_pairingKey", + * // "partnerAsn": "my_partnerAsn", + * // "partnerMetadata": {}, + * // "privateInterconnectInfo": {}, + * // "region": "my_region", + * // "router": "my_router", + * // "selfLink": "my_selfLink", + * // "state": "my_state", + * // "type": "my_type", + * // "vlanTag8021q": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.interconnectAttachments.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnectAttachments.insert * @memberOf! () * @@ -46480,71 +54028,75 @@ export namespace compute_beta { * compute.interconnectAttachments.list * @desc Retrieves the list of interconnect attachments contained within the specified region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnectAttachments.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.interconnectAttachments.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.interconnectAttachments.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnectAttachments.list * @memberOf! () * @@ -46631,6 +54183,116 @@ export namespace compute_beta { /** * compute.interconnectAttachments.patch * @desc Updates the specified interconnect attachment with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnectAttachments.patch({ + * // Name of the interconnect attachment to patch. + * interconnectAttachment: + * '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adminEnabled": false, + * // "bandwidth": "my_bandwidth", + * // "candidateSubnets": [], + * // "cloudRouterIpAddress": "my_cloudRouterIpAddress", + * // "creationTimestamp": "my_creationTimestamp", + * // "customerRouterIpAddress": "my_customerRouterIpAddress", + * // "description": "my_description", + * // "edgeAvailabilityDomain": "my_edgeAvailabilityDomain", + * // "googleReferenceId": "my_googleReferenceId", + * // "id": "my_id", + * // "interconnect": "my_interconnect", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "operationalStatus": "my_operationalStatus", + * // "pairingKey": "my_pairingKey", + * // "partnerAsn": "my_partnerAsn", + * // "partnerMetadata": {}, + * // "privateInterconnectInfo": {}, + * // "region": "my_region", + * // "router": "my_router", + * // "selfLink": "my_selfLink", + * // "state": "my_state", + * // "type": "my_type", + * // "vlanTag8021q": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnectAttachments.patch * @memberOf! () * @@ -46709,6 +54371,91 @@ export namespace compute_beta { /** * compute.interconnectAttachments.setLabels * @desc Sets the labels on an InterconnectAttachment. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnectAttachments.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnectAttachments.setLabels * @memberOf! () * @@ -46788,65 +54535,62 @@ export namespace compute_beta { * compute.interconnectAttachments.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnectAttachments.testIamPermissions({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.interconnectAttachments.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnectAttachments.testIamPermissions * @memberOf! () * @@ -47157,58 +54901,66 @@ export namespace compute_beta { * compute.interconnectLocations.get * @desc Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnectLocations.get({ * // Name of the interconnect location to return. - * interconnectLocation: 'my-interconnect-location', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.interconnectLocations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * interconnectLocation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "availabilityZone": "my_availabilityZone", + * // "city": "my_city", + * // "continent": "my_continent", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "facilityProvider": "my_facilityProvider", + * // "facilityProviderFacilityId": "my_facilityProviderFacilityId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "peeringdbFacilityId": "my_peeringdbFacilityId", + * // "regionInfos": [], + * // "selfLink": "my_selfLink", + * // "status": "my_status" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnectLocations.get * @memberOf! () * @@ -47287,68 +55039,73 @@ export namespace compute_beta { * compute.interconnectLocations.list * @desc Retrieves the list of interconnect locations available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.interconnectLocations.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnectLocations.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.interconnectLocations.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnectLocations.list * @memberOf! () * @@ -47482,58 +55239,79 @@ export namespace compute_beta { * compute.interconnects.delete * @desc Deletes the specified interconnect. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnects.delete({ * // Name of the interconnect to delete. - * interconnect: 'my-interconnect', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.interconnects.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * interconnect: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnects.delete * @memberOf! () * @@ -47611,58 +55389,75 @@ export namespace compute_beta { * compute.interconnects.get * @desc Returns the specified interconnect. Get a list of available interconnects by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnects.get({ * // Name of the interconnect to return. - * interconnect: 'my-interconnect', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.interconnects.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * interconnect: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adminEnabled": false, + * // "circuitInfos": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "customerName": "my_customerName", + * // "description": "my_description", + * // "expectedOutages": [], + * // "googleIpAddress": "my_googleIpAddress", + * // "googleReferenceId": "my_googleReferenceId", + * // "id": "my_id", + * // "interconnectAttachments": [], + * // "interconnectType": "my_interconnectType", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "linkType": "my_linkType", + * // "location": "my_location", + * // "name": "my_name", + * // "nocContactEmail": "my_nocContactEmail", + * // "operationalStatus": "my_operationalStatus", + * // "peerIpAddress": "my_peerIpAddress", + * // "provisionedLinkCount": 0, + * // "requestedLinkCount": 0, + * // "selfLink": "my_selfLink", + * // "state": "my_state" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnects.get * @memberOf! () * @@ -47738,6 +55533,53 @@ export namespace compute_beta { /** * compute.interconnects.getDiagnostics * @desc Returns the interconnectDiagnostics for the specified interconnect. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnects.getDiagnostics({ + * // Name of the interconnect resource to query. + * interconnect: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "result": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnects.getDiagnostics * @memberOf! () * @@ -47825,59 +55667,108 @@ export namespace compute_beta { * compute.interconnects.insert * @desc Creates a Interconnect in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnects.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adminEnabled": false, + * // "circuitInfos": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "customerName": "my_customerName", + * // "description": "my_description", + * // "expectedOutages": [], + * // "googleIpAddress": "my_googleIpAddress", + * // "googleReferenceId": "my_googleReferenceId", + * // "id": "my_id", + * // "interconnectAttachments": [], + * // "interconnectType": "my_interconnectType", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "linkType": "my_linkType", + * // "location": "my_location", + * // "name": "my_name", + * // "nocContactEmail": "my_nocContactEmail", + * // "operationalStatus": "my_operationalStatus", + * // "peerIpAddress": "my_peerIpAddress", + * // "provisionedLinkCount": 0, + * // "requestedLinkCount": 0, + * // "selfLink": "my_selfLink", + * // "state": "my_state" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.interconnects.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnects.insert * @memberOf! () * @@ -47954,68 +55845,73 @@ export namespace compute_beta { * compute.interconnects.list * @desc Retrieves the list of interconnect available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.interconnects.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnects.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.interconnects.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnects.list * @memberOf! () * @@ -48094,63 +55990,110 @@ export namespace compute_beta { * compute.interconnects.patch * @desc Updates the specified interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnects.patch({ * // Name of the interconnect to update. - * interconnect: 'my-interconnect', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * interconnect: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adminEnabled": false, + * // "circuitInfos": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "customerName": "my_customerName", + * // "description": "my_description", + * // "expectedOutages": [], + * // "googleIpAddress": "my_googleIpAddress", + * // "googleReferenceId": "my_googleReferenceId", + * // "id": "my_id", + * // "interconnectAttachments": [], + * // "interconnectType": "my_interconnectType", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "linkType": "my_linkType", + * // "location": "my_location", + * // "name": "my_name", + * // "nocContactEmail": "my_nocContactEmail", + * // "operationalStatus": "my_operationalStatus", + * // "peerIpAddress": "my_peerIpAddress", + * // "provisionedLinkCount": 0, + * // "requestedLinkCount": 0, + * // "selfLink": "my_selfLink", + * // "state": "my_state" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.interconnects.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnects.patch * @memberOf! () * @@ -48228,6 +56171,83 @@ export namespace compute_beta { /** * compute.interconnects.setLabels * @desc Sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnects.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnects.setLabels * @memberOf! () * @@ -48305,62 +56325,60 @@ export namespace compute_beta { * compute.interconnects.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnects.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.interconnects.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnects.testIamPermissions * @memberOf! () * @@ -48617,6 +56635,61 @@ export namespace compute_beta { /** * compute.licenseCodes.get * @desc Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.licenseCodes.get({ + * // Number corresponding to the License code resource to return. + * licenseCode: '[0-9]{0,61}?', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "licenseAlias": [], + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "state": "my_state", + * // "transferable": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenseCodes.get * @memberOf! () * @@ -48714,6 +56787,80 @@ export namespace compute_beta { /** * compute.licenses.delete * @desc Deletes the specified license. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.licenses.delete({ + * // Name of the license resource to delete. + * license: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenses.delete * @memberOf! () * @@ -48790,58 +56937,61 @@ export namespace compute_beta { * compute.licenses.get * @desc Returns the specified License resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.licenses.get({ * // Name of the License resource to return. - * license: 'my-license', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.licenses.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * license: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "chargesUseFee": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "licenseCode": "my_licenseCode", + * // "name": "my_name", + * // "resourceRequirements": {}, + * // "selfLink": "my_selfLink", + * // "transferable": false + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.licenses.get * @memberOf! () * @@ -48914,6 +57064,60 @@ export namespace compute_beta { /** * compute.licenses.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.licenses.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenses.getIamPolicy * @memberOf! () * @@ -48988,6 +57192,98 @@ export namespace compute_beta { /** * compute.licenses.insert * @desc Create a License resource in the specified project. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 compute.licenses.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "chargesUseFee": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "licenseCode": "my_licenseCode", + * // "name": "my_name", + * // "resourceRequirements": {}, + * // "selfLink": "my_selfLink", + * // "transferable": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenses.insert * @memberOf! () * @@ -49062,6 +57358,73 @@ export namespace compute_beta { /** * compute.licenses.list * @desc Retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.licenses.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenses.list * @memberOf! () * @@ -49140,6 +57503,67 @@ export namespace compute_beta { /** * compute.licenses.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.licenses.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenses.setIamPolicy * @memberOf! () * @@ -49344,6 +57768,80 @@ export namespace compute_beta { /** * compute.machineImages.delete * @desc Deletes the specified machine image. Deleting a machine image is permanent and cannot be undone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.machineImages.delete({ + * // The name of the machine image to delete. + * machineImage: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.machineImages.delete * @memberOf! () * @@ -49420,6 +57918,66 @@ export namespace compute_beta { /** * compute.machineImages.get * @desc Returns the specified machine image. Gets a list of available machine images by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.machineImages.get({ + * // The name of the machine image. + * machineImage: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "guestFlush": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "machineImageEncryptionKey": {}, + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "sourceDiskEncryptionKeys": [], + * // "sourceInstance": "my_sourceInstance", + * // "sourceInstanceProperties": {}, + * // "status": "my_status", + * // "storageLocations": [], + * // "totalStorageBytes": "my_totalStorageBytes" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.machineImages.get * @memberOf! () * @@ -49495,6 +58053,60 @@ export namespace compute_beta { /** * compute.machineImages.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.machineImages.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.machineImages.getIamPolicy * @memberOf! () * @@ -49569,6 +58181,101 @@ export namespace compute_beta { /** * compute.machineImages.insert * @desc Creates a machine image in the specified project using the data that is included in the request. If you are creating a new machine image to update an existing instance, your new machine image should use the same network or, if applicable, the same subnetwork as the original instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.machineImages.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Required. Source instance that is used to create the machine image from. + * sourceInstance: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "guestFlush": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "machineImageEncryptionKey": {}, + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "sourceDiskEncryptionKeys": [], + * // "sourceInstance": "my_sourceInstance", + * // "sourceInstanceProperties": {}, + * // "status": "my_status", + * // "storageLocations": [], + * // "totalStorageBytes": "my_totalStorageBytes" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.machineImages.insert * @memberOf! () * @@ -49645,6 +58352,74 @@ export namespace compute_beta { /** * compute.machineImages.list * @desc Retrieves a list of machine images that are contained within the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.machineImages.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.machineImages.list * @memberOf! () * @@ -49722,6 +58497,67 @@ export namespace compute_beta { /** * compute.machineImages.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.machineImages.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.machineImages.setIamPolicy * @memberOf! () * @@ -49796,6 +58632,61 @@ export namespace compute_beta { /** * compute.machineImages.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.machineImages.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.machineImages.testIamPermissions * @memberOf! () * @@ -50036,68 +58927,75 @@ export namespace compute_beta { * compute.machineTypes.aggregatedList * @desc Retrieves an aggregated list of machine types. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.machineTypes.aggregatedList(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.machineTypes.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.machineTypes.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.machineTypes.aggregatedList * @memberOf! () * @@ -50185,61 +59083,66 @@ export namespace compute_beta { * compute.machineTypes.get * @desc Returns the specified machine type. Gets a list of available machine types by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.machineTypes.get({ + * // Name of the machine type to return. + * machineType: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the machine type to return. - * machineType: 'my-machine-type', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.machineTypes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "guestCpus": 0, + * // "id": "my_id", + * // "isSharedCpu": false, + * // "kind": "my_kind", + * // "maximumPersistentDisks": 0, + * // "maximumPersistentDisksSizeGb": "my_maximumPersistentDisksSizeGb", + * // "memoryMb": 0, + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.machineTypes.get * @memberOf! () * @@ -50316,71 +59219,75 @@ export namespace compute_beta { * compute.machineTypes.list * @desc Retrieves a list of machine types available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.machineTypes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.machineTypes.list(request, handlePage); - * } - * }; + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.machineTypes.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.machineTypes.list * @memberOf! () * @@ -50551,6 +59458,76 @@ export namespace compute_beta { /** * compute.networkEndpointGroups.aggregatedList * @desc Retrieves the list of network endpoint groups and sorts them by zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networkEndpointGroups.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.aggregatedList * @memberOf! () * @@ -50639,6 +59616,90 @@ export namespace compute_beta { /** * compute.networkEndpointGroups.attachNetworkEndpoints * @desc Attach a list of network endpoints to the specified network endpoint group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networkEndpointGroups.attachNetworkEndpoints({ + * // The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "networkEndpoints": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.attachNetworkEndpoints * @memberOf! () * @@ -50719,6 +59780,82 @@ export namespace compute_beta { /** * compute.networkEndpointGroups.delete * @desc Deletes the specified network endpoint group. The network endpoints in the NEG and the VM instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot be deleted if there are backend services referencing it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networkEndpointGroups.delete({ + * // The name of the network endpoint group to delete. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.delete * @memberOf! () * @@ -50796,6 +59933,90 @@ export namespace compute_beta { /** * compute.networkEndpointGroups.detachNetworkEndpoints * @desc Detach a list of network endpoints from the specified network endpoint group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networkEndpointGroups.detachNetworkEndpoints({ + * // The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "networkEndpoints": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.detachNetworkEndpoints * @memberOf! () * @@ -50876,6 +60097,68 @@ export namespace compute_beta { /** * compute.networkEndpointGroups.get * @desc Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networkEndpointGroups.get({ + * // The name of the network endpoint group. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "annotations": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultPort": 0, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancer": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkEndpointType": "my_networkEndpointType", + * // "selfLink": "my_selfLink", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.get * @memberOf! () * @@ -50954,6 +60237,101 @@ export namespace compute_beta { /** * compute.networkEndpointGroups.insert * @desc Creates a network endpoint group in the specified project using the parameters that are included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networkEndpointGroups.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where you want to create the network endpoint group. It should comply with RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "annotations": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultPort": 0, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancer": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkEndpointType": "my_networkEndpointType", + * // "selfLink": "my_selfLink", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.insert * @memberOf! () * @@ -51031,6 +60409,76 @@ export namespace compute_beta { /** * compute.networkEndpointGroups.list * @desc Retrieves the list of network endpoint groups that are located in the specified project and zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networkEndpointGroups.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.list * @memberOf! () * @@ -51112,6 +60560,85 @@ export namespace compute_beta { /** * compute.networkEndpointGroups.listNetworkEndpoints * @desc Lists the network endpoints in the specified network endpoint group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networkEndpointGroups.listNetworkEndpoints({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "healthStatus": "my_healthStatus" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.listNetworkEndpoints * @memberOf! () * @@ -51216,6 +60743,63 @@ export namespace compute_beta { /** * compute.networkEndpointGroups.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networkEndpointGroups.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.testIamPermissions * @memberOf! () * @@ -51563,62 +61147,90 @@ export namespace compute_beta { * compute.networks.addPeering * @desc Adds a peering to the specified network. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.addPeering({ * // Name of the network resource to add peering to. - * network: 'my-network', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoCreateRoutes": false, + * // "name": "my_name", + * // "networkPeering": {}, + * // "peerNetwork": "my_peerNetwork" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.networks.addPeering(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.networks.addPeering * @memberOf! () * @@ -51697,58 +61309,79 @@ export namespace compute_beta { * compute.networks.delete * @desc Deletes the specified network. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.delete({ * // Name of the network to delete. - * network: 'my-network', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.networks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.networks.delete * @memberOf! () * @@ -51825,58 +61458,63 @@ export namespace compute_beta { * compute.networks.get * @desc Returns the specified network. Gets a list of available networks by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networks.get({ * // Name of the network to return. - * network: 'my-network', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.networks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "IPv4Range": "my_IPv4Range", + * // "autoCreateSubnetworks": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "gatewayIPv4": "my_gatewayIPv4", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "peerings": [], + * // "routingConfig": {}, + * // "selfLink": "my_selfLink", + * // "subnetworks": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.networks.get * @memberOf! () * @@ -51949,6 +61587,54 @@ export namespace compute_beta { /** * compute.networks.getEffectiveFirewalls * @desc Returns the effective firewalls on a given network. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networks.getEffectiveFirewalls({ + * // Name of the network for this request. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "firewalls": [], + * // "organizationFirewalls": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networks.getEffectiveFirewalls * @memberOf! () * @@ -52042,59 +61728,96 @@ export namespace compute_beta { * compute.networks.insert * @desc Creates a network in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "IPv4Range": "my_IPv4Range", + * // "autoCreateSubnetworks": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "gatewayIPv4": "my_gatewayIPv4", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "peerings": [], + * // "routingConfig": {}, + * // "selfLink": "my_selfLink", + * // "subnetworks": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.networks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.networks.insert * @memberOf! () * @@ -52170,68 +61893,73 @@ export namespace compute_beta { * compute.networks.list * @desc Retrieves the list of networks available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.networks.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.networks.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.networks.list * @memberOf! () * @@ -52308,6 +62036,82 @@ export namespace compute_beta { /** * compute.networks.listPeeringRoutes * @desc Lists the peering routes exchanged over peering connection. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networks.listPeeringRoutes({ + * // The direction of the exchanged routes. + * direction: 'placeholder-value', + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Name of the network for this request. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The response will show routes exchanged over the given peering connection. + * peeringName: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The region of the request. The response will include all subnet routes, static routes and dynamic routes in the region. + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networks.listPeeringRoutes * @memberOf! () * @@ -52398,63 +62202,98 @@ export namespace compute_beta { * compute.networks.patch * @desc Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.patch({ * // Name of the network to update. - * network: 'my-network', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "IPv4Range": "my_IPv4Range", + * // "autoCreateSubnetworks": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "gatewayIPv4": "my_gatewayIPv4", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "peerings": [], + * // "routingConfig": {}, + * // "selfLink": "my_selfLink", + * // "subnetworks": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.networks.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.networks.patch * @memberOf! () * @@ -52532,62 +62371,87 @@ export namespace compute_beta { * compute.networks.removePeering * @desc Removes a peering from the specified network. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.removePeering({ * // Name of the network resource to remove peering from. - * network: 'my-network', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.networks.removePeering(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.networks.removePeering * @memberOf! () * @@ -52666,58 +62530,79 @@ export namespace compute_beta { * compute.networks.switchToCustomMode * @desc Switches the network mode from auto subnet mode to custom subnet mode. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.switchToCustomMode({ * // Name of the network to be updated. - * network: 'my-network', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.networks.switchToCustomMode(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.networks.switchToCustomMode * @memberOf! () * @@ -52795,62 +62680,60 @@ export namespace compute_beta { * compute.networks.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networks.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.networks.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.networks.testIamPermissions * @memberOf! () * @@ -52931,6 +62814,88 @@ export namespace compute_beta { /** * compute.networks.updatePeering * @desc Updates the specified network peering with the data included in the request Only the following fields can be modified: NetworkPeering.export_custom_routes, and NetworkPeering.import_custom_routes + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.updatePeering({ + * // Name of the network resource which the updated peering is belonging to. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "networkPeering": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networks.updatePeering * @memberOf! () * @@ -53297,6 +63262,90 @@ export namespace compute_beta { /** * compute.nodeGroups.addNodes * @desc Adds specified number of nodes to the node group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.addNodes({ + * // Name of the NodeGroup resource. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "additionalNodeCount": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.addNodes * @memberOf! () * @@ -53375,6 +63424,76 @@ export namespace compute_beta { /** * compute.nodeGroups.aggregatedList * @desc Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeGroups.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.aggregatedList * @memberOf! () * @@ -53457,6 +63576,82 @@ export namespace compute_beta { /** * compute.nodeGroups.delete * @desc Deletes the specified NodeGroup resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.delete({ + * // Name of the NodeGroup resource to delete. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.delete * @memberOf! () * @@ -53534,6 +63729,90 @@ export namespace compute_beta { /** * compute.nodeGroups.deleteNodes * @desc Deletes specified nodes from the node group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.deleteNodes({ + * // Name of the NodeGroup resource whose nodes will be deleted. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "nodes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.deleteNodes * @memberOf! () * @@ -53612,6 +63891,67 @@ export namespace compute_beta { /** * compute.nodeGroups.get * @desc Returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request. Note: the "nodes" field should not be used. Use nodeGroups.listNodes instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeGroups.get({ + * // Name of the node group to return. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "maintenancePolicy": "my_maintenancePolicy", + * // "name": "my_name", + * // "nodeTemplate": "my_nodeTemplate", + * // "selfLink": "my_selfLink", + * // "size": 0, + * // "status": "my_status", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.get * @memberOf! () * @@ -53687,6 +64027,62 @@ export namespace compute_beta { /** * compute.nodeGroups.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeGroups.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.getIamPolicy * @memberOf! () * @@ -53762,6 +64158,102 @@ export namespace compute_beta { /** * compute.nodeGroups.insert * @desc Creates a NodeGroup resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.insert({ + * // Initial count of nodes in the node group. + * initialNodeCount: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "maintenancePolicy": "my_maintenancePolicy", + * // "name": "my_name", + * // "nodeTemplate": "my_nodeTemplate", + * // "selfLink": "my_selfLink", + * // "size": 0, + * // "status": "my_status", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.insert * @memberOf! () * @@ -53840,6 +64332,76 @@ export namespace compute_beta { /** * compute.nodeGroups.list * @desc Retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeGroups.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.list * @memberOf! () * @@ -53918,6 +64480,78 @@ export namespace compute_beta { /** * compute.nodeGroups.listNodes * @desc Lists nodes in the node group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeGroups.listNodes({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Name of the NodeGroup resource whose nodes you want to list. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.listNodes * @memberOf! () * @@ -53998,6 +64632,102 @@ export namespace compute_beta { /** * compute.nodeGroups.patch * @desc Updates the specified node group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.patch({ + * // Name of the NodeGroup resource to update. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "maintenancePolicy": "my_maintenancePolicy", + * // "name": "my_name", + * // "nodeTemplate": "my_nodeTemplate", + * // "selfLink": "my_selfLink", + * // "size": 0, + * // "status": "my_status", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.patch * @memberOf! () * @@ -54075,6 +64805,69 @@ export namespace compute_beta { /** * compute.nodeGroups.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.setIamPolicy * @memberOf! () * @@ -54150,6 +64943,90 @@ export namespace compute_beta { /** * compute.nodeGroups.setNodeTemplate * @desc Updates the node template of the node group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.setNodeTemplate({ + * // Name of the NodeGroup resource to update. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "nodeTemplate": "my_nodeTemplate" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.setNodeTemplate * @memberOf! () * @@ -54228,6 +65105,63 @@ export namespace compute_beta { /** * compute.nodeGroups.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeGroups.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.testIamPermissions * @memberOf! () * @@ -54677,6 +65611,76 @@ export namespace compute_beta { /** * compute.nodeTemplates.aggregatedList * @desc Retrieves an aggregated list of node templates. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTemplates.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.aggregatedList * @memberOf! () * @@ -54763,6 +65767,82 @@ export namespace compute_beta { /** * compute.nodeTemplates.delete * @desc Deletes the specified NodeTemplate resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeTemplates.delete({ + * // Name of the NodeTemplate resource to delete. + * nodeTemplate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.delete * @memberOf! () * @@ -54840,6 +65920,68 @@ export namespace compute_beta { /** * compute.nodeTemplates.get * @desc Returns the specified node template. Gets a list of available node templates by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTemplates.get({ + * // Name of the node template to return. + * nodeTemplate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cpuOvercommitType": "my_cpuOvercommitType", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "nodeAffinityLabels": {}, + * // "nodeType": "my_nodeType", + * // "nodeTypeFlexibility": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serverBinding": {}, + * // "status": "my_status", + * // "statusMessage": "my_statusMessage" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.get * @memberOf! () * @@ -54916,6 +66058,62 @@ export namespace compute_beta { /** * compute.nodeTemplates.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTemplates.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.getIamPolicy * @memberOf! () * @@ -54991,6 +66189,101 @@ export namespace compute_beta { /** * compute.nodeTemplates.insert * @desc Creates a NodeTemplate resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeTemplates.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "cpuOvercommitType": "my_cpuOvercommitType", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "nodeAffinityLabels": {}, + * // "nodeType": "my_nodeType", + * // "nodeTypeFlexibility": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serverBinding": {}, + * // "status": "my_status", + * // "statusMessage": "my_statusMessage" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.insert * @memberOf! () * @@ -55068,6 +66361,76 @@ export namespace compute_beta { /** * compute.nodeTemplates.list * @desc Retrieves a list of node templates available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTemplates.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.list * @memberOf! () * @@ -55147,6 +66510,69 @@ export namespace compute_beta { /** * compute.nodeTemplates.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeTemplates.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.setIamPolicy * @memberOf! () * @@ -55222,6 +66648,63 @@ export namespace compute_beta { /** * compute.nodeTemplates.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTemplates.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.testIamPermissions * @memberOf! () * @@ -55518,6 +67001,76 @@ export namespace compute_beta { /** * compute.nodeTypes.aggregatedList * @desc Retrieves an aggregated list of node types. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTypes.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTypes.aggregatedList * @memberOf! () * @@ -55600,6 +67153,66 @@ export namespace compute_beta { /** * compute.nodeTypes.get * @desc Returns the specified node type. Gets a list of available node types by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTypes.get({ + * // Name of the node type to return. + * nodeType: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cpuPlatform": "my_cpuPlatform", + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "guestCpus": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "localSsdGb": 0, + * // "memoryMb": 0, + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTypes.get * @memberOf! () * @@ -55673,6 +67286,76 @@ export namespace compute_beta { /** * compute.nodeTypes.list * @desc Retrieves a list of node types available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTypes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTypes.list * @memberOf! () * @@ -55841,6 +67524,90 @@ export namespace compute_beta { /** * compute.organizationSecurityPolicies.addAssociation * @desc Inserts an association for the specified security policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.addAssociation({ + * // Indicates whether or not to replace it if an association of the attachment already exists. This is false by default, in which case an error will be returned if an assocation already exists. + * replaceExistingAssociation: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to update. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "attachmentId": "my_attachmentId", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "securityPolicyId": "my_securityPolicyId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.addAssociation * @memberOf! () * @@ -55918,6 +67685,95 @@ export namespace compute_beta { /** * compute.organizationSecurityPolicies.addRule * @desc Inserts a rule into a security policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.addRule({ + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to update. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "direction": "my_direction", + * // "enableLogging": false, + * // "kind": "my_kind", + * // "match": {}, + * // "preview": false, + * // "priority": 0, + * // "ruleTupleCount": 0, + * // "targetResources": [], + * // "targetServiceAccounts": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.addRule * @memberOf! () * @@ -55994,6 +67850,79 @@ export namespace compute_beta { /** * compute.organizationSecurityPolicies.copyRules * @desc Copies rules to the specified security policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.copyRules({ + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to update. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * // The security policy from which to copy rules. + * sourceSecurityPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.copyRules * @memberOf! () * @@ -56070,6 +67999,77 @@ export namespace compute_beta { /** * compute.organizationSecurityPolicies.delete * @desc Deletes the specified policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.delete({ + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to delete. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.delete * @memberOf! () * @@ -56145,6 +68145,65 @@ export namespace compute_beta { /** * compute.organizationSecurityPolicies.get * @desc List all of the ordered rules present in a single specified policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.organizationSecurityPolicies.get({ + * // Name of the security policy to get. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "associations": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "parent": "my_parent", + * // "ruleTupleCount": 0, + * // "rules": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.get * @memberOf! () * @@ -56219,6 +68278,55 @@ export namespace compute_beta { /** * compute.organizationSecurityPolicies.getAssociation * @desc Gets an association with the specified name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.organizationSecurityPolicies.getAssociation({ + * // The name of the association to get from the security policy. + * name: 'placeholder-value', + * // Name of the security policy to which the queried rule belongs. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attachmentId": "my_attachmentId", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "securityPolicyId": "my_securityPolicyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.getAssociation * @memberOf! () * @@ -56301,6 +68409,62 @@ export namespace compute_beta { /** * compute.organizationSecurityPolicies.getRule * @desc Gets a rule at the specified priority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.organizationSecurityPolicies.getRule({ + * // The priority of the rule to get from the security policy. + * priority: 'placeholder-value', + * // Name of the security policy to which the queried rule belongs. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "direction": "my_direction", + * // "enableLogging": false, + * // "kind": "my_kind", + * // "match": {}, + * // "preview": false, + * // "priority": 0, + * // "ruleTupleCount": 0, + * // "targetResources": [], + * // "targetServiceAccounts": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.getRule * @memberOf! () * @@ -56376,6 +68540,100 @@ export namespace compute_beta { /** * compute.organizationSecurityPolicies.insert * @desc Creates a new policy in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.insert({ + * // Parent ID for this request. + * parentId: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "associations": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "parent": "my_parent", + * // "ruleTupleCount": 0, + * // "rules": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.insert * @memberOf! () * @@ -56452,6 +68710,72 @@ export namespace compute_beta { /** * compute.organizationSecurityPolicies.list * @desc List all the policies that have been configured for the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.organizationSecurityPolicies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Parent ID for this request. + * parentId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.list * @memberOf! () * @@ -56530,6 +68854,50 @@ export namespace compute_beta { /** * compute.organizationSecurityPolicies.listAssociations * @desc Lists associations of a specified target, i.e., organization or folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.listAssociations({ + * // The target resource to list associations. It is an organization, or a folder. + * targetResource: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "associations": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.listAssociations * @memberOf! () * @@ -56630,6 +68998,79 @@ export namespace compute_beta { /** * compute.organizationSecurityPolicies.move * @desc Moves the specified security policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.move({ + * // The new parent of the security policy. + * parentId: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to update. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.move * @memberOf! () * @@ -56706,6 +69147,100 @@ export namespace compute_beta { /** * compute.organizationSecurityPolicies.patch * @desc Patches the specified policy with the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.patch({ + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to update. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "associations": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "parent": "my_parent", + * // "ruleTupleCount": 0, + * // "rules": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.patch * @memberOf! () * @@ -56782,6 +69317,97 @@ export namespace compute_beta { /** * compute.organizationSecurityPolicies.patchRule * @desc Patches a rule at the specified priority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.patchRule({ + * // The priority of the rule to patch. + * priority: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to update. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "direction": "my_direction", + * // "enableLogging": false, + * // "kind": "my_kind", + * // "match": {}, + * // "preview": false, + * // "priority": 0, + * // "ruleTupleCount": 0, + * // "targetResources": [], + * // "targetServiceAccounts": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.patchRule * @memberOf! () * @@ -56859,6 +69485,79 @@ export namespace compute_beta { /** * compute.organizationSecurityPolicies.removeAssociation * @desc Removes an association for the specified security policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.removeAssociation({ + * // Name for the attachment that will be removed. + * name: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to update. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.removeAssociation * @memberOf! () * @@ -56935,6 +69634,79 @@ export namespace compute_beta { /** * compute.organizationSecurityPolicies.removeRule * @desc Deletes a rule at the specified priority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.organizationSecurityPolicies.removeRule({ + * // The priority of the rule to remove from the security policy. + * priority: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to update. + * securityPolicy: '(securityPolicies/)?[0-9]{0,20}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.organizationSecurityPolicies.removeRule * @memberOf! () * @@ -57312,6 +70084,76 @@ export namespace compute_beta { /** * compute.packetMirrorings.aggregatedList * @desc Retrieves an aggregated list of packetMirrorings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.packetMirrorings.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.aggregatedList * @memberOf! () * @@ -57400,6 +70242,82 @@ export namespace compute_beta { /** * compute.packetMirrorings.delete * @desc Deletes the specified PacketMirroring resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.packetMirrorings.delete({ + * // Name of the PacketMirroring resource to delete. + * packetMirroring: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.delete * @memberOf! () * @@ -57477,6 +70395,67 @@ export namespace compute_beta { /** * compute.packetMirrorings.get * @desc Returns the specified PacketMirroring resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.packetMirrorings.get({ + * // Name of the PacketMirroring resource to return. + * packetMirroring: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "collectorIlb": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enable": "my_enable", + * // "filter": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mirroredResources": {}, + * // "name": "my_name", + * // "network": {}, + * // "priority": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.get * @memberOf! () * @@ -57553,6 +70532,100 @@ export namespace compute_beta { /** * compute.packetMirrorings.insert * @desc Creates a PacketMirroring resource in the specified project and region using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.packetMirrorings.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "collectorIlb": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enable": "my_enable", + * // "filter": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mirroredResources": {}, + * // "name": "my_name", + * // "network": {}, + * // "priority": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.insert * @memberOf! () * @@ -57630,6 +70703,76 @@ export namespace compute_beta { /** * compute.packetMirrorings.list * @desc Retrieves a list of PacketMirroring resources available to the specified project and region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.packetMirrorings.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.list * @memberOf! () * @@ -57709,6 +70852,102 @@ export namespace compute_beta { /** * compute.packetMirrorings.patch * @desc Patches the specified PacketMirroring resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.packetMirrorings.patch({ + * // Name of the PacketMirroring resource to patch. + * packetMirroring: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "collectorIlb": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enable": "my_enable", + * // "filter": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mirroredResources": {}, + * // "name": "my_name", + * // "network": {}, + * // "priority": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.patch * @memberOf! () * @@ -57787,6 +71026,63 @@ export namespace compute_beta { /** * compute.packetMirrorings.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.packetMirrorings.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.testIamPermissions * @memberOf! () * @@ -58064,55 +71360,77 @@ export namespace compute_beta { * compute.projects.disableXpnHost * @desc Disable this project as a shared VPC host project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.projects.disableXpnHost(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.disableXpnHost({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.disableXpnHost * @memberOf! () * @@ -58188,59 +71506,85 @@ export namespace compute_beta { * compute.projects.disableXpnResource * @desc Disable a service resource (also known as service project) associated with this host project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.disableXpnResource({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "xpnResource": {} + * // } * }, - * - * auth: authClient, - * }; - * - * compute.projects.disableXpnResource(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.disableXpnResource * @memberOf! () * @@ -58317,55 +71661,77 @@ export namespace compute_beta { * compute.projects.enableXpnHost * @desc Enable this project as a shared VPC host project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.projects.enableXpnHost(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.enableXpnHost({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.enableXpnHost * @memberOf! () * @@ -58441,59 +71807,85 @@ export namespace compute_beta { * compute.projects.enableXpnResource * @desc Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.enableXpnResource({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "xpnResource": {} + * // } * }, - * - * auth: authClient, - * }; - * - * compute.projects.enableXpnResource(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.enableXpnResource * @memberOf! () * @@ -58570,55 +71962,62 @@ export namespace compute_beta { * compute.projects.get * @desc Returns the specified Project resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.projects.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.projects.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "commonInstanceMetadata": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultNetworkTier": "my_defaultNetworkTier", + * // "defaultServiceAccount": "my_defaultServiceAccount", + * // "description": "my_description", + * // "enabledFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "quotas": [], + * // "selfLink": "my_selfLink", + * // "usageExportLocation": {}, + * // "xpnProjectStatus": "my_xpnProjectStatus" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.get * @memberOf! () * @@ -58691,55 +72090,61 @@ export namespace compute_beta { * compute.projects.getXpnHost * @desc Gets the shared VPC host project that this project links to. May be empty if no link exists. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.projects.getXpnHost(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.getXpnHost({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "commonInstanceMetadata": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultNetworkTier": "my_defaultNetworkTier", + * // "defaultServiceAccount": "my_defaultServiceAccount", + * // "description": "my_description", + * // "enabledFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "quotas": [], + * // "selfLink": "my_selfLink", + * // "usageExportLocation": {}, + * // "xpnProjectStatus": "my_xpnProjectStatus" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.getXpnHost * @memberOf! () * @@ -58812,68 +72217,69 @@ export namespace compute_beta { * compute.projects.getXpnResources * @desc Gets service resources (a.k.a service project) associated with this host project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var resourcesPage = response['resources']; - * if (!resourcesPage) { - * return; - * } - * for (var i = 0; i < resourcesPage.length; i++) { - * // TODO: Change code below to process each resource in `resourcesPage`: - * console.log(JSON.stringify(resourcesPage[i], null, 2)); - * } + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.getXpnResources({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.projects.getXpnResources(request, handlePage); - * } - * }; + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } * - * compute.projects.getXpnResources(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.getXpnResources * @memberOf! () * @@ -58956,72 +72362,80 @@ export namespace compute_beta { * compute.projects.listXpnHosts * @desc Lists all shared VPC host projects visible to the user in an organization. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.listXpnHosts({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "organization": "my_organization" + * // } * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.projects.listXpnHosts(request, handlePage); - * } - * }; - * - * compute.projects.listXpnHosts(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.listXpnHosts * @memberOf! () * @@ -59101,59 +72515,86 @@ export namespace compute_beta { * compute.projects.moveDisk * @desc Moves a persistent disk from one zone to another. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.moveDisk({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destinationZone": "my_destinationZone", + * // "targetDisk": "my_targetDisk" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.projects.moveDisk(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.moveDisk * @memberOf! () * @@ -59230,59 +72671,86 @@ export namespace compute_beta { * compute.projects.moveInstance * @desc Moves an instance and its attached persistent disks from one zone to another. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.moveInstance({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destinationZone": "my_destinationZone", + * // "targetInstance": "my_targetInstance" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.projects.moveInstance(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.moveInstance * @memberOf! () * @@ -59359,59 +72827,87 @@ export namespace compute_beta { * compute.projects.setCommonInstanceMetadata * @desc Sets metadata common to all instances within the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.setCommonInstanceMetadata({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "items": [], + * // "kind": "my_kind" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.projects.setCommonInstanceMetadata(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.setCommonInstanceMetadata * @memberOf! () * @@ -59490,6 +72986,86 @@ export namespace compute_beta { /** * compute.projects.setDefaultNetworkTier * @desc Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.setDefaultNetworkTier({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "networkTier": "my_networkTier" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.projects.setDefaultNetworkTier * @memberOf! () * @@ -59568,59 +73144,89 @@ export namespace compute_beta { * compute.projects.setUsageExportBucket * @desc Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 compute.projects.setUsageExportBucket({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucketName": "my_bucketName", + * // "reportNamePrefix": "my_reportNamePrefix" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.projects.setUsageExportBucket(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.setUsageExportBucket * @memberOf! () * @@ -59970,61 +73576,81 @@ export namespace compute_beta { * compute.regionAutoscalers.delete * @desc Deletes the specified autoscaler. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionAutoscalers.delete({ + * // Name of the autoscaler to delete. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the autoscaler to delete. - * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionAutoscalers.delete * @memberOf! () * @@ -60103,61 +73729,66 @@ export namespace compute_beta { * compute.regionAutoscalers.get * @desc Returns the specified autoscaler. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionAutoscalers.get({ + * // Name of the autoscaler to return. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the autoscaler to return. - * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionAutoscalers.get * @memberOf! () * @@ -60235,62 +73866,99 @@ export namespace compute_beta { * compute.regionAutoscalers.insert * @desc Creates an autoscaler in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionAutoscalers.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionAutoscalers.insert * @memberOf! () * @@ -60369,71 +74037,75 @@ export namespace compute_beta { * compute.regionAutoscalers.list * @desc Retrieves a list of autoscalers contained within the specified region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionAutoscalers.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionAutoscalers.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.regionAutoscalers.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionAutoscalers.list * @memberOf! () * @@ -60516,63 +74188,101 @@ export namespace compute_beta { * compute.regionAutoscalers.patch * @desc Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionAutoscalers.patch({ + * // Name of the autoscaler to patch. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionAutoscalers.patch * @memberOf! () * @@ -60652,65 +74362,62 @@ export namespace compute_beta { * compute.regionAutoscalers.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionAutoscalers.testIamPermissions({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionAutoscalers.testIamPermissions * @memberOf! () * @@ -60793,63 +74500,101 @@ export namespace compute_beta { * compute.regionAutoscalers.update * @desc Updates an autoscaler in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionAutoscalers.update({ + * // Name of the autoscaler to update. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionAutoscalers.update * @memberOf! () * @@ -61121,61 +74866,81 @@ export namespace compute_beta { * compute.regionBackendServices.delete * @desc Deletes the specified regional BackendService resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionBackendServices.delete({ + * // Name of the BackendService resource to delete. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to delete. - * backendService: 'my-backend-service', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionBackendServices.delete * @memberOf! () * @@ -61254,61 +75019,84 @@ export namespace compute_beta { * compute.regionBackendServices.get * @desc Returns the specified regional BackendService resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionBackendServices.get({ + * // Name of the BackendService resource to return. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to return. - * backendService: 'my-backend-service', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "securitySettings": {}, + * // "selfLink": "my_selfLink", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionBackendServices.get * @memberOf! () * @@ -61386,64 +75174,64 @@ export namespace compute_beta { * compute.regionBackendServices.getHealth * @desc Gets the most recent health check results for this regional BackendService. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionBackendServices.getHealth({ + * // Name of the BackendService resource for which to get health. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to which the queried instance belongs. - * backendService: 'my-backend-service', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "group": "my_group" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.regionBackendServices.getHealth(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "annotations": {}, + * // "healthStatus": [], + * // "kind": "my_kind" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionBackendServices.getHealth * @memberOf! () * @@ -61529,62 +75317,117 @@ export namespace compute_beta { * compute.regionBackendServices.insert * @desc Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Understanding backend services for more information. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionBackendServices.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "securitySettings": {}, + * // "selfLink": "my_selfLink", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionBackendServices.insert * @memberOf! () * @@ -61663,71 +75506,75 @@ export namespace compute_beta { * compute.regionBackendServices.list * @desc Retrieves the list of regional BackendService resources available to the specified project in the given region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionBackendServices.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionBackendServices.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.regionBackendServices.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionBackendServices.list * @memberOf! () * @@ -61808,66 +75655,119 @@ export namespace compute_beta { * compute.regionBackendServices.patch * @desc Updates the specified regional BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionBackendServices.patch({ + * // Name of the BackendService resource to patch. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to patch. - * backendService: 'my-backend-service', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "securitySettings": {}, + * // "selfLink": "my_selfLink", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionBackendServices.patch * @memberOf! () * @@ -61947,65 +75847,62 @@ export namespace compute_beta { * compute.regionBackendServices.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionBackendServices.testIamPermissions({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.regionBackendServices.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionBackendServices.testIamPermissions * @memberOf! () * @@ -62088,66 +75985,119 @@ export namespace compute_beta { * compute.regionBackendServices.update * @desc Updates the specified regional BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionBackendServices.update({ + * // Name of the BackendService resource to update. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to update. - * backendService: 'my-backend-service', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "securitySettings": {}, + * // "selfLink": "my_selfLink", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionBackendServices.update * @memberOf! () * @@ -62444,68 +76394,75 @@ export namespace compute_beta { * compute.regionCommitments.aggregatedList * @desc Retrieves an aggregated list of commitments. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionCommitments.aggregatedList(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionCommitments.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.regionCommitments.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionCommitments.aggregatedList * @memberOf! () * @@ -62590,61 +76547,68 @@ export namespace compute_beta { * compute.regionCommitments.get * @desc Returns the specified commitment resource. Gets a list of available commitments by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionCommitments.get({ + * // Name of the commitment to return. + * commitment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the commitment to return. - * commitment: 'my-commitment', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionCommitments.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTimestamp": "my_endTimestamp", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "plan": "my_plan", + * // "region": "my_region", + * // "reservations": [], + * // "resources": [], + * // "selfLink": "my_selfLink", + * // "startTimestamp": "my_startTimestamp", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "type": "my_type" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionCommitments.get * @memberOf! () * @@ -62722,62 +76686,101 @@ export namespace compute_beta { * compute.regionCommitments.insert * @desc Creates a commitment in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionCommitments.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTimestamp": "my_endTimestamp", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "plan": "my_plan", + * // "region": "my_region", + * // "reservations": [], + * // "resources": [], + * // "selfLink": "my_selfLink", + * // "startTimestamp": "my_startTimestamp", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "type": "my_type" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionCommitments.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionCommitments.insert * @memberOf! () * @@ -62856,71 +76859,75 @@ export namespace compute_beta { * compute.regionCommitments.list * @desc Retrieves a list of commitments contained within the specified region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionCommitments.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionCommitments.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.regionCommitments.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionCommitments.list * @memberOf! () * @@ -63000,6 +77007,90 @@ export namespace compute_beta { /** * compute.regionCommitments.updateReservations * @desc Transfers GPUs or local SSDs between reservations within commitments. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionCommitments.updateReservations({ + * // Name of the commitment for which the reservation is being updated. + * commitment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "reservations": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionCommitments.updateReservations * @memberOf! () * @@ -63224,6 +77315,90 @@ export namespace compute_beta { /** * compute.regionDisks.addResourcePolicies * @desc Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.addResourcePolicies({ + * // The disk name for this request. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourcePolicies": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.addResourcePolicies * @memberOf! () * @@ -63302,6 +77477,110 @@ export namespace compute_beta { /** * compute.regionDisks.createSnapshot * @desc Creates a snapshot of this regional disk. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.createSnapshot({ + * // Name of the regional persistent disk to snapshot. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoCreated": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "downloadBytes": "my_downloadBytes", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "snapshotEncryptionKey": {}, + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskEncryptionKey": {}, + * // "sourceDiskId": "my_sourceDiskId", + * // "status": "my_status", + * // "storageBytes": "my_storageBytes", + * // "storageBytesStatus": "my_storageBytesStatus", + * // "storageLocations": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.createSnapshot * @memberOf! () * @@ -63380,6 +77659,82 @@ export namespace compute_beta { /** * compute.regionDisks.delete * @desc Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.delete({ + * // Name of the regional persistent disk to delete. + * disk: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.delete * @memberOf! () * @@ -63457,6 +77812,86 @@ export namespace compute_beta { /** * compute.regionDisks.get * @desc Returns a specified regional persistent disk. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionDisks.get({ + * // Name of the regional persistent disk to return. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskEncryptionKey": {}, + * // "eraseWindowsVssSignature": false, + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "lastAttachTimestamp": "my_lastAttachTimestamp", + * // "lastDetachTimestamp": "my_lastDetachTimestamp", + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "options": "my_options", + * // "physicalBlockSizeBytes": "my_physicalBlockSizeBytes", + * // "region": "my_region", + * // "replicaZones": [], + * // "resourcePolicies": [], + * // "selfLink": "my_selfLink", + * // "sizeGb": "my_sizeGb", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "status": "my_status", + * // "storageType": "my_storageType", + * // "type": "my_type", + * // "users": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.get * @memberOf! () * @@ -63530,6 +77965,62 @@ export namespace compute_beta { /** * compute.regionDisks.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionDisks.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.getIamPolicy * @memberOf! () * @@ -63605,6 +78096,121 @@ export namespace compute_beta { /** * compute.regionDisks.insert * @desc Creates a persistent regional disk in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Optional. Source image to restore onto a disk. + * sourceImage: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskEncryptionKey": {}, + * // "eraseWindowsVssSignature": false, + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "lastAttachTimestamp": "my_lastAttachTimestamp", + * // "lastDetachTimestamp": "my_lastDetachTimestamp", + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "options": "my_options", + * // "physicalBlockSizeBytes": "my_physicalBlockSizeBytes", + * // "region": "my_region", + * // "replicaZones": [], + * // "resourcePolicies": [], + * // "selfLink": "my_selfLink", + * // "sizeGb": "my_sizeGb", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "status": "my_status", + * // "storageType": "my_storageType", + * // "type": "my_type", + * // "users": [], + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.insert * @memberOf! () * @@ -63683,6 +78289,76 @@ export namespace compute_beta { /** * compute.regionDisks.list * @desc Retrieves the list of persistent disks contained within the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionDisks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.list * @memberOf! () * @@ -63759,6 +78435,90 @@ export namespace compute_beta { /** * compute.regionDisks.removeResourcePolicies * @desc Removes resource policies from a regional disk. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.removeResourcePolicies({ + * // The disk name for this request. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourcePolicies": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.removeResourcePolicies * @memberOf! () * @@ -63839,6 +78599,90 @@ export namespace compute_beta { /** * compute.regionDisks.resize * @desc Resizes the specified regional persistent disk. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.resize({ + * // Name of the regional persistent disk. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sizeGb": "my_sizeGb" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.resize * @memberOf! () * @@ -63917,6 +78761,69 @@ export namespace compute_beta { /** * compute.regionDisks.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.setIamPolicy * @memberOf! () * @@ -63992,6 +78899,91 @@ export namespace compute_beta { /** * compute.regionDisks.setLabels * @desc Sets the labels on the target regional disk. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.setLabels * @memberOf! () * @@ -64070,6 +79062,63 @@ export namespace compute_beta { /** * compute.regionDisks.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionDisks.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.testIamPermissions * @memberOf! () * @@ -64481,6 +79530,65 @@ export namespace compute_beta { /** * compute.regionDiskTypes.get * @desc Returns the specified regional disk type. Gets a list of available disk types by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionDiskTypes.get({ + * // Name of the disk type to return. + * diskType: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultDiskSizeGb": "my_defaultDiskSizeGb", + * // "deprecated": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "validDiskSize": "my_validDiskSize", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDiskTypes.get * @memberOf! () * @@ -64555,6 +79663,76 @@ export namespace compute_beta { /** * compute.regionDiskTypes.list * @desc Retrieves a list of regional disk types available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionDiskTypes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDiskTypes.list * @memberOf! () * @@ -64694,6 +79872,82 @@ export namespace compute_beta { /** * compute.regionHealthChecks.delete * @desc Deletes the specified HealthCheck resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionHealthChecks.delete({ + * // Name of the HealthCheck resource to delete. + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthChecks.delete * @memberOf! () * @@ -64771,6 +80025,72 @@ export namespace compute_beta { /** * compute.regionHealthChecks.get * @desc Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionHealthChecks.get({ + * // Name of the HealthCheck resource to return. + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "unhealthyThreshold": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthChecks.get * @memberOf! () * @@ -64847,6 +80167,105 @@ export namespace compute_beta { /** * compute.regionHealthChecks.insert * @desc Creates a HealthCheck resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionHealthChecks.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "unhealthyThreshold": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthChecks.insert * @memberOf! () * @@ -64924,6 +80343,76 @@ export namespace compute_beta { /** * compute.regionHealthChecks.list * @desc Retrieves the list of HealthCheck resources available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionHealthChecks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthChecks.list * @memberOf! () * @@ -65003,6 +80492,107 @@ export namespace compute_beta { /** * compute.regionHealthChecks.patch * @desc Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionHealthChecks.patch({ + * // Name of the HealthCheck resource to patch. + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "unhealthyThreshold": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthChecks.patch * @memberOf! () * @@ -65081,6 +80671,107 @@ export namespace compute_beta { /** * compute.regionHealthChecks.update * @desc Updates a HealthCheck resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionHealthChecks.update({ + * // Name of the HealthCheck resource to update. + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "unhealthyThreshold": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthChecks.update * @memberOf! () * @@ -65326,6 +81017,82 @@ export namespace compute_beta { /** * compute.regionHealthCheckServices.delete * @desc Deletes the specified regional HealthCheckService. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionHealthCheckServices.delete({ + * // Name of the HealthCheckService to delete. The name must be 1-63 characters long, and comply with RFC1035. + * healthCheckService: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthCheckServices.delete * @memberOf! () * @@ -65403,6 +81170,67 @@ export namespace compute_beta { /** * compute.regionHealthCheckServices.get * @desc Returns the specified regional HealthCheckService resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionHealthCheckServices.get({ + * // Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. + * healthCheckService: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "healthStatusAggregationPolicy": "my_healthStatusAggregationPolicy", + * // "healthStatusAggregationStrategy": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networkEndpointGroups": [], + * // "notificationEndpoints": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthCheckServices.get * @memberOf! () * @@ -65479,6 +81307,100 @@ export namespace compute_beta { /** * compute.regionHealthCheckServices.insert * @desc Creates a regional HealthCheckService resource in the specified project and region using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionHealthCheckServices.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "healthStatusAggregationPolicy": "my_healthStatusAggregationPolicy", + * // "healthStatusAggregationStrategy": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networkEndpointGroups": [], + * // "notificationEndpoints": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthCheckServices.insert * @memberOf! () * @@ -65556,6 +81478,76 @@ export namespace compute_beta { /** * compute.regionHealthCheckServices.list * @desc Lists all the HealthCheckService resources that have been configured for the specified project in the given region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionHealthCheckServices.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthCheckServices.list * @memberOf! () * @@ -65637,6 +81629,102 @@ export namespace compute_beta { /** * compute.regionHealthCheckServices.patch * @desc Updates the specified regional HealthCheckService resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionHealthCheckServices.patch({ + * // Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. + * healthCheckService: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "healthStatusAggregationPolicy": "my_healthStatusAggregationPolicy", + * // "healthStatusAggregationStrategy": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networkEndpointGroups": [], + * // "notificationEndpoints": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthCheckServices.patch * @memberOf! () * @@ -65854,65 +81942,89 @@ export namespace compute_beta { * compute.regionInstanceGroupManagers.abandonInstances * @desc Flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.abandonInstances({ + * // Name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.abandonInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.abandonInstances * @memberOf! () * @@ -65991,6 +82103,88 @@ export namespace compute_beta { /** * compute.regionInstanceGroupManagers.applyUpdatesToInstances * @desc Apply updates to selected instances the managed instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.applyUpdatesToInstances( + * { + * // The name of the managed instance group, should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request, should conform to RFC1035. + * region: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [], + * // "minimalAction": "my_minimalAction", + * // "mostDisruptiveAllowedAction": "my_mostDisruptiveAllowedAction" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.applyUpdatesToInstances * @memberOf! () * @@ -66070,6 +82264,90 @@ export namespace compute_beta { /** * compute.regionInstanceGroupManagers.createInstances * @desc Creates instances with per-instance configs in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.createInstances({ + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region where the managed instance group is located. It should conform to RFC1035. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.createInstances * @memberOf! () * @@ -66149,61 +82427,81 @@ export namespace compute_beta { * compute.regionInstanceGroupManagers.delete * @desc Deletes the specified managed instance group and all of the instances in that group. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.delete({ + * // Name of the managed instance group to delete. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group to delete. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.delete * @memberOf! () * @@ -66282,65 +82580,89 @@ export namespace compute_beta { * compute.regionInstanceGroupManagers.deleteInstances * @desc Flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.deleteInstances({ + * // Name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.deleteInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.deleteInstances * @memberOf! () * @@ -66419,6 +82741,86 @@ export namespace compute_beta { /** * compute.regionInstanceGroupManagers.deletePerInstanceConfigs * @desc Deletes selected per-instance configs for the managed instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.deletePerInstanceConfigs( + * { + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request, should conform to RFC1035. + * region: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "names": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.deletePerInstanceConfigs * @memberOf! () * @@ -66499,61 +82901,78 @@ export namespace compute_beta { * compute.regionInstanceGroupManagers.get * @desc Returns all of the details about the specified managed instance group. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroupManagers.get({ + * // Name of the managed instance group to return. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group to return. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "failoverAction": "my_failoverAction", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "pendingActions": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serviceAccount": "my_serviceAccount", + * // "statefulPolicy": {}, + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.get * @memberOf! () * @@ -66633,62 +83052,111 @@ export namespace compute_beta { * compute.regionInstanceGroupManagers.insert * @desc Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. A regional managed instance group can contain up to 2000 instances. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "failoverAction": "my_failoverAction", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "pendingActions": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serviceAccount": "my_serviceAccount", + * // "statefulPolicy": {}, + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.insert * @memberOf! () * @@ -66767,71 +83235,75 @@ export namespace compute_beta { * compute.regionInstanceGroupManagers.list * @desc Retrieves the list of managed instance groups that are contained within the specified region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroupManagers.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionInstanceGroupManagers.list(request, handlePage); - * } - * }; + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.regionInstanceGroupManagers.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.list * @memberOf! () * @@ -66920,6 +83392,74 @@ export namespace compute_beta { /** * compute.regionInstanceGroupManagers.listErrors * @desc Lists all errors thrown by actions on instances for a given regional managed instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroupManagers.listErrors({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9][0-9]{0,19}. + * instanceGroupManager: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. This should conform to RFC1035. + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.listErrors * @memberOf! () * @@ -67026,74 +83566,73 @@ export namespace compute_beta { * compute.regionInstanceGroupManagers.listManagedInstances * @desc Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroupManagers.listManagedInstances({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var managedInstancesPage = response['managedInstances']; - * if (!managedInstancesPage) { - * return; - * } - * for (var i = 0; i < managedInstancesPage.length; i++) { - * // TODO: Change code below to process each resource in `managedInstancesPage`: - * console.log(JSON.stringify(managedInstancesPage[i], null, 2)); - * } + * region: 'placeholder-value', + * }); + * console.log(res.data); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionInstanceGroupManagers.listManagedInstances(request, handlePage); - * } - * }; + * // Example response + * // { + * // "managedInstances": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } * - * compute.regionInstanceGroupManagers.listManagedInstances(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.listManagedInstances * @memberOf! () * @@ -67198,6 +83737,75 @@ export namespace compute_beta { /** * compute.regionInstanceGroupManagers.listPerInstanceConfigs * @desc Lists all of the per-instance configs defined for the managed instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroupManagers.listPerInstanceConfigs({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request, should conform to RFC1035. + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "nextPageToken": "my_nextPageToken", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.listPerInstanceConfigs * @memberOf! () * @@ -67303,66 +83911,113 @@ export namespace compute_beta { * compute.regionInstanceGroupManagers.patch * @desc Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.patch({ + * // The name of the instance group manager. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // The name of the instance group manager. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "failoverAction": "my_failoverAction", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "pendingActions": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serviceAccount": "my_serviceAccount", + * // "statefulPolicy": {}, + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.patch * @memberOf! () * @@ -67441,6 +84096,92 @@ export namespace compute_beta { /** * compute.regionInstanceGroupManagers.patchPerInstanceConfigs * @desc Insert or patch (for the ones that already exist) per-instance configs for the managed instance group. perInstanceConfig.instance serves as a key used to distinguish whether to perform insert or patch. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.patchPerInstanceConfigs( + * { + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request, should conform to RFC1035. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "perInstanceConfigs": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.patchPerInstanceConfigs * @memberOf! () * @@ -67522,65 +84263,89 @@ export namespace compute_beta { * compute.regionInstanceGroupManagers.recreateInstances * @desc Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.recreateInstances({ + * // Name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.recreateInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.recreateInstances * @memberOf! () * @@ -67660,64 +84425,83 @@ export namespace compute_beta { * compute.regionInstanceGroupManagers.resize * @desc Changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances. The resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.resize({ + * // Name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Number of instances that should exist in this instance group manager. - * size: 0, // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.resize(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * size: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.resize * @memberOf! () * @@ -67797,65 +84581,89 @@ export namespace compute_beta { * compute.regionInstanceGroupManagers.setAutoHealingPolicies * @desc Modifies the autohealing policy for the instances in this managed instance group. [Deprecated] This method is deprecated. Please use Patch instead. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.setAutoHealingPolicies({ + * // Name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoHealingPolicies": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.setAutoHealingPolicies(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.setAutoHealingPolicies * @memberOf! () * @@ -67937,65 +84745,89 @@ export namespace compute_beta { * compute.regionInstanceGroupManagers.setInstanceTemplate * @desc Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.setInstanceTemplate({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instanceTemplate": "my_instanceTemplate" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.setInstanceTemplate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.setInstanceTemplate * @memberOf! () * @@ -68075,65 +84907,90 @@ export namespace compute_beta { * compute.regionInstanceGroupManagers.setTargetPools * @desc Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.setTargetPools({ + * // Name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "targetPools": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.setTargetPools(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.setTargetPools * @memberOf! () * @@ -68213,65 +85070,62 @@ export namespace compute_beta { * compute.regionInstanceGroupManagers.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroupManagers.testIamPermissions({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.testIamPermissions * @memberOf! () * @@ -68354,66 +85208,113 @@ export namespace compute_beta { * compute.regionInstanceGroupManagers.update * @desc Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is updated even if the instances in the group have not yet been updated. You must separately verify the status of the individual instances with the listmanagedinstances method. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.update({ + * // The name of the instance group manager. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // The name of the instance group manager. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "failoverAction": "my_failoverAction", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "pendingActions": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serviceAccount": "my_serviceAccount", + * // "statefulPolicy": {}, + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.update * @memberOf! () * @@ -68492,6 +85393,92 @@ export namespace compute_beta { /** * compute.regionInstanceGroupManagers.updatePerInstanceConfigs * @desc Insert or update (for the ones that already exist) per-instance configs for the managed instance group. perInstanceConfig.instance serves as a key used to distinguish whether to perform insert or patch. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.updatePerInstanceConfigs( + * { + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request, should conform to RFC1035. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "perInstanceConfigs": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.updatePerInstanceConfigs * @memberOf! () * @@ -69212,61 +86199,66 @@ export namespace compute_beta { * compute.regionInstanceGroups.get * @desc Returns the specified instance group resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroups.get({ + * // Name of the instance group resource to return. + * instanceGroup: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the instance group resource to return. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroups.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroups.get * @memberOf! () * @@ -69344,71 +86336,75 @@ export namespace compute_beta { * compute.regionInstanceGroups.list * @desc Retrieves the list of instance group resources contained within the specified region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroups.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionInstanceGroups.list(request, handlePage); - * } - * }; + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.regionInstanceGroups.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroups.list * @memberOf! () * @@ -69491,78 +86487,86 @@ export namespace compute_beta { * compute.regionInstanceGroups.listInstances * @desc Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroups.listInstances({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Name of the regional instance group for which we want to list the instances. + * instanceGroup: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the regional instance group for which we want to list the instances. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instanceState": "my_instanceState", + * // "portName": "my_portName" + * // } * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionInstanceGroups.listInstances(request, handlePage); - * } - * }; - * - * compute.regionInstanceGroups.listInstances(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroups.listInstances * @memberOf! () * @@ -69654,65 +86658,90 @@ export namespace compute_beta { * compute.regionInstanceGroups.setNamedPorts * @desc Sets the named ports for the specified regional instance group. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroups.setNamedPorts({ + * // The name of the regional instance group where the named ports are updated. + * instanceGroup: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // The name of the regional instance group where the named ports are updated. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "namedPorts": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroups.setNamedPorts(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroups.setNamedPorts * @memberOf! () * @@ -69792,65 +86821,62 @@ export namespace compute_beta { * compute.regionInstanceGroups.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroups.testIamPermissions({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.regionInstanceGroups.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroups.testIamPermissions * @memberOf! () * @@ -70087,6 +87113,82 @@ export namespace compute_beta { /** * compute.regionNotificationEndpoints.delete * @desc Deletes the specified NotificationEndpoint in the given region + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionNotificationEndpoints.delete({ + * // Name of the NotificationEndpoint resource to delete. + * notificationEndpoint: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionNotificationEndpoints.delete * @memberOf! () * @@ -70164,6 +87266,62 @@ export namespace compute_beta { /** * compute.regionNotificationEndpoints.get * @desc Returns the specified NotificationEndpoint resource in the given region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionNotificationEndpoints.get({ + * // Name of the NotificationEndpoint resource to return. + * notificationEndpoint: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "grpcSettings": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionNotificationEndpoints.get * @memberOf! () * @@ -70242,6 +87400,95 @@ export namespace compute_beta { /** * compute.regionNotificationEndpoints.insert * @desc Create a NotificationEndpoint in the specified project in the given region using the parameters that are included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionNotificationEndpoints.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "grpcSettings": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionNotificationEndpoints.insert * @memberOf! () * @@ -70319,6 +87566,76 @@ export namespace compute_beta { /** * compute.regionNotificationEndpoints.list * @desc Lists the NotificationEndpoints for a project in the given region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionNotificationEndpoints.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionNotificationEndpoints.list * @memberOf! () * @@ -70510,58 +87827,48 @@ export namespace compute_beta { * compute.regionOperations.delete * @desc Deletes the specified region-specific Operations resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionOperations.delete({ + * // Name of the Operations resource to delete. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Operations resource to delete. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionOperations.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionOperations.delete * @memberOf! () * @@ -70637,61 +87944,76 @@ export namespace compute_beta { * compute.regionOperations.get * @desc Retrieves the specified region-specific Operations resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionOperations.get({ + * // Name of the Operations resource to return. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Operations resource to return. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionOperations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionOperations.get * @memberOf! () * @@ -70769,71 +88091,75 @@ export namespace compute_beta { * compute.regionOperations.list * @desc Retrieves a list of Operation resources contained within the specified region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionOperations.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionOperations.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.regionOperations.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionOperations.list * @memberOf! () * @@ -70913,6 +88239,77 @@ export namespace compute_beta { /** * compute.regionOperations.wait * @desc Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionOperations.wait({ + * // Name of the Operations resource to return. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionOperations.wait * @memberOf! () * @@ -71090,58 +88487,61 @@ export namespace compute_beta { * compute.regions.get * @desc Returns the specified Region resource. Gets a list of available regions by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regions.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region resource to return. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regions.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "quotas": [], + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "zones": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regions.get * @memberOf! () * @@ -71214,68 +88614,73 @@ export namespace compute_beta { * compute.regions.list * @desc Retrieves the list of region resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regions.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regions.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.regions.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regions.list * @memberOf! () * @@ -71403,6 +88808,82 @@ export namespace compute_beta { /** * compute.regionSslCertificates.delete * @desc Deletes the specified SslCertificate resource in the region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionSslCertificates.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the SslCertificate resource to delete. + * sslCertificate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionSslCertificates.delete * @memberOf! () * @@ -71480,6 +88961,68 @@ export namespace compute_beta { /** * compute.regionSslCertificates.get * @desc Returns the specified SslCertificate resource in the specified region. Get a list of available SSL certificates by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionSslCertificates.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the SslCertificate resource to return. + * sslCertificate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificate": "my_certificate", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "managed": {}, + * // "name": "my_name", + * // "privateKey": "my_privateKey", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfManaged": {}, + * // "subjectAlternativeNames": [], + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionSslCertificates.get * @memberOf! () * @@ -71556,6 +89099,101 @@ export namespace compute_beta { /** * compute.regionSslCertificates.insert * @desc Creates a SslCertificate resource in the specified project and region using the data included in the request + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionSslCertificates.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "certificate": "my_certificate", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "managed": {}, + * // "name": "my_name", + * // "privateKey": "my_privateKey", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfManaged": {}, + * // "subjectAlternativeNames": [], + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionSslCertificates.insert * @memberOf! () * @@ -71633,6 +89271,76 @@ export namespace compute_beta { /** * compute.regionSslCertificates.list * @desc Retrieves the list of SslCertificate resources available to the specified project in the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionSslCertificates.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionSslCertificates.list * @memberOf! () * @@ -71821,6 +89529,82 @@ export namespace compute_beta { /** * compute.regionTargetHttpProxies.delete * @desc Deletes the specified TargetHttpProxy resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpProxies.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpProxy resource to delete. + * targetHttpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpProxies.delete * @memberOf! () * @@ -71898,6 +89682,63 @@ export namespace compute_beta { /** * compute.regionTargetHttpProxies.get * @desc Returns the specified TargetHttpProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionTargetHttpProxies.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the TargetHttpProxy resource to return. + * targetHttpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyBind": false, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "urlMap": "my_urlMap" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpProxies.get * @memberOf! () * @@ -71974,6 +89815,96 @@ export namespace compute_beta { /** * compute.regionTargetHttpProxies.insert * @desc Creates a TargetHttpProxy resource in the specified project and region using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpProxies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyBind": false, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "urlMap": "my_urlMap" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpProxies.insert * @memberOf! () * @@ -72051,6 +89982,76 @@ export namespace compute_beta { /** * compute.regionTargetHttpProxies.list * @desc Retrieves the list of TargetHttpProxy resources available to the specified project in the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionTargetHttpProxies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpProxies.list * @memberOf! () * @@ -72130,6 +90131,90 @@ export namespace compute_beta { /** * compute.regionTargetHttpProxies.setUrlMap * @desc Changes the URL map for TargetHttpProxy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpProxies.setUrlMap({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpProxy to set a URL map for. + * targetHttpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "urlMap": "my_urlMap" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpProxies.setUrlMap * @memberOf! () * @@ -72346,6 +90431,82 @@ export namespace compute_beta { /** * compute.regionTargetHttpsProxies.delete * @desc Deletes the specified TargetHttpsProxy resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpsProxies.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpsProxy resource to delete. + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpsProxies.delete * @memberOf! () * @@ -72423,6 +90584,68 @@ export namespace compute_beta { /** * compute.regionTargetHttpsProxies.get * @desc Returns the specified TargetHttpsProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionTargetHttpsProxies.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the TargetHttpsProxy resource to return. + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authentication": "my_authentication", + * // "authorization": "my_authorization", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyBind": false, + * // "quicOverride": "my_quicOverride", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslCertificates": [], + * // "sslPolicy": "my_sslPolicy", + * // "urlMap": "my_urlMap" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpsProxies.get * @memberOf! () * @@ -72499,6 +90722,101 @@ export namespace compute_beta { /** * compute.regionTargetHttpsProxies.insert * @desc Creates a TargetHttpsProxy resource in the specified project and region using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpsProxies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "authentication": "my_authentication", + * // "authorization": "my_authorization", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyBind": false, + * // "quicOverride": "my_quicOverride", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslCertificates": [], + * // "sslPolicy": "my_sslPolicy", + * // "urlMap": "my_urlMap" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpsProxies.insert * @memberOf! () * @@ -72576,6 +90894,76 @@ export namespace compute_beta { /** * compute.regionTargetHttpsProxies.list * @desc Retrieves the list of TargetHttpsProxy resources available to the specified project in the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionTargetHttpsProxies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpsProxies.list * @memberOf! () * @@ -72657,6 +91045,90 @@ export namespace compute_beta { /** * compute.regionTargetHttpsProxies.setSslCertificates * @desc Replaces SslCertificates for TargetHttpsProxy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpsProxies.setSslCertificates({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sslCertificates": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpsProxies.setSslCertificates * @memberOf! () * @@ -72735,6 +91207,90 @@ export namespace compute_beta { /** * compute.regionTargetHttpsProxies.setUrlMap * @desc Changes the URL map for TargetHttpsProxy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpsProxies.setUrlMap({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpsProxy to set a URL map for. + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "urlMap": "my_urlMap" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpsProxies.setUrlMap * @memberOf! () * @@ -72980,6 +91536,78 @@ export namespace compute_beta { /** * compute.regionUrlMaps.delete * @desc Deletes the specified UrlMap resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionUrlMaps.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * requestId: 'placeholder-value', + * // Name of the UrlMap resource to delete. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.delete * @memberOf! () * @@ -73057,6 +91685,69 @@ export namespace compute_beta { /** * compute.regionUrlMaps.get * @desc Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionUrlMaps.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the UrlMap resource to return. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.get * @memberOf! () * @@ -73131,6 +91822,98 @@ export namespace compute_beta { /** * compute.regionUrlMaps.insert * @desc Creates a UrlMap resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionUrlMaps.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.insert * @memberOf! () * @@ -73208,6 +91991,87 @@ export namespace compute_beta { /** * compute.regionUrlMaps.invalidateCache * @desc Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionUrlMaps.invalidateCache({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * requestId: 'placeholder-value', + * // Name of the UrlMap scoping this request. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "host": "my_host", + * // "path": "my_path" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.invalidateCache * @memberOf! () * @@ -73286,6 +92150,76 @@ export namespace compute_beta { /** * compute.regionUrlMaps.list * @desc Retrieves the list of UrlMap resources available to the specified project in the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionUrlMaps.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.list * @memberOf! () * @@ -73365,6 +92299,100 @@ export namespace compute_beta { /** * compute.regionUrlMaps.patch * @desc Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionUrlMaps.patch({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * requestId: 'placeholder-value', + * // Name of the UrlMap resource to patch. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.patch * @memberOf! () * @@ -73443,6 +92471,100 @@ export namespace compute_beta { /** * compute.regionUrlMaps.update * @desc Updates the specified UrlMap resource with the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionUrlMaps.update({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * requestId: 'placeholder-value', + * // Name of the UrlMap resource to update. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.update * @memberOf! () * @@ -73521,6 +92643,62 @@ export namespace compute_beta { /** * compute.regionUrlMaps.validate * @desc Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionUrlMaps.validate({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the UrlMap resource to be validated as. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resource": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "result": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.validate * @memberOf! () * @@ -73823,6 +93001,76 @@ export namespace compute_beta { /** * compute.reservations.aggregatedList * @desc Retrieves an aggregated list of reservations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.reservations.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.aggregatedList * @memberOf! () * @@ -73909,6 +93157,82 @@ export namespace compute_beta { /** * compute.reservations.delete * @desc Deletes the specified reservation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.reservations.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the reservation to delete. + * reservation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.delete * @memberOf! () * @@ -73986,6 +93310,65 @@ export namespace compute_beta { /** * compute.reservations.get * @desc Retrieves information about the specified reservation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.reservations.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the reservation to retrieve. + * reservation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "commitment": "my_commitment", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "specificReservation": {}, + * // "specificReservationRequired": false, + * // "status": "my_status", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.get * @memberOf! () * @@ -74061,6 +93444,62 @@ export namespace compute_beta { /** * compute.reservations.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.reservations.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.getIamPolicy * @memberOf! () * @@ -74136,6 +93575,98 @@ export namespace compute_beta { /** * compute.reservations.insert * @desc Creates a new reservation. For more information, read Reserving zonal resources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.reservations.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "commitment": "my_commitment", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "specificReservation": {}, + * // "specificReservationRequired": false, + * // "status": "my_status", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.insert * @memberOf! () * @@ -74213,6 +93744,76 @@ export namespace compute_beta { /** * compute.reservations.list * @desc A list of all the reservations that have been configured for the specified project in specified zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.reservations.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.list * @memberOf! () * @@ -74292,6 +93893,90 @@ export namespace compute_beta { /** * compute.reservations.resize * @desc Resizes the reservation (applicable to standalone reservations only). For more information, read Modifying reservations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.reservations.resize({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the reservation to update. + * reservation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "specificSkuCount": "my_specificSkuCount" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.resize * @memberOf! () * @@ -74370,6 +94055,69 @@ export namespace compute_beta { /** * compute.reservations.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.reservations.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.setIamPolicy * @memberOf! () * @@ -74445,6 +94193,63 @@ export namespace compute_beta { /** * compute.reservations.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.reservations.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.testIamPermissions * @memberOf! () * @@ -74769,6 +94574,77 @@ export namespace compute_beta { /** * compute.resourcePolicies.aggregatedList * @desc Retrieves an aggregated list of resource policies. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.resourcePolicies.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.aggregatedList * @memberOf! () * @@ -74857,6 +94733,82 @@ export namespace compute_beta { /** * compute.resourcePolicies.delete * @desc Deletes the specified resource policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.resourcePolicies.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the resource policy to delete. + * resourcePolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.delete * @memberOf! () * @@ -74934,6 +94886,64 @@ export namespace compute_beta { /** * compute.resourcePolicies.get * @desc Retrieves all information of the specified resource policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.resourcePolicies.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the resource policy to retrieve. + * resourcePolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "groupPlacementPolicy": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "snapshotSchedulePolicy": {}, + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.get * @memberOf! () * @@ -75010,6 +95020,62 @@ export namespace compute_beta { /** * compute.resourcePolicies.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.resourcePolicies.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.getIamPolicy * @memberOf! () * @@ -75085,6 +95151,97 @@ export namespace compute_beta { /** * compute.resourcePolicies.insert * @desc Creates a new resource policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.resourcePolicies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "groupPlacementPolicy": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "snapshotSchedulePolicy": {}, + * // "status": "my_status" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.insert * @memberOf! () * @@ -75162,6 +95319,77 @@ export namespace compute_beta { /** * compute.resourcePolicies.list * @desc A list all the resource policies that have been configured for the specified project in specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.resourcePolicies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.list * @memberOf! () * @@ -75241,6 +95469,69 @@ export namespace compute_beta { /** * compute.resourcePolicies.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.resourcePolicies.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.setIamPolicy * @memberOf! () * @@ -75316,6 +95607,63 @@ export namespace compute_beta { /** * compute.resourcePolicies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.resourcePolicies.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.testIamPermissions * @memberOf! () * @@ -75613,68 +95961,75 @@ export namespace compute_beta { * compute.routers.aggregatedList * @desc Retrieves an aggregated list of routers. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.routers.aggregatedList(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routers.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.routers.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routers.aggregatedList * @memberOf! () * @@ -75758,61 +96113,81 @@ export namespace compute_beta { * compute.routers.delete * @desc Deletes the specified Router resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.routers.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the Router resource to delete. - * router: 'my-router', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.routers.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routers.delete * @memberOf! () * @@ -75890,61 +96265,65 @@ export namespace compute_beta { * compute.routers.get * @desc Returns the specified Router resource. Gets a list of available routers by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routers.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * // Name of the Router resource to return. - * router: 'my-router', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.routers.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bgp": {}, + * // "bgpPeers": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "nats": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routers.get * @memberOf! () * @@ -76018,6 +96397,80 @@ export namespace compute_beta { /** * compute.routers.getNatMappingInfo * @desc Retrieves runtime Nat mapping information of VM endpoints. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routers.getNatMappingInfo({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Name of the nat service to filter the Nat Mapping information. If it is omitted, all nats for this router will be returned. Name should conform to RFC1035. + * natName: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the Router resource to query for Nat Mapping information of VM endpoints. + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "result": [], + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.routers.getNatMappingInfo * @memberOf! () * @@ -76107,61 +96560,55 @@ export namespace compute_beta { * compute.routers.getRouterStatus * @desc Retrieves runtime information of the specified router. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routers.getRouterStatus({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * // Name of the Router resource to query. - * router: 'my-router', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); * - * compute.routers.getRouterStatus(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "kind": "my_kind", + * // "result": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routers.getRouterStatus * @memberOf! () * @@ -76243,62 +96690,98 @@ export namespace compute_beta { * compute.routers.insert * @desc Creates a Router resource in the specified project and region using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.routers.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bgp": {}, + * // "bgpPeers": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "nats": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.routers.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routers.insert * @memberOf! () * @@ -76376,71 +96859,75 @@ export namespace compute_beta { * compute.routers.list * @desc Retrieves a list of Router resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routers.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.routers.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.routers.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routers.list * @memberOf! () * @@ -76520,66 +97007,100 @@ export namespace compute_beta { * compute.routers.patch * @desc Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.routers.patch({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the Router resource to patch. - * router: 'my-router', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bgp": {}, + * // "bgpPeers": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "nats": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.routers.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routers.patch * @memberOf! () * @@ -76658,65 +97179,73 @@ export namespace compute_beta { * compute.routers.preview * @desc Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routers.preview({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * // Name of the Router resource to query. - * router: 'my-router', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bgp": {}, + * // "bgpPeers": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "nats": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.routers.preview(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "resource": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routers.preview * @memberOf! () * @@ -76798,65 +97327,62 @@ export namespace compute_beta { * compute.routers.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routers.testIamPermissions({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.routers.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routers.testIamPermissions * @memberOf! () * @@ -76939,66 +97465,100 @@ export namespace compute_beta { * compute.routers.update * @desc Updates the specified Router resource with the data included in the request. This method conforms to PUT semantics, which requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.routers.update({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the Router resource to update. - * router: 'my-router', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bgp": {}, + * // "bgpPeers": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "nats": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.routers.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routers.update * @memberOf! () * @@ -77379,58 +97939,79 @@ export namespace compute_beta { * compute.routes.delete * @desc Deletes the specified Route resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.routes.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the Route resource to delete. - * route: 'my-route', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.routes.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * route: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routes.delete * @memberOf! () * @@ -77506,58 +98087,70 @@ export namespace compute_beta { * compute.routes.get * @desc Returns the specified Route resource. Gets a list of available routes by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routes.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the Route resource to return. - * route: 'my-route', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.routes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * route: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "destRange": "my_destRange", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "network": "my_network", + * // "nextHopGateway": "my_nextHopGateway", + * // "nextHopIlb": "my_nextHopIlb", + * // "nextHopInstance": "my_nextHopInstance", + * // "nextHopInterconnectAttachment": "my_nextHopInterconnectAttachment", + * // "nextHopIp": "my_nextHopIp", + * // "nextHopNetwork": "my_nextHopNetwork", + * // "nextHopPeering": "my_nextHopPeering", + * // "nextHopVpnTunnel": "my_nextHopVpnTunnel", + * // "priority": 0, + * // "selfLink": "my_selfLink", + * // "tags": [], + * // "warnings": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routes.get * @memberOf! () * @@ -77630,59 +98223,103 @@ export namespace compute_beta { * compute.routes.insert * @desc Creates a Route resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.routes.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "destRange": "my_destRange", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "network": "my_network", + * // "nextHopGateway": "my_nextHopGateway", + * // "nextHopIlb": "my_nextHopIlb", + * // "nextHopInstance": "my_nextHopInstance", + * // "nextHopInterconnectAttachment": "my_nextHopInterconnectAttachment", + * // "nextHopIp": "my_nextHopIp", + * // "nextHopNetwork": "my_nextHopNetwork", + * // "nextHopPeering": "my_nextHopPeering", + * // "nextHopVpnTunnel": "my_nextHopVpnTunnel", + * // "priority": 0, + * // "selfLink": "my_selfLink", + * // "tags": [], + * // "warnings": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.routes.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routes.insert * @memberOf! () * @@ -77758,68 +98395,73 @@ export namespace compute_beta { * compute.routes.list * @desc Retrieves the list of Route resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.routes.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.routes.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routes.list * @memberOf! () * @@ -77897,62 +98539,60 @@ export namespace compute_beta { * compute.routes.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routes.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.routes.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routes.testIamPermissions * @memberOf! () * @@ -78143,6 +98783,94 @@ export namespace compute_beta { /** * compute.securityPolicies.addRule * @desc Inserts a rule into a security policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.addRule({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the security policy to update. + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // If true, the request will not be committed. + * validateOnly: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "direction": "my_direction", + * // "enableLogging": false, + * // "kind": "my_kind", + * // "match": {}, + * // "preview": false, + * // "priority": 0, + * // "ruleTupleCount": 0, + * // "targetResources": [], + * // "targetServiceAccounts": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.addRule * @memberOf! () * @@ -78221,58 +98949,79 @@ export namespace compute_beta { * compute.securityPolicies.delete * @desc Deletes the specified policy. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the security policy to delete. - * securityPolicy: 'my-security-policy', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.securityPolicies.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.securityPolicies.delete * @memberOf! () * @@ -78350,58 +99099,67 @@ export namespace compute_beta { * compute.securityPolicies.get * @desc List all of the ordered rules present in a single specified policy. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.securityPolicies.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the security policy to get. - * securityPolicy: 'my-security-policy', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.securityPolicies.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "associations": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "parent": "my_parent", + * // "ruleTupleCount": 0, + * // "rules": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "type": "my_type" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.securityPolicies.get * @memberOf! () * @@ -78477,6 +99235,65 @@ export namespace compute_beta { /** * compute.securityPolicies.getRule * @desc Gets a rule at the specified priority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.securityPolicies.getRule({ + * // The priority of the rule to get from the security policy. + * priority: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the security policy to which the queried rule belongs. + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "direction": "my_direction", + * // "enableLogging": false, + * // "kind": "my_kind", + * // "match": {}, + * // "preview": false, + * // "priority": 0, + * // "ruleTupleCount": 0, + * // "targetResources": [], + * // "targetServiceAccounts": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.getRule * @memberOf! () * @@ -78554,59 +99371,102 @@ export namespace compute_beta { * compute.securityPolicies.insert * @desc Creates a new policy in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // If true, the request will not be committed. + * validateOnly: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "associations": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "parent": "my_parent", + * // "ruleTupleCount": 0, + * // "rules": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "type": "my_type" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.securityPolicies.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.securityPolicies.insert * @memberOf! () * @@ -78685,68 +99545,72 @@ export namespace compute_beta { * compute.securityPolicies.list * @desc List all the policies that have been configured for the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.securityPolicies.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.securityPolicies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "warning": {} + * // } + * } * - * compute.securityPolicies.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.securityPolicies.list * @memberOf! () * @@ -78825,6 +99689,68 @@ export namespace compute_beta { /** * compute.securityPolicies.listPreconfiguredExpressionSets * @desc Gets the current list of preconfigured Web Application Firewall (WAF) expressions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.listPreconfiguredExpressionSets({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "preconfiguredExpressionSets": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.listPreconfiguredExpressionSets * @memberOf! () * @@ -78930,63 +99856,102 @@ export namespace compute_beta { * compute.securityPolicies.patch * @desc Patches the specified policy with the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.patch({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the security policy to update. - * securityPolicy: 'my-security-policy', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "associations": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "parent": "my_parent", + * // "ruleTupleCount": 0, + * // "rules": [], + * // "selfLink": "my_selfLink", + * // "selfLinkWithId": "my_selfLinkWithId", + * // "type": "my_type" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.securityPolicies.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.securityPolicies.patch * @memberOf! () * @@ -79064,6 +100029,96 @@ export namespace compute_beta { /** * compute.securityPolicies.patchRule * @desc Patches a rule at the specified priority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.patchRule({ + * // The priority of the rule to patch. + * priority: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the security policy to update. + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // If true, the request will not be committed. + * validateOnly: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "direction": "my_direction", + * // "enableLogging": false, + * // "kind": "my_kind", + * // "match": {}, + * // "preview": false, + * // "priority": 0, + * // "ruleTupleCount": 0, + * // "targetResources": [], + * // "targetServiceAccounts": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.patchRule * @memberOf! () * @@ -79142,6 +100197,76 @@ export namespace compute_beta { /** * compute.securityPolicies.removeRule * @desc Deletes a rule at the specified priority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.removeRule({ + * // The priority of the rule to remove from the security policy. + * priority: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the security policy to update. + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.removeRule * @memberOf! () * @@ -79218,6 +100343,83 @@ export namespace compute_beta { /** * compute.securityPolicies.setLabels * @desc Sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.setLabels * @memberOf! () * @@ -79295,62 +100497,60 @@ export namespace compute_beta { * compute.securityPolicies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.securityPolicies.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.securityPolicies.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.securityPolicies.testIamPermissions * @memberOf! () * @@ -79718,58 +100918,79 @@ export namespace compute_beta { * compute.snapshots.delete * @desc Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. For more information, see Deleting snapshots. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.snapshots.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the Snapshot resource to delete. - * snapshot: 'my-snapshot', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.snapshots.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * snapshot: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.snapshots.delete * @memberOf! () * @@ -79846,58 +101067,72 @@ export namespace compute_beta { * compute.snapshots.get * @desc Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.snapshots.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the Snapshot resource to return. - * snapshot: 'my-snapshot', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.snapshots.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * snapshot: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoCreated": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "downloadBytes": "my_downloadBytes", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "snapshotEncryptionKey": {}, + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskEncryptionKey": {}, + * // "sourceDiskId": "my_sourceDiskId", + * // "status": "my_status", + * // "storageBytes": "my_storageBytes", + * // "storageBytesStatus": "my_storageBytesStatus", + * // "storageLocations": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.snapshots.get * @memberOf! () * @@ -79970,6 +101205,60 @@ export namespace compute_beta { /** * compute.snapshots.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.snapshots.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.snapshots.getIamPolicy * @memberOf! () * @@ -80045,68 +101334,73 @@ export namespace compute_beta { * compute.snapshots.list * @desc Retrieves the list of Snapshot resources contained within the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.snapshots.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.snapshots.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.snapshots.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.snapshots.list * @memberOf! () * @@ -80183,6 +101477,67 @@ export namespace compute_beta { /** * compute.snapshots.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.snapshots.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.snapshots.setIamPolicy * @memberOf! () * @@ -80258,62 +101613,82 @@ export namespace compute_beta { * compute.snapshots.setLabels * @desc Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.snapshots.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } * }, - * - * auth: authClient, - * }; - * - * compute.snapshots.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.snapshots.setLabels * @memberOf! () * @@ -80391,62 +101766,60 @@ export namespace compute_beta { * compute.snapshots.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.snapshots.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.snapshots.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.snapshots.testIamPermissions * @memberOf! () * @@ -80679,6 +102052,76 @@ export namespace compute_beta { /** * compute.sslCertificates.aggregatedList * @desc Retrieves the list of all SslCertificate resources, regional and global, available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslCertificates.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Name of the project scoping this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslCertificates.aggregatedList * @memberOf! () * @@ -80768,58 +102211,79 @@ export namespace compute_beta { * compute.sslCertificates.delete * @desc Deletes the specified SslCertificate resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.sslCertificates.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the SslCertificate resource to delete. - * sslCertificate: 'my-ssl-certificate', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.sslCertificates.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * sslCertificate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.sslCertificates.delete * @memberOf! () * @@ -80897,58 +102361,65 @@ export namespace compute_beta { * compute.sslCertificates.get * @desc Returns the specified SslCertificate resource. Gets a list of available SSL certificates by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslCertificates.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the SslCertificate resource to return. - * sslCertificate: 'my-ssl-certificate', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.sslCertificates.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * sslCertificate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificate": "my_certificate", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "managed": {}, + * // "name": "my_name", + * // "privateKey": "my_privateKey", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfManaged": {}, + * // "subjectAlternativeNames": [], + * // "type": "my_type" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.sslCertificates.get * @memberOf! () * @@ -81025,59 +102496,98 @@ export namespace compute_beta { * compute.sslCertificates.insert * @desc Creates a SslCertificate resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.sslCertificates.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "certificate": "my_certificate", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "managed": {}, + * // "name": "my_name", + * // "privateKey": "my_privateKey", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfManaged": {}, + * // "subjectAlternativeNames": [], + * // "type": "my_type" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.sslCertificates.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.sslCertificates.insert * @memberOf! () * @@ -81155,68 +102665,73 @@ export namespace compute_beta { * compute.sslCertificates.list * @desc Retrieves the list of SslCertificate resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.sslCertificates.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslCertificates.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.sslCertificates.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.sslCertificates.list * @memberOf! () * @@ -81296,62 +102811,60 @@ export namespace compute_beta { * compute.sslCertificates.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslCertificates.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.sslCertificates.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.sslCertificates.testIamPermissions * @memberOf! () * @@ -81578,6 +103091,80 @@ export namespace compute_beta { /** * compute.sslPolicies.delete * @desc Deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.sslPolicies.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. + * sslPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslPolicies.delete * @memberOf! () * @@ -81654,6 +103241,64 @@ export namespace compute_beta { /** * compute.sslPolicies.get * @desc Lists all of the ordered rules present in a single specified policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslPolicies.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * sslPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "customFeatures": [], + * // "description": "my_description", + * // "enabledFeatures": [], + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "minTlsVersion": "my_minTlsVersion", + * // "name": "my_name", + * // "profile": "my_profile", + * // "selfLink": "my_selfLink", + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslPolicies.get * @memberOf! () * @@ -81728,6 +103373,97 @@ export namespace compute_beta { /** * compute.sslPolicies.insert * @desc Returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.sslPolicies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "customFeatures": [], + * // "description": "my_description", + * // "enabledFeatures": [], + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "minTlsVersion": "my_minTlsVersion", + * // "name": "my_name", + * // "profile": "my_profile", + * // "selfLink": "my_selfLink", + * // "warnings": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslPolicies.insert * @memberOf! () * @@ -81803,6 +103539,74 @@ export namespace compute_beta { /** * compute.sslPolicies.list * @desc Lists all the SSL policies that have been configured for the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslPolicies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslPolicies.list * @memberOf! () * @@ -81879,6 +103683,69 @@ export namespace compute_beta { /** * compute.sslPolicies.listAvailableFeatures * @desc Lists all features that can be specified in the SSL policy when using custom profile. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslPolicies.listAvailableFeatures({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "features": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslPolicies.listAvailableFeatures * @memberOf! () * @@ -81974,6 +103841,99 @@ export namespace compute_beta { /** * compute.sslPolicies.patch * @desc Patches the specified SSL policy with the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.sslPolicies.patch({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * sslPolicy: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "customFeatures": [], + * // "description": "my_description", + * // "enabledFeatures": [], + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "minTlsVersion": "my_minTlsVersion", + * // "name": "my_name", + * // "profile": "my_profile", + * // "selfLink": "my_selfLink", + * // "warnings": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslPolicies.patch * @memberOf! () * @@ -82051,6 +104011,61 @@ export namespace compute_beta { /** * compute.sslPolicies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslPolicies.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslPolicies.testIamPermissions * @memberOf! () * @@ -82297,68 +104312,75 @@ export namespace compute_beta { * compute.subnetworks.aggregatedList * @desc Retrieves an aggregated list of subnetworks. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.subnetworks.aggregatedList(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.subnetworks.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.subnetworks.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.subnetworks.aggregatedList * @memberOf! () * @@ -82443,61 +104465,81 @@ export namespace compute_beta { * compute.subnetworks.delete * @desc Deletes the specified subnetwork. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.subnetworks.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the Subnetwork resource to delete. - * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.subnetworks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * subnetwork: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.subnetworks.delete * @memberOf! () * @@ -82576,65 +104618,89 @@ export namespace compute_beta { * compute.subnetworks.expandIpCidrRange * @desc Expands the IP CIDR range of the subnetwork to a specified value. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.subnetworks.expandIpCidrRange({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the Subnetwork resource to update. - * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * subnetwork: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ipCidrRange": "my_ipCidrRange" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.subnetworks.expandIpCidrRange(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.subnetworks.expandIpCidrRange * @memberOf! () * @@ -82714,61 +104780,75 @@ export namespace compute_beta { * compute.subnetworks.get * @desc Returns the specified subnetwork. Gets a list of available subnetworks list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.subnetworks.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * // Name of the Subnetwork resource to return. - * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.subnetworks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * subnetwork: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "allowSubnetCidrRoutesOverlap": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableFlowLogs": false, + * // "fingerprint": "my_fingerprint", + * // "gatewayAddress": "my_gatewayAddress", + * // "id": "my_id", + * // "ipCidrRange": "my_ipCidrRange", + * // "ipv6CidrRange": "my_ipv6CidrRange", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "privateIpGoogleAccess": false, + * // "privateIpv6GoogleAccess": "my_privateIpv6GoogleAccess", + * // "privateIpv6GoogleAccessServiceAccounts": [], + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "role": "my_role", + * // "secondaryIpRanges": [], + * // "selfLink": "my_selfLink", + * // "state": "my_state" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.subnetworks.get * @memberOf! () * @@ -82845,61 +104925,61 @@ export namespace compute_beta { * compute.subnetworks.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.subnetworks.getIamPolicy({ + * // Requested IAM Policy version. + * optionsRequestedPolicyVersion: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.subnetworks.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.subnetworks.getIamPolicy * @memberOf! () * @@ -82976,62 +105056,108 @@ export namespace compute_beta { * compute.subnetworks.insert * @desc Creates a subnetwork in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.subnetworks.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "allowSubnetCidrRoutesOverlap": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableFlowLogs": false, + * // "fingerprint": "my_fingerprint", + * // "gatewayAddress": "my_gatewayAddress", + * // "id": "my_id", + * // "ipCidrRange": "my_ipCidrRange", + * // "ipv6CidrRange": "my_ipv6CidrRange", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "privateIpGoogleAccess": false, + * // "privateIpv6GoogleAccess": "my_privateIpv6GoogleAccess", + * // "privateIpv6GoogleAccessServiceAccounts": [], + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "role": "my_role", + * // "secondaryIpRanges": [], + * // "selfLink": "my_selfLink", + * // "state": "my_state" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.subnetworks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.subnetworks.insert * @memberOf! () * @@ -83110,71 +105236,75 @@ export namespace compute_beta { * compute.subnetworks.list * @desc Retrieves a list of subnetworks available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.subnetworks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.subnetworks.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.subnetworks.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.subnetworks.list * @memberOf! () * @@ -83253,6 +105383,74 @@ export namespace compute_beta { /** * compute.subnetworks.listUsable * @desc Retrieves an aggregated list of all usable subnetworks in the project. The list contains all of the subnetworks in the project and the subnetworks that were shared by a Shared VPC host project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.subnetworks.listUsable({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.subnetworks.listUsable * @memberOf! () * @@ -83341,66 +105539,112 @@ export namespace compute_beta { * compute.subnetworks.patch * @desc Patches the specified subnetwork with the data included in the request. Only certain fields can up updated with a patch request as indicated in the field descriptions. You must specify the current fingerprint of the subnetwork resource being patched. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.subnetworks.patch({ + * // The drain timeout specifies the upper bound in seconds on the amount of time allowed to drain connections from the current ACTIVE subnetwork to the current BACKUP subnetwork. The drain timeout is only applicable when the following conditions are true: - the subnetwork being patched has purpose = INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role = BACKUP - the patch request is setting the role to ACTIVE. Note that after this patch operation the roles of the ACTIVE and BACKUP subnetworks will be swapped. + * drainTimeoutSeconds: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the Subnetwork resource to patch. - * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * subnetwork: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "allowSubnetCidrRoutesOverlap": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableFlowLogs": false, + * // "fingerprint": "my_fingerprint", + * // "gatewayAddress": "my_gatewayAddress", + * // "id": "my_id", + * // "ipCidrRange": "my_ipCidrRange", + * // "ipv6CidrRange": "my_ipv6CidrRange", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "privateIpGoogleAccess": false, + * // "privateIpv6GoogleAccess": "my_privateIpv6GoogleAccess", + * // "privateIpv6GoogleAccessServiceAccounts": [], + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "role": "my_role", + * // "secondaryIpRanges": [], + * // "selfLink": "my_selfLink", + * // "state": "my_state" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.subnetworks.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.subnetworks.patch * @memberOf! () * @@ -83481,65 +105725,68 @@ export namespace compute_beta { * compute.subnetworks.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.subnetworks.setIamPolicy({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } * }, - * - * auth: authClient, - * }; - * - * compute.subnetworks.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.subnetworks.setIamPolicy * @memberOf! () * @@ -83616,65 +105863,89 @@ export namespace compute_beta { * compute.subnetworks.setPrivateIpGoogleAccess * @desc Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.subnetworks.setPrivateIpGoogleAccess({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the Subnetwork resource. - * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * subnetwork: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "privateIpGoogleAccess": false + * // } * }, - * - * auth: authClient, - * }; - * - * compute.subnetworks.setPrivateIpGoogleAccess(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.subnetworks.setPrivateIpGoogleAccess * @memberOf! () * @@ -83756,65 +106027,62 @@ export namespace compute_beta { * compute.subnetworks.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.subnetworks.testIamPermissions({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.subnetworks.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.subnetworks.testIamPermissions * @memberOf! () * @@ -84228,6 +106496,76 @@ export namespace compute_beta { /** * compute.targetHttpProxies.aggregatedList * @desc Retrieves the list of all TargetHttpProxy resources, regional and global, available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpProxies.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Name of the project scoping this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpProxies.aggregatedList * @memberOf! () * @@ -84317,58 +106655,79 @@ export namespace compute_beta { * compute.targetHttpProxies.delete * @desc Deletes the specified TargetHttpProxy resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpProxies.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetHttpProxy resource to delete. - * targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetHttpProxies.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetHttpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpProxies.delete * @memberOf! () * @@ -84446,58 +106805,60 @@ export namespace compute_beta { * compute.targetHttpProxies.get * @desc Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpProxies.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the TargetHttpProxy resource to return. - * targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetHttpProxies.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetHttpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyBind": false, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "urlMap": "my_urlMap" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpProxies.get * @memberOf! () * @@ -84574,59 +106935,93 @@ export namespace compute_beta { * compute.targetHttpProxies.insert * @desc Creates a TargetHttpProxy resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpProxies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyBind": false, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "urlMap": "my_urlMap" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpProxies.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpProxies.insert * @memberOf! () * @@ -84704,68 +107099,73 @@ export namespace compute_beta { * compute.targetHttpProxies.list * @desc Retrieves the list of TargetHttpProxy resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetHttpProxies.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpProxies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.targetHttpProxies.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpProxies.list * @memberOf! () * @@ -84845,62 +107245,87 @@ export namespace compute_beta { * compute.targetHttpProxies.setUrlMap * @desc Changes the URL map for TargetHttpProxy. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpProxies.setUrlMap({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetHttpProxy to set a URL map for. - * targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetHttpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "urlMap": "my_urlMap" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpProxies.setUrlMap(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpProxies.setUrlMap * @memberOf! () * @@ -84979,62 +107404,60 @@ export namespace compute_beta { * compute.targetHttpProxies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpProxies.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.targetHttpProxies.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpProxies.testIamPermissions * @memberOf! () * @@ -85286,6 +107709,76 @@ export namespace compute_beta { /** * compute.targetHttpsProxies.aggregatedList * @desc Retrieves the list of all TargetHttpsProxy resources, regional and global, available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpsProxies.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Name of the project scoping this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpsProxies.aggregatedList * @memberOf! () * @@ -85375,58 +107868,79 @@ export namespace compute_beta { * compute.targetHttpsProxies.delete * @desc Deletes the specified TargetHttpsProxy resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpsProxies.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetHttpsProxy resource to delete. - * targetHttpsProxy: 'my-target-https-proxy', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpsProxies.delete * @memberOf! () * @@ -85504,58 +108018,65 @@ export namespace compute_beta { * compute.targetHttpsProxies.get * @desc Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpsProxies.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the TargetHttpsProxy resource to return. - * targetHttpsProxy: 'my-target-https-proxy', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authentication": "my_authentication", + * // "authorization": "my_authorization", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyBind": false, + * // "quicOverride": "my_quicOverride", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslCertificates": [], + * // "sslPolicy": "my_sslPolicy", + * // "urlMap": "my_urlMap" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpsProxies.get * @memberOf! () * @@ -85632,59 +108153,98 @@ export namespace compute_beta { * compute.targetHttpsProxies.insert * @desc Creates a TargetHttpsProxy resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpsProxies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "authentication": "my_authentication", + * // "authorization": "my_authorization", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyBind": false, + * // "quicOverride": "my_quicOverride", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslCertificates": [], + * // "sslPolicy": "my_sslPolicy", + * // "urlMap": "my_urlMap" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpsProxies.insert * @memberOf! () * @@ -85762,68 +108322,73 @@ export namespace compute_beta { * compute.targetHttpsProxies.list * @desc Retrieves the list of TargetHttpsProxy resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetHttpsProxies.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpsProxies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.targetHttpsProxies.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpsProxies.list * @memberOf! () * @@ -85904,6 +108469,88 @@ export namespace compute_beta { /** * compute.targetHttpsProxies.setQuicOverride * @desc Sets the QUIC override policy for TargetHttpsProxy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpsProxies.setQuicOverride({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035. + * targetHttpsProxy: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "quicOverride": "my_quicOverride" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpsProxies.setQuicOverride * @memberOf! () * @@ -85982,62 +108629,87 @@ export namespace compute_beta { * compute.targetHttpsProxies.setSslCertificates * @desc Replaces SslCertificates for TargetHttpsProxy. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpsProxies.setSslCertificates({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetHttpsProxy resource to set an SslCertificates resource for. - * targetHttpsProxy: 'my-target-https-proxy', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sslCertificates": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.setSslCertificates(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpsProxies.setSslCertificates * @memberOf! () * @@ -86115,6 +108787,88 @@ export namespace compute_beta { /** * compute.targetHttpsProxies.setSslPolicy * @desc Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the HTTPS proxy load balancer. They do not affect the connection between the load balancer and the backends. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpsProxies.setSslPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * targetHttpsProxy: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sslPolicy": "my_sslPolicy" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpsProxies.setSslPolicy * @memberOf! () * @@ -86193,62 +108947,87 @@ export namespace compute_beta { * compute.targetHttpsProxies.setUrlMap * @desc Changes the URL map for TargetHttpsProxy. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpsProxies.setUrlMap({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetHttpsProxy resource whose URL map is to be set. - * targetHttpsProxy: 'my-target-https-proxy', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "urlMap": "my_urlMap" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.setUrlMap(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpsProxies.setUrlMap * @memberOf! () * @@ -86327,62 +109106,60 @@ export namespace compute_beta { * compute.targetHttpsProxies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpsProxies.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpsProxies.testIamPermissions * @memberOf! () * @@ -86710,68 +109487,75 @@ export namespace compute_beta { * compute.targetInstances.aggregatedList * @desc Retrieves an aggregated list of target instances. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetInstances.aggregatedList(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetInstances.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.targetInstances.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetInstances.aggregatedList * @memberOf! () * @@ -86861,61 +109645,81 @@ export namespace compute_beta { * compute.targetInstances.delete * @desc Deletes the specified TargetInstance resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetInstances.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone scoping this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetInstance resource to delete. - * targetInstance: 'my-target-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetInstances.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetInstance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Name of the zone scoping this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetInstances.delete * @memberOf! () * @@ -86994,61 +109798,62 @@ export namespace compute_beta { * compute.targetInstances.get * @desc Returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetInstances.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone scoping this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the TargetInstance resource to return. - * targetInstance: 'my-target-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetInstances.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetInstance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Name of the zone scoping this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "name": "my_name", + * // "natPolicy": "my_natPolicy", + * // "selfLink": "my_selfLink", + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetInstances.get * @memberOf! () * @@ -87126,62 +109931,95 @@ export namespace compute_beta { * compute.targetInstances.insert * @desc Creates a TargetInstance resource in the specified project and zone using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetInstances.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the zone scoping this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "name": "my_name", + * // "natPolicy": "my_natPolicy", + * // "selfLink": "my_selfLink", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetInstances.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetInstances.insert * @memberOf! () * @@ -87260,71 +110098,75 @@ export namespace compute_beta { * compute.targetInstances.list * @desc Retrieves a list of TargetInstance resources available to the specified project and zone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetInstances.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the zone scoping this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetInstances.list(request, handlePage); - * } - * }; + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.targetInstances.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetInstances.list * @memberOf! () * @@ -87405,65 +110247,62 @@ export namespace compute_beta { * compute.targetInstances.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetInstances.testIamPermissions({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.targetInstances.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetInstances.testIamPermissions * @memberOf! () * @@ -87712,65 +110551,89 @@ export namespace compute_beta { * compute.targetPools.addHealthCheck * @desc Adds health check URLs to a target pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.addHealthCheck({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the target pool to add a health check to. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "healthChecks": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.addHealthCheck(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.addHealthCheck * @memberOf! () * @@ -87850,65 +110713,89 @@ export namespace compute_beta { * compute.targetPools.addInstance * @desc Adds an instance to a target pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.addInstance({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetPool resource to add instances to. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.addInstance(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.addInstance * @memberOf! () * @@ -87988,68 +110875,75 @@ export namespace compute_beta { * compute.targetPools.aggregatedList * @desc Retrieves an aggregated list of target pools. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetPools.aggregatedList(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetPools.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.targetPools.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.aggregatedList * @memberOf! () * @@ -88134,61 +111028,81 @@ export namespace compute_beta { * compute.targetPools.delete * @desc Deletes the specified target pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetPool resource to delete. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetPools.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.delete * @memberOf! () * @@ -88267,61 +111181,65 @@ export namespace compute_beta { * compute.targetPools.get * @desc Returns the specified target pool. Gets a list of available target pools by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetPools.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * // Name of the TargetPool resource to return. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetPools.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backupPool": "my_backupPool", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "failoverRatio": {}, + * // "healthChecks": [], + * // "id": "my_id", + * // "instances": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sessionAffinity": "my_sessionAffinity" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.get * @memberOf! () * @@ -88398,65 +111316,63 @@ export namespace compute_beta { * compute.targetPools.getHealth * @desc Gets the most recent health check results for each IP for the instance that is referenced by the given target pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetPools.getHealth({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * // Name of the TargetPool resource to which the queried instance belongs. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instance": "my_instance" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.targetPools.getHealth(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "healthStatus": [], + * // "kind": "my_kind" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.getHealth * @memberOf! () * @@ -88539,62 +111455,98 @@ export namespace compute_beta { * compute.targetPools.insert * @desc Creates a target pool in the specified project and region using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "backupPool": "my_backupPool", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "failoverRatio": {}, + * // "healthChecks": [], + * // "id": "my_id", + * // "instances": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sessionAffinity": "my_sessionAffinity" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.insert * @memberOf! () * @@ -88673,71 +111625,75 @@ export namespace compute_beta { * compute.targetPools.list * @desc Retrieves a list of target pools available to the specified project and region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetPools.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetPools.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.targetPools.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.list * @memberOf! () * @@ -88817,65 +111773,89 @@ export namespace compute_beta { * compute.targetPools.removeHealthCheck * @desc Removes health check URL from a target pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.removeHealthCheck({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the target pool to remove health checks from. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "healthChecks": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.removeHealthCheck(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.removeHealthCheck * @memberOf! () * @@ -88955,65 +111935,89 @@ export namespace compute_beta { * compute.targetPools.removeInstance * @desc Removes instance URL from a target pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.removeInstance({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetPool resource to remove instances from. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.removeInstance(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.removeInstance * @memberOf! () * @@ -89093,65 +112097,91 @@ export namespace compute_beta { * compute.targetPools.setBackup * @desc Changes a backup target pool's configurations. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.setBackup({ + * // New failoverRatio value for the target pool. + * failoverRatio: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetPool resource to set a backup pool for. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "target": "my_target" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.setBackup(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.setBackup * @memberOf! () * @@ -89232,65 +112262,62 @@ export namespace compute_beta { * compute.targetPools.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetPools.testIamPermissions({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.targetPools.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.testIamPermissions * @memberOf! () * @@ -89711,58 +112738,79 @@ export namespace compute_beta { * compute.targetSslProxies.delete * @desc Deletes the specified TargetSslProxy resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetSslProxies.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetSslProxy resource to delete. - * targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetSslProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetSslProxies.delete * @memberOf! () * @@ -89840,58 +112888,61 @@ export namespace compute_beta { * compute.targetSslProxies.get * @desc Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetSslProxies.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the TargetSslProxy resource to return. - * targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetSslProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyHeader": "my_proxyHeader", + * // "selfLink": "my_selfLink", + * // "service": "my_service", + * // "sslCertificates": [], + * // "sslPolicy": "my_sslPolicy" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetSslProxies.get * @memberOf! () * @@ -89968,59 +113019,94 @@ export namespace compute_beta { * compute.targetSslProxies.insert * @desc Creates a TargetSslProxy resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetSslProxies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyHeader": "my_proxyHeader", + * // "selfLink": "my_selfLink", + * // "service": "my_service", + * // "sslCertificates": [], + * // "sslPolicy": "my_sslPolicy" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetSslProxies.insert * @memberOf! () * @@ -90098,68 +113184,73 @@ export namespace compute_beta { * compute.targetSslProxies.list * @desc Retrieves the list of TargetSslProxy resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetSslProxies.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetSslProxies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.targetSslProxies.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetSslProxies.list * @memberOf! () * @@ -90239,62 +113330,87 @@ export namespace compute_beta { * compute.targetSslProxies.setBackendService * @desc Changes the BackendService for TargetSslProxy. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetSslProxies.setBackendService({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetSslProxy resource whose BackendService resource is to be set. - * targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetSslProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "service": "my_service" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.setBackendService(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetSslProxies.setBackendService * @memberOf! () * @@ -90373,62 +113489,87 @@ export namespace compute_beta { * compute.targetSslProxies.setProxyHeader * @desc Changes the ProxyHeaderType for TargetSslProxy. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetSslProxies.setProxyHeader({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetSslProxy resource whose ProxyHeader is to be set. - * targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetSslProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "proxyHeader": "my_proxyHeader" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.setProxyHeader(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetSslProxies.setProxyHeader * @memberOf! () * @@ -90507,62 +113648,87 @@ export namespace compute_beta { * compute.targetSslProxies.setSslCertificates * @desc Changes SslCertificates for TargetSslProxy. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetSslProxies.setSslCertificates({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetSslProxy resource whose SslCertificate resource is to be set. - * targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetSslProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sslCertificates": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.setSslCertificates(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetSslProxies.setSslCertificates * @memberOf! () * @@ -90640,6 +113806,88 @@ export namespace compute_beta { /** * compute.targetSslProxies.setSslPolicy * @desc Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the SSL proxy load balancer. They do not affect the connection between the load balancer and the backends. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetSslProxies.setSslPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * targetSslProxy: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sslPolicy": "my_sslPolicy" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetSslProxies.setSslPolicy * @memberOf! () * @@ -90718,62 +113966,60 @@ export namespace compute_beta { * compute.targetSslProxies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetSslProxies.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.targetSslProxies.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetSslProxies.testIamPermissions * @memberOf! () * @@ -91069,58 +114315,79 @@ export namespace compute_beta { * compute.targetTcpProxies.delete * @desc Deletes the specified TargetTcpProxy resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetTcpProxies.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetTcpProxy resource to delete. - * targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetTcpProxies.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetTcpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetTcpProxies.delete * @memberOf! () * @@ -91198,58 +114465,59 @@ export namespace compute_beta { * compute.targetTcpProxies.get * @desc Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetTcpProxies.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the TargetTcpProxy resource to return. - * targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetTcpProxies.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetTcpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyHeader": "my_proxyHeader", + * // "selfLink": "my_selfLink", + * // "service": "my_service" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetTcpProxies.get * @memberOf! () * @@ -91326,59 +114594,92 @@ export namespace compute_beta { * compute.targetTcpProxies.insert * @desc Creates a TargetTcpProxy resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetTcpProxies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyHeader": "my_proxyHeader", + * // "selfLink": "my_selfLink", + * // "service": "my_service" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetTcpProxies.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetTcpProxies.insert * @memberOf! () * @@ -91456,68 +114757,73 @@ export namespace compute_beta { * compute.targetTcpProxies.list * @desc Retrieves the list of TargetTcpProxy resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetTcpProxies.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetTcpProxies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.targetTcpProxies.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetTcpProxies.list * @memberOf! () * @@ -91597,62 +114903,87 @@ export namespace compute_beta { * compute.targetTcpProxies.setBackendService * @desc Changes the BackendService for TargetTcpProxy. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetTcpProxies.setBackendService({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetTcpProxy resource whose BackendService resource is to be set. - * targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetTcpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "service": "my_service" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetTcpProxies.setBackendService(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetTcpProxies.setBackendService * @memberOf! () * @@ -91731,62 +115062,87 @@ export namespace compute_beta { * compute.targetTcpProxies.setProxyHeader * @desc Changes the ProxyHeaderType for TargetTcpProxy. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetTcpProxies.setProxyHeader({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetTcpProxy resource whose ProxyHeader is to be set. - * targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetTcpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "proxyHeader": "my_proxyHeader" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetTcpProxies.setProxyHeader(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetTcpProxies.setProxyHeader * @memberOf! () * @@ -92008,68 +115364,75 @@ export namespace compute_beta { * compute.targetVpnGateways.aggregatedList * @desc Retrieves an aggregated list of target VPN gateways. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetVpnGateways.aggregatedList(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetVpnGateways.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.targetVpnGateways.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetVpnGateways.aggregatedList * @memberOf! () * @@ -92159,61 +115522,81 @@ export namespace compute_beta { * compute.targetVpnGateways.delete * @desc Deletes the specified target VPN gateway. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetVpnGateways.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the target VPN gateway to delete. - * targetVpnGateway: 'my-target-vpn-gateway', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetVpnGateways.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetVpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetVpnGateways.delete * @memberOf! () * @@ -92292,61 +115675,66 @@ export namespace compute_beta { * compute.targetVpnGateways.get * @desc Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetVpnGateways.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * // Name of the target VPN gateway to return. - * targetVpnGateway: 'my-target-vpn-gateway', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetVpnGateways.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetVpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "forwardingRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "tunnels": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetVpnGateways.get * @memberOf! () * @@ -92424,62 +115812,99 @@ export namespace compute_beta { * compute.targetVpnGateways.insert * @desc Creates a target VPN gateway in the specified project and region using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetVpnGateways.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "forwardingRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "tunnels": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetVpnGateways.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetVpnGateways.insert * @memberOf! () * @@ -92558,71 +115983,75 @@ export namespace compute_beta { * compute.targetVpnGateways.list * @desc Retrieves a list of target VPN gateways available to the specified project and region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetVpnGateways.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetVpnGateways.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.targetVpnGateways.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetVpnGateways.list * @memberOf! () * @@ -92704,6 +116133,91 @@ export namespace compute_beta { /** * compute.targetVpnGateways.setLabels * @desc Sets the labels on a TargetVpnGateway. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetVpnGateways.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetVpnGateways.setLabels * @memberOf! () * @@ -92783,65 +116297,62 @@ export namespace compute_beta { * compute.targetVpnGateways.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetVpnGateways.testIamPermissions({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.targetVpnGateways.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetVpnGateways.testIamPermissions * @memberOf! () * @@ -93118,6 +116629,76 @@ export namespace compute_beta { /** * compute.urlMaps.aggregatedList * @desc Retrieves the list of all UrlMap resources, regional and global, available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.urlMaps.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Name of the project scoping this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.urlMaps.aggregatedList * @memberOf! () * @@ -93201,58 +116782,79 @@ export namespace compute_beta { * compute.urlMaps.delete * @desc Deletes the specified UrlMap resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.urlMaps.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the UrlMap resource to delete. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.urlMaps.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.urlMaps.delete * @memberOf! () * @@ -93329,58 +116931,66 @@ export namespace compute_beta { * compute.urlMaps.get * @desc Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.urlMaps.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the UrlMap resource to return. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.urlMaps.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.urlMaps.get * @memberOf! () * @@ -93454,59 +117064,99 @@ export namespace compute_beta { * compute.urlMaps.insert * @desc Creates a UrlMap resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.urlMaps.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.urlMaps.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.urlMaps.insert * @memberOf! () * @@ -93582,62 +117232,88 @@ export namespace compute_beta { * compute.urlMaps.invalidateCache * @desc Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.urlMaps.invalidateCache({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the UrlMap scoping this request. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "host": "my_host", + * // "path": "my_path" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.urlMaps.invalidateCache(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.urlMaps.invalidateCache * @memberOf! () * @@ -93716,68 +117392,73 @@ export namespace compute_beta { * compute.urlMaps.list * @desc Retrieves the list of UrlMap resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.urlMaps.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.urlMaps.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.urlMaps.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.urlMaps.list * @memberOf! () * @@ -93855,63 +117536,101 @@ export namespace compute_beta { * compute.urlMaps.patch * @desc Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.urlMaps.patch({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the UrlMap resource to patch. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.urlMaps.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.urlMaps.patch * @memberOf! () * @@ -93989,62 +117708,60 @@ export namespace compute_beta { * compute.urlMaps.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.urlMaps.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.urlMaps.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.urlMaps.testIamPermissions * @memberOf! () * @@ -94126,63 +117843,101 @@ export namespace compute_beta { * compute.urlMaps.update * @desc Updates the specified UrlMap resource with the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.urlMaps.update({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the UrlMap resource to update. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.urlMaps.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.urlMaps.update * @memberOf! () * @@ -94260,62 +118015,59 @@ export namespace compute_beta { * compute.urlMaps.validate * @desc Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.urlMaps.validate({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the UrlMap resource to be validated as. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resource": {} + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.urlMaps.validate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "result": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.urlMaps.validate * @memberOf! () * @@ -94630,6 +118382,76 @@ export namespace compute_beta { /** * compute.vpnGateways.aggregatedList * @desc Retrieves an aggregated list of VPN gateways. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnGateways.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.aggregatedList * @memberOf! () * @@ -94713,6 +118535,82 @@ export namespace compute_beta { /** * compute.vpnGateways.delete * @desc Deletes the specified VPN gateway. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.vpnGateways.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the VPN gateway to delete. + * vpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.delete * @memberOf! () * @@ -94790,6 +118688,65 @@ export namespace compute_beta { /** * compute.vpnGateways.get * @desc Returns the specified VPN gateway. Gets a list of available VPN gateways by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnGateways.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the VPN gateway to return. + * vpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "vpnInterfaces": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.get * @memberOf! () * @@ -94865,6 +118822,55 @@ export namespace compute_beta { /** * compute.vpnGateways.getStatus * @desc Returns the status for the specified VPN gateway. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnGateways.getStatus({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the VPN gateway to return. + * vpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "result": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.getStatus * @memberOf! () * @@ -94950,6 +118956,98 @@ export namespace compute_beta { /** * compute.vpnGateways.insert * @desc Creates a VPN gateway in the specified project and region using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.vpnGateways.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "vpnInterfaces": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.insert * @memberOf! () * @@ -95027,6 +119125,76 @@ export namespace compute_beta { /** * compute.vpnGateways.list * @desc Retrieves a list of VPN gateways available to the specified project and region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnGateways.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.list * @memberOf! () * @@ -95105,6 +119273,91 @@ export namespace compute_beta { /** * compute.vpnGateways.setLabels * @desc Sets the labels on a VpnGateway. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.vpnGateways.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.setLabels * @memberOf! () * @@ -95372,68 +119625,75 @@ export namespace compute_beta { * compute.vpnTunnels.aggregatedList * @desc Retrieves an aggregated list of VPN tunnels. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.vpnTunnels.aggregatedList(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnTunnels.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.vpnTunnels.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.vpnTunnels.aggregatedList * @memberOf! () * @@ -95517,61 +119777,81 @@ export namespace compute_beta { * compute.vpnTunnels.delete * @desc Deletes the specified VpnTunnel resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.vpnTunnels.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the VpnTunnel resource to delete. - * vpnTunnel: 'my-vpn-tunnel', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.vpnTunnels.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * vpnTunnel: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.vpnTunnels.delete * @memberOf! () * @@ -95650,61 +119930,77 @@ export namespace compute_beta { * compute.vpnTunnels.get * @desc Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnTunnels.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * // Name of the VpnTunnel resource to return. - * vpnTunnel: 'my-vpn-tunnel', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.vpnTunnels.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * vpnTunnel: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "detailedStatus": "my_detailedStatus", + * // "id": "my_id", + * // "ikeVersion": 0, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "localTrafficSelector": [], + * // "name": "my_name", + * // "peerExternalGateway": "my_peerExternalGateway", + * // "peerExternalGatewayInterface": 0, + * // "peerGcpGateway": "my_peerGcpGateway", + * // "peerIp": "my_peerIp", + * // "region": "my_region", + * // "remoteTrafficSelector": [], + * // "router": "my_router", + * // "selfLink": "my_selfLink", + * // "sharedSecret": "my_sharedSecret", + * // "sharedSecretHash": "my_sharedSecretHash", + * // "status": "my_status", + * // "targetVpnGateway": "my_targetVpnGateway", + * // "vpnGateway": "my_vpnGateway", + * // "vpnGatewayInterface": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.vpnTunnels.get * @memberOf! () * @@ -95781,62 +120077,110 @@ export namespace compute_beta { * compute.vpnTunnels.insert * @desc Creates a VpnTunnel resource in the specified project and region using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.vpnTunnels.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "detailedStatus": "my_detailedStatus", + * // "id": "my_id", + * // "ikeVersion": 0, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "localTrafficSelector": [], + * // "name": "my_name", + * // "peerExternalGateway": "my_peerExternalGateway", + * // "peerExternalGatewayInterface": 0, + * // "peerGcpGateway": "my_peerGcpGateway", + * // "peerIp": "my_peerIp", + * // "region": "my_region", + * // "remoteTrafficSelector": [], + * // "router": "my_router", + * // "selfLink": "my_selfLink", + * // "sharedSecret": "my_sharedSecret", + * // "sharedSecretHash": "my_sharedSecretHash", + * // "status": "my_status", + * // "targetVpnGateway": "my_targetVpnGateway", + * // "vpnGateway": "my_vpnGateway", + * // "vpnGatewayInterface": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.vpnTunnels.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.vpnTunnels.insert * @memberOf! () * @@ -95915,71 +120259,75 @@ export namespace compute_beta { * compute.vpnTunnels.list * @desc Retrieves a list of VpnTunnel resources contained in the specified project and region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnTunnels.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.vpnTunnels.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.vpnTunnels.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.vpnTunnels.list * @memberOf! () * @@ -96058,6 +120406,91 @@ export namespace compute_beta { /** * compute.vpnTunnels.setLabels * @desc Sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.vpnTunnels.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnTunnels.setLabels * @memberOf! () * @@ -96137,65 +120570,62 @@ export namespace compute_beta { * compute.vpnTunnels.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnTunnels.testIamPermissions({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.vpnTunnels.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.vpnTunnels.testIamPermissions * @memberOf! () * @@ -96471,58 +120901,48 @@ export namespace compute_beta { * compute.zoneOperations.delete * @desc Deletes the specified zone-specific Operations resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.zoneOperations.delete({ + * // Name of the Operations resource to delete. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the Operations resource to delete. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.zoneOperations.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.zoneOperations.delete * @memberOf! () * @@ -96598,61 +121018,76 @@ export namespace compute_beta { * compute.zoneOperations.get * @desc Retrieves the specified zone-specific Operations resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.zoneOperations.get({ + * // Name of the Operations resource to return. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the Operations resource to return. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.zoneOperations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.zoneOperations.get * @memberOf! () * @@ -96730,71 +121165,75 @@ export namespace compute_beta { * compute.zoneOperations.list * @desc Retrieves a list of Operation resources contained within the specified zone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.zoneOperations.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the zone for request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.zoneOperations.list(request, handlePage); - * } - * }; + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.zoneOperations.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.zoneOperations.list * @memberOf! () * @@ -96874,6 +121313,77 @@ export namespace compute_beta { /** * compute.zoneOperations.wait * @desc Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.zoneOperations.wait({ + * // Name of the Operations resource to return. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.zoneOperations.wait * @memberOf! () * @@ -97051,58 +121561,61 @@ export namespace compute_beta { * compute.zones.get * @desc Returns the specified Zone resource. Gets a list of available zones by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.zones.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the zone resource to return. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.zones.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "availableCpuPlatforms": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.zones.get * @memberOf! () * @@ -97175,68 +121688,73 @@ export namespace compute_beta { * compute.zones.list * @desc Retrieves the list of Zone resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.zones.list(request, handlePage); - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.zones.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.zones.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.zones.list * @memberOf! () * diff --git a/src/apis/compute/v1.ts b/src/apis/compute/v1.ts index 36e37e26544..da5f84bc72f 100644 --- a/src/apis/compute/v1.ts +++ b/src/apis/compute/v1.ts @@ -11431,68 +11431,75 @@ export namespace compute_v1 { * compute.acceleratorTypes.aggregatedList * @desc Retrieves an aggregated list of accelerator types. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.acceleratorTypes.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.acceleratorTypes.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.acceleratorTypes.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.acceleratorTypes.aggregatedList * @memberOf! () * @@ -11582,61 +11589,62 @@ export namespace compute_v1 { * compute.acceleratorTypes.get * @desc Returns the specified accelerator type. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.acceleratorTypes.get({ + * // Name of the accelerator type to return. + * acceleratorType: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the accelerator type to return. - * acceleratorType: 'my-accelerator-type', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.acceleratorTypes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "maximumCardsPerInstance": 0, + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.acceleratorTypes.get * @memberOf! () * @@ -11714,71 +11722,75 @@ export namespace compute_v1 { * compute.acceleratorTypes.list * @desc Retrieves a list of accelerator types available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.acceleratorTypes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.acceleratorTypes.list(request, handlePage); - * } - * }; + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.acceleratorTypes.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.acceleratorTypes.list * @memberOf! () * @@ -11951,68 +11963,75 @@ export namespace compute_v1 { * compute.addresses.aggregatedList * @desc Retrieves an aggregated list of addresses. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.addresses.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.addresses.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.addresses.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.addresses.aggregatedList * @memberOf! () * @@ -12096,61 +12115,81 @@ export namespace compute_v1 { * compute.addresses.delete * @desc Deletes the specified address resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.addresses.delete({ + * // Name of the address resource to delete. + * address: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the address resource to delete. - * address: 'my-address', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.addresses.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.addresses.delete * @memberOf! () * @@ -12228,61 +12267,70 @@ export namespace compute_v1 { * compute.addresses.get * @desc Returns the specified address resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.addresses.get({ + * // Name of the address resource to return. + * address: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the address resource to return. - * address: 'my-address', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.addresses.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "addressType": "my_addressType", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "kind": "my_kind", + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "prefixLength": 0, + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "subnetwork": "my_subnetwork", + * // "users": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.addresses.get * @memberOf! () * @@ -12357,62 +12405,103 @@ export namespace compute_v1 { * compute.addresses.insert * @desc Creates an address resource in the specified project by using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.addresses.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "addressType": "my_addressType", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "kind": "my_kind", + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "prefixLength": 0, + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "subnetwork": "my_subnetwork", + * // "users": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.addresses.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.addresses.insert * @memberOf! () * @@ -12490,71 +12579,75 @@ export namespace compute_v1 { * compute.addresses.list * @desc Retrieves a list of addresses contained within the specified region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.addresses.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.addresses.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.addresses.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.addresses.list * @memberOf! () * @@ -12771,68 +12864,75 @@ export namespace compute_v1 { * compute.autoscalers.aggregatedList * @desc Retrieves an aggregated list of autoscalers. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.autoscalers.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.autoscalers.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.autoscalers.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.autoscalers.aggregatedList * @memberOf! () * @@ -12916,61 +13016,81 @@ export namespace compute_v1 { * compute.autoscalers.delete * @desc Deletes the specified autoscaler. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.autoscalers.delete({ + * // Name of the autoscaler to delete. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the autoscaler to delete. - * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.autoscalers.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.autoscalers.delete * @memberOf! () * @@ -13049,61 +13169,66 @@ export namespace compute_v1 { * compute.autoscalers.get * @desc Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.autoscalers.get({ + * // Name of the autoscaler to return. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the autoscaler to return. - * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.autoscalers.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.autoscalers.get * @memberOf! () * @@ -13180,62 +13305,99 @@ export namespace compute_v1 { * compute.autoscalers.insert * @desc Creates an autoscaler in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.autoscalers.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.autoscalers.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.autoscalers.insert * @memberOf! () * @@ -13314,71 +13476,75 @@ export namespace compute_v1 { * compute.autoscalers.list * @desc Retrieves a list of autoscalers contained within the specified zone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.autoscalers.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.autoscalers.list(request, handlePage); - * } - * }; + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.autoscalers.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.autoscalers.list * @memberOf! () * @@ -13458,63 +13624,101 @@ export namespace compute_v1 { * compute.autoscalers.patch * @desc Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.autoscalers.patch({ + * // Name of the autoscaler to patch. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.autoscalers.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.autoscalers.patch * @memberOf! () * @@ -13594,63 +13798,101 @@ export namespace compute_v1 { * compute.autoscalers.update * @desc Updates an autoscaler in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.autoscalers.update({ + * // Name of the autoscaler to update. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.autoscalers.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.autoscalers.update * @memberOf! () * @@ -13926,6 +14168,89 @@ export namespace compute_v1 { /** * compute.backendBuckets.addSignedUrlKey * @desc Adds a key for validating requests with signed URLs for this backend bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendBuckets.addSignedUrlKey({ + * // Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * backendBucket: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "keyName": "my_keyName", + * // "keyValue": "my_keyValue" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendBuckets.addSignedUrlKey * @memberOf! () * @@ -14004,58 +14329,79 @@ export namespace compute_v1 { * compute.backendBuckets.delete * @desc Deletes the specified BackendBucket resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendBuckets.delete({ * // Name of the BackendBucket resource to delete. - * backendBucket: 'my-backend-bucket', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.backendBuckets.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * backendBucket: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendBuckets.delete * @memberOf! () * @@ -14132,6 +14478,82 @@ export namespace compute_v1 { /** * compute.backendBuckets.deleteSignedUrlKey * @desc Deletes a key for validating requests with signed URLs for this backend bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendBuckets.deleteSignedUrlKey({ + * // Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * backendBucket: 'placeholder-value', + * // The name of the Signed URL Key to delete. + * keyName: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendBuckets.deleteSignedUrlKey * @memberOf! () * @@ -14210,58 +14632,60 @@ export namespace compute_v1 { * compute.backendBuckets.get * @desc Returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendBuckets.get({ * // Name of the BackendBucket resource to return. - * backendBucket: 'my-backend-bucket', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.backendBuckets.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * backendBucket: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucketName": "my_bucketName", + * // "cdnPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableCdn": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "selfLink": "my_selfLink" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendBuckets.get * @memberOf! () * @@ -14338,59 +14762,93 @@ export namespace compute_v1 { * compute.backendBuckets.insert * @desc Creates a BackendBucket resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendBuckets.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucketName": "my_bucketName", + * // "cdnPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableCdn": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.backendBuckets.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendBuckets.insert * @memberOf! () * @@ -14467,68 +14925,73 @@ export namespace compute_v1 { * compute.backendBuckets.list * @desc Retrieves the list of BackendBucket resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendBuckets.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.backendBuckets.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.backendBuckets.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendBuckets.list * @memberOf! () * @@ -14607,63 +15070,95 @@ export namespace compute_v1 { * compute.backendBuckets.patch * @desc Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendBuckets.patch({ * // Name of the BackendBucket resource to patch. - * backendBucket: 'my-backend-bucket', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * backendBucket: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucketName": "my_bucketName", + * // "cdnPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableCdn": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.backendBuckets.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendBuckets.patch * @memberOf! () * @@ -14742,63 +15237,95 @@ export namespace compute_v1 { * compute.backendBuckets.update * @desc Updates the specified BackendBucket resource with the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendBuckets.update({ * // Name of the BackendBucket resource to update. - * backendBucket: 'my-backend-bucket', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * backendBucket: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucketName": "my_bucketName", + * // "cdnPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableCdn": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.backendBuckets.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendBuckets.update * @memberOf! () * @@ -15068,6 +15595,89 @@ export namespace compute_v1 { /** * compute.backendServices.addSignedUrlKey * @desc Adds a key for validating requests with signed URLs for this backend service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.addSignedUrlKey({ + * // Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * backendService: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "keyName": "my_keyName", + * // "keyValue": "my_keyValue" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendServices.addSignedUrlKey * @memberOf! () * @@ -15146,68 +15756,75 @@ export namespace compute_v1 { * compute.backendServices.aggregatedList * @desc Retrieves the list of all BackendService resources, regional and global, available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendServices.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Name of the project scoping this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.backendServices.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.backendServices.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendServices.aggregatedList * @memberOf! () * @@ -15297,58 +15914,79 @@ export namespace compute_v1 { * compute.backendServices.delete * @desc Deletes the specified BackendService resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.delete({ * // Name of the BackendService resource to delete. - * backendService: 'my-backend-service', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.backendServices.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendServices.delete * @memberOf! () * @@ -15425,6 +16063,82 @@ export namespace compute_v1 { /** * compute.backendServices.deleteSignedUrlKey * @desc Deletes a key for validating requests with signed URLs for this backend service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.deleteSignedUrlKey({ + * // Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * backendService: 'placeholder-value', + * // The name of the Signed URL Key to delete. + * keyName: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendServices.deleteSignedUrlKey * @memberOf! () * @@ -15503,58 +16217,81 @@ export namespace compute_v1 { * compute.backendServices.get * @desc Returns the specified BackendService resource. Gets a list of available backend services. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendServices.get({ * // Name of the BackendService resource to return. - * backendService: 'my-backend-service', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.backendServices.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "selfLink": "my_selfLink", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendServices.get * @memberOf! () * @@ -15631,61 +16368,61 @@ export namespace compute_v1 { * compute.backendServices.getHealth * @desc Gets the most recent health check results for this BackendService. Example request body: { "group": "/zones/us-east1-b/instanceGroups/lb-backend-example" } * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendServices.getHealth({ * // Name of the BackendService resource to which the queried instance belongs. - * backendService: 'my-backend-service', // TODO: Update placeholder value. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * - * auth: authClient, - * }; + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "group": "my_group" + * // } + * }, + * }); + * console.log(res.data); * - * compute.backendServices.getHealth(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "healthStatus": [], + * // "kind": "my_kind" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendServices.getHealth * @memberOf! () * @@ -15770,59 +16507,114 @@ export namespace compute_v1 { * compute.backendServices.insert * @desc Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Understanding backend services for more information. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "selfLink": "my_selfLink", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.backendServices.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendServices.insert * @memberOf! () * @@ -15899,68 +16691,73 @@ export namespace compute_v1 { * compute.backendServices.list * @desc Retrieves the list of BackendService resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.backendServices.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.backendServices.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.backendServices.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendServices.list * @memberOf! () * @@ -16039,63 +16836,116 @@ export namespace compute_v1 { * compute.backendServices.patch * @desc Patches the specified BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.patch({ * // Name of the BackendService resource to patch. - * backendService: 'my-backend-service', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "selfLink": "my_selfLink", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.backendServices.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendServices.patch * @memberOf! () * @@ -16173,6 +17023,88 @@ export namespace compute_v1 { /** * compute.backendServices.setSecurityPolicy * @desc Sets the security policy for the specified backend service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.setSecurityPolicy({ + * // Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. + * backendService: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "securityPolicy": "my_securityPolicy" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.backendServices.setSecurityPolicy * @memberOf! () * @@ -16251,63 +17183,116 @@ export namespace compute_v1 { * compute.backendServices.update * @desc Updates the specified BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.backendServices.update({ * // Name of the BackendService resource to update. - * backendService: 'my-backend-service', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "selfLink": "my_selfLink", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.backendServices.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.backendServices.update * @memberOf! () * @@ -16655,6 +17640,90 @@ export namespace compute_v1 { /** * compute.disks.addResourcePolicies * @desc Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.addResourcePolicies({ + * // The disk name for this request. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourcePolicies": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.addResourcePolicies * @memberOf! () * @@ -16734,68 +17803,75 @@ export namespace compute_v1 { * compute.disks.aggregatedList * @desc Retrieves an aggregated list of persistent disks. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.disks.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.disks.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.disks.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.disks.aggregatedList * @memberOf! () * @@ -16877,65 +17953,111 @@ export namespace compute_v1 { * compute.disks.createSnapshot * @desc Creates a snapshot of a specified persistent disk. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.createSnapshot({ + * // Name of the persistent disk to snapshot. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // [Input Only] Specifies to create an application consistent snapshot by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS). + * guestFlush: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the persistent disk to snapshot. - * disk: 'my-disk', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoCreated": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "downloadBytes": "my_downloadBytes", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "snapshotEncryptionKey": {}, + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskEncryptionKey": {}, + * // "sourceDiskId": "my_sourceDiskId", + * // "status": "my_status", + * // "storageBytes": "my_storageBytes", + * // "storageBytesStatus": "my_storageBytesStatus", + * // "storageLocations": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.disks.createSnapshot(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.disks.createSnapshot * @memberOf! () * @@ -17016,61 +18138,81 @@ export namespace compute_v1 { * compute.disks.delete * @desc Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.delete({ + * // Name of the persistent disk to delete. + * disk: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the persistent disk to delete. - * disk: 'my-disk', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.disks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.disks.delete * @memberOf! () * @@ -17148,61 +18290,83 @@ export namespace compute_v1 { * compute.disks.get * @desc Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.disks.get({ + * // Name of the persistent disk to return. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the persistent disk to return. - * disk: 'my-disk', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.disks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskEncryptionKey": {}, + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "lastAttachTimestamp": "my_lastAttachTimestamp", + * // "lastDetachTimestamp": "my_lastDetachTimestamp", + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "options": "my_options", + * // "physicalBlockSizeBytes": "my_physicalBlockSizeBytes", + * // "region": "my_region", + * // "replicaZones": [], + * // "resourcePolicies": [], + * // "selfLink": "my_selfLink", + * // "sizeGb": "my_sizeGb", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "status": "my_status", + * // "type": "my_type", + * // "users": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.disks.get * @memberOf! () * @@ -17276,6 +18440,60 @@ export namespace compute_v1 { /** * compute.disks.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.disks.getIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.getIamPolicy * @memberOf! () * @@ -17351,62 +18569,118 @@ export namespace compute_v1 { * compute.disks.insert * @desc Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Optional. Source image to restore onto a disk. + * sourceImage: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskEncryptionKey": {}, + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "lastAttachTimestamp": "my_lastAttachTimestamp", + * // "lastDetachTimestamp": "my_lastDetachTimestamp", + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "options": "my_options", + * // "physicalBlockSizeBytes": "my_physicalBlockSizeBytes", + * // "region": "my_region", + * // "replicaZones": [], + * // "resourcePolicies": [], + * // "selfLink": "my_selfLink", + * // "sizeGb": "my_sizeGb", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "status": "my_status", + * // "type": "my_type", + * // "users": [], + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.disks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.disks.insert * @memberOf! () * @@ -17484,71 +18758,75 @@ export namespace compute_v1 { * compute.disks.list * @desc Retrieves a list of persistent disks contained within the specified zone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.disks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.disks.list(request, handlePage); - * } - * }; + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.disks.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.disks.list * @memberOf! () * @@ -17624,6 +18902,90 @@ export namespace compute_v1 { /** * compute.disks.removeResourcePolicies * @desc Removes resource policies from a disk. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.removeResourcePolicies({ + * // The disk name for this request. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourcePolicies": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.removeResourcePolicies * @memberOf! () * @@ -17705,65 +19067,89 @@ export namespace compute_v1 { * compute.disks.resize * @desc Resizes the specified persistent disk. You can only increase the size of the disk. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.resize({ + * // The name of the persistent disk. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the persistent disk. - * disk: 'my-disk', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sizeGb": "my_sizeGb" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.disks.resize(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.disks.resize * @memberOf! () * @@ -17841,6 +19227,69 @@ export namespace compute_v1 { /** * compute.disks.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.setIamPolicy * @memberOf! () * @@ -17917,65 +19366,90 @@ export namespace compute_v1 { * compute.disks.setLabels * @desc Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.disks.setLabels({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } * }, - * - * auth: authClient, - * }; - * - * compute.disks.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.disks.setLabels * @memberOf! () * @@ -18053,6 +19527,63 @@ export namespace compute_v1 { /** * compute.disks.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.disks.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.disks.testIamPermissions * @memberOf! () * @@ -18493,68 +20024,75 @@ export namespace compute_v1 { * compute.diskTypes.aggregatedList * @desc Retrieves an aggregated list of disk types. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.diskTypes.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.diskTypes.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.diskTypes.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.diskTypes.aggregatedList * @memberOf! () * @@ -18638,61 +20176,64 @@ export namespace compute_v1 { * compute.diskTypes.get * @desc Returns the specified disk type. Gets a list of available disk types by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.diskTypes.get({ + * // Name of the disk type to return. + * diskType: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the disk type to return. - * diskType: 'my-disk-type', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.diskTypes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultDiskSizeGb": "my_defaultDiskSizeGb", + * // "deprecated": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "validDiskSize": "my_validDiskSize", + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.diskTypes.get * @memberOf! () * @@ -18767,71 +20308,75 @@ export namespace compute_v1 { * compute.diskTypes.list * @desc Retrieves a list of disk types available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.diskTypes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.diskTypes.list(request, handlePage); - * } - * }; + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.diskTypes.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.diskTypes.list * @memberOf! () * @@ -18999,6 +20544,80 @@ export namespace compute_v1 { /** * compute.externalVpnGateways.delete * @desc Deletes the specified externalVpnGateway. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.externalVpnGateways.delete({ + * // Name of the externalVpnGateways to delete. + * externalVpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.externalVpnGateways.delete * @memberOf! () * @@ -19075,6 +20694,62 @@ export namespace compute_v1 { /** * compute.externalVpnGateways.get * @desc Returns the specified externalVpnGateway. Get a list of available externalVpnGateways by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.externalVpnGateways.get({ + * // Name of the externalVpnGateway to return. + * externalVpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "redundancyType": "my_redundancyType", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.externalVpnGateways.get * @memberOf! () * @@ -19150,6 +20825,95 @@ export namespace compute_v1 { /** * compute.externalVpnGateways.insert * @desc Creates a ExternalVpnGateway in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.externalVpnGateways.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "redundancyType": "my_redundancyType", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.externalVpnGateways.insert * @memberOf! () * @@ -19226,6 +20990,75 @@ export namespace compute_v1 { /** * compute.externalVpnGateways.list * @desc Retrieves the list of ExternalVpnGateway available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.externalVpnGateways.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.externalVpnGateways.list * @memberOf! () * @@ -19306,6 +21139,83 @@ export namespace compute_v1 { /** * compute.externalVpnGateways.setLabels * @desc Sets the labels on an ExternalVpnGateway. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.externalVpnGateways.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.externalVpnGateways.setLabels * @memberOf! () * @@ -19382,6 +21292,61 @@ export namespace compute_v1 { /** * compute.externalVpnGateways.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.externalVpnGateways.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.externalVpnGateways.testIamPermissions * @memberOf! () * @@ -19598,58 +21563,79 @@ export namespace compute_v1 { * compute.firewalls.delete * @desc Deletes the specified firewall. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.firewalls.delete({ * // Name of the firewall rule to delete. - * firewall: 'my-firewall', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.firewalls.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * firewall: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.firewalls.delete * @memberOf! () * @@ -19726,58 +21712,70 @@ export namespace compute_v1 { * compute.firewalls.get * @desc Returns the specified firewall. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.firewalls.get({ * // Name of the firewall rule to return. - * firewall: 'my-firewall', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.firewalls.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * firewall: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "allowed": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "denied": [], + * // "description": "my_description", + * // "destinationRanges": [], + * // "direction": "my_direction", + * // "disabled": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "priority": 0, + * // "selfLink": "my_selfLink", + * // "sourceRanges": [], + * // "sourceServiceAccounts": [], + * // "sourceTags": [], + * // "targetServiceAccounts": [], + * // "targetTags": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.firewalls.get * @memberOf! () * @@ -19851,59 +21849,103 @@ export namespace compute_v1 { * compute.firewalls.insert * @desc Creates a firewall rule in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.firewalls.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "allowed": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "denied": [], + * // "description": "my_description", + * // "destinationRanges": [], + * // "direction": "my_direction", + * // "disabled": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "priority": 0, + * // "selfLink": "my_selfLink", + * // "sourceRanges": [], + * // "sourceServiceAccounts": [], + * // "sourceTags": [], + * // "targetServiceAccounts": [], + * // "targetTags": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.firewalls.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.firewalls.insert * @memberOf! () * @@ -19979,68 +22021,73 @@ export namespace compute_v1 { * compute.firewalls.list * @desc Retrieves the list of firewall rules available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.firewalls.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.firewalls.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.firewalls.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.firewalls.list * @memberOf! () * @@ -20118,63 +22165,105 @@ export namespace compute_v1 { * compute.firewalls.patch * @desc Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.firewalls.patch({ * // Name of the firewall rule to patch. - * firewall: 'my-firewall', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * firewall: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "allowed": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "denied": [], + * // "description": "my_description", + * // "destinationRanges": [], + * // "direction": "my_direction", + * // "disabled": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "priority": 0, + * // "selfLink": "my_selfLink", + * // "sourceRanges": [], + * // "sourceServiceAccounts": [], + * // "sourceTags": [], + * // "targetServiceAccounts": [], + * // "targetTags": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.firewalls.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.firewalls.patch * @memberOf! () * @@ -20252,63 +22341,105 @@ export namespace compute_v1 { * compute.firewalls.update * @desc Updates the specified firewall rule with the data included in the request. Note that all fields will be updated if using PUT, even fields that are not specified. To update individual fields, please use PATCH instead. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.firewalls.update({ * // Name of the firewall rule to update. - * firewall: 'my-firewall', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * firewall: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "allowed": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "denied": [], + * // "description": "my_description", + * // "destinationRanges": [], + * // "direction": "my_direction", + * // "disabled": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "priority": 0, + * // "selfLink": "my_selfLink", + * // "sourceRanges": [], + * // "sourceServiceAccounts": [], + * // "sourceTags": [], + * // "targetServiceAccounts": [], + * // "targetTags": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.firewalls.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.firewalls.update * @memberOf! () * @@ -20523,68 +22654,75 @@ export namespace compute_v1 { * compute.forwardingRules.aggregatedList * @desc Retrieves an aggregated list of forwarding rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.forwardingRules.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.forwardingRules.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.forwardingRules.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.forwardingRules.aggregatedList * @memberOf! () * @@ -20674,61 +22812,81 @@ export namespace compute_v1 { * compute.forwardingRules.delete * @desc Deletes the specified ForwardingRule resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.forwardingRules.delete({ + * // Name of the ForwardingRule resource to delete. + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the ForwardingRule resource to delete. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.forwardingRules.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.forwardingRules.delete * @memberOf! () * @@ -20807,61 +22965,78 @@ export namespace compute_v1 { * compute.forwardingRules.get * @desc Returns the specified ForwardingRule resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.forwardingRules.get({ + * // Name of the ForwardingRule resource to return. + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the ForwardingRule resource to return. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.forwardingRules.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "IPAddress": "my_IPAddress", + * // "IPProtocol": "my_IPProtocol", + * // "allPorts": false, + * // "allowGlobalAccess": false, + * // "backendService": "my_backendService", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "isMirroringCollector": false, + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "metadataFilters": [], + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "portRange": "my_portRange", + * // "ports": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serviceLabel": "my_serviceLabel", + * // "serviceName": "my_serviceName", + * // "subnetwork": "my_subnetwork", + * // "target": "my_target" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.forwardingRules.get * @memberOf! () * @@ -20939,62 +23114,111 @@ export namespace compute_v1 { * compute.forwardingRules.insert * @desc Creates a ForwardingRule resource in the specified project and region using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.forwardingRules.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "IPAddress": "my_IPAddress", + * // "IPProtocol": "my_IPProtocol", + * // "allPorts": false, + * // "allowGlobalAccess": false, + * // "backendService": "my_backendService", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "isMirroringCollector": false, + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "metadataFilters": [], + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "portRange": "my_portRange", + * // "ports": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serviceLabel": "my_serviceLabel", + * // "serviceName": "my_serviceName", + * // "subnetwork": "my_subnetwork", + * // "target": "my_target" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.forwardingRules.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.forwardingRules.insert * @memberOf! () * @@ -21073,71 +23297,75 @@ export namespace compute_v1 { * compute.forwardingRules.list * @desc Retrieves a list of ForwardingRule resources available to the specified project and region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.forwardingRules.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.forwardingRules.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.forwardingRules.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.forwardingRules.list * @memberOf! () * @@ -21217,6 +23445,114 @@ export namespace compute_v1 { /** * compute.forwardingRules.patch * @desc Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.forwardingRules.patch({ + * // Name of the ForwardingRule resource to patch. + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "IPAddress": "my_IPAddress", + * // "IPProtocol": "my_IPProtocol", + * // "allPorts": false, + * // "allowGlobalAccess": false, + * // "backendService": "my_backendService", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "isMirroringCollector": false, + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "metadataFilters": [], + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "portRange": "my_portRange", + * // "ports": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serviceLabel": "my_serviceLabel", + * // "serviceName": "my_serviceName", + * // "subnetwork": "my_subnetwork", + * // "target": "my_target" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.forwardingRules.patch * @memberOf! () * @@ -21296,65 +23632,89 @@ export namespace compute_v1 { * compute.forwardingRules.setTarget * @desc Changes target URL for forwarding rule. The new target should be of the same type as the old target. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.forwardingRules.setTarget({ + * // Name of the ForwardingRule resource in which target is to be set. + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the ForwardingRule resource in which target is to be set. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "target": "my_target" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.forwardingRules.setTarget(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.forwardingRules.setTarget * @memberOf! () * @@ -21633,58 +23993,79 @@ export namespace compute_v1 { * compute.globalAddresses.delete * @desc Deletes the specified address resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalAddresses.delete({ * // Name of the address resource to delete. - * address: 'my-address', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.globalAddresses.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * address: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalAddresses.delete * @memberOf! () * @@ -21762,58 +24143,68 @@ export namespace compute_v1 { * compute.globalAddresses.get * @desc Returns the specified address resource. Gets a list of available addresses by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalAddresses.get({ * // Name of the address resource to return. - * address: 'my-address', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.globalAddresses.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * address: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "addressType": "my_addressType", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "kind": "my_kind", + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "prefixLength": 0, + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "subnetwork": "my_subnetwork", + * // "users": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalAddresses.get * @memberOf! () * @@ -21888,59 +24279,101 @@ export namespace compute_v1 { * compute.globalAddresses.insert * @desc Creates an address resource in the specified project by using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalAddresses.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "addressType": "my_addressType", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "kind": "my_kind", + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "prefixLength": 0, + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "subnetwork": "my_subnetwork", + * // "users": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.globalAddresses.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalAddresses.insert * @memberOf! () * @@ -22017,68 +24450,73 @@ export namespace compute_v1 { * compute.globalAddresses.list * @desc Retrieves a list of global addresses. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalAddresses.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.globalAddresses.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.globalAddresses.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalAddresses.list * @memberOf! () * @@ -22250,58 +24688,79 @@ export namespace compute_v1 { * compute.globalForwardingRules.delete * @desc Deletes the specified GlobalForwardingRule resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalForwardingRules.delete({ * // Name of the ForwardingRule resource to delete. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.globalForwardingRules.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalForwardingRules.delete * @memberOf! () * @@ -22379,58 +24838,76 @@ export namespace compute_v1 { * compute.globalForwardingRules.get * @desc Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalForwardingRules.get({ * // Name of the ForwardingRule resource to return. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.globalForwardingRules.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "IPAddress": "my_IPAddress", + * // "IPProtocol": "my_IPProtocol", + * // "allPorts": false, + * // "allowGlobalAccess": false, + * // "backendService": "my_backendService", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "isMirroringCollector": false, + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "metadataFilters": [], + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "portRange": "my_portRange", + * // "ports": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serviceLabel": "my_serviceLabel", + * // "serviceName": "my_serviceName", + * // "subnetwork": "my_subnetwork", + * // "target": "my_target" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalForwardingRules.get * @memberOf! () * @@ -22507,59 +24984,109 @@ export namespace compute_v1 { * compute.globalForwardingRules.insert * @desc Creates a GlobalForwardingRule resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalForwardingRules.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "IPAddress": "my_IPAddress", + * // "IPProtocol": "my_IPProtocol", + * // "allPorts": false, + * // "allowGlobalAccess": false, + * // "backendService": "my_backendService", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "isMirroringCollector": false, + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "metadataFilters": [], + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "portRange": "my_portRange", + * // "ports": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serviceLabel": "my_serviceLabel", + * // "serviceName": "my_serviceName", + * // "subnetwork": "my_subnetwork", + * // "target": "my_target" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.globalForwardingRules.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalForwardingRules.insert * @memberOf! () * @@ -22636,68 +25163,73 @@ export namespace compute_v1 { * compute.globalForwardingRules.list * @desc Retrieves a list of GlobalForwardingRule resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalForwardingRules.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.globalForwardingRules.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.globalForwardingRules.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalForwardingRules.list * @memberOf! () * @@ -22775,6 +25307,112 @@ export namespace compute_v1 { /** * compute.globalForwardingRules.patch * @desc Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalForwardingRules.patch({ + * // Name of the ForwardingRule resource to patch. + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "IPAddress": "my_IPAddress", + * // "IPProtocol": "my_IPProtocol", + * // "allPorts": false, + * // "allowGlobalAccess": false, + * // "backendService": "my_backendService", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "ipVersion": "my_ipVersion", + * // "isMirroringCollector": false, + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "metadataFilters": [], + * // "name": "my_name", + * // "network": "my_network", + * // "networkTier": "my_networkTier", + * // "portRange": "my_portRange", + * // "ports": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serviceLabel": "my_serviceLabel", + * // "serviceName": "my_serviceName", + * // "subnetwork": "my_subnetwork", + * // "target": "my_target" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalForwardingRules.patch * @memberOf! () * @@ -22853,62 +25491,87 @@ export namespace compute_v1 { * compute.globalForwardingRules.setTarget * @desc Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalForwardingRules.setTarget({ * // Name of the ForwardingRule resource in which target is to be set. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * forwardingRule: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "target": "my_target" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.globalForwardingRules.setTarget(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalForwardingRules.setTarget * @memberOf! () * @@ -23129,6 +25792,88 @@ export namespace compute_v1 { /** * compute.globalNetworkEndpointGroups.attachNetworkEndpoints * @desc Attach a network endpoint to the specified network endpoint group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalNetworkEndpointGroups.attachNetworkEndpoints({ + * // The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "networkEndpoints": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.attachNetworkEndpoints * @memberOf! () * @@ -23208,6 +25953,80 @@ export namespace compute_v1 { /** * compute.globalNetworkEndpointGroups.delete * @desc Deletes the specified network endpoint group.Note that the NEG cannot be deleted if there are backend services referencing it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalNetworkEndpointGroups.delete({ + * // The name of the network endpoint group to delete. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.delete * @memberOf! () * @@ -23284,6 +26103,88 @@ export namespace compute_v1 { /** * compute.globalNetworkEndpointGroups.detachNetworkEndpoints * @desc Detach the network endpoint from the specified network endpoint group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalNetworkEndpointGroups.detachNetworkEndpoints({ + * // The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "networkEndpoints": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.detachNetworkEndpoints * @memberOf! () * @@ -23363,6 +26264,64 @@ export namespace compute_v1 { /** * compute.globalNetworkEndpointGroups.get * @desc Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalNetworkEndpointGroups.get({ + * // The name of the network endpoint group. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultPort": 0, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "network": "my_network", + * // "networkEndpointType": "my_networkEndpointType", + * // "selfLink": "my_selfLink", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.get * @memberOf! () * @@ -23440,6 +26399,97 @@ export namespace compute_v1 { /** * compute.globalNetworkEndpointGroups.insert * @desc Creates a network endpoint group in the specified project using the parameters that are included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalNetworkEndpointGroups.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultPort": 0, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "network": "my_network", + * // "networkEndpointType": "my_networkEndpointType", + * // "selfLink": "my_selfLink", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.insert * @memberOf! () * @@ -23516,6 +26566,74 @@ export namespace compute_v1 { /** * compute.globalNetworkEndpointGroups.list * @desc Retrieves the list of network endpoint groups that are located in the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalNetworkEndpointGroups.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.list * @memberOf! () * @@ -23596,6 +26714,75 @@ export namespace compute_v1 { /** * compute.globalNetworkEndpointGroups.listNetworkEndpoints * @desc Lists the network endpoints in the specified network endpoint group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalNetworkEndpointGroups.listNetworkEndpoints({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalNetworkEndpointGroups.listNetworkEndpoints * @memberOf! () * @@ -23874,68 +27061,75 @@ export namespace compute_v1 { * compute.globalOperations.aggregatedList * @desc Retrieves an aggregated list of all operations. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalOperations.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.globalOperations.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.globalOperations.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalOperations.aggregatedList * @memberOf! () * @@ -24019,55 +27213,46 @@ export namespace compute_v1 { * compute.globalOperations.delete * @desc Deletes the specified Operations resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.globalOperations.delete({ * // Name of the Operations resource to delete. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.globalOperations.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalOperations.delete * @memberOf! () * @@ -24142,58 +27327,74 @@ export namespace compute_v1 { * compute.globalOperations.get * @desc Retrieves the specified Operations resource. Gets a list of operations by making a `list()` request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalOperations.get({ * // Name of the Operations resource to return. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.globalOperations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalOperations.get * @memberOf! () * @@ -24270,68 +27471,73 @@ export namespace compute_v1 { * compute.globalOperations.list * @desc Retrieves a list of Operation resources contained within the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalOperations.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.globalOperations.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.globalOperations.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.globalOperations.list * @memberOf! () * @@ -24409,6 +27615,75 @@ export namespace compute_v1 { /** * compute.globalOperations.wait * @desc Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.globalOperations.wait({ + * // Name of the Operations resource to return. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.globalOperations.wait * @memberOf! () * @@ -24600,6 +27875,76 @@ export namespace compute_v1 { /** * compute.healthChecks.aggregatedList * @desc Retrieves the list of all HealthCheck resources, regional and global, available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.healthChecks.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Name of the project scoping this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.healthChecks.aggregatedList * @memberOf! () * @@ -24686,58 +28031,79 @@ export namespace compute_v1 { * compute.healthChecks.delete * @desc Deletes the specified HealthCheck resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.healthChecks.delete({ * // Name of the HealthCheck resource to delete. - * healthCheck: 'my-health-check', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.healthChecks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.healthChecks.delete * @memberOf! () * @@ -24815,58 +28181,68 @@ export namespace compute_v1 { * compute.healthChecks.get * @desc Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.healthChecks.get({ * // Name of the HealthCheck resource to return. - * healthCheck: 'my-health-check', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.healthChecks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "unhealthyThreshold": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.healthChecks.get * @memberOf! () * @@ -24942,59 +28318,101 @@ export namespace compute_v1 { * compute.healthChecks.insert * @desc Creates a HealthCheck resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.healthChecks.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "unhealthyThreshold": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.healthChecks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.healthChecks.insert * @memberOf! () * @@ -25071,68 +28489,73 @@ export namespace compute_v1 { * compute.healthChecks.list * @desc Retrieves the list of HealthCheck resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.healthChecks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.healthChecks.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.healthChecks.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.healthChecks.list * @memberOf! () * @@ -25211,63 +28634,103 @@ export namespace compute_v1 { * compute.healthChecks.patch * @desc Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.healthChecks.patch({ * // Name of the HealthCheck resource to patch. - * healthCheck: 'my-health-check', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "unhealthyThreshold": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.healthChecks.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.healthChecks.patch * @memberOf! () * @@ -25346,63 +28809,103 @@ export namespace compute_v1 { * compute.healthChecks.update * @desc Updates a HealthCheck resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.healthChecks.update({ * // Name of the HealthCheck resource to update. - * healthCheck: 'my-health-check', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "unhealthyThreshold": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.healthChecks.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.healthChecks.update * @memberOf! () * @@ -25655,58 +29158,79 @@ export namespace compute_v1 { * compute.httpHealthChecks.delete * @desc Deletes the specified HttpHealthCheck resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpHealthChecks.delete({ * // Name of the HttpHealthCheck resource to delete. - * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * httpHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpHealthChecks.delete * @memberOf! () * @@ -25784,58 +29308,64 @@ export namespace compute_v1 { * compute.httpHealthChecks.get * @desc Returns the specified HttpHealthCheck resource. Gets a list of available HTTP health checks by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.httpHealthChecks.get({ * // Name of the HttpHealthCheck resource to return. - * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * httpHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpHealthChecks.get * @memberOf! () * @@ -25912,59 +29442,97 @@ export namespace compute_v1 { * compute.httpHealthChecks.insert * @desc Creates a HttpHealthCheck resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpHealthChecks.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpHealthChecks.insert * @memberOf! () * @@ -26041,68 +29609,73 @@ export namespace compute_v1 { * compute.httpHealthChecks.list * @desc Retrieves the list of HttpHealthCheck resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.httpHealthChecks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.httpHealthChecks.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.httpHealthChecks.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpHealthChecks.list * @memberOf! () * @@ -26181,63 +29754,99 @@ export namespace compute_v1 { * compute.httpHealthChecks.patch * @desc Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpHealthChecks.patch({ * // Name of the HttpHealthCheck resource to patch. - * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * httpHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpHealthChecks.patch * @memberOf! () * @@ -26316,63 +29925,99 @@ export namespace compute_v1 { * compute.httpHealthChecks.update * @desc Updates a HttpHealthCheck resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpHealthChecks.update({ * // Name of the HttpHealthCheck resource to update. - * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * httpHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpHealthChecks.update * @memberOf! () * @@ -26594,58 +30239,79 @@ export namespace compute_v1 { * compute.httpsHealthChecks.delete * @desc Deletes the specified HttpsHealthCheck resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpsHealthChecks.delete({ * // Name of the HttpsHealthCheck resource to delete. - * httpsHealthCheck: 'my-https-health-check', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * httpsHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpsHealthChecks.delete * @memberOf! () * @@ -26723,58 +30389,64 @@ export namespace compute_v1 { * compute.httpsHealthChecks.get * @desc Returns the specified HttpsHealthCheck resource. Gets a list of available HTTPS health checks by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.httpsHealthChecks.get({ * // Name of the HttpsHealthCheck resource to return. - * httpsHealthCheck: 'my-https-health-check', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * httpsHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpsHealthChecks.get * @memberOf! () * @@ -26851,59 +30523,97 @@ export namespace compute_v1 { * compute.httpsHealthChecks.insert * @desc Creates a HttpsHealthCheck resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpsHealthChecks.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpsHealthChecks.insert * @memberOf! () * @@ -26981,68 +30691,73 @@ export namespace compute_v1 { * compute.httpsHealthChecks.list * @desc Retrieves the list of HttpsHealthCheck resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.httpsHealthChecks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.httpsHealthChecks.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.httpsHealthChecks.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpsHealthChecks.list * @memberOf! () * @@ -27124,63 +30839,99 @@ export namespace compute_v1 { * compute.httpsHealthChecks.patch * @desc Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpsHealthChecks.patch({ * // Name of the HttpsHealthCheck resource to patch. - * httpsHealthCheck: 'my-https-health-check', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * httpsHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpsHealthChecks.patch * @memberOf! () * @@ -27259,63 +31010,99 @@ export namespace compute_v1 { * compute.httpsHealthChecks.update * @desc Updates a HttpsHealthCheck resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.httpsHealthChecks.update({ * // Name of the HttpsHealthCheck resource to update. - * httpsHealthCheck: 'my-https-health-check', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * httpsHealthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "host": "my_host", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "port": 0, + * // "requestPath": "my_requestPath", + * // "selfLink": "my_selfLink", + * // "timeoutSec": 0, + * // "unhealthyThreshold": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.httpsHealthChecks.update * @memberOf! () * @@ -27537,58 +31324,79 @@ export namespace compute_v1 { * compute.images.delete * @desc Deletes the specified image. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.images.delete({ * // Name of the image resource to delete. - * image: 'my-image', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.images.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * image: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.images.delete * @memberOf! () * @@ -27664,62 +31472,91 @@ export namespace compute_v1 { * compute.images.deprecate * @desc Sets the deprecation status of an image. If an empty request body is given, clears the deprecation status instead. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.images.deprecate({ * // Image name. - * image: 'my-image', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * image: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deleted": "my_deleted", + * // "deprecated": "my_deprecated", + * // "obsolete": "my_obsolete", + * // "replacement": "my_replacement", + * // "state": "my_state" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.images.deprecate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.images.deprecate * @memberOf! () * @@ -27797,58 +31634,81 @@ export namespace compute_v1 { * compute.images.get * @desc Returns the specified image. Gets a list of available images by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.images.get({ * // Name of the image resource to return. - * image: 'my-image', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.images.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * image: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "archiveSizeBytes": "my_archiveSizeBytes", + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "family": "my_family", + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "imageEncryptionKey": {}, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "rawDisk": {}, + * // "selfLink": "my_selfLink", + * // "shieldedInstanceInitialState": {}, + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskEncryptionKey": {}, + * // "sourceDiskId": "my_sourceDiskId", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "sourceType": "my_sourceType", + * // "status": "my_status", + * // "storageLocations": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.images.get * @memberOf! () * @@ -27921,58 +31781,81 @@ export namespace compute_v1 { * compute.images.getFromFamily * @desc Returns the latest image that is part of an image family and is not deprecated. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.images.getFromFamily({ * // Name of the image family to search for. - * family: 'my-family', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.images.getFromFamily(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * family: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "archiveSizeBytes": "my_archiveSizeBytes", + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "family": "my_family", + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "imageEncryptionKey": {}, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "rawDisk": {}, + * // "selfLink": "my_selfLink", + * // "shieldedInstanceInitialState": {}, + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskEncryptionKey": {}, + * // "sourceDiskId": "my_sourceDiskId", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "sourceType": "my_sourceType", + * // "status": "my_status", + * // "storageLocations": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.images.getFromFamily * @memberOf! () * @@ -28046,6 +31929,58 @@ export namespace compute_v1 { /** * compute.images.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.images.getIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.images.getIamPolicy * @memberOf! () * @@ -28120,59 +32055,119 @@ export namespace compute_v1 { * compute.images.insert * @desc Creates an image in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 compute.images.insert({ + * // Force image creation if true. + * forceCreate: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "archiveSizeBytes": "my_archiveSizeBytes", + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "family": "my_family", + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "imageEncryptionKey": {}, + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "rawDisk": {}, + * // "selfLink": "my_selfLink", + * // "shieldedInstanceInitialState": {}, + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskEncryptionKey": {}, + * // "sourceDiskId": "my_sourceDiskId", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "sourceType": "my_sourceType", + * // "status": "my_status", + * // "storageLocations": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.images.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.images.insert * @memberOf! () * @@ -28249,68 +32244,73 @@ export namespace compute_v1 { * compute.images.list * @desc Retrieves the list of custom images available to the specified project. Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.images.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.images.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.images.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.images.list * @memberOf! () * @@ -28387,6 +32387,67 @@ export namespace compute_v1 { /** * compute.images.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.images.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.images.setIamPolicy * @memberOf! () * @@ -28462,62 +32523,82 @@ export namespace compute_v1 { * compute.images.setLabels * @desc Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.images.setLabels({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } * }, - * - * auth: authClient, - * }; - * - * compute.images.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.images.setLabels * @memberOf! () * @@ -28593,6 +32674,61 @@ export namespace compute_v1 { /** * compute.images.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.images.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.images.testIamPermissions * @memberOf! () * @@ -28885,65 +33021,89 @@ export namespace compute_v1 { * compute.instanceGroupManagers.abandonInstances * @desc Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.abandonInstances({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.abandonInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.abandonInstances * @memberOf! () * @@ -29023,68 +33183,75 @@ export namespace compute_v1 { * compute.instanceGroupManagers.aggregatedList * @desc Retrieves the list of managed instance groups and groups them by zone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroupManagers.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroupManagers.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.instanceGroupManagers.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.aggregatedList * @memberOf! () * @@ -29173,6 +33340,86 @@ export namespace compute_v1 { /** * compute.instanceGroupManagers.applyUpdatesToInstances * @desc Applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.applyUpdatesToInstances({ + * // The name of the managed instance group, should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone where the managed instance group is located. Should conform to RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [], + * // "minimalAction": "my_minimalAction", + * // "mostDisruptiveAllowedAction": "my_mostDisruptiveAllowedAction" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.applyUpdatesToInstances * @memberOf! () * @@ -29252,6 +33499,90 @@ export namespace compute_v1 { /** * compute.instanceGroupManagers.createInstances * @desc Creates instances with per-instance configs in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.createInstances({ + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the managed instance group is located. It should conform to RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.createInstances * @memberOf! () * @@ -29331,61 +33662,81 @@ export namespace compute_v1 { * compute.instanceGroupManagers.delete * @desc Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.delete({ + * // The name of the managed instance group to delete. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group to delete. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.delete * @memberOf! () * @@ -29464,65 +33815,89 @@ export namespace compute_v1 { * compute.instanceGroupManagers.deleteInstances * @desc Flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.deleteInstances({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.deleteInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.deleteInstances * @memberOf! () * @@ -29602,61 +33977,74 @@ export namespace compute_v1 { * compute.instanceGroupManagers.get * @desc Returns all of the details about the specified managed instance group. Gets a list of available managed instance groups by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroupManagers.get({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.get * @memberOf! () * @@ -29736,62 +34124,107 @@ export namespace compute_v1 { * compute.instanceGroupManagers.insert * @desc Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where you want to create the managed instance group. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.insert * @memberOf! () * @@ -29870,71 +34303,75 @@ export namespace compute_v1 { * compute.instanceGroupManagers.list * @desc Retrieves a list of managed instance groups that are contained within the specified project and zone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroupManagers.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroupManagers.list(request, handlePage); - * } - * }; + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.instanceGroupManagers.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.list * @memberOf! () * @@ -30016,6 +34453,74 @@ export namespace compute_v1 { /** * compute.instanceGroupManagers.listErrors * @desc Lists all errors thrown by actions on instances for a given managed instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroupManagers.listErrors({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9][0-9]{0,19}. + * instanceGroupManager: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone where the managed instance group is located. It should conform to RFC1035. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.listErrors * @memberOf! () * @@ -30114,61 +34619,73 @@ export namespace compute_v1 { * compute.instanceGroupManagers.listManagedInstances * @desc Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroupManagers.listManagedInstances({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * zone: 'placeholder-value', + * }); + * console.log(res.data); * - * compute.instanceGroupManagers.listManagedInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "managedInstances": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.listManagedInstances * @memberOf! () * @@ -30273,6 +34790,110 @@ export namespace compute_v1 { /** * compute.instanceGroupManagers.patch * @desc Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.patch({ + * // The name of the instance group manager. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where you want to create the managed instance group. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceGroupManagers.patch * @memberOf! () * @@ -30352,65 +34973,89 @@ export namespace compute_v1 { * compute.instanceGroupManagers.recreateInstances * @desc Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.recreateInstances({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.recreateInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.recreateInstances * @memberOf! () * @@ -30490,66 +35135,83 @@ export namespace compute_v1 { * compute.instanceGroupManagers.resize * @desc Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. When resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including: + The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance. This list is subject to change. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.resize({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. + * size: 'placeholder-value', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * // The number of running instances that the managed instance group should maintain at any given time. - * // The group automatically adds or removes instances to maintain the number of instances specified by - * // this parameter. - * size: 0, // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.resize(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.resize * @memberOf! () * @@ -30629,65 +35291,89 @@ export namespace compute_v1 { * compute.instanceGroupManagers.setInstanceTemplate * @desc Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.setInstanceTemplate({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instanceTemplate": "my_instanceTemplate" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.setInstanceTemplate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.setInstanceTemplate * @memberOf! () * @@ -30767,65 +35453,90 @@ export namespace compute_v1 { * compute.instanceGroupManagers.setTargetPools * @desc Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroupManagers.setTargetPools({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "targetPools": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.setTargetPools(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroupManagers.setTargetPools * @memberOf! () * @@ -31374,65 +36085,89 @@ export namespace compute_v1 { * compute.instanceGroups.addInstances * @desc Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroups.addInstances({ + * // The name of the instance group where you are adding instances. + * instanceGroup: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group where you are adding instances. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroups.addInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroups.addInstances * @memberOf! () * @@ -31512,68 +36247,75 @@ export namespace compute_v1 { * compute.instanceGroups.aggregatedList * @desc Retrieves the list of instance groups and sorts them by zone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroups.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroups.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.instanceGroups.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroups.aggregatedList * @memberOf! () * @@ -31661,61 +36403,81 @@ export namespace compute_v1 { * compute.instanceGroups.delete * @desc Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroups.delete({ + * // The name of the instance group to delete. + * instanceGroup: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group to delete. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroups.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroups.delete * @memberOf! () * @@ -31794,61 +36556,66 @@ export namespace compute_v1 { * compute.instanceGroups.get * @desc Returns the specified instance group. Gets a list of available instance groups by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroups.get({ + * // The name of the instance group. + * instanceGroup: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroups.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroups.get * @memberOf! () * @@ -31926,62 +36693,99 @@ export namespace compute_v1 { * compute.instanceGroups.insert * @desc Creates an instance group in the specified project using the parameters that are included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroups.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where you want to create the instance group. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroups.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroups.insert * @memberOf! () * @@ -32060,71 +36864,75 @@ export namespace compute_v1 { * compute.instanceGroups.list * @desc Retrieves the list of instance groups that are located in the specified project and zone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroups.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroups.list(request, handlePage); - * } - * }; + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.instanceGroups.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroups.list * @memberOf! () * @@ -32205,78 +37013,85 @@ export namespace compute_v1 { * compute.instanceGroups.listInstances * @desc Lists the instances in the specified instance group. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceGroups.listInstances({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The name of the instance group from which you want to generate a list of included instances. + * instanceGroup: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group from which you want to generate a list of included instances. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instanceState": "my_instanceState" + * // } * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroups.listInstances(request, handlePage); - * } - * }; - * - * compute.instanceGroups.listInstances(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroups.listInstances * @memberOf! () * @@ -32366,65 +37181,89 @@ export namespace compute_v1 { * compute.instanceGroups.removeInstances * @desc Removes one or more instances from the specified instance group, but does not delete those instances. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroups.removeInstances({ + * // The name of the instance group where the specified instances will be removed. + * instanceGroup: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group where the specified instances will be removed. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroups.removeInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroups.removeInstances * @memberOf! () * @@ -32504,65 +37343,90 @@ export namespace compute_v1 { * compute.instanceGroups.setNamedPorts * @desc Sets the named ports for the specified instance group. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceGroups.setNamedPorts({ + * // The name of the instance group where the named ports are updated. + * instanceGroup: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group where the named ports are updated. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "namedPorts": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroups.setNamedPorts(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceGroups.setNamedPorts * @memberOf! () * @@ -32911,68 +37775,97 @@ export namespace compute_v1 { * compute.instances.addAccessConfig * @desc Adds an access config to an instance's network interface. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.addAccessConfig({ * // The instance name for this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // The name of the network interface to add to this instance. - * networkInterface: '', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * networkInterface: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "name": "my_name", + * // "natIP": "my_natIP", + * // "networkTier": "my_networkTier", + * // "publicPtrDomainName": "my_publicPtrDomainName", + * // "setPublicPtr": false, + * // "type": "my_type" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.addAccessConfig(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.addAccessConfig * @memberOf! () * @@ -33052,6 +37945,90 @@ export namespace compute_v1 { /** * compute.instances.addResourcePolicies * @desc Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.addResourcePolicies({ + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourcePolicies": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.addResourcePolicies * @memberOf! () * @@ -33131,68 +38108,75 @@ export namespace compute_v1 { * compute.instances.aggregatedList * @desc Retrieves aggregated list of all of the instances in your project across all regions and zones. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instances.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.instances.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.aggregatedList * @memberOf! () * @@ -33276,65 +38260,105 @@ export namespace compute_v1 { * compute.instances.attachDisk * @desc Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.attachDisk({ + * // Whether to force attach the disk even if it's currently attached to another instance. + * forceAttach: 'placeholder-value', + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The instance name for this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoDelete": false, + * // "boot": false, + * // "deviceName": "my_deviceName", + * // "diskEncryptionKey": {}, + * // "diskSizeGb": "my_diskSizeGb", + * // "guestOsFeatures": [], + * // "index": 0, + * // "initializeParams": {}, + * // "interface": "my_interface", + * // "kind": "my_kind", + * // "licenses": [], + * // "mode": "my_mode", + * // "shieldedInstanceInitialState": {}, + * // "source": "my_source", + * // "type": "my_type" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.attachDisk(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.attachDisk * @memberOf! () * @@ -33415,61 +38439,81 @@ export namespace compute_v1 { * compute.instances.delete * @desc Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.delete({ + * // Name of the instance resource to delete. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to delete. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.delete * @memberOf! () * @@ -33547,67 +38591,85 @@ export namespace compute_v1 { * compute.instances.deleteAccessConfig * @desc Deletes an access config from an instance's network interface. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The instance name for this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.deleteAccessConfig({ * // The name of the access config to delete. - * accessConfig: '', // TODO: Update placeholder value. - * + * accessConfig: 'placeholder-value', + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // The name of the network interface. - * networkInterface: '', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.deleteAccessConfig(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * networkInterface: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.deleteAccessConfig * @memberOf! () * @@ -33694,64 +38756,83 @@ export namespace compute_v1 { * compute.instances.detachDisk * @desc Detaches a disk from an instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.detachDisk({ + * // The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names. + * deviceName: 'placeholder-value', + * // Instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Instance name. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * // Disk device name to detach. - * deviceName: '', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.detachDisk(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.detachDisk * @memberOf! () * @@ -33831,61 +38912,84 @@ export namespace compute_v1 { * compute.instances.get * @desc Returns the specified Instance resource. Gets a list of available instances by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.get({ + * // Name of the instance resource to return. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to return. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "canIpForward": false, + * // "cpuPlatform": "my_cpuPlatform", + * // "creationTimestamp": "my_creationTimestamp", + * // "deletionProtection": false, + * // "description": "my_description", + * // "disks": [], + * // "displayDevice": {}, + * // "fingerprint": "my_fingerprint", + * // "guestAccelerators": [], + * // "hostname": "my_hostname", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "machineType": "my_machineType", + * // "metadata": {}, + * // "minCpuPlatform": "my_minCpuPlatform", + * // "name": "my_name", + * // "networkInterfaces": [], + * // "reservationAffinity": {}, + * // "resourcePolicies": [], + * // "scheduling": {}, + * // "selfLink": "my_selfLink", + * // "serviceAccounts": [], + * // "shieldedInstanceConfig": {}, + * // "shieldedInstanceIntegrityPolicy": {}, + * // "startRestricted": false, + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "tags": {}, + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.get * @memberOf! () * @@ -33959,6 +39063,64 @@ export namespace compute_v1 { /** * compute.instances.getGuestAttributes * @desc Returns the specified guest attributes entry. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.getGuestAttributes({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Specifies the guest attributes path to be queried. + * queryPath: 'placeholder-value', + * // Specifies the key for the guest attributes entry. + * variableKey: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "queryPath": "my_queryPath", + * // "queryValue": {}, + * // "selfLink": "my_selfLink", + * // "variableKey": "my_variableKey", + * // "variableValue": "my_variableValue" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.getGuestAttributes * @memberOf! () * @@ -34039,6 +39201,60 @@ export namespace compute_v1 { /** * compute.instances.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.getIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.getIamPolicy * @memberOf! () * @@ -34114,61 +39330,62 @@ export namespace compute_v1 { * compute.instances.getSerialPortOutput * @desc Returns the last 1 MB of serial port output from the specified instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.getSerialPortOutput({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Specifies which COM or serial port to retrieve data from. + * port: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call. + * start: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.getSerialPortOutput(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contents": "my_contents", + * // "kind": "my_kind", + * // "next": "my_next", + * // "selfLink": "my_selfLink", + * // "start": "my_start" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.getSerialPortOutput * @memberOf! () * @@ -34249,6 +39466,57 @@ export namespace compute_v1 { /** * compute.instances.getShieldedInstanceIdentity * @desc Returns the Shielded Instance Identity of an instance + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.getShieldedInstanceIdentity({ + * // Name or id of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "encryptionKey": {}, + * // "kind": "my_kind", + * // "signingKey": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.getShieldedInstanceIdentity * @memberOf! () * @@ -34330,62 +39598,124 @@ export namespace compute_v1 { * compute.instances.insert * @desc Creates an instance resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Specifies instance template to create the instance. + * // + * // This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: + * // - https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate + * // - projects/project/global/instanceTemplates/instanceTemplate + * // - global/instanceTemplates/instanceTemplate + * sourceInstanceTemplate: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "canIpForward": false, + * // "cpuPlatform": "my_cpuPlatform", + * // "creationTimestamp": "my_creationTimestamp", + * // "deletionProtection": false, + * // "description": "my_description", + * // "disks": [], + * // "displayDevice": {}, + * // "fingerprint": "my_fingerprint", + * // "guestAccelerators": [], + * // "hostname": "my_hostname", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "machineType": "my_machineType", + * // "metadata": {}, + * // "minCpuPlatform": "my_minCpuPlatform", + * // "name": "my_name", + * // "networkInterfaces": [], + * // "reservationAffinity": {}, + * // "resourcePolicies": [], + * // "scheduling": {}, + * // "selfLink": "my_selfLink", + * // "serviceAccounts": [], + * // "shieldedInstanceConfig": {}, + * // "shieldedInstanceIntegrityPolicy": {}, + * // "startRestricted": false, + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "tags": {}, + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.insert * @memberOf! () * @@ -34463,71 +39793,75 @@ export namespace compute_v1 { * compute.instances.list * @desc Retrieves the list of instances contained within the specified zone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instances.list(request, handlePage); - * } - * }; + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.instances.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.list * @memberOf! () * @@ -34605,6 +39939,78 @@ export namespace compute_v1 { /** * compute.instances.listReferrers * @desc Retrieves the list of referrers to instances contained within the specified zone. For more information, read Viewing Referrers to VM Instances. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.listReferrers({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. + * instance: '-|[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.listReferrers * @memberOf! () * @@ -34689,6 +40095,90 @@ export namespace compute_v1 { /** * compute.instances.removeResourcePolicies * @desc Removes resource policies from an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.removeResourcePolicies({ + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourcePolicies": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.removeResourcePolicies * @memberOf! () * @@ -34770,61 +40260,81 @@ export namespace compute_v1 { * compute.instances.reset * @desc Performs a reset on the instance. This is a hard reset the VM does not do a graceful shutdown. For more information, see Resetting an instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.reset({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.reset(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.reset * @memberOf! () * @@ -34902,61 +40412,83 @@ export namespace compute_v1 { * compute.instances.setDeletionProtection * @desc Sets deletion protection on the instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setDeletionProtection({ + * // Whether the resource should be protected against deletion. + * deletionProtection: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.setDeletionProtection(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.setDeletionProtection * @memberOf! () * @@ -35038,67 +40570,85 @@ export namespace compute_v1 { * compute.instances.setDiskAutoDelete * @desc Sets the auto-delete flag for a disk attached to an instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setDiskAutoDelete({ + * // Whether to auto-delete the disk when the instance is deleted. + * autoDelete: 'placeholder-value', + * // The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names. + * deviceName: 'w[w.-]{0,254}', + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The instance name. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * // Whether to auto-delete the disk when the instance is deleted. - * autoDelete: false, // TODO: Update placeholder value. - * - * // The device name of the disk to modify. - * deviceName: '', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.setDiskAutoDelete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.setDiskAutoDelete * @memberOf! () * @@ -35184,6 +40734,69 @@ export namespace compute_v1 { /** * compute.instances.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.setIamPolicy * @memberOf! () * @@ -35260,65 +40873,90 @@ export namespace compute_v1 { * compute.instances.setLabels * @desc Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setLabels({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.setLabels * @memberOf! () * @@ -35398,65 +41036,89 @@ export namespace compute_v1 { * compute.instances.setMachineResources * @desc Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setMachineResources({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "guestAccelerators": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.setMachineResources(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.setMachineResources * @memberOf! () * @@ -35536,65 +41198,89 @@ export namespace compute_v1 { * compute.instances.setMachineType * @desc Changes the machine type for a stopped instance to the machine type specified in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setMachineType({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "machineType": "my_machineType" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.setMachineType(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.setMachineType * @memberOf! () * @@ -35674,65 +41360,91 @@ export namespace compute_v1 { * compute.instances.setMetadata * @desc Sets metadata for the specified instance to the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setMetadata({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "items": [], + * // "kind": "my_kind" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.setMetadata(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.setMetadata * @memberOf! () * @@ -35812,65 +41524,89 @@ export namespace compute_v1 { * compute.instances.setMinCpuPlatform * @desc Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setMinCpuPlatform({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "minCpuPlatform": "my_minCpuPlatform" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.setMinCpuPlatform(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.setMinCpuPlatform * @memberOf! () * @@ -35950,65 +41686,92 @@ export namespace compute_v1 { * compute.instances.setScheduling * @desc Sets an instance's scheduling options. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setScheduling({ + * // Instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Instance name. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "automaticRestart": false, + * // "nodeAffinities": [], + * // "onHostMaintenance": "my_onHostMaintenance", + * // "preemptible": false + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.setScheduling(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.setScheduling * @memberOf! () * @@ -36088,65 +41851,90 @@ export namespace compute_v1 { * compute.instances.setServiceAccount * @desc Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setServiceAccount({ + * // Name of the instance resource to start. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to start. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "email": "my_email", + * // "scopes": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.setServiceAccount(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.setServiceAccount * @memberOf! () * @@ -36225,6 +42013,90 @@ export namespace compute_v1 { /** * compute.instances.setShieldedInstanceIntegrityPolicy * @desc Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setShieldedInstanceIntegrityPolicy({ + * // Name or id of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "updateAutoLearnPolicy": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.setShieldedInstanceIntegrityPolicy * @memberOf! () * @@ -36306,65 +42178,90 @@ export namespace compute_v1 { * compute.instances.setTags * @desc Sets network tags for the specified instance to the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.setTags({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "items": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.setTags(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.setTags * @memberOf! () * @@ -36443,6 +42340,76 @@ export namespace compute_v1 { /** * compute.instances.simulateMaintenanceEvent * @desc Simulates a maintenance event on the instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.simulateMaintenanceEvent({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.simulateMaintenanceEvent * @memberOf! () * @@ -36522,61 +42489,81 @@ export namespace compute_v1 { * compute.instances.start * @desc Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.start({ + * // Name of the instance resource to start. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to start. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.start(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.start * @memberOf! () * @@ -36654,65 +42641,89 @@ export namespace compute_v1 { * compute.instances.startWithEncryptionKey * @desc Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.startWithEncryptionKey({ + * // Name of the instance resource to start. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to start. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "disks": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instances.startWithEncryptionKey(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.startWithEncryptionKey * @memberOf! () * @@ -36794,61 +42805,81 @@ export namespace compute_v1 { * compute.instances.stop * @desc Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.stop({ + * // Name of the instance resource to stop. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to stop. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.stop(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instances.stop * @memberOf! () * @@ -36925,6 +42956,63 @@ export namespace compute_v1 { /** * compute.instances.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instances.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.testIamPermissions * @memberOf! () * @@ -37006,6 +43094,124 @@ export namespace compute_v1 { /** * compute.instances.update * @desc Updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.update({ + * // Name of the instance resource to update. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Specifies the action to take when updating an instance even if the updated properties do not require it. If not specified, then Compute Engine acts based on the minimum action that the updated properties require. + * minimalAction: 'placeholder-value', + * // Specifies the most disruptive action that can be taken on the instance as part of the update. Compute Engine returns an error if the instance properties require a more disruptive action as part of the instance update. Valid options from lowest to highest are NO_EFFECT, REFRESH, and RESTART. + * mostDisruptiveAllowedAction: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "canIpForward": false, + * // "cpuPlatform": "my_cpuPlatform", + * // "creationTimestamp": "my_creationTimestamp", + * // "deletionProtection": false, + * // "description": "my_description", + * // "disks": [], + * // "displayDevice": {}, + * // "fingerprint": "my_fingerprint", + * // "guestAccelerators": [], + * // "hostname": "my_hostname", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "machineType": "my_machineType", + * // "metadata": {}, + * // "minCpuPlatform": "my_minCpuPlatform", + * // "name": "my_name", + * // "networkInterfaces": [], + * // "reservationAffinity": {}, + * // "resourcePolicies": [], + * // "scheduling": {}, + * // "selfLink": "my_selfLink", + * // "serviceAccounts": [], + * // "shieldedInstanceConfig": {}, + * // "shieldedInstanceIntegrityPolicy": {}, + * // "startRestricted": false, + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "tags": {}, + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.update * @memberOf! () * @@ -37085,6 +43291,98 @@ export namespace compute_v1 { /** * compute.instances.updateAccessConfig * @desc Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.updateAccessConfig({ + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the network interface where the access config is attached. + * networkInterface: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "name": "my_name", + * // "natIP": "my_natIP", + * // "networkTier": "my_networkTier", + * // "publicPtrDomainName": "my_publicPtrDomainName", + * // "setPublicPtr": false, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.updateAccessConfig * @memberOf! () * @@ -37164,6 +43462,90 @@ export namespace compute_v1 { /** * compute.instances.updateDisplayDevice * @desc Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.updateDisplayDevice({ + * // Name of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "enableDisplay": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.updateDisplayDevice * @memberOf! () * @@ -37242,6 +43624,99 @@ export namespace compute_v1 { /** * compute.instances.updateNetworkInterface * @desc Updates an instance's network interface. This method follows PATCH semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.updateNetworkInterface({ + * // The instance name for this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the network interface to update. + * networkInterface: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accessConfigs": [], + * // "aliasIpRanges": [], + * // "fingerprint": "my_fingerprint", + * // "kind": "my_kind", + * // "name": "my_name", + * // "network": "my_network", + * // "networkIP": "my_networkIP", + * // "subnetwork": "my_subnetwork" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.updateNetworkInterface * @memberOf! () * @@ -37323,6 +43798,92 @@ export namespace compute_v1 { /** * compute.instances.updateShieldedInstanceConfig * @desc Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instances.updateShieldedInstanceConfig({ + * // Name or id of the instance scoping this request. + * instance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "enableIntegrityMonitoring": false, + * // "enableSecureBoot": false, + * // "enableVtpm": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instances.updateShieldedInstanceConfig * @memberOf! () * @@ -38510,58 +45071,79 @@ export namespace compute_v1 { * compute.instanceTemplates.delete * @desc Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceTemplates.delete({ * // The name of the instance template to delete. - * instanceTemplate: 'my-instance-template', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceTemplates.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * instanceTemplate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceTemplates.delete * @memberOf! () * @@ -38639,58 +45221,60 @@ export namespace compute_v1 { * compute.instanceTemplates.get * @desc Returns the specified instance template. Gets a list of available instance templates by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceTemplates.get({ * // The name of the instance template. - * instanceTemplate: 'my-instance-template', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceTemplates.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * instanceTemplate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "properties": {}, + * // "selfLink": "my_selfLink", + * // "sourceInstance": "my_sourceInstance", + * // "sourceInstanceParams": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceTemplates.get * @memberOf! () * @@ -38766,6 +45350,58 @@ export namespace compute_v1 { /** * compute.instanceTemplates.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceTemplates.getIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceTemplates.getIamPolicy * @memberOf! () * @@ -38840,59 +45476,93 @@ export namespace compute_v1 { * compute.instanceTemplates.insert * @desc Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceTemplates.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "properties": {}, + * // "selfLink": "my_selfLink", + * // "sourceInstance": "my_sourceInstance", + * // "sourceInstanceParams": {} + * // } * }, - * - * auth: authClient, - * }; - * - * compute.instanceTemplates.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceTemplates.insert * @memberOf! () * @@ -38970,68 +45640,73 @@ export namespace compute_v1 { * compute.instanceTemplates.list * @desc Retrieves a list of instance templates that are contained within the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceTemplates.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceTemplates.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.instanceTemplates.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.instanceTemplates.list * @memberOf! () * @@ -39112,6 +45787,67 @@ export namespace compute_v1 { /** * compute.instanceTemplates.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.instanceTemplates.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceTemplates.setIamPolicy * @memberOf! () * @@ -39186,6 +45922,61 @@ export namespace compute_v1 { /** * compute.instanceTemplates.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.instanceTemplates.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.instanceTemplates.testIamPermissions * @memberOf! () * @@ -39418,68 +46209,75 @@ export namespace compute_v1 { * compute.interconnectAttachments.aggregatedList * @desc Retrieves an aggregated list of interconnect attachments. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnectAttachments.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.interconnectAttachments.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.interconnectAttachments.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnectAttachments.aggregatedList * @memberOf! () * @@ -39577,61 +46375,82 @@ export namespace compute_v1 { * compute.interconnectAttachments.delete * @desc Deletes the specified interconnect attachment. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnectAttachments.delete({ + * // Name of the interconnect attachment to delete. + * interconnectAttachment: + * '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the interconnect attachment to delete. - * interconnectAttachment: 'my-interconnect-attachment', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.interconnectAttachments.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnectAttachments.delete * @memberOf! () * @@ -39710,61 +46529,78 @@ export namespace compute_v1 { * compute.interconnectAttachments.get * @desc Returns the specified interconnect attachment. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnectAttachments.get({ + * // Name of the interconnect attachment to return. + * interconnectAttachment: + * '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the interconnect attachment to return. - * interconnectAttachment: 'my-interconnect-attachment', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.interconnectAttachments.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adminEnabled": false, + * // "bandwidth": "my_bandwidth", + * // "candidateSubnets": [], + * // "cloudRouterIpAddress": "my_cloudRouterIpAddress", + * // "creationTimestamp": "my_creationTimestamp", + * // "customerRouterIpAddress": "my_customerRouterIpAddress", + * // "description": "my_description", + * // "edgeAvailabilityDomain": "my_edgeAvailabilityDomain", + * // "googleReferenceId": "my_googleReferenceId", + * // "id": "my_id", + * // "interconnect": "my_interconnect", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationalStatus": "my_operationalStatus", + * // "pairingKey": "my_pairingKey", + * // "partnerAsn": "my_partnerAsn", + * // "partnerMetadata": {}, + * // "privateInterconnectInfo": {}, + * // "region": "my_region", + * // "router": "my_router", + * // "selfLink": "my_selfLink", + * // "state": "my_state", + * // "type": "my_type", + * // "vlanTag8021q": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnectAttachments.get * @memberOf! () * @@ -39844,62 +46680,112 @@ export namespace compute_v1 { * compute.interconnectAttachments.insert * @desc Creates an InterconnectAttachment in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnectAttachments.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // If true, the request will not be committed. + * validateOnly: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adminEnabled": false, + * // "bandwidth": "my_bandwidth", + * // "candidateSubnets": [], + * // "cloudRouterIpAddress": "my_cloudRouterIpAddress", + * // "creationTimestamp": "my_creationTimestamp", + * // "customerRouterIpAddress": "my_customerRouterIpAddress", + * // "description": "my_description", + * // "edgeAvailabilityDomain": "my_edgeAvailabilityDomain", + * // "googleReferenceId": "my_googleReferenceId", + * // "id": "my_id", + * // "interconnect": "my_interconnect", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationalStatus": "my_operationalStatus", + * // "pairingKey": "my_pairingKey", + * // "partnerAsn": "my_partnerAsn", + * // "partnerMetadata": {}, + * // "privateInterconnectInfo": {}, + * // "region": "my_region", + * // "router": "my_router", + * // "selfLink": "my_selfLink", + * // "state": "my_state", + * // "type": "my_type", + * // "vlanTag8021q": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.interconnectAttachments.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnectAttachments.insert * @memberOf! () * @@ -39979,71 +46865,75 @@ export namespace compute_v1 { * compute.interconnectAttachments.list * @desc Retrieves the list of interconnect attachments contained within the specified region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnectAttachments.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.interconnectAttachments.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.interconnectAttachments.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnectAttachments.list * @memberOf! () * @@ -40130,6 +47020,114 @@ export namespace compute_v1 { /** * compute.interconnectAttachments.patch * @desc Updates the specified interconnect attachment with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnectAttachments.patch({ + * // Name of the interconnect attachment to patch. + * interconnectAttachment: + * '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adminEnabled": false, + * // "bandwidth": "my_bandwidth", + * // "candidateSubnets": [], + * // "cloudRouterIpAddress": "my_cloudRouterIpAddress", + * // "creationTimestamp": "my_creationTimestamp", + * // "customerRouterIpAddress": "my_customerRouterIpAddress", + * // "description": "my_description", + * // "edgeAvailabilityDomain": "my_edgeAvailabilityDomain", + * // "googleReferenceId": "my_googleReferenceId", + * // "id": "my_id", + * // "interconnect": "my_interconnect", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationalStatus": "my_operationalStatus", + * // "pairingKey": "my_pairingKey", + * // "partnerAsn": "my_partnerAsn", + * // "partnerMetadata": {}, + * // "privateInterconnectInfo": {}, + * // "region": "my_region", + * // "router": "my_router", + * // "selfLink": "my_selfLink", + * // "state": "my_state", + * // "type": "my_type", + * // "vlanTag8021q": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnectAttachments.patch * @memberOf! () * @@ -40383,58 +47381,66 @@ export namespace compute_v1 { * compute.interconnectLocations.get * @desc Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnectLocations.get({ * // Name of the interconnect location to return. - * interconnectLocation: 'my-interconnect-location', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.interconnectLocations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * interconnectLocation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "availabilityZone": "my_availabilityZone", + * // "city": "my_city", + * // "continent": "my_continent", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "facilityProvider": "my_facilityProvider", + * // "facilityProviderFacilityId": "my_facilityProviderFacilityId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "peeringdbFacilityId": "my_peeringdbFacilityId", + * // "regionInfos": [], + * // "selfLink": "my_selfLink", + * // "status": "my_status" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnectLocations.get * @memberOf! () * @@ -40513,68 +47519,73 @@ export namespace compute_v1 { * compute.interconnectLocations.list * @desc Retrieves the list of interconnect locations available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnectLocations.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.interconnectLocations.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.interconnectLocations.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnectLocations.list * @memberOf! () * @@ -40708,58 +47719,79 @@ export namespace compute_v1 { * compute.interconnects.delete * @desc Deletes the specified interconnect. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnects.delete({ * // Name of the interconnect to delete. - * interconnect: 'my-interconnect', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.interconnects.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * interconnect: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnects.delete * @memberOf! () * @@ -40837,58 +47869,73 @@ export namespace compute_v1 { * compute.interconnects.get * @desc Returns the specified interconnect. Get a list of available interconnects by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnects.get({ * // Name of the interconnect to return. - * interconnect: 'my-interconnect', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.interconnects.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * interconnect: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adminEnabled": false, + * // "circuitInfos": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "customerName": "my_customerName", + * // "description": "my_description", + * // "expectedOutages": [], + * // "googleIpAddress": "my_googleIpAddress", + * // "googleReferenceId": "my_googleReferenceId", + * // "id": "my_id", + * // "interconnectAttachments": [], + * // "interconnectType": "my_interconnectType", + * // "kind": "my_kind", + * // "linkType": "my_linkType", + * // "location": "my_location", + * // "name": "my_name", + * // "nocContactEmail": "my_nocContactEmail", + * // "operationalStatus": "my_operationalStatus", + * // "peerIpAddress": "my_peerIpAddress", + * // "provisionedLinkCount": 0, + * // "requestedLinkCount": 0, + * // "selfLink": "my_selfLink", + * // "state": "my_state" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnects.get * @memberOf! () * @@ -40964,6 +48011,53 @@ export namespace compute_v1 { /** * compute.interconnects.getDiagnostics * @desc Returns the interconnectDiagnostics for the specified interconnect. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnects.getDiagnostics({ + * // Name of the interconnect resource to query. + * interconnect: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "result": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.interconnects.getDiagnostics * @memberOf! () * @@ -41051,59 +48145,106 @@ export namespace compute_v1 { * compute.interconnects.insert * @desc Creates a Interconnect in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnects.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adminEnabled": false, + * // "circuitInfos": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "customerName": "my_customerName", + * // "description": "my_description", + * // "expectedOutages": [], + * // "googleIpAddress": "my_googleIpAddress", + * // "googleReferenceId": "my_googleReferenceId", + * // "id": "my_id", + * // "interconnectAttachments": [], + * // "interconnectType": "my_interconnectType", + * // "kind": "my_kind", + * // "linkType": "my_linkType", + * // "location": "my_location", + * // "name": "my_name", + * // "nocContactEmail": "my_nocContactEmail", + * // "operationalStatus": "my_operationalStatus", + * // "peerIpAddress": "my_peerIpAddress", + * // "provisionedLinkCount": 0, + * // "requestedLinkCount": 0, + * // "selfLink": "my_selfLink", + * // "state": "my_state" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.interconnects.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnects.insert * @memberOf! () * @@ -41180,68 +48321,73 @@ export namespace compute_v1 { * compute.interconnects.list * @desc Retrieves the list of interconnect available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.interconnects.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.interconnects.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.interconnects.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnects.list * @memberOf! () * @@ -41320,63 +48466,108 @@ export namespace compute_v1 { * compute.interconnects.patch * @desc Updates the specified interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.interconnects.patch({ * // Name of the interconnect to update. - * interconnect: 'my-interconnect', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * interconnect: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adminEnabled": false, + * // "circuitInfos": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "customerName": "my_customerName", + * // "description": "my_description", + * // "expectedOutages": [], + * // "googleIpAddress": "my_googleIpAddress", + * // "googleReferenceId": "my_googleReferenceId", + * // "id": "my_id", + * // "interconnectAttachments": [], + * // "interconnectType": "my_interconnectType", + * // "kind": "my_kind", + * // "linkType": "my_linkType", + * // "location": "my_location", + * // "name": "my_name", + * // "nocContactEmail": "my_nocContactEmail", + * // "operationalStatus": "my_operationalStatus", + * // "peerIpAddress": "my_peerIpAddress", + * // "provisionedLinkCount": 0, + * // "requestedLinkCount": 0, + * // "selfLink": "my_selfLink", + * // "state": "my_state" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.interconnects.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.interconnects.patch * @memberOf! () * @@ -41588,6 +48779,61 @@ export namespace compute_v1 { /** * compute.licenseCodes.get * @desc Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.licenseCodes.get({ + * // Number corresponding to the License code resource to return. + * licenseCode: '[0-9]{0,61}?', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "licenseAlias": [], + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "state": "my_state", + * // "transferable": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenseCodes.get * @memberOf! () * @@ -41662,6 +48908,61 @@ export namespace compute_v1 { /** * compute.licenseCodes.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.licenseCodes.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenseCodes.testIamPermissions * @memberOf! () * @@ -41786,6 +49087,80 @@ export namespace compute_v1 { /** * compute.licenses.delete * @desc Deletes the specified license. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.licenses.delete({ + * // Name of the license resource to delete. + * license: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenses.delete * @memberOf! () * @@ -41862,58 +49237,61 @@ export namespace compute_v1 { * compute.licenses.get * @desc Returns the specified License resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.licenses.get({ * // Name of the License resource to return. - * license: 'my-license', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.licenses.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * license: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "chargesUseFee": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "licenseCode": "my_licenseCode", + * // "name": "my_name", + * // "resourceRequirements": {}, + * // "selfLink": "my_selfLink", + * // "transferable": false + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.licenses.get * @memberOf! () * @@ -41986,6 +49364,58 @@ export namespace compute_v1 { /** * compute.licenses.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.licenses.getIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenses.getIamPolicy * @memberOf! () * @@ -42059,6 +49489,98 @@ export namespace compute_v1 { /** * compute.licenses.insert * @desc Create a License resource in the specified project. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 compute.licenses.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "chargesUseFee": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "licenseCode": "my_licenseCode", + * // "name": "my_name", + * // "resourceRequirements": {}, + * // "selfLink": "my_selfLink", + * // "transferable": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenses.insert * @memberOf! () * @@ -42133,6 +49655,73 @@ export namespace compute_v1 { /** * compute.licenses.list * @desc Retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.licenses.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenses.list * @memberOf! () * @@ -42211,6 +49800,67 @@ export namespace compute_v1 { /** * compute.licenses.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.licenses.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenses.setIamPolicy * @memberOf! () * @@ -42285,6 +49935,61 @@ export namespace compute_v1 { /** * compute.licenses.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.licenses.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.licenses.testIamPermissions * @memberOf! () * @@ -42513,68 +50218,75 @@ export namespace compute_v1 { * compute.machineTypes.aggregatedList * @desc Retrieves an aggregated list of machine types. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.machineTypes.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.machineTypes.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.machineTypes.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.machineTypes.aggregatedList * @memberOf! () * @@ -42661,61 +50373,68 @@ export namespace compute_v1 { * compute.machineTypes.get * @desc Returns the specified machine type. Gets a list of available machine types by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.machineTypes.get({ + * // Name of the machine type to return. + * machineType: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the machine type to return. - * machineType: 'my-machine-type', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.machineTypes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "guestCpus": 0, + * // "id": "my_id", + * // "imageSpaceGb": 0, + * // "isSharedCpu": false, + * // "kind": "my_kind", + * // "maximumPersistentDisks": 0, + * // "maximumPersistentDisksSizeGb": "my_maximumPersistentDisksSizeGb", + * // "memoryMb": 0, + * // "name": "my_name", + * // "scratchDisks": [], + * // "selfLink": "my_selfLink", + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.machineTypes.get * @memberOf! () * @@ -42792,71 +50511,75 @@ export namespace compute_v1 { * compute.machineTypes.list * @desc Retrieves a list of machine types available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.machineTypes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.machineTypes.list(request, handlePage); - * } - * }; + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.machineTypes.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.machineTypes.list * @memberOf! () * @@ -43027,6 +50750,76 @@ export namespace compute_v1 { /** * compute.networkEndpointGroups.aggregatedList * @desc Retrieves the list of network endpoint groups and sorts them by zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networkEndpointGroups.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.aggregatedList * @memberOf! () * @@ -43115,6 +50908,90 @@ export namespace compute_v1 { /** * compute.networkEndpointGroups.attachNetworkEndpoints * @desc Attach a list of network endpoints to the specified network endpoint group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networkEndpointGroups.attachNetworkEndpoints({ + * // The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "networkEndpoints": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.attachNetworkEndpoints * @memberOf! () * @@ -43195,6 +51072,82 @@ export namespace compute_v1 { /** * compute.networkEndpointGroups.delete * @desc Deletes the specified network endpoint group. The network endpoints in the NEG and the VM instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot be deleted if there are backend services referencing it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networkEndpointGroups.delete({ + * // The name of the network endpoint group to delete. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.delete * @memberOf! () * @@ -43272,6 +51225,90 @@ export namespace compute_v1 { /** * compute.networkEndpointGroups.detachNetworkEndpoints * @desc Detach a list of network endpoints from the specified network endpoint group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networkEndpointGroups.detachNetworkEndpoints({ + * // The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "networkEndpoints": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.detachNetworkEndpoints * @memberOf! () * @@ -43352,6 +51389,66 @@ export namespace compute_v1 { /** * compute.networkEndpointGroups.get * @desc Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networkEndpointGroups.get({ + * // The name of the network endpoint group. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultPort": 0, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "network": "my_network", + * // "networkEndpointType": "my_networkEndpointType", + * // "selfLink": "my_selfLink", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.get * @memberOf! () * @@ -43430,6 +51527,99 @@ export namespace compute_v1 { /** * compute.networkEndpointGroups.insert * @desc Creates a network endpoint group in the specified project using the parameters that are included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networkEndpointGroups.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone where you want to create the network endpoint group. It should comply with RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultPort": 0, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "network": "my_network", + * // "networkEndpointType": "my_networkEndpointType", + * // "selfLink": "my_selfLink", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.insert * @memberOf! () * @@ -43507,6 +51697,76 @@ export namespace compute_v1 { /** * compute.networkEndpointGroups.list * @desc Retrieves the list of network endpoint groups that are located in the specified project and zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networkEndpointGroups.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.list * @memberOf! () * @@ -43588,6 +51848,85 @@ export namespace compute_v1 { /** * compute.networkEndpointGroups.listNetworkEndpoints * @desc Lists the network endpoints in the specified network endpoint group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networkEndpointGroups.listNetworkEndpoints({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * networkEndpointGroup: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "healthStatus": "my_healthStatus" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.listNetworkEndpoints * @memberOf! () * @@ -43692,6 +52031,63 @@ export namespace compute_v1 { /** * compute.networkEndpointGroups.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networkEndpointGroups.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networkEndpointGroups.testIamPermissions * @memberOf! () * @@ -44039,62 +52435,90 @@ export namespace compute_v1 { * compute.networks.addPeering * @desc Adds a peering to the specified network. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.addPeering({ * // Name of the network resource to add peering to. - * network: 'my-network', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoCreateRoutes": false, + * // "name": "my_name", + * // "networkPeering": {}, + * // "peerNetwork": "my_peerNetwork" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.networks.addPeering(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.networks.addPeering * @memberOf! () * @@ -44173,58 +52597,79 @@ export namespace compute_v1 { * compute.networks.delete * @desc Deletes the specified network. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.delete({ * // Name of the network to delete. - * network: 'my-network', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.networks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.networks.delete * @memberOf! () * @@ -44301,58 +52746,63 @@ export namespace compute_v1 { * compute.networks.get * @desc Returns the specified network. Gets a list of available networks by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networks.get({ * // Name of the network to return. - * network: 'my-network', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.networks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "IPv4Range": "my_IPv4Range", + * // "autoCreateSubnetworks": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "gatewayIPv4": "my_gatewayIPv4", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "peerings": [], + * // "routingConfig": {}, + * // "selfLink": "my_selfLink", + * // "subnetworks": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.networks.get * @memberOf! () * @@ -44426,59 +52876,96 @@ export namespace compute_v1 { * compute.networks.insert * @desc Creates a network in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "IPv4Range": "my_IPv4Range", + * // "autoCreateSubnetworks": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "gatewayIPv4": "my_gatewayIPv4", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "peerings": [], + * // "routingConfig": {}, + * // "selfLink": "my_selfLink", + * // "subnetworks": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.networks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.networks.insert * @memberOf! () * @@ -44554,68 +53041,73 @@ export namespace compute_v1 { * compute.networks.list * @desc Retrieves the list of networks available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.networks.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.networks.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.networks.list * @memberOf! () * @@ -44692,6 +53184,82 @@ export namespace compute_v1 { /** * compute.networks.listPeeringRoutes * @desc Lists the peering routes exchanged over peering connection. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.networks.listPeeringRoutes({ + * // The direction of the exchanged routes. + * direction: 'placeholder-value', + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Name of the network for this request. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The response will show routes exchanged over the given peering connection. + * peeringName: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The region of the request. The response will include all subnet routes, static routes and dynamic routes in the region. + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networks.listPeeringRoutes * @memberOf! () * @@ -44782,63 +53350,98 @@ export namespace compute_v1 { * compute.networks.patch * @desc Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.patch({ * // Name of the network to update. - * network: 'my-network', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "IPv4Range": "my_IPv4Range", + * // "autoCreateSubnetworks": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "gatewayIPv4": "my_gatewayIPv4", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "peerings": [], + * // "routingConfig": {}, + * // "selfLink": "my_selfLink", + * // "subnetworks": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.networks.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.networks.patch * @memberOf! () * @@ -44916,62 +53519,87 @@ export namespace compute_v1 { * compute.networks.removePeering * @desc Removes a peering from the specified network. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.removePeering({ * // Name of the network resource to remove peering from. - * network: 'my-network', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.networks.removePeering(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.networks.removePeering * @memberOf! () * @@ -45050,58 +53678,79 @@ export namespace compute_v1 { * compute.networks.switchToCustomMode * @desc Switches the network mode from auto subnet mode to custom subnet mode. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.switchToCustomMode({ * // Name of the network to be updated. - * network: 'my-network', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.networks.switchToCustomMode(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.networks.switchToCustomMode * @memberOf! () * @@ -45178,6 +53827,88 @@ export namespace compute_v1 { /** * compute.networks.updatePeering * @desc Updates the specified network peering with the data included in the request Only the following fields can be modified: NetworkPeering.export_custom_routes, and NetworkPeering.import_custom_routes + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.networks.updatePeering({ + * // Name of the network resource which the updated peering is belonging to. + * network: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "networkPeering": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.networks.updatePeering * @memberOf! () * @@ -45507,6 +54238,90 @@ export namespace compute_v1 { /** * compute.nodeGroups.addNodes * @desc Adds specified number of nodes to the node group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.addNodes({ + * // Name of the NodeGroup resource. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "additionalNodeCount": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.addNodes * @memberOf! () * @@ -45585,6 +54400,76 @@ export namespace compute_v1 { /** * compute.nodeGroups.aggregatedList * @desc Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeGroups.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.aggregatedList * @memberOf! () * @@ -45667,6 +54552,82 @@ export namespace compute_v1 { /** * compute.nodeGroups.delete * @desc Deletes the specified NodeGroup resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.delete({ + * // Name of the NodeGroup resource to delete. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.delete * @memberOf! () * @@ -45744,6 +54705,90 @@ export namespace compute_v1 { /** * compute.nodeGroups.deleteNodes * @desc Deletes specified nodes from the node group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.deleteNodes({ + * // Name of the NodeGroup resource whose nodes will be deleted. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "nodes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.deleteNodes * @memberOf! () * @@ -45822,6 +54867,67 @@ export namespace compute_v1 { /** * compute.nodeGroups.get * @desc Returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request. Note: the "nodes" field should not be used. Use nodeGroups.listNodes instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeGroups.get({ + * // Name of the node group to return. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "maintenancePolicy": "my_maintenancePolicy", + * // "name": "my_name", + * // "nodeTemplate": "my_nodeTemplate", + * // "selfLink": "my_selfLink", + * // "size": 0, + * // "status": "my_status", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.get * @memberOf! () * @@ -45897,6 +55003,60 @@ export namespace compute_v1 { /** * compute.nodeGroups.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeGroups.getIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.getIamPolicy * @memberOf! () * @@ -45971,6 +55131,102 @@ export namespace compute_v1 { /** * compute.nodeGroups.insert * @desc Creates a NodeGroup resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.insert({ + * // Initial count of nodes in the node group. + * initialNodeCount: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "maintenancePolicy": "my_maintenancePolicy", + * // "name": "my_name", + * // "nodeTemplate": "my_nodeTemplate", + * // "selfLink": "my_selfLink", + * // "size": 0, + * // "status": "my_status", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.insert * @memberOf! () * @@ -46048,6 +55304,76 @@ export namespace compute_v1 { /** * compute.nodeGroups.list * @desc Retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeGroups.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.list * @memberOf! () * @@ -46125,6 +55451,78 @@ export namespace compute_v1 { /** * compute.nodeGroups.listNodes * @desc Lists nodes in the node group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeGroups.listNodes({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Name of the NodeGroup resource whose nodes you want to list. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.listNodes * @memberOf! () * @@ -46205,6 +55603,102 @@ export namespace compute_v1 { /** * compute.nodeGroups.patch * @desc Updates the specified node group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.patch({ + * // Name of the NodeGroup resource to update. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "maintenancePolicy": "my_maintenancePolicy", + * // "name": "my_name", + * // "nodeTemplate": "my_nodeTemplate", + * // "selfLink": "my_selfLink", + * // "size": 0, + * // "status": "my_status", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.patch * @memberOf! () * @@ -46282,6 +55776,69 @@ export namespace compute_v1 { /** * compute.nodeGroups.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.setIamPolicy * @memberOf! () * @@ -46357,6 +55914,90 @@ export namespace compute_v1 { /** * compute.nodeGroups.setNodeTemplate * @desc Updates the node template of the node group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeGroups.setNodeTemplate({ + * // Name of the NodeGroup resource to update. + * nodeGroup: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "nodeTemplate": "my_nodeTemplate" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.setNodeTemplate * @memberOf! () * @@ -46435,6 +56076,63 @@ export namespace compute_v1 { /** * compute.nodeGroups.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeGroups.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeGroups.testIamPermissions * @memberOf! () * @@ -46880,6 +56578,76 @@ export namespace compute_v1 { /** * compute.nodeTemplates.aggregatedList * @desc Retrieves an aggregated list of node templates. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTemplates.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.aggregatedList * @memberOf! () * @@ -46966,6 +56734,82 @@ export namespace compute_v1 { /** * compute.nodeTemplates.delete * @desc Deletes the specified NodeTemplate resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeTemplates.delete({ + * // Name of the NodeTemplate resource to delete. + * nodeTemplate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.delete * @memberOf! () * @@ -47043,6 +56887,67 @@ export namespace compute_v1 { /** * compute.nodeTemplates.get * @desc Returns the specified node template. Gets a list of available node templates by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTemplates.get({ + * // Name of the node template to return. + * nodeTemplate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "nodeAffinityLabels": {}, + * // "nodeType": "my_nodeType", + * // "nodeTypeFlexibility": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serverBinding": {}, + * // "status": "my_status", + * // "statusMessage": "my_statusMessage" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.get * @memberOf! () * @@ -47119,6 +57024,60 @@ export namespace compute_v1 { /** * compute.nodeTemplates.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTemplates.getIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.getIamPolicy * @memberOf! () * @@ -47193,6 +57152,100 @@ export namespace compute_v1 { /** * compute.nodeTemplates.insert * @desc Creates a NodeTemplate resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeTemplates.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "nodeAffinityLabels": {}, + * // "nodeType": "my_nodeType", + * // "nodeTypeFlexibility": {}, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "serverBinding": {}, + * // "status": "my_status", + * // "statusMessage": "my_statusMessage" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.insert * @memberOf! () * @@ -47270,6 +57323,76 @@ export namespace compute_v1 { /** * compute.nodeTemplates.list * @desc Retrieves a list of node templates available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTemplates.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.list * @memberOf! () * @@ -47349,6 +57472,69 @@ export namespace compute_v1 { /** * compute.nodeTemplates.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.nodeTemplates.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.setIamPolicy * @memberOf! () * @@ -47424,6 +57610,63 @@ export namespace compute_v1 { /** * compute.nodeTemplates.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTemplates.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTemplates.testIamPermissions * @memberOf! () * @@ -47716,6 +57959,76 @@ export namespace compute_v1 { /** * compute.nodeTypes.aggregatedList * @desc Retrieves an aggregated list of node types. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTypes.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTypes.aggregatedList * @memberOf! () * @@ -47798,6 +58111,66 @@ export namespace compute_v1 { /** * compute.nodeTypes.get * @desc Returns the specified node type. Gets a list of available node types by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTypes.get({ + * // Name of the node type to return. + * nodeType: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cpuPlatform": "my_cpuPlatform", + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "guestCpus": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "localSsdGb": 0, + * // "memoryMb": 0, + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTypes.get * @memberOf! () * @@ -47871,6 +58244,76 @@ export namespace compute_v1 { /** * compute.nodeTypes.list * @desc Retrieves a list of node types available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.nodeTypes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.nodeTypes.list * @memberOf! () * @@ -48038,6 +58481,76 @@ export namespace compute_v1 { /** * compute.packetMirrorings.aggregatedList * @desc Retrieves an aggregated list of packetMirrorings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.packetMirrorings.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.aggregatedList * @memberOf! () * @@ -48126,6 +58639,82 @@ export namespace compute_v1 { /** * compute.packetMirrorings.delete * @desc Deletes the specified PacketMirroring resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.packetMirrorings.delete({ + * // Name of the PacketMirroring resource to delete. + * packetMirroring: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.delete * @memberOf! () * @@ -48203,6 +58792,67 @@ export namespace compute_v1 { /** * compute.packetMirrorings.get * @desc Returns the specified PacketMirroring resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.packetMirrorings.get({ + * // Name of the PacketMirroring resource to return. + * packetMirroring: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "collectorIlb": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enable": "my_enable", + * // "filter": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mirroredResources": {}, + * // "name": "my_name", + * // "network": {}, + * // "priority": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.get * @memberOf! () * @@ -48279,6 +58929,100 @@ export namespace compute_v1 { /** * compute.packetMirrorings.insert * @desc Creates a PacketMirroring resource in the specified project and region using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.packetMirrorings.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "collectorIlb": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enable": "my_enable", + * // "filter": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mirroredResources": {}, + * // "name": "my_name", + * // "network": {}, + * // "priority": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.insert * @memberOf! () * @@ -48356,6 +59100,76 @@ export namespace compute_v1 { /** * compute.packetMirrorings.list * @desc Retrieves a list of PacketMirroring resources available to the specified project and region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.packetMirrorings.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.list * @memberOf! () * @@ -48435,6 +59249,102 @@ export namespace compute_v1 { /** * compute.packetMirrorings.patch * @desc Patches the specified PacketMirroring resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.packetMirrorings.patch({ + * // Name of the PacketMirroring resource to patch. + * packetMirroring: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "collectorIlb": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enable": "my_enable", + * // "filter": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "mirroredResources": {}, + * // "name": "my_name", + * // "network": {}, + * // "priority": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.patch * @memberOf! () * @@ -48513,6 +59423,63 @@ export namespace compute_v1 { /** * compute.packetMirrorings.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.packetMirrorings.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.packetMirrorings.testIamPermissions * @memberOf! () * @@ -48790,55 +59757,77 @@ export namespace compute_v1 { * compute.projects.disableXpnHost * @desc Disable this project as a shared VPC host project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.disableXpnHost({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.projects.disableXpnHost(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.disableXpnHost * @memberOf! () * @@ -48914,59 +59903,85 @@ export namespace compute_v1 { * compute.projects.disableXpnResource * @desc Disable a service resource (also known as service project) associated with this host project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.disableXpnResource({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "xpnResource": {} + * // } * }, - * - * auth: authClient, - * }; - * - * compute.projects.disableXpnResource(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.disableXpnResource * @memberOf! () * @@ -49043,55 +60058,77 @@ export namespace compute_v1 { * compute.projects.enableXpnHost * @desc Enable this project as a shared VPC host project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.enableXpnHost({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.projects.enableXpnHost(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.enableXpnHost * @memberOf! () * @@ -49167,59 +60204,85 @@ export namespace compute_v1 { * compute.projects.enableXpnResource * @desc Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.enableXpnResource({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "xpnResource": {} + * // } * }, - * - * auth: authClient, - * }; - * - * compute.projects.enableXpnResource(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.enableXpnResource * @memberOf! () * @@ -49296,55 +60359,62 @@ export namespace compute_v1 { * compute.projects.get * @desc Returns the specified Project resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.projects.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.projects.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "commonInstanceMetadata": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultNetworkTier": "my_defaultNetworkTier", + * // "defaultServiceAccount": "my_defaultServiceAccount", + * // "description": "my_description", + * // "enabledFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "quotas": [], + * // "selfLink": "my_selfLink", + * // "usageExportLocation": {}, + * // "xpnProjectStatus": "my_xpnProjectStatus" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.get * @memberOf! () * @@ -49417,55 +60487,61 @@ export namespace compute_v1 { * compute.projects.getXpnHost * @desc Gets the shared VPC host project that this project links to. May be empty if no link exists. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.getXpnHost({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.projects.getXpnHost(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "commonInstanceMetadata": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultNetworkTier": "my_defaultNetworkTier", + * // "defaultServiceAccount": "my_defaultServiceAccount", + * // "description": "my_description", + * // "enabledFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "quotas": [], + * // "selfLink": "my_selfLink", + * // "usageExportLocation": {}, + * // "xpnProjectStatus": "my_xpnProjectStatus" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.getXpnHost * @memberOf! () * @@ -49538,68 +60614,69 @@ export namespace compute_v1 { * compute.projects.getXpnResources * @desc Gets service resources (a.k.a service project) associated with this host project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.getXpnResources({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var resourcesPage = response['resources']; - * if (!resourcesPage) { - * return; - * } - * for (var i = 0; i < resourcesPage.length; i++) { - * // TODO: Change code below to process each resource in `resourcesPage`: - * console.log(JSON.stringify(resourcesPage[i], null, 2)); - * } + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.projects.getXpnResources(request, handlePage); - * } - * }; + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } * - * compute.projects.getXpnResources(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.getXpnResources * @memberOf! () * @@ -49682,72 +60759,80 @@ export namespace compute_v1 { * compute.projects.listXpnHosts * @desc Lists all shared VPC host projects visible to the user in an organization. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.listXpnHosts({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "organization": "my_organization" + * // } * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.projects.listXpnHosts(request, handlePage); - * } - * }; - * - * compute.projects.listXpnHosts(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.listXpnHosts * @memberOf! () * @@ -49827,59 +60912,86 @@ export namespace compute_v1 { * compute.projects.moveDisk * @desc Moves a persistent disk from one zone to another. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.moveDisk({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destinationZone": "my_destinationZone", + * // "targetDisk": "my_targetDisk" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.projects.moveDisk(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.moveDisk * @memberOf! () * @@ -49957,59 +61069,86 @@ export namespace compute_v1 { * compute.projects.moveInstance * @desc Moves an instance and its attached persistent disks from one zone to another. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.moveInstance({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destinationZone": "my_destinationZone", + * // "targetInstance": "my_targetInstance" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.projects.moveInstance(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.moveInstance * @memberOf! () * @@ -50086,59 +61225,87 @@ export namespace compute_v1 { * compute.projects.setCommonInstanceMetadata * @desc Sets metadata common to all instances within the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.setCommonInstanceMetadata({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "items": [], + * // "kind": "my_kind" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.projects.setCommonInstanceMetadata(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.setCommonInstanceMetadata * @memberOf! () * @@ -50217,6 +61384,86 @@ export namespace compute_v1 { /** * compute.projects.setDefaultNetworkTier * @desc Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.projects.setDefaultNetworkTier({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "networkTier": "my_networkTier" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.projects.setDefaultNetworkTier * @memberOf! () * @@ -50295,59 +61542,89 @@ export namespace compute_v1 { * compute.projects.setUsageExportBucket * @desc Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 compute.projects.setUsageExportBucket({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucketName": "my_bucketName", + * // "reportNamePrefix": "my_reportNamePrefix" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.projects.setUsageExportBucket(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.projects.setUsageExportBucket * @memberOf! () * @@ -50697,61 +61974,81 @@ export namespace compute_v1 { * compute.regionAutoscalers.delete * @desc Deletes the specified autoscaler. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionAutoscalers.delete({ + * // Name of the autoscaler to delete. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the autoscaler to delete. - * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionAutoscalers.delete * @memberOf! () * @@ -50830,61 +62127,66 @@ export namespace compute_v1 { * compute.regionAutoscalers.get * @desc Returns the specified autoscaler. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionAutoscalers.get({ + * // Name of the autoscaler to return. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the autoscaler to return. - * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionAutoscalers.get * @memberOf! () * @@ -50962,62 +62264,99 @@ export namespace compute_v1 { * compute.regionAutoscalers.insert * @desc Creates an autoscaler in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionAutoscalers.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionAutoscalers.insert * @memberOf! () * @@ -51096,71 +62435,75 @@ export namespace compute_v1 { * compute.regionAutoscalers.list * @desc Retrieves a list of autoscalers contained within the specified region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionAutoscalers.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionAutoscalers.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.regionAutoscalers.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionAutoscalers.list * @memberOf! () * @@ -51243,63 +62586,101 @@ export namespace compute_v1 { * compute.regionAutoscalers.patch * @desc Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionAutoscalers.patch({ + * // Name of the autoscaler to patch. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionAutoscalers.patch * @memberOf! () * @@ -51379,63 +62760,101 @@ export namespace compute_v1 { * compute.regionAutoscalers.update * @desc Updates an autoscaler in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionAutoscalers.update({ + * // Name of the autoscaler to update. + * autoscaler: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscalingPolicy": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "recommendedSize": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "statusDetails": [], + * // "target": "my_target", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionAutoscalers.update * @memberOf! () * @@ -51682,61 +63101,81 @@ export namespace compute_v1 { * compute.regionBackendServices.delete * @desc Deletes the specified regional BackendService resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionBackendServices.delete({ + * // Name of the BackendService resource to delete. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to delete. - * backendService: 'my-backend-service', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionBackendServices.delete * @memberOf! () * @@ -51815,61 +63254,83 @@ export namespace compute_v1 { * compute.regionBackendServices.get * @desc Returns the specified regional BackendService resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionBackendServices.get({ + * // Name of the BackendService resource to return. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to return. - * backendService: 'my-backend-service', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "selfLink": "my_selfLink", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionBackendServices.get * @memberOf! () * @@ -51947,64 +63408,63 @@ export namespace compute_v1 { * compute.regionBackendServices.getHealth * @desc Gets the most recent health check results for this regional BackendService. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * project: 'my-project', // TODO: Update placeholder value. - * + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionBackendServices.getHealth({ + * // Name of the BackendService resource for which to get health. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to which the queried instance belongs. - * backendService: 'my-backend-service', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "group": "my_group" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.regionBackendServices.getHealth(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "healthStatus": [], + * // "kind": "my_kind" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionBackendServices.getHealth * @memberOf! () * @@ -52090,62 +63550,116 @@ export namespace compute_v1 { * compute.regionBackendServices.insert * @desc Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Understanding backend services for more information. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionBackendServices.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "selfLink": "my_selfLink", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionBackendServices.insert * @memberOf! () * @@ -52224,71 +63738,75 @@ export namespace compute_v1 { * compute.regionBackendServices.list * @desc Retrieves the list of regional BackendService resources available to the specified project in the given region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionBackendServices.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionBackendServices.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.regionBackendServices.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionBackendServices.list * @memberOf! () * @@ -52369,66 +63887,118 @@ export namespace compute_v1 { * compute.regionBackendServices.patch * @desc Updates the specified regional BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionBackendServices.patch({ + * // Name of the BackendService resource to patch. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to patch. - * backendService: 'my-backend-service', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "selfLink": "my_selfLink", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionBackendServices.patch * @memberOf! () * @@ -52508,66 +64078,118 @@ export namespace compute_v1 { * compute.regionBackendServices.update * @desc Updates the specified regional BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionBackendServices.update({ + * // Name of the BackendService resource to update. + * backendService: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to update. - * backendService: 'my-backend-service', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "affinityCookieTtlSec": 0, + * // "backends": [], + * // "cdnPolicy": {}, + * // "circuitBreakers": {}, + * // "connectionDraining": {}, + * // "consistentHash": {}, + * // "creationTimestamp": "my_creationTimestamp", + * // "customRequestHeaders": [], + * // "description": "my_description", + * // "enableCDN": false, + * // "failoverPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "healthChecks": [], + * // "iap": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "loadBalancingScheme": "my_loadBalancingScheme", + * // "localityLbPolicy": "my_localityLbPolicy", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "outlierDetection": {}, + * // "port": 0, + * // "portName": "my_portName", + * // "protocol": "my_protocol", + * // "region": "my_region", + * // "securityPolicy": "my_securityPolicy", + * // "selfLink": "my_selfLink", + * // "sessionAffinity": "my_sessionAffinity", + * // "timeoutSec": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionBackendServices.update * @memberOf! () * @@ -52839,68 +64461,75 @@ export namespace compute_v1 { * compute.regionCommitments.aggregatedList * @desc Retrieves an aggregated list of commitments. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionCommitments.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionCommitments.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.regionCommitments.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionCommitments.aggregatedList * @memberOf! () * @@ -52984,61 +64613,67 @@ export namespace compute_v1 { * compute.regionCommitments.get * @desc Returns the specified commitment resource. Gets a list of available commitments by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionCommitments.get({ + * // Name of the commitment to return. + * commitment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the commitment to return. - * commitment: 'my-commitment', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionCommitments.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTimestamp": "my_endTimestamp", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "plan": "my_plan", + * // "region": "my_region", + * // "reservations": [], + * // "resources": [], + * // "selfLink": "my_selfLink", + * // "startTimestamp": "my_startTimestamp", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionCommitments.get * @memberOf! () * @@ -53116,62 +64751,100 @@ export namespace compute_v1 { * compute.regionCommitments.insert * @desc Creates a commitment in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionCommitments.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTimestamp": "my_endTimestamp", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "plan": "my_plan", + * // "region": "my_region", + * // "reservations": [], + * // "resources": [], + * // "selfLink": "my_selfLink", + * // "startTimestamp": "my_startTimestamp", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionCommitments.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionCommitments.insert * @memberOf! () * @@ -53250,71 +64923,75 @@ export namespace compute_v1 { * compute.regionCommitments.list * @desc Retrieves a list of commitments contained within the specified region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionCommitments.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionCommitments.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.regionCommitments.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionCommitments.list * @memberOf! () * @@ -53511,6 +65188,90 @@ export namespace compute_v1 { /** * compute.regionDisks.addResourcePolicies * @desc Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.addResourcePolicies({ + * // The disk name for this request. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourcePolicies": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.addResourcePolicies * @memberOf! () * @@ -53589,6 +65350,110 @@ export namespace compute_v1 { /** * compute.regionDisks.createSnapshot * @desc Creates a snapshot of this regional disk. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.createSnapshot({ + * // Name of the regional persistent disk to snapshot. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoCreated": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "downloadBytes": "my_downloadBytes", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "snapshotEncryptionKey": {}, + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskEncryptionKey": {}, + * // "sourceDiskId": "my_sourceDiskId", + * // "status": "my_status", + * // "storageBytes": "my_storageBytes", + * // "storageBytesStatus": "my_storageBytesStatus", + * // "storageLocations": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.createSnapshot * @memberOf! () * @@ -53667,6 +65532,82 @@ export namespace compute_v1 { /** * compute.regionDisks.delete * @desc Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.delete({ + * // Name of the regional persistent disk to delete. + * disk: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.delete * @memberOf! () * @@ -53744,6 +65685,84 @@ export namespace compute_v1 { /** * compute.regionDisks.get * @desc Returns a specified regional persistent disk. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionDisks.get({ + * // Name of the regional persistent disk to return. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskEncryptionKey": {}, + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "lastAttachTimestamp": "my_lastAttachTimestamp", + * // "lastDetachTimestamp": "my_lastDetachTimestamp", + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "options": "my_options", + * // "physicalBlockSizeBytes": "my_physicalBlockSizeBytes", + * // "region": "my_region", + * // "replicaZones": [], + * // "resourcePolicies": [], + * // "selfLink": "my_selfLink", + * // "sizeGb": "my_sizeGb", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "status": "my_status", + * // "type": "my_type", + * // "users": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.get * @memberOf! () * @@ -53817,6 +65836,119 @@ export namespace compute_v1 { /** * compute.regionDisks.insert * @desc Creates a persistent regional disk in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Optional. Source image to restore onto a disk. + * sourceImage: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskEncryptionKey": {}, + * // "guestOsFeatures": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "lastAttachTimestamp": "my_lastAttachTimestamp", + * // "lastDetachTimestamp": "my_lastDetachTimestamp", + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "options": "my_options", + * // "physicalBlockSizeBytes": "my_physicalBlockSizeBytes", + * // "region": "my_region", + * // "replicaZones": [], + * // "resourcePolicies": [], + * // "selfLink": "my_selfLink", + * // "sizeGb": "my_sizeGb", + * // "sourceImage": "my_sourceImage", + * // "sourceImageEncryptionKey": {}, + * // "sourceImageId": "my_sourceImageId", + * // "sourceSnapshot": "my_sourceSnapshot", + * // "sourceSnapshotEncryptionKey": {}, + * // "sourceSnapshotId": "my_sourceSnapshotId", + * // "status": "my_status", + * // "type": "my_type", + * // "users": [], + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.insert * @memberOf! () * @@ -53894,6 +66026,76 @@ export namespace compute_v1 { /** * compute.regionDisks.list * @desc Retrieves the list of persistent disks contained within the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionDisks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.list * @memberOf! () * @@ -53969,6 +66171,90 @@ export namespace compute_v1 { /** * compute.regionDisks.removeResourcePolicies * @desc Removes resource policies from a regional disk. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.removeResourcePolicies({ + * // The disk name for this request. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourcePolicies": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.removeResourcePolicies * @memberOf! () * @@ -54049,6 +66335,90 @@ export namespace compute_v1 { /** * compute.regionDisks.resize * @desc Resizes the specified regional persistent disk. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.resize({ + * // Name of the regional persistent disk. + * disk: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sizeGb": "my_sizeGb" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.resize * @memberOf! () * @@ -54127,6 +66497,91 @@ export namespace compute_v1 { /** * compute.regionDisks.setLabels * @desc Sets the labels on the target regional disk. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionDisks.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.setLabels * @memberOf! () * @@ -54205,6 +66660,63 @@ export namespace compute_v1 { /** * compute.regionDisks.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionDisks.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDisks.testIamPermissions * @memberOf! () * @@ -54567,6 +67079,65 @@ export namespace compute_v1 { /** * compute.regionDiskTypes.get * @desc Returns the specified regional disk type. Gets a list of available disk types by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionDiskTypes.get({ + * // Name of the disk type to return. + * diskType: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultDiskSizeGb": "my_defaultDiskSizeGb", + * // "deprecated": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "validDiskSize": "my_validDiskSize", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDiskTypes.get * @memberOf! () * @@ -54641,6 +67212,76 @@ export namespace compute_v1 { /** * compute.regionDiskTypes.list * @desc Retrieves a list of regional disk types available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionDiskTypes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionDiskTypes.list * @memberOf! () * @@ -54780,6 +67421,82 @@ export namespace compute_v1 { /** * compute.regionHealthChecks.delete * @desc Deletes the specified HealthCheck resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionHealthChecks.delete({ + * // Name of the HealthCheck resource to delete. + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthChecks.delete * @memberOf! () * @@ -54857,6 +67574,71 @@ export namespace compute_v1 { /** * compute.regionHealthChecks.get * @desc Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionHealthChecks.get({ + * // Name of the HealthCheck resource to return. + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "unhealthyThreshold": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthChecks.get * @memberOf! () * @@ -54933,6 +67715,104 @@ export namespace compute_v1 { /** * compute.regionHealthChecks.insert * @desc Creates a HealthCheck resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionHealthChecks.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "unhealthyThreshold": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthChecks.insert * @memberOf! () * @@ -55010,6 +67890,76 @@ export namespace compute_v1 { /** * compute.regionHealthChecks.list * @desc Retrieves the list of HealthCheck resources available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionHealthChecks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthChecks.list * @memberOf! () * @@ -55089,6 +68039,106 @@ export namespace compute_v1 { /** * compute.regionHealthChecks.patch * @desc Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionHealthChecks.patch({ + * // Name of the HealthCheck resource to patch. + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "unhealthyThreshold": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthChecks.patch * @memberOf! () * @@ -55167,6 +68217,106 @@ export namespace compute_v1 { /** * compute.regionHealthChecks.update * @desc Updates a HealthCheck resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionHealthChecks.update({ + * // Name of the HealthCheck resource to update. + * healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "checkIntervalSec": 0, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "healthyThreshold": 0, + * // "http2HealthCheck": {}, + * // "httpHealthCheck": {}, + * // "httpsHealthCheck": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslHealthCheck": {}, + * // "tcpHealthCheck": {}, + * // "timeoutSec": 0, + * // "type": "my_type", + * // "unhealthyThreshold": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionHealthChecks.update * @memberOf! () * @@ -55413,65 +68563,89 @@ export namespace compute_v1 { * compute.regionInstanceGroupManagers.abandonInstances * @desc Flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.abandonInstances({ + * // Name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.abandonInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.abandonInstances * @memberOf! () * @@ -55550,6 +68724,88 @@ export namespace compute_v1 { /** * compute.regionInstanceGroupManagers.applyUpdatesToInstances * @desc Apply updates to selected instances the managed instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.applyUpdatesToInstances( + * { + * // The name of the managed instance group, should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request, should conform to RFC1035. + * region: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [], + * // "minimalAction": "my_minimalAction", + * // "mostDisruptiveAllowedAction": "my_mostDisruptiveAllowedAction" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.applyUpdatesToInstances * @memberOf! () * @@ -55629,6 +68885,90 @@ export namespace compute_v1 { /** * compute.regionInstanceGroupManagers.createInstances * @desc Creates instances with per-instance configs in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.createInstances({ + * // The name of the managed instance group. It should conform to RFC1035. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region where the managed instance group is located. It should conform to RFC1035. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.createInstances * @memberOf! () * @@ -55708,61 +69048,81 @@ export namespace compute_v1 { * compute.regionInstanceGroupManagers.delete * @desc Deletes the specified managed instance group and all of the instances in that group. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.delete({ + * // Name of the managed instance group to delete. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group to delete. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.delete * @memberOf! () * @@ -55841,65 +69201,89 @@ export namespace compute_v1 { * compute.regionInstanceGroupManagers.deleteInstances * @desc Flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.deleteInstances({ + * // Name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.deleteInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.deleteInstances * @memberOf! () * @@ -55979,61 +69363,74 @@ export namespace compute_v1 { * compute.regionInstanceGroupManagers.get * @desc Returns all of the details about the specified managed instance group. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroupManagers.get({ + * // Name of the managed instance group to return. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group to return. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.get * @memberOf! () * @@ -56113,62 +69510,107 @@ export namespace compute_v1 { * compute.regionInstanceGroupManagers.insert * @desc Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. A regional managed instance group can contain up to 2000 instances. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.insert * @memberOf! () * @@ -56247,71 +69689,75 @@ export namespace compute_v1 { * compute.regionInstanceGroupManagers.list * @desc Retrieves the list of managed instance groups that are contained within the specified region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroupManagers.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionInstanceGroupManagers.list(request, handlePage); - * } - * }; + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.regionInstanceGroupManagers.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.list * @memberOf! () * @@ -56400,6 +69846,74 @@ export namespace compute_v1 { /** * compute.regionInstanceGroupManagers.listErrors * @desc Lists all errors thrown by actions on instances for a given regional managed instance group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroupManagers.listErrors({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9][0-9]{0,19}. + * instanceGroupManager: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. This should conform to RFC1035. + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.listErrors * @memberOf! () * @@ -56506,61 +70020,73 @@ export namespace compute_v1 { * compute.regionInstanceGroupManagers.listManagedInstances * @desc Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroupManagers.listManagedInstances({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * region: 'placeholder-value', + * }); + * console.log(res.data); * - * compute.regionInstanceGroupManagers.listManagedInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "managedInstances": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.listManagedInstances * @memberOf! () * @@ -56665,6 +70191,110 @@ export namespace compute_v1 { /** * compute.regionInstanceGroupManagers.patch * @desc Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.patch({ + * // The name of the instance group manager. + * instanceGroupManager: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoHealingPolicies": [], + * // "baseInstanceName": "my_baseInstanceName", + * // "creationTimestamp": "my_creationTimestamp", + * // "currentActions": {}, + * // "description": "my_description", + * // "distributionPolicy": {}, + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "instanceGroup": "my_instanceGroup", + * // "instanceTemplate": "my_instanceTemplate", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": {}, + * // "targetPools": [], + * // "targetSize": 0, + * // "updatePolicy": {}, + * // "versions": [], + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionInstanceGroupManagers.patch * @memberOf! () * @@ -56744,65 +70374,89 @@ export namespace compute_v1 { * compute.regionInstanceGroupManagers.recreateInstances * @desc Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.recreateInstances({ + * // Name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.recreateInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.recreateInstances * @memberOf! () * @@ -56882,64 +70536,83 @@ export namespace compute_v1 { * compute.regionInstanceGroupManagers.resize * @desc Changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances. The resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.resize({ + * // Name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Number of instances that should exist in this instance group manager. - * size: 0, // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.resize(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * size: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.resize * @memberOf! () * @@ -57019,65 +70692,89 @@ export namespace compute_v1 { * compute.regionInstanceGroupManagers.setInstanceTemplate * @desc Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.setInstanceTemplate({ + * // The name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instanceTemplate": "my_instanceTemplate" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.setInstanceTemplate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.setInstanceTemplate * @memberOf! () * @@ -57157,65 +70854,90 @@ export namespace compute_v1 { * compute.regionInstanceGroupManagers.setTargetPools * @desc Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroupManagers.setTargetPools({ + * // Name of the managed instance group. + * instanceGroupManager: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "targetPools": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.setTargetPools(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroupManagers.setTargetPools * @memberOf! () * @@ -57732,61 +71454,66 @@ export namespace compute_v1 { * compute.regionInstanceGroups.get * @desc Returns the specified instance group resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroups.get({ + * // Name of the instance group resource to return. + * instanceGroup: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the instance group resource to return. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroups.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "namedPorts": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "size": 0, + * // "subnetwork": "my_subnetwork", + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroups.get * @memberOf! () * @@ -57864,71 +71591,75 @@ export namespace compute_v1 { * compute.regionInstanceGroups.list * @desc Retrieves the list of instance group resources contained within the specified region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroups.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionInstanceGroups.list(request, handlePage); - * } - * }; + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.regionInstanceGroups.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroups.list * @memberOf! () * @@ -58011,78 +71742,86 @@ export namespace compute_v1 { * compute.regionInstanceGroups.listInstances * @desc Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionInstanceGroups.listInstances({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Name of the regional instance group for which we want to list the instances. + * instanceGroup: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the regional instance group for which we want to list the instances. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instanceState": "my_instanceState", + * // "portName": "my_portName" + * // } * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionInstanceGroups.listInstances(request, handlePage); - * } - * }; - * - * compute.regionInstanceGroups.listInstances(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroups.listInstances * @memberOf! () * @@ -58174,65 +71913,90 @@ export namespace compute_v1 { * compute.regionInstanceGroups.setNamedPorts * @desc Sets the named ports for the specified regional instance group. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionInstanceGroups.setNamedPorts({ + * // The name of the regional instance group where the named ports are updated. + * instanceGroup: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // The name of the regional instance group where the named ports are updated. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: 'placeholder-value', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint", + * // "namedPorts": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroups.setNamedPorts(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionInstanceGroups.setNamedPorts * @memberOf! () * @@ -58442,58 +72206,48 @@ export namespace compute_v1 { * compute.regionOperations.delete * @desc Deletes the specified region-specific Operations resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionOperations.delete({ + * // Name of the Operations resource to delete. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Operations resource to delete. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionOperations.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionOperations.delete * @memberOf! () * @@ -58569,61 +72323,76 @@ export namespace compute_v1 { * compute.regionOperations.get * @desc Retrieves the specified region-specific Operations resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionOperations.get({ + * // Name of the Operations resource to return. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Operations resource to return. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionOperations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionOperations.get * @memberOf! () * @@ -58701,71 +72470,75 @@ export namespace compute_v1 { * compute.regionOperations.list * @desc Retrieves a list of Operation resources contained within the specified region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionOperations.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionOperations.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.regionOperations.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regionOperations.list * @memberOf! () * @@ -58845,6 +72618,77 @@ export namespace compute_v1 { /** * compute.regionOperations.wait * @desc Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionOperations.wait({ + * // Name of the Operations resource to return. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionOperations.wait * @memberOf! () * @@ -59022,58 +72866,61 @@ export namespace compute_v1 { * compute.regions.get * @desc Returns the specified Region resource. Gets a list of available regions by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regions.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region resource to return. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regions.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "quotas": [], + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "zones": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regions.get * @memberOf! () * @@ -59146,68 +72993,73 @@ export namespace compute_v1 { * compute.regions.list * @desc Retrieves the list of region resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regions.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regions.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.regions.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.regions.list * @memberOf! () * @@ -59335,6 +73187,82 @@ export namespace compute_v1 { /** * compute.regionSslCertificates.delete * @desc Deletes the specified SslCertificate resource in the region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionSslCertificates.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the SslCertificate resource to delete. + * sslCertificate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionSslCertificates.delete * @memberOf! () * @@ -59412,6 +73340,68 @@ export namespace compute_v1 { /** * compute.regionSslCertificates.get * @desc Returns the specified SslCertificate resource in the specified region. Get a list of available SSL certificates by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionSslCertificates.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the SslCertificate resource to return. + * sslCertificate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificate": "my_certificate", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "managed": {}, + * // "name": "my_name", + * // "privateKey": "my_privateKey", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfManaged": {}, + * // "subjectAlternativeNames": [], + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionSslCertificates.get * @memberOf! () * @@ -59488,6 +73478,101 @@ export namespace compute_v1 { /** * compute.regionSslCertificates.insert * @desc Creates a SslCertificate resource in the specified project and region using the data included in the request + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionSslCertificates.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "certificate": "my_certificate", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "managed": {}, + * // "name": "my_name", + * // "privateKey": "my_privateKey", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfManaged": {}, + * // "subjectAlternativeNames": [], + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionSslCertificates.insert * @memberOf! () * @@ -59565,6 +73650,76 @@ export namespace compute_v1 { /** * compute.regionSslCertificates.list * @desc Retrieves the list of SslCertificate resources available to the specified project in the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionSslCertificates.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionSslCertificates.list * @memberOf! () * @@ -59753,6 +73908,82 @@ export namespace compute_v1 { /** * compute.regionTargetHttpProxies.delete * @desc Deletes the specified TargetHttpProxy resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpProxies.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpProxy resource to delete. + * targetHttpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpProxies.delete * @memberOf! () * @@ -59830,6 +74061,62 @@ export namespace compute_v1 { /** * compute.regionTargetHttpProxies.get * @desc Returns the specified TargetHttpProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionTargetHttpProxies.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the TargetHttpProxy resource to return. + * targetHttpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "urlMap": "my_urlMap" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpProxies.get * @memberOf! () * @@ -59906,6 +74193,95 @@ export namespace compute_v1 { /** * compute.regionTargetHttpProxies.insert * @desc Creates a TargetHttpProxy resource in the specified project and region using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpProxies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "urlMap": "my_urlMap" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpProxies.insert * @memberOf! () * @@ -59983,6 +74359,76 @@ export namespace compute_v1 { /** * compute.regionTargetHttpProxies.list * @desc Retrieves the list of TargetHttpProxy resources available to the specified project in the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionTargetHttpProxies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpProxies.list * @memberOf! () * @@ -60062,6 +74508,90 @@ export namespace compute_v1 { /** * compute.regionTargetHttpProxies.setUrlMap * @desc Changes the URL map for TargetHttpProxy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpProxies.setUrlMap({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpProxy to set a URL map for. + * targetHttpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "urlMap": "my_urlMap" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpProxies.setUrlMap * @memberOf! () * @@ -60278,6 +74808,82 @@ export namespace compute_v1 { /** * compute.regionTargetHttpsProxies.delete * @desc Deletes the specified TargetHttpsProxy resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpsProxies.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpsProxy resource to delete. + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpsProxies.delete * @memberOf! () * @@ -60355,6 +74961,65 @@ export namespace compute_v1 { /** * compute.regionTargetHttpsProxies.get * @desc Returns the specified TargetHttpsProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionTargetHttpsProxies.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the TargetHttpsProxy resource to return. + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "quicOverride": "my_quicOverride", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslCertificates": [], + * // "sslPolicy": "my_sslPolicy", + * // "urlMap": "my_urlMap" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpsProxies.get * @memberOf! () * @@ -60431,6 +75096,98 @@ export namespace compute_v1 { /** * compute.regionTargetHttpsProxies.insert * @desc Creates a TargetHttpsProxy resource in the specified project and region using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpsProxies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "quicOverride": "my_quicOverride", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslCertificates": [], + * // "sslPolicy": "my_sslPolicy", + * // "urlMap": "my_urlMap" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpsProxies.insert * @memberOf! () * @@ -60508,6 +75265,76 @@ export namespace compute_v1 { /** * compute.regionTargetHttpsProxies.list * @desc Retrieves the list of TargetHttpsProxy resources available to the specified project in the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionTargetHttpsProxies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpsProxies.list * @memberOf! () * @@ -60589,6 +75416,90 @@ export namespace compute_v1 { /** * compute.regionTargetHttpsProxies.setSslCertificates * @desc Replaces SslCertificates for TargetHttpsProxy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpsProxies.setSslCertificates({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sslCertificates": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpsProxies.setSslCertificates * @memberOf! () * @@ -60667,6 +75578,90 @@ export namespace compute_v1 { /** * compute.regionTargetHttpsProxies.setUrlMap * @desc Changes the URL map for TargetHttpsProxy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionTargetHttpsProxies.setUrlMap({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpsProxy to set a URL map for. + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "urlMap": "my_urlMap" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionTargetHttpsProxies.setUrlMap * @memberOf! () * @@ -60912,6 +75907,78 @@ export namespace compute_v1 { /** * compute.regionUrlMaps.delete * @desc Deletes the specified UrlMap resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionUrlMaps.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * requestId: 'placeholder-value', + * // Name of the UrlMap resource to delete. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.delete * @memberOf! () * @@ -60989,6 +76056,69 @@ export namespace compute_v1 { /** * compute.regionUrlMaps.get * @desc Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionUrlMaps.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the UrlMap resource to return. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.get * @memberOf! () * @@ -61063,6 +76193,98 @@ export namespace compute_v1 { /** * compute.regionUrlMaps.insert * @desc Creates a UrlMap resource in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionUrlMaps.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.insert * @memberOf! () * @@ -61140,6 +76362,76 @@ export namespace compute_v1 { /** * compute.regionUrlMaps.list * @desc Retrieves the list of UrlMap resources available to the specified project in the specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.regionUrlMaps.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.list * @memberOf! () * @@ -61219,6 +76511,100 @@ export namespace compute_v1 { /** * compute.regionUrlMaps.patch * @desc Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionUrlMaps.patch({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * requestId: 'placeholder-value', + * // Name of the UrlMap resource to patch. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.patch * @memberOf! () * @@ -61297,6 +76683,100 @@ export namespace compute_v1 { /** * compute.regionUrlMaps.update * @desc Updates the specified UrlMap resource with the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionUrlMaps.update({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * requestId: 'placeholder-value', + * // Name of the UrlMap resource to update. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.update * @memberOf! () * @@ -61375,6 +76855,62 @@ export namespace compute_v1 { /** * compute.regionUrlMaps.validate * @desc Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.regionUrlMaps.validate({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the UrlMap resource to be validated as. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resource": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "result": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.regionUrlMaps.validate * @memberOf! () * @@ -61648,6 +77184,76 @@ export namespace compute_v1 { /** * compute.reservations.aggregatedList * @desc Retrieves an aggregated list of reservations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.reservations.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.aggregatedList * @memberOf! () * @@ -61733,6 +77339,82 @@ export namespace compute_v1 { /** * compute.reservations.delete * @desc Deletes the specified reservation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.reservations.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the reservation to delete. + * reservation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.delete * @memberOf! () * @@ -61810,6 +77492,65 @@ export namespace compute_v1 { /** * compute.reservations.get * @desc Retrieves information about the specified reservation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.reservations.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the reservation to retrieve. + * reservation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "commitment": "my_commitment", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "specificReservation": {}, + * // "specificReservationRequired": false, + * // "status": "my_status", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.get * @memberOf! () * @@ -61885,6 +77626,60 @@ export namespace compute_v1 { /** * compute.reservations.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.reservations.getIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.getIamPolicy * @memberOf! () * @@ -61959,6 +77754,98 @@ export namespace compute_v1 { /** * compute.reservations.insert * @desc Creates a new reservation. For more information, read Reserving zonal resources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.reservations.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "commitment": "my_commitment", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "specificReservation": {}, + * // "specificReservationRequired": false, + * // "status": "my_status", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.insert * @memberOf! () * @@ -62036,6 +77923,76 @@ export namespace compute_v1 { /** * compute.reservations.list * @desc A list of all the reservations that have been configured for the specified project in specified zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.reservations.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.list * @memberOf! () * @@ -62115,6 +78072,90 @@ export namespace compute_v1 { /** * compute.reservations.resize * @desc Resizes the reservation (applicable to standalone reservations only). For more information, read Modifying reservations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.reservations.resize({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the reservation to update. + * reservation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "specificSkuCount": "my_specificSkuCount" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.resize * @memberOf! () * @@ -62193,6 +78234,69 @@ export namespace compute_v1 { /** * compute.reservations.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.reservations.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.setIamPolicy * @memberOf! () * @@ -62268,6 +78372,63 @@ export namespace compute_v1 { /** * compute.reservations.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.reservations.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // The name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.reservations.testIamPermissions * @memberOf! () * @@ -62588,6 +78749,77 @@ export namespace compute_v1 { /** * compute.resourcePolicies.aggregatedList * @desc Retrieves an aggregated list of resource policies. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.resourcePolicies.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.aggregatedList * @memberOf! () * @@ -62676,6 +78908,82 @@ export namespace compute_v1 { /** * compute.resourcePolicies.delete * @desc Deletes the specified resource policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.resourcePolicies.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the resource policy to delete. + * resourcePolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.delete * @memberOf! () * @@ -62753,6 +79061,64 @@ export namespace compute_v1 { /** * compute.resourcePolicies.get * @desc Retrieves all information of the specified resource policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.resourcePolicies.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the resource policy to retrieve. + * resourcePolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "groupPlacementPolicy": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "snapshotSchedulePolicy": {}, + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.get * @memberOf! () * @@ -62829,6 +79195,60 @@ export namespace compute_v1 { /** * compute.resourcePolicies.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.resourcePolicies.getIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.getIamPolicy * @memberOf! () * @@ -62903,6 +79323,97 @@ export namespace compute_v1 { /** * compute.resourcePolicies.insert * @desc Creates a new resource policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.resourcePolicies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "groupPlacementPolicy": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "snapshotSchedulePolicy": {}, + * // "status": "my_status" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.insert * @memberOf! () * @@ -62980,6 +79491,77 @@ export namespace compute_v1 { /** * compute.resourcePolicies.list * @desc A list all the resource policies that have been configured for the specified project in specified region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.resourcePolicies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.list * @memberOf! () * @@ -63059,6 +79641,69 @@ export namespace compute_v1 { /** * compute.resourcePolicies.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.resourcePolicies.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.setIamPolicy * @memberOf! () * @@ -63134,6 +79779,63 @@ export namespace compute_v1 { /** * compute.resourcePolicies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.resourcePolicies.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.resourcePolicies.testIamPermissions * @memberOf! () * @@ -63427,68 +80129,75 @@ export namespace compute_v1 { * compute.routers.aggregatedList * @desc Retrieves an aggregated list of routers. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routers.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.routers.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.routers.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routers.aggregatedList * @memberOf! () * @@ -63572,61 +80281,81 @@ export namespace compute_v1 { * compute.routers.delete * @desc Deletes the specified Router resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.routers.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the Router resource to delete. - * router: 'my-router', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.routers.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routers.delete * @memberOf! () * @@ -63704,61 +80433,65 @@ export namespace compute_v1 { * compute.routers.get * @desc Returns the specified Router resource. Gets a list of available routers by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routers.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * // Name of the Router resource to return. - * router: 'my-router', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.routers.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bgp": {}, + * // "bgpPeers": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "nats": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routers.get * @memberOf! () * @@ -63832,6 +80565,78 @@ export namespace compute_v1 { /** * compute.routers.getNatMappingInfo * @desc Retrieves runtime Nat mapping information of VM endpoints. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routers.getNatMappingInfo({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the Router resource to query for Nat Mapping information of VM endpoints. + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "result": [], + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.routers.getNatMappingInfo * @memberOf! () * @@ -63920,61 +80725,55 @@ export namespace compute_v1 { * compute.routers.getRouterStatus * @desc Retrieves runtime information of the specified router. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routers.getRouterStatus({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * // Name of the Router resource to query. - * router: 'my-router', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); * - * compute.routers.getRouterStatus(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "kind": "my_kind", + * // "result": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routers.getRouterStatus * @memberOf! () * @@ -64056,62 +80855,98 @@ export namespace compute_v1 { * compute.routers.insert * @desc Creates a Router resource in the specified project and region using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.routers.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bgp": {}, + * // "bgpPeers": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "nats": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.routers.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routers.insert * @memberOf! () * @@ -64189,71 +81024,75 @@ export namespace compute_v1 { * compute.routers.list * @desc Retrieves a list of Router resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routers.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.routers.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.routers.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routers.list * @memberOf! () * @@ -64333,66 +81172,100 @@ export namespace compute_v1 { * compute.routers.patch * @desc Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.routers.patch({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the Router resource to patch. - * router: 'my-router', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bgp": {}, + * // "bgpPeers": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "nats": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.routers.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routers.patch * @memberOf! () * @@ -64471,65 +81344,73 @@ export namespace compute_v1 { * compute.routers.preview * @desc Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routers.preview({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * // Name of the Router resource to query. - * router: 'my-router', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bgp": {}, + * // "bgpPeers": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "nats": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.routers.preview(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "resource": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routers.preview * @memberOf! () * @@ -64611,66 +81492,100 @@ export namespace compute_v1 { * compute.routers.update * @desc Updates the specified Router resource with the data included in the request. This method conforms to PUT semantics, which requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.routers.update({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the Router resource to update. - * router: 'my-router', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * router: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bgp": {}, + * // "bgpPeers": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "interfaces": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "nats": [], + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.routers.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routers.update * @memberOf! () * @@ -65022,58 +81937,79 @@ export namespace compute_v1 { * compute.routes.delete * @desc Deletes the specified Route resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.routes.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the Route resource to delete. - * route: 'my-route', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.routes.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * route: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routes.delete * @memberOf! () * @@ -65149,58 +82085,69 @@ export namespace compute_v1 { * compute.routes.get * @desc Returns the specified Route resource. Gets a list of available routes by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routes.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the Route resource to return. - * route: 'my-route', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.routes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * route: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "destRange": "my_destRange", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "network": "my_network", + * // "nextHopGateway": "my_nextHopGateway", + * // "nextHopIlb": "my_nextHopIlb", + * // "nextHopInstance": "my_nextHopInstance", + * // "nextHopIp": "my_nextHopIp", + * // "nextHopNetwork": "my_nextHopNetwork", + * // "nextHopPeering": "my_nextHopPeering", + * // "nextHopVpnTunnel": "my_nextHopVpnTunnel", + * // "priority": 0, + * // "selfLink": "my_selfLink", + * // "tags": [], + * // "warnings": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routes.get * @memberOf! () * @@ -65273,59 +82220,102 @@ export namespace compute_v1 { * compute.routes.insert * @desc Creates a Route resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.routes.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "destRange": "my_destRange", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "network": "my_network", + * // "nextHopGateway": "my_nextHopGateway", + * // "nextHopIlb": "my_nextHopIlb", + * // "nextHopInstance": "my_nextHopInstance", + * // "nextHopIp": "my_nextHopIp", + * // "nextHopNetwork": "my_nextHopNetwork", + * // "nextHopPeering": "my_nextHopPeering", + * // "nextHopVpnTunnel": "my_nextHopVpnTunnel", + * // "priority": 0, + * // "selfLink": "my_selfLink", + * // "tags": [], + * // "warnings": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.routes.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routes.insert * @memberOf! () * @@ -65401,68 +82391,73 @@ export namespace compute_v1 { * compute.routes.list * @desc Retrieves the list of Route resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.routes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.routes.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.routes.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.routes.list * @memberOf! () * @@ -65628,6 +82623,87 @@ export namespace compute_v1 { /** * compute.securityPolicies.addRule * @desc Inserts a rule into a security policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.addRule({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the security policy to update. + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "kind": "my_kind", + * // "match": {}, + * // "preview": false, + * // "priority": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.addRule * @memberOf! () * @@ -65704,6 +82780,80 @@ export namespace compute_v1 { /** * compute.securityPolicies.delete * @desc Deletes the specified policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to delete. + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.delete * @memberOf! () * @@ -65780,6 +82930,60 @@ export namespace compute_v1 { /** * compute.securityPolicies.get * @desc List all of the ordered rules present in a single specified policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.securityPolicies.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the security policy to get. + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "rules": [], + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.get * @memberOf! () * @@ -65855,6 +83059,60 @@ export namespace compute_v1 { /** * compute.securityPolicies.getRule * @desc Gets a rule at the specified priority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.securityPolicies.getRule({ + * // The priority of the rule to get from the security policy. + * priority: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the security policy to which the queried rule belongs. + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "kind": "my_kind", + * // "match": {}, + * // "preview": false, + * // "priority": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.getRule * @memberOf! () * @@ -65931,6 +83189,93 @@ export namespace compute_v1 { /** * compute.securityPolicies.insert * @desc Creates a new policy in the specified project using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "rules": [], + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.insert * @memberOf! () * @@ -66006,6 +83351,73 @@ export namespace compute_v1 { /** * compute.securityPolicies.list * @desc List all the policies that have been configured for the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.securityPolicies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.list * @memberOf! () * @@ -66083,6 +83495,68 @@ export namespace compute_v1 { /** * compute.securityPolicies.listPreconfiguredExpressionSets * @desc Gets the current list of preconfigured Web Application Firewall (WAF) expressions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.listPreconfiguredExpressionSets({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "preconfiguredExpressionSets": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.listPreconfiguredExpressionSets * @memberOf! () * @@ -66187,6 +83661,95 @@ export namespace compute_v1 { /** * compute.securityPolicies.patch * @desc Patches the specified policy with the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.patch({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the security policy to update. + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "rules": [], + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.patch * @memberOf! () * @@ -66264,6 +83827,89 @@ export namespace compute_v1 { /** * compute.securityPolicies.patchRule * @desc Patches a rule at the specified priority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.patchRule({ + * // The priority of the rule to patch. + * priority: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the security policy to update. + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "description": "my_description", + * // "kind": "my_kind", + * // "match": {}, + * // "preview": false, + * // "priority": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.patchRule * @memberOf! () * @@ -66341,6 +83987,76 @@ export namespace compute_v1 { /** * compute.securityPolicies.removeRule * @desc Deletes a rule at the specified priority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.securityPolicies.removeRule({ + * // The priority of the rule to remove from the security policy. + * priority: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the security policy to update. + * securityPolicy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.securityPolicies.removeRule * @memberOf! () * @@ -66650,58 +84366,79 @@ export namespace compute_v1 { * compute.snapshots.delete * @desc Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. For more information, see Deleting snapshots. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.snapshots.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the Snapshot resource to delete. - * snapshot: 'my-snapshot', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.snapshots.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * snapshot: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.snapshots.delete * @memberOf! () * @@ -66778,58 +84515,72 @@ export namespace compute_v1 { * compute.snapshots.get * @desc Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.snapshots.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the Snapshot resource to return. - * snapshot: 'my-snapshot', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.snapshots.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * snapshot: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoCreated": false, + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "diskSizeGb": "my_diskSizeGb", + * // "downloadBytes": "my_downloadBytes", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "licenseCodes": [], + * // "licenses": [], + * // "name": "my_name", + * // "selfLink": "my_selfLink", + * // "snapshotEncryptionKey": {}, + * // "sourceDisk": "my_sourceDisk", + * // "sourceDiskEncryptionKey": {}, + * // "sourceDiskId": "my_sourceDiskId", + * // "status": "my_status", + * // "storageBytes": "my_storageBytes", + * // "storageBytesStatus": "my_storageBytesStatus", + * // "storageLocations": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.snapshots.get * @memberOf! () * @@ -66902,6 +84653,58 @@ export namespace compute_v1 { /** * compute.snapshots.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.snapshots.getIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.snapshots.getIamPolicy * @memberOf! () * @@ -66976,68 +84779,73 @@ export namespace compute_v1 { * compute.snapshots.list * @desc Retrieves the list of Snapshot resources contained within the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.snapshots.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.snapshots.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.snapshots.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.snapshots.list * @memberOf! () * @@ -67114,6 +84922,67 @@ export namespace compute_v1 { /** * compute.snapshots.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.snapshots.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.snapshots.setIamPolicy * @memberOf! () * @@ -67189,62 +85058,82 @@ export namespace compute_v1 { * compute.snapshots.setLabels * @desc Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.snapshots.setLabels({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } * }, - * - * auth: authClient, - * }; - * - * compute.snapshots.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.snapshots.setLabels * @memberOf! () * @@ -67321,6 +85210,61 @@ export namespace compute_v1 { /** * compute.snapshots.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.snapshots.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.snapshots.testIamPermissions * @memberOf! () * @@ -67549,6 +85493,76 @@ export namespace compute_v1 { /** * compute.sslCertificates.aggregatedList * @desc Retrieves the list of all SslCertificate resources, regional and global, available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslCertificates.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Name of the project scoping this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslCertificates.aggregatedList * @memberOf! () * @@ -67638,58 +85652,79 @@ export namespace compute_v1 { * compute.sslCertificates.delete * @desc Deletes the specified SslCertificate resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.sslCertificates.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the SslCertificate resource to delete. - * sslCertificate: 'my-ssl-certificate', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.sslCertificates.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * sslCertificate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.sslCertificates.delete * @memberOf! () * @@ -67767,58 +85802,65 @@ export namespace compute_v1 { * compute.sslCertificates.get * @desc Returns the specified SslCertificate resource. Gets a list of available SSL certificates by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslCertificates.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the SslCertificate resource to return. - * sslCertificate: 'my-ssl-certificate', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.sslCertificates.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * sslCertificate: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificate": "my_certificate", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "managed": {}, + * // "name": "my_name", + * // "privateKey": "my_privateKey", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfManaged": {}, + * // "subjectAlternativeNames": [], + * // "type": "my_type" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.sslCertificates.get * @memberOf! () * @@ -67895,59 +85937,98 @@ export namespace compute_v1 { * compute.sslCertificates.insert * @desc Creates a SslCertificate resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.sslCertificates.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "certificate": "my_certificate", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "managed": {}, + * // "name": "my_name", + * // "privateKey": "my_privateKey", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "selfManaged": {}, + * // "subjectAlternativeNames": [], + * // "type": "my_type" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.sslCertificates.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.sslCertificates.insert * @memberOf! () * @@ -68024,68 +86105,73 @@ export namespace compute_v1 { * compute.sslCertificates.list * @desc Retrieves the list of SslCertificate resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslCertificates.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.sslCertificates.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.sslCertificates.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.sslCertificates.list * @memberOf! () * @@ -68288,6 +86374,80 @@ export namespace compute_v1 { /** * compute.sslPolicies.delete * @desc Deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.sslPolicies.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. + * sslPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslPolicies.delete * @memberOf! () * @@ -68364,6 +86524,64 @@ export namespace compute_v1 { /** * compute.sslPolicies.get * @desc Lists all of the ordered rules present in a single specified policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslPolicies.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * sslPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "customFeatures": [], + * // "description": "my_description", + * // "enabledFeatures": [], + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "minTlsVersion": "my_minTlsVersion", + * // "name": "my_name", + * // "profile": "my_profile", + * // "selfLink": "my_selfLink", + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslPolicies.get * @memberOf! () * @@ -68438,6 +86656,97 @@ export namespace compute_v1 { /** * compute.sslPolicies.insert * @desc Returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.sslPolicies.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "customFeatures": [], + * // "description": "my_description", + * // "enabledFeatures": [], + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "minTlsVersion": "my_minTlsVersion", + * // "name": "my_name", + * // "profile": "my_profile", + * // "selfLink": "my_selfLink", + * // "warnings": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslPolicies.insert * @memberOf! () * @@ -68513,6 +86822,74 @@ export namespace compute_v1 { /** * compute.sslPolicies.list * @desc Lists all the SSL policies that have been configured for the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslPolicies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslPolicies.list * @memberOf! () * @@ -68589,6 +86966,69 @@ export namespace compute_v1 { /** * compute.sslPolicies.listAvailableFeatures * @desc Lists all features that can be specified in the SSL policy when using custom profile. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.sslPolicies.listAvailableFeatures({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "features": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslPolicies.listAvailableFeatures * @memberOf! () * @@ -68684,6 +87124,99 @@ export namespace compute_v1 { /** * compute.sslPolicies.patch * @desc Patches the specified SSL policy with the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.sslPolicies.patch({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * sslPolicy: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "customFeatures": [], + * // "description": "my_description", + * // "enabledFeatures": [], + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "kind": "my_kind", + * // "minTlsVersion": "my_minTlsVersion", + * // "name": "my_name", + * // "profile": "my_profile", + * // "selfLink": "my_selfLink", + * // "warnings": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.sslPolicies.patch * @memberOf! () * @@ -68906,68 +87439,75 @@ export namespace compute_v1 { * compute.subnetworks.aggregatedList * @desc Retrieves an aggregated list of subnetworks. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.subnetworks.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.subnetworks.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.subnetworks.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.subnetworks.aggregatedList * @memberOf! () * @@ -69051,61 +87591,81 @@ export namespace compute_v1 { * compute.subnetworks.delete * @desc Deletes the specified subnetwork. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.subnetworks.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the Subnetwork resource to delete. - * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.subnetworks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * subnetwork: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.subnetworks.delete * @memberOf! () * @@ -69184,65 +87744,89 @@ export namespace compute_v1 { * compute.subnetworks.expandIpCidrRange * @desc Expands the IP CIDR range of the subnetwork to a specified value. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.subnetworks.expandIpCidrRange({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the Subnetwork resource to update. - * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * subnetwork: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ipCidrRange": "my_ipCidrRange" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.subnetworks.expandIpCidrRange(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.subnetworks.expandIpCidrRange * @memberOf! () * @@ -69322,61 +87906,71 @@ export namespace compute_v1 { * compute.subnetworks.get * @desc Returns the specified subnetwork. Gets a list of available subnetworks list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.subnetworks.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * // Name of the Subnetwork resource to return. - * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.subnetworks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * subnetwork: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableFlowLogs": false, + * // "fingerprint": "my_fingerprint", + * // "gatewayAddress": "my_gatewayAddress", + * // "id": "my_id", + * // "ipCidrRange": "my_ipCidrRange", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "privateIpGoogleAccess": false, + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "role": "my_role", + * // "secondaryIpRanges": [], + * // "selfLink": "my_selfLink", + * // "state": "my_state" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.subnetworks.get * @memberOf! () * @@ -69452,6 +88046,60 @@ export namespace compute_v1 { /** * compute.subnetworks.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.subnetworks.getIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.subnetworks.getIamPolicy * @memberOf! () * @@ -69527,62 +88175,104 @@ export namespace compute_v1 { * compute.subnetworks.insert * @desc Creates a subnetwork in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.subnetworks.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableFlowLogs": false, + * // "fingerprint": "my_fingerprint", + * // "gatewayAddress": "my_gatewayAddress", + * // "id": "my_id", + * // "ipCidrRange": "my_ipCidrRange", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "privateIpGoogleAccess": false, + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "role": "my_role", + * // "secondaryIpRanges": [], + * // "selfLink": "my_selfLink", + * // "state": "my_state" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.subnetworks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.subnetworks.insert * @memberOf! () * @@ -69661,71 +88351,75 @@ export namespace compute_v1 { * compute.subnetworks.list * @desc Retrieves a list of subnetworks available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.subnetworks.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.subnetworks.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.subnetworks.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.subnetworks.list * @memberOf! () * @@ -69804,6 +88498,74 @@ export namespace compute_v1 { /** * compute.subnetworks.listUsable * @desc Retrieves an aggregated list of all usable subnetworks in the project. The list contains all of the subnetworks in the project and the subnetworks that were shared by a Shared VPC host project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.subnetworks.listUsable({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.subnetworks.listUsable * @memberOf! () * @@ -69891,6 +88653,109 @@ export namespace compute_v1 { /** * compute.subnetworks.patch * @desc Patches the specified subnetwork with the data included in the request. Only certain fields can up updated with a patch request as indicated in the field descriptions. You must specify the current fingerprint of the subnetwork resource being patched. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.subnetworks.patch({ + * // The drain timeout specifies the upper bound in seconds on the amount of time allowed to drain connections from the current ACTIVE subnetwork to the current BACKUP subnetwork. The drain timeout is only applicable when the following conditions are true: - the subnetwork being patched has purpose = INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role = BACKUP - the patch request is setting the role to ACTIVE. Note that after this patch operation the roles of the ACTIVE and BACKUP subnetworks will be swapped. + * drainTimeoutSeconds: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region scoping this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the Subnetwork resource to patch. + * subnetwork: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "enableFlowLogs": false, + * // "fingerprint": "my_fingerprint", + * // "gatewayAddress": "my_gatewayAddress", + * // "id": "my_id", + * // "ipCidrRange": "my_ipCidrRange", + * // "kind": "my_kind", + * // "logConfig": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "privateIpGoogleAccess": false, + * // "purpose": "my_purpose", + * // "region": "my_region", + * // "role": "my_role", + * // "secondaryIpRanges": [], + * // "selfLink": "my_selfLink", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.subnetworks.patch * @memberOf! () * @@ -69970,6 +88835,69 @@ export namespace compute_v1 { /** * compute.subnetworks.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.subnetworks.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.subnetworks.setIamPolicy * @memberOf! () * @@ -70046,65 +88974,89 @@ export namespace compute_v1 { * compute.subnetworks.setPrivateIpGoogleAccess * @desc Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.subnetworks.setPrivateIpGoogleAccess({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the Subnetwork resource. - * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * subnetwork: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "privateIpGoogleAccess": false + * // } * }, - * - * auth: authClient, - * }; - * - * compute.subnetworks.setPrivateIpGoogleAccess(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.subnetworks.setPrivateIpGoogleAccess * @memberOf! () * @@ -70185,6 +89137,63 @@ export namespace compute_v1 { /** * compute.subnetworks.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.subnetworks.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.subnetworks.testIamPermissions * @memberOf! () * @@ -70594,6 +89603,75 @@ export namespace compute_v1 { /** * compute.targetHttpProxies.aggregatedList * @desc Retrieves the list of all TargetHttpProxy resources, regional and global, available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpProxies.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Name of the project scoping this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpProxies.aggregatedList * @memberOf! () * @@ -70683,58 +89761,79 @@ export namespace compute_v1 { * compute.targetHttpProxies.delete * @desc Deletes the specified TargetHttpProxy resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpProxies.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetHttpProxy resource to delete. - * targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetHttpProxies.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetHttpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpProxies.delete * @memberOf! () * @@ -70812,58 +89911,59 @@ export namespace compute_v1 { * compute.targetHttpProxies.get * @desc Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpProxies.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the TargetHttpProxy resource to return. - * targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetHttpProxies.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetHttpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "urlMap": "my_urlMap" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpProxies.get * @memberOf! () * @@ -70940,59 +90040,92 @@ export namespace compute_v1 { * compute.targetHttpProxies.insert * @desc Creates a TargetHttpProxy resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpProxies.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "urlMap": "my_urlMap" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpProxies.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpProxies.insert * @memberOf! () * @@ -71070,68 +90203,73 @@ export namespace compute_v1 { * compute.targetHttpProxies.list * @desc Retrieves the list of TargetHttpProxy resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpProxies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetHttpProxies.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.targetHttpProxies.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpProxies.list * @memberOf! () * @@ -71211,62 +90349,87 @@ export namespace compute_v1 { * compute.targetHttpProxies.setUrlMap * @desc Changes the URL map for TargetHttpProxy. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpProxies.setUrlMap({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetHttpProxy to set a URL map for. - * targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetHttpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "urlMap": "my_urlMap" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpProxies.setUrlMap(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpProxies.setUrlMap * @memberOf! () * @@ -71494,6 +90657,76 @@ export namespace compute_v1 { /** * compute.targetHttpsProxies.aggregatedList * @desc Retrieves the list of all TargetHttpsProxy resources, regional and global, available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpsProxies.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Name of the project scoping this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpsProxies.aggregatedList * @memberOf! () * @@ -71583,58 +90816,79 @@ export namespace compute_v1 { * compute.targetHttpsProxies.delete * @desc Deletes the specified TargetHttpsProxy resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpsProxies.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetHttpsProxy resource to delete. - * targetHttpsProxy: 'my-target-https-proxy', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpsProxies.delete * @memberOf! () * @@ -71712,58 +90966,62 @@ export namespace compute_v1 { * compute.targetHttpsProxies.get * @desc Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpsProxies.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the TargetHttpsProxy resource to return. - * targetHttpsProxy: 'my-target-https-proxy', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "quicOverride": "my_quicOverride", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslCertificates": [], + * // "sslPolicy": "my_sslPolicy", + * // "urlMap": "my_urlMap" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpsProxies.get * @memberOf! () * @@ -71840,59 +91098,95 @@ export namespace compute_v1 { * compute.targetHttpsProxies.insert * @desc Creates a TargetHttpsProxy resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpsProxies.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "quicOverride": "my_quicOverride", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sslCertificates": [], + * // "sslPolicy": "my_sslPolicy", + * // "urlMap": "my_urlMap" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpsProxies.insert * @memberOf! () * @@ -71970,68 +91264,73 @@ export namespace compute_v1 { * compute.targetHttpsProxies.list * @desc Retrieves the list of TargetHttpsProxy resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetHttpsProxies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetHttpsProxies.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.targetHttpsProxies.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpsProxies.list * @memberOf! () * @@ -72112,6 +91411,88 @@ export namespace compute_v1 { /** * compute.targetHttpsProxies.setQuicOverride * @desc Sets the QUIC override policy for TargetHttpsProxy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpsProxies.setQuicOverride({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035. + * targetHttpsProxy: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "quicOverride": "my_quicOverride" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpsProxies.setQuicOverride * @memberOf! () * @@ -72190,62 +91571,87 @@ export namespace compute_v1 { * compute.targetHttpsProxies.setSslCertificates * @desc Replaces SslCertificates for TargetHttpsProxy. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpsProxies.setSslCertificates({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetHttpsProxy resource to set an SslCertificates resource for. - * targetHttpsProxy: 'my-target-https-proxy', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sslCertificates": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.setSslCertificates(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpsProxies.setSslCertificates * @memberOf! () * @@ -72323,6 +91729,88 @@ export namespace compute_v1 { /** * compute.targetHttpsProxies.setSslPolicy * @desc Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the HTTPS proxy load balancer. They do not affect the connection between the load balancer and the backends. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpsProxies.setSslPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * targetHttpsProxy: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sslPolicy": "my_sslPolicy" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetHttpsProxies.setSslPolicy * @memberOf! () * @@ -72401,62 +91889,87 @@ export namespace compute_v1 { * compute.targetHttpsProxies.setUrlMap * @desc Changes the URL map for TargetHttpsProxy. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetHttpsProxies.setUrlMap({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetHttpsProxy resource whose URL map is to be set. - * targetHttpsProxy: 'my-target-https-proxy', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetHttpsProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "urlMap": "my_urlMap" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.setUrlMap(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetHttpsProxies.setUrlMap * @memberOf! () * @@ -72760,68 +92273,75 @@ export namespace compute_v1 { * compute.targetInstances.aggregatedList * @desc Retrieves an aggregated list of target instances. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetInstances.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetInstances.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.targetInstances.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetInstances.aggregatedList * @memberOf! () * @@ -72911,61 +92431,81 @@ export namespace compute_v1 { * compute.targetInstances.delete * @desc Deletes the specified TargetInstance resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetInstances.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone scoping this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetInstance resource to delete. - * targetInstance: 'my-target-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetInstances.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetInstance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Name of the zone scoping this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetInstances.delete * @memberOf! () * @@ -73044,61 +92584,62 @@ export namespace compute_v1 { * compute.targetInstances.get * @desc Returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetInstances.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone scoping this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the TargetInstance resource to return. - * targetInstance: 'my-target-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetInstances.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetInstance: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Name of the zone scoping this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "name": "my_name", + * // "natPolicy": "my_natPolicy", + * // "selfLink": "my_selfLink", + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetInstances.get * @memberOf! () * @@ -73176,62 +92717,95 @@ export namespace compute_v1 { * compute.targetInstances.insert * @desc Creates a TargetInstance resource in the specified project and zone using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetInstances.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the zone scoping this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "name": "my_name", + * // "natPolicy": "my_natPolicy", + * // "selfLink": "my_selfLink", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetInstances.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetInstances.insert * @memberOf! () * @@ -73310,71 +92884,75 @@ export namespace compute_v1 { * compute.targetInstances.list * @desc Retrieves a list of TargetInstance resources available to the specified project and zone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetInstances.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the zone scoping this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetInstances.list(request, handlePage); - * } - * }; + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.targetInstances.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetInstances.list * @memberOf! () * @@ -73596,65 +93174,89 @@ export namespace compute_v1 { * compute.targetPools.addHealthCheck * @desc Adds health check URLs to a target pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.addHealthCheck({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the target pool to add a health check to. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "healthChecks": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.addHealthCheck(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.addHealthCheck * @memberOf! () * @@ -73734,65 +93336,89 @@ export namespace compute_v1 { * compute.targetPools.addInstance * @desc Adds an instance to a target pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.addInstance({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetPool resource to add instances to. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.addInstance(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.addInstance * @memberOf! () * @@ -73872,68 +93498,75 @@ export namespace compute_v1 { * compute.targetPools.aggregatedList * @desc Retrieves an aggregated list of target pools. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetPools.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetPools.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.targetPools.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.aggregatedList * @memberOf! () * @@ -74017,61 +93650,81 @@ export namespace compute_v1 { * compute.targetPools.delete * @desc Deletes the specified target pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetPool resource to delete. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetPools.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.delete * @memberOf! () * @@ -74150,61 +93803,65 @@ export namespace compute_v1 { * compute.targetPools.get * @desc Returns the specified target pool. Gets a list of available target pools by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetPools.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * // Name of the TargetPool resource to return. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetPools.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backupPool": "my_backupPool", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "failoverRatio": {}, + * // "healthChecks": [], + * // "id": "my_id", + * // "instances": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sessionAffinity": "my_sessionAffinity" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.get * @memberOf! () * @@ -74281,65 +93938,63 @@ export namespace compute_v1 { * compute.targetPools.getHealth * @desc Gets the most recent health check results for each IP for the instance that is referenced by the given target pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetPools.getHealth({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * // Name of the TargetPool resource to which the queried instance belongs. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instance": "my_instance" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.targetPools.getHealth(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "healthStatus": [], + * // "kind": "my_kind" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.getHealth * @memberOf! () * @@ -74422,62 +94077,98 @@ export namespace compute_v1 { * compute.targetPools.insert * @desc Creates a target pool in the specified project and region using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "backupPool": "my_backupPool", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "failoverRatio": {}, + * // "healthChecks": [], + * // "id": "my_id", + * // "instances": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "sessionAffinity": "my_sessionAffinity" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.insert * @memberOf! () * @@ -74556,71 +94247,75 @@ export namespace compute_v1 { * compute.targetPools.list * @desc Retrieves a list of target pools available to the specified project and region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetPools.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetPools.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.targetPools.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.list * @memberOf! () * @@ -74700,65 +94395,89 @@ export namespace compute_v1 { * compute.targetPools.removeHealthCheck * @desc Removes health check URL from a target pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.removeHealthCheck({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the target pool to remove health checks from. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "healthChecks": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.removeHealthCheck(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.removeHealthCheck * @memberOf! () * @@ -74838,65 +94557,89 @@ export namespace compute_v1 { * compute.targetPools.removeInstance * @desc Removes instance URL from a target pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.removeInstance({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetPool resource to remove instances from. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instances": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.removeInstance(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.removeInstance * @memberOf! () * @@ -74976,65 +94719,91 @@ export namespace compute_v1 { * compute.targetPools.setBackup * @desc Changes a backup target pool's configurations. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetPools.setBackup({ + * // New failoverRatio value for the target pool. + * failoverRatio: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetPool resource to set a backup pool for. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetPool: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "target": "my_target" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.setBackup(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetPools.setBackup * @memberOf! () * @@ -75428,58 +95197,79 @@ export namespace compute_v1 { * compute.targetSslProxies.delete * @desc Deletes the specified TargetSslProxy resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetSslProxies.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetSslProxy resource to delete. - * targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetSslProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetSslProxies.delete * @memberOf! () * @@ -75557,58 +95347,61 @@ export namespace compute_v1 { * compute.targetSslProxies.get * @desc Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetSslProxies.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the TargetSslProxy resource to return. - * targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetSslProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyHeader": "my_proxyHeader", + * // "selfLink": "my_selfLink", + * // "service": "my_service", + * // "sslCertificates": [], + * // "sslPolicy": "my_sslPolicy" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetSslProxies.get * @memberOf! () * @@ -75685,59 +95478,94 @@ export namespace compute_v1 { * compute.targetSslProxies.insert * @desc Creates a TargetSslProxy resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetSslProxies.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyHeader": "my_proxyHeader", + * // "selfLink": "my_selfLink", + * // "service": "my_service", + * // "sslCertificates": [], + * // "sslPolicy": "my_sslPolicy" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetSslProxies.insert * @memberOf! () * @@ -75814,68 +95642,73 @@ export namespace compute_v1 { * compute.targetSslProxies.list * @desc Retrieves the list of TargetSslProxy resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetSslProxies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetSslProxies.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.targetSslProxies.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetSslProxies.list * @memberOf! () * @@ -75954,62 +95787,87 @@ export namespace compute_v1 { * compute.targetSslProxies.setBackendService * @desc Changes the BackendService for TargetSslProxy. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetSslProxies.setBackendService({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetSslProxy resource whose BackendService resource is to be set. - * targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetSslProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "service": "my_service" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.setBackendService(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetSslProxies.setBackendService * @memberOf! () * @@ -76088,62 +95946,87 @@ export namespace compute_v1 { * compute.targetSslProxies.setProxyHeader * @desc Changes the ProxyHeaderType for TargetSslProxy. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetSslProxies.setProxyHeader({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetSslProxy resource whose ProxyHeader is to be set. - * targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetSslProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "proxyHeader": "my_proxyHeader" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.setProxyHeader(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetSslProxies.setProxyHeader * @memberOf! () * @@ -76222,62 +96105,87 @@ export namespace compute_v1 { * compute.targetSslProxies.setSslCertificates * @desc Changes SslCertificates for TargetSslProxy. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetSslProxies.setSslCertificates({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetSslProxy resource whose SslCertificate resource is to be set. - * targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetSslProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sslCertificates": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.setSslCertificates(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetSslProxies.setSslCertificates * @memberOf! () * @@ -76355,6 +96263,88 @@ export namespace compute_v1 { /** * compute.targetSslProxies.setSslPolicy * @desc Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the SSL proxy load balancer. They do not affect the connection between the load balancer and the backends. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetSslProxies.setSslPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * targetSslProxy: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sslPolicy": "my_sslPolicy" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.targetSslProxies.setSslPolicy * @memberOf! () * @@ -76626,58 +96616,79 @@ export namespace compute_v1 { * compute.targetTcpProxies.delete * @desc Deletes the specified TargetTcpProxy resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetTcpProxies.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetTcpProxy resource to delete. - * targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetTcpProxies.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetTcpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetTcpProxies.delete * @memberOf! () * @@ -76755,58 +96766,59 @@ export namespace compute_v1 { * compute.targetTcpProxies.get * @desc Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetTcpProxies.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the TargetTcpProxy resource to return. - * targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetTcpProxies.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetTcpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyHeader": "my_proxyHeader", + * // "selfLink": "my_selfLink", + * // "service": "my_service" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetTcpProxies.get * @memberOf! () * @@ -76883,59 +96895,92 @@ export namespace compute_v1 { * compute.targetTcpProxies.insert * @desc Creates a TargetTcpProxy resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetTcpProxies.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "proxyHeader": "my_proxyHeader", + * // "selfLink": "my_selfLink", + * // "service": "my_service" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetTcpProxies.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetTcpProxies.insert * @memberOf! () * @@ -77012,68 +97057,73 @@ export namespace compute_v1 { * compute.targetTcpProxies.list * @desc Retrieves the list of TargetTcpProxy resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetTcpProxies.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetTcpProxies.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.targetTcpProxies.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetTcpProxies.list * @memberOf! () * @@ -77152,62 +97202,87 @@ export namespace compute_v1 { * compute.targetTcpProxies.setBackendService * @desc Changes the BackendService for TargetTcpProxy. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetTcpProxies.setBackendService({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetTcpProxy resource whose BackendService resource is to be set. - * targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetTcpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "service": "my_service" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetTcpProxies.setBackendService(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetTcpProxies.setBackendService * @memberOf! () * @@ -77286,62 +97361,87 @@ export namespace compute_v1 { * compute.targetTcpProxies.setProxyHeader * @desc Changes the ProxyHeaderType for TargetTcpProxy. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetTcpProxies.setProxyHeader({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the TargetTcpProxy resource whose ProxyHeader is to be set. - * targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * targetTcpProxy: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "proxyHeader": "my_proxyHeader" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetTcpProxies.setProxyHeader(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetTcpProxies.setProxyHeader * @memberOf! () * @@ -77563,68 +97663,75 @@ export namespace compute_v1 { * compute.targetVpnGateways.aggregatedList * @desc Retrieves an aggregated list of target VPN gateways. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetVpnGateways.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetVpnGateways.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.targetVpnGateways.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetVpnGateways.aggregatedList * @memberOf! () * @@ -77714,61 +97821,81 @@ export namespace compute_v1 { * compute.targetVpnGateways.delete * @desc Deletes the specified target VPN gateway. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetVpnGateways.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the target VPN gateway to delete. - * targetVpnGateway: 'my-target-vpn-gateway', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetVpnGateways.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetVpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetVpnGateways.delete * @memberOf! () * @@ -77847,61 +97974,64 @@ export namespace compute_v1 { * compute.targetVpnGateways.get * @desc Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetVpnGateways.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * // Name of the target VPN gateway to return. - * targetVpnGateway: 'my-target-vpn-gateway', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetVpnGateways.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * targetVpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "forwardingRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "tunnels": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetVpnGateways.get * @memberOf! () * @@ -77979,62 +98109,97 @@ export namespace compute_v1 { * compute.targetVpnGateways.insert * @desc Creates a target VPN gateway in the specified project and region using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.targetVpnGateways.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "forwardingRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "tunnels": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.targetVpnGateways.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetVpnGateways.insert * @memberOf! () * @@ -78113,71 +98278,75 @@ export namespace compute_v1 { * compute.targetVpnGateways.list * @desc Retrieves a list of target VPN gateways available to the specified project and region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.targetVpnGateways.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetVpnGateways.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.targetVpnGateways.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.targetVpnGateways.list * @memberOf! () * @@ -78400,6 +98569,76 @@ export namespace compute_v1 { /** * compute.urlMaps.aggregatedList * @desc Retrieves the list of all UrlMap resources, regional and global, available to the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.urlMaps.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Name of the project scoping this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.urlMaps.aggregatedList * @memberOf! () * @@ -78483,58 +98722,79 @@ export namespace compute_v1 { * compute.urlMaps.delete * @desc Deletes the specified UrlMap resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.urlMaps.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the UrlMap resource to delete. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.urlMaps.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.urlMaps.delete * @memberOf! () * @@ -78610,58 +98870,66 @@ export namespace compute_v1 { * compute.urlMaps.get * @desc Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.urlMaps.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the UrlMap resource to return. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.urlMaps.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.urlMaps.get * @memberOf! () * @@ -78734,59 +99002,99 @@ export namespace compute_v1 { * compute.urlMaps.insert * @desc Creates a UrlMap resource in the specified project using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.urlMaps.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.urlMaps.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.urlMaps.insert * @memberOf! () * @@ -78862,62 +99170,88 @@ export namespace compute_v1 { * compute.urlMaps.invalidateCache * @desc Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.urlMaps.invalidateCache({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the UrlMap scoping this request. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "host": "my_host", + * // "path": "my_path" + * // } * }, - * - * auth: authClient, - * }; - * - * compute.urlMaps.invalidateCache(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.urlMaps.invalidateCache * @memberOf! () * @@ -78996,68 +99330,73 @@ export namespace compute_v1 { * compute.urlMaps.list * @desc Retrieves the list of UrlMap resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.urlMaps.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.urlMaps.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.urlMaps.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.urlMaps.list * @memberOf! () * @@ -79135,63 +99474,101 @@ export namespace compute_v1 { * compute.urlMaps.patch * @desc Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.urlMaps.patch({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the UrlMap resource to patch. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.urlMaps.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.urlMaps.patch * @memberOf! () * @@ -79268,63 +99645,101 @@ export namespace compute_v1 { * compute.urlMaps.update * @desc Updates the specified UrlMap resource with the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.urlMaps.update({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the UrlMap resource to update. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "defaultRouteAction": {}, + * // "defaultService": "my_defaultService", + * // "defaultUrlRedirect": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "headerAction": {}, + * // "hostRules": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "pathMatchers": [], + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "tests": [] + * // } * }, - * - * auth: authClient, - * }; - * - * compute.urlMaps.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.urlMaps.update * @memberOf! () * @@ -79401,62 +99816,59 @@ export namespace compute_v1 { * compute.urlMaps.validate * @desc Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.urlMaps.validate({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the UrlMap resource to be validated as. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * urlMap: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resource": {} + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * compute.urlMaps.validate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "result": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.urlMaps.validate * @memberOf! () * @@ -79750,6 +100162,76 @@ export namespace compute_v1 { /** * compute.vpnGateways.aggregatedList * @desc Retrieves an aggregated list of VPN gateways. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnGateways.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.aggregatedList * @memberOf! () * @@ -79832,6 +100314,82 @@ export namespace compute_v1 { /** * compute.vpnGateways.delete * @desc Deletes the specified VPN gateway. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.vpnGateways.delete({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name of the VPN gateway to delete. + * vpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.delete * @memberOf! () * @@ -79909,6 +100467,65 @@ export namespace compute_v1 { /** * compute.vpnGateways.get * @desc Returns the specified VPN gateway. Gets a list of available VPN gateways by making a list() request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnGateways.get({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the VPN gateway to return. + * vpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "vpnInterfaces": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.get * @memberOf! () * @@ -79984,6 +100601,55 @@ export namespace compute_v1 { /** * compute.vpnGateways.getStatus * @desc Returns the status for the specified VPN gateway. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnGateways.getStatus({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name of the VPN gateway to return. + * vpnGateway: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "result": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.getStatus * @memberOf! () * @@ -80069,6 +100735,98 @@ export namespace compute_v1 { /** * compute.vpnGateways.insert * @desc Creates a VPN gateway in the specified project and region using the data included in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.vpnGateways.insert({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "vpnInterfaces": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.insert * @memberOf! () * @@ -80146,6 +100904,76 @@ export namespace compute_v1 { /** * compute.vpnGateways.list * @desc Retrieves a list of VPN gateways available to the specified project and region. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnGateways.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.list * @memberOf! () * @@ -80224,6 +101052,91 @@ export namespace compute_v1 { /** * compute.vpnGateways.setLabels * @desc Sets the labels on a VpnGateway. To learn more about labels, read the Labeling Resources documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.vpnGateways.setLabels({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFingerprint": "my_labelFingerprint", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.setLabels * @memberOf! () * @@ -80302,6 +101215,63 @@ export namespace compute_v1 { /** * compute.vpnGateways.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnGateways.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the region for this request. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.vpnGateways.testIamPermissions * @memberOf! () * @@ -80597,68 +101567,75 @@ export namespace compute_v1 { * compute.vpnTunnels.aggregatedList * @desc Retrieves an aggregated list of VPN tunnels. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnTunnels.aggregatedList({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * includeAllScopes: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.vpnTunnels.aggregatedList(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.vpnTunnels.aggregatedList(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.vpnTunnels.aggregatedList * @memberOf! () * @@ -80742,61 +101719,81 @@ export namespace compute_v1 { * compute.vpnTunnels.delete * @desc Deletes the specified VpnTunnel resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.vpnTunnels.delete({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', * // Name of the VpnTunnel resource to delete. - * vpnTunnel: 'my-vpn-tunnel', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.vpnTunnels.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * vpnTunnel: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.vpnTunnels.delete * @memberOf! () * @@ -80875,61 +101872,75 @@ export namespace compute_v1 { * compute.vpnTunnels.get * @desc Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnTunnels.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * // Name of the VpnTunnel resource to return. - * vpnTunnel: 'my-vpn-tunnel', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.vpnTunnels.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * vpnTunnel: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "detailedStatus": "my_detailedStatus", + * // "id": "my_id", + * // "ikeVersion": 0, + * // "kind": "my_kind", + * // "localTrafficSelector": [], + * // "name": "my_name", + * // "peerExternalGateway": "my_peerExternalGateway", + * // "peerExternalGatewayInterface": 0, + * // "peerGcpGateway": "my_peerGcpGateway", + * // "peerIp": "my_peerIp", + * // "region": "my_region", + * // "remoteTrafficSelector": [], + * // "router": "my_router", + * // "selfLink": "my_selfLink", + * // "sharedSecret": "my_sharedSecret", + * // "sharedSecretHash": "my_sharedSecretHash", + * // "status": "my_status", + * // "targetVpnGateway": "my_targetVpnGateway", + * // "vpnGateway": "my_vpnGateway", + * // "vpnGatewayInterface": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.vpnTunnels.get * @memberOf! () * @@ -81006,62 +102017,108 @@ export namespace compute_v1 { * compute.vpnTunnels.insert * @desc Creates a VpnTunnel resource in the specified project and region using the data included in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.vpnTunnels.insert({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + * // + * // For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + * // + * // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "detailedStatus": "my_detailedStatus", + * // "id": "my_id", + * // "ikeVersion": 0, + * // "kind": "my_kind", + * // "localTrafficSelector": [], + * // "name": "my_name", + * // "peerExternalGateway": "my_peerExternalGateway", + * // "peerExternalGatewayInterface": 0, + * // "peerGcpGateway": "my_peerGcpGateway", + * // "peerIp": "my_peerIp", + * // "region": "my_region", + * // "remoteTrafficSelector": [], + * // "router": "my_router", + * // "selfLink": "my_selfLink", + * // "sharedSecret": "my_sharedSecret", + * // "sharedSecretHash": "my_sharedSecretHash", + * // "status": "my_status", + * // "targetVpnGateway": "my_targetVpnGateway", + * // "vpnGateway": "my_vpnGateway", + * // "vpnGatewayInterface": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * compute.vpnTunnels.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.vpnTunnels.insert * @memberOf! () * @@ -81140,71 +102197,75 @@ export namespace compute_v1 { * compute.vpnTunnels.list * @desc Retrieves a list of VpnTunnel resources contained in the specified project and region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.vpnTunnels.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.vpnTunnels.list(request, handlePage); - * } - * }; + * region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.vpnTunnels.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.vpnTunnels.list * @memberOf! () * @@ -81423,58 +102484,48 @@ export namespace compute_v1 { * compute.zoneOperations.delete * @desc Deletes the specified zone-specific Operations resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 compute.zoneOperations.delete({ + * // Name of the Operations resource to delete. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the Operations resource to delete. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.zoneOperations.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.zoneOperations.delete * @memberOf! () * @@ -81550,61 +102601,76 @@ export namespace compute_v1 { * compute.zoneOperations.get * @desc Retrieves the specified zone-specific Operations resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.zoneOperations.get({ + * // Name of the Operations resource to return. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the Operations resource to return. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.zoneOperations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.zoneOperations.get * @memberOf! () * @@ -81682,71 +102748,75 @@ export namespace compute_v1 { * compute.zoneOperations.list * @desc Retrieves a list of Operation resources contained within the specified zone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.zoneOperations.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the zone for request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.zoneOperations.list(request, handlePage); - * } - * }; + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.zoneOperations.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.zoneOperations.list * @memberOf! () * @@ -81825,6 +102895,77 @@ export namespace compute_v1 { /** * compute.zoneOperations.wait * @desc Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.zoneOperations.wait({ + * // Name of the Operations resource to return. + * operation: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name of the zone for this request. + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias compute.zoneOperations.wait * @memberOf! () * @@ -82002,58 +103143,61 @@ export namespace compute_v1 { * compute.zones.get * @desc Returns the specified Zone resource. Gets a list of available zones by making a list() request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.zones.get({ * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // Name of the zone resource to return. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.zones.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * zone: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "availableCpuPlatforms": [], + * // "creationTimestamp": "my_creationTimestamp", + * // "deprecated": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "status": "my_status" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.zones.get * @memberOf! () * @@ -82126,68 +103270,73 @@ export namespace compute_v1 { * compute.zones.list * @desc Retrieves the list of Zone resources available to the specified project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/compute.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 compute = google.compute('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 compute.zones.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * // + * // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.zones.list(request, handlePage); - * } - * }; + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "warning": {} + * // } + * } * - * compute.zones.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias compute.zones.list * @memberOf! () * diff --git a/src/apis/container/v1.ts b/src/apis/container/v1.ts index 6320e35d299..5882e407c33 100644 --- a/src/apis/container/v1.ts +++ b/src/apis/container/v1.ts @@ -2108,65 +2108,60 @@ export namespace container_v1 { * container.projects.aggregated.usableSubnetworks.list * @desc Lists subnetworks that are usable for creating clusters in a project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // The parent project where subnetworks are usable. - * // Specified in the format 'projects/<'. - * parent: 'projects/my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * 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/cloud-platform'], + * }); * - * var subnetworksPage = response['subnetworks']; - * if (!subnetworksPage) { - * return; - * } - * for (var i = 0; i < subnetworksPage.length; i++) { - * // TODO: Change code below to process each resource in `subnetworksPage`: - * console.log(JSON.stringify(subnetworksPage[i], null, 2)); - * } + * // 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 container.projects.aggregated.usableSubnetworks.list({ + * // Filtering currently only supports equality on the networkProjectId and must + * // be in the form: "networkProjectId=[PROJECTID]", where `networkProjectId` + * // is the project which owns the listed subnetworks. This defaults to the + * // parent project ID. + * filter: 'placeholder-value', + * // The max number of results per page that should be returned. If the number + * // of available results is larger than `page_size`, a `next_page_token` is + * // returned which can be used to get the next page of results in subsequent + * // requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * pageSize: 'placeholder-value', + * // Specifies a page token to use. Set this to the nextPageToken returned by + * // previous list requests to get the next page of results. + * pageToken: 'placeholder-value', + * // The parent project where subnetworks are usable. + * // Specified in the format 'projects/x'. + * parent: 'projects/my-project', + * }); + * console.log(res.data); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * container.projects.aggregated.usableSubnetworks.list(request, handlePage); - * } - * }; + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "subnetworks": [] + * // } + * } * - * container.projects.aggregated.usableSubnetworks.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.aggregated.usableSubnetworks.list * @memberOf! () * @@ -2291,52 +2286,59 @@ export namespace container_v1 { * container.projects.locations.getServerConfig * @desc Returns configuration info about the Google Kubernetes Engine service. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name (project and location) of the server config to get, - * // specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.getServerConfig * @memberOf! () * @@ -2450,56 +2452,70 @@ export namespace container_v1 { * container.projects.locations.clusters.completeIpRotation * @desc Completes master IP rotation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name (project, location, cluster id) of the cluster to complete IP - * // rotation. Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.completeIpRotation * @memberOf! () * @@ -2576,56 +2592,70 @@ export namespace container_v1 { * container.projects.locations.clusters.create * @desc Creates a cluster, consisting of the specified number and type of Google Compute Engine instances. By default, the cluster is created in the project's [default network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). One firewall is added for the cluster. After cluster creation, the Kubelet creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster. Finally, an entry is added to the project's global metadata indicating which CIDR range the cluster is using. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The parent (project and location) where the cluster will be created. - * // Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.create * @memberOf! () * @@ -2702,52 +2732,71 @@ export namespace container_v1 { * container.projects.locations.clusters.delete * @desc Deletes the cluster, including the Kubernetes endpoint and all worker nodes. Firewalls and routes that were configured during cluster creation are also deleted. Other Google Compute Engine resources that might be in use by the cluster, such as load balancer resources, are not deleted if they weren't present when the cluster was initially created. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name (project, location, cluster) of the cluster to delete. - * // Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.delete * @memberOf! () * @@ -2823,52 +2872,107 @@ export namespace container_v1 { * container.projects.locations.clusters.get * @desc Gets the details of a specific cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name (project, location, cluster) of the cluster to retrieve. - * // Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.get * @memberOf! () * @@ -2942,52 +3046,47 @@ export namespace container_v1 { * container.projects.locations.clusters.getJwks * @desc Gets the public component of the cluster signing keys in JSON Web Key format. This API is not yet intended for general use, and is not available for all clusters. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // The cluster (project, location, cluster id) to get keys for. Specified in - * // the format 'projects/ { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // { + * // "cacheHeader": {}, + * // "keys": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.getJwks * @memberOf! () * @@ -3064,53 +3163,57 @@ export namespace container_v1 { * container.projects.locations.clusters.list * @desc Lists all clusters owned by a project in either the specified zone or all zones. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 container.projects.locations.clusters.list({ * // The parent (project and location) where the clusters will be listed. - * // Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.list * @memberOf! () * @@ -3190,56 +3293,71 @@ export namespace container_v1 { * container.projects.locations.clusters.setAddons * @desc Sets the addons for a specific cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // The name (project, location, cluster) of the cluster to set addons. - * // Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.setAddons * @memberOf! () * @@ -3316,56 +3434,71 @@ export namespace container_v1 { * container.projects.locations.clusters.setLegacyAbac * @desc Enables or disables the ABAC authorization mechanism on a cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name (project, location, cluster id) of the cluster to set legacy abac. - * // Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.setLegacyAbac * @memberOf! () * @@ -3442,56 +3575,71 @@ export namespace container_v1 { * container.projects.locations.clusters.setLocations * @desc Sets the locations for a specific cluster. Deprecated. Use [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) instead. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // The name (project, location, cluster) of the cluster to set locations. - * // Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.setLocations * @memberOf! () * @@ -3568,56 +3716,71 @@ export namespace container_v1 { * container.projects.locations.clusters.setLogging * @desc Sets the logging service for a specific cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name (project, location, cluster) of the cluster to set logging. - * // Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.setLogging * @memberOf! () * @@ -3694,57 +3857,72 @@ export namespace container_v1 { * container.projects.locations.clusters.setMaintenancePolicy * @desc Sets the maintenance policy for a cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.setMaintenancePolicy({ * // The name (project, location, cluster id) of the cluster to set maintenance * // policy. - * // Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.setMaintenancePolicy * @memberOf! () * @@ -3823,56 +4001,72 @@ export namespace container_v1 { * container.projects.locations.clusters.setMasterAuth * @desc Sets master auth materials. Currently supports changing the admin password or a specific cluster, either via password generation or explicitly setting the password. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name (project, location, cluster) of the cluster to set auth. - * // Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.setMasterAuth * @memberOf! () * @@ -3949,56 +4143,71 @@ export namespace container_v1 { * container.projects.locations.clusters.setMonitoring * @desc Sets the monitoring service for a specific cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // The name (project, location, cluster) of the cluster to set monitoring. - * // Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.setMonitoring * @memberOf! () * @@ -4075,56 +4284,71 @@ export namespace container_v1 { * container.projects.locations.clusters.setNetworkPolicy * @desc Enables or disables Network Policy for a cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name (project, location, cluster id) of the cluster to set networking - * // policy. Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.setNetworkPolicy * @memberOf! () * @@ -4201,56 +4425,72 @@ export namespace container_v1 { * container.projects.locations.clusters.setResourceLabels * @desc Sets labels on a cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // The name (project, location, cluster id) of the cluster to set labels. - * // Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.setResourceLabels * @memberOf! () * @@ -4327,56 +4567,71 @@ export namespace container_v1 { * container.projects.locations.clusters.startIpRotation * @desc Starts master IP rotation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name (project, location, cluster id) of the cluster to start IP - * // rotation. Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.startIpRotation * @memberOf! () * @@ -4453,57 +4708,71 @@ export namespace container_v1 { * container.projects.locations.clusters.update * @desc Updates the settings of a specific cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // The name (project, location, cluster) of the cluster to update. - * // Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.update * @memberOf! () * @@ -4577,56 +4846,71 @@ export namespace container_v1 { * container.projects.locations.clusters.updateMaster * @desc Updates the master for a specific cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name (project, location, cluster) of the cluster to update. - * // Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.updateMaster * @memberOf! () * @@ -5029,57 +5313,72 @@ export namespace container_v1 { * container.projects.locations.clusters.nodePools.create * @desc Creates a node pool for a cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.nodePools.create({ * // The parent (project, location, cluster id) where the node pool will be * // created. Specified in the format - * // 'projects/ { + * console.error(e); + * throw e; + * }); * - * container.projects.locations.clusters.nodePools.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.nodePools.create * @memberOf! () * @@ -5156,53 +5455,76 @@ export namespace container_v1 { * container.projects.locations.clusters.nodePools.delete * @desc Deletes a node pool from a cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // The name (project, location, cluster, node pool id) of the node pool to - * // delete. Specified in the format - * // 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.nodePools.delete * @memberOf! () * @@ -5279,53 +5601,77 @@ export namespace container_v1 { * container.projects.locations.clusters.nodePools.get * @desc Retrieves the requested node pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // The name (project, location, cluster, node pool id) of the node pool to - * // get. Specified in the format - * // 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.nodePools.get * @memberOf! () * @@ -5400,52 +5746,58 @@ export namespace container_v1 { * container.projects.locations.clusters.nodePools.list * @desc Lists the node pools for a cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // The parent (project, location, cluster id) where the node pools will be - * // listed. Specified in the format 'projects/ { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // { + * // "nodePools": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.nodePools.list * @memberOf! () * @@ -5526,57 +5878,73 @@ export namespace container_v1 { * container.projects.locations.clusters.nodePools.rollback * @desc Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.nodePools.rollback({ * // The name (project, location, cluster, node pool id) of the node poll to * // rollback upgrade. - * // Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.nodePools.rollback * @memberOf! () * @@ -5653,57 +6021,76 @@ export namespace container_v1 { * container.projects.locations.clusters.nodePools.setAutoscaling * @desc Sets the autoscaling settings for the specified node pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name (project, location, cluster, node pool) of the node pool to set - * // autoscaler settings. Specified in the format - * // 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.nodePools.setAutoscaling * @memberOf! () * @@ -5780,57 +6167,76 @@ export namespace container_v1 { * container.projects.locations.clusters.nodePools.setManagement * @desc Sets the NodeManagement options for a node pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name (project, location, cluster, node pool id) of the node pool to set - * // management properties. Specified in the format - * // 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.nodePools.setManagement * @memberOf! () * @@ -5907,57 +6313,74 @@ export namespace container_v1 { * container.projects.locations.clusters.nodePools.setSize * @desc Sets the size for a specific node pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await container.projects.locations.clusters.nodePools.setSize({ * // The name (project, location, cluster, node pool id) of the node pool to set * // size. - * // Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.nodePools.setSize * @memberOf! () * @@ -6034,58 +6457,78 @@ export namespace container_v1 { * container.projects.locations.clusters.nodePools.update * @desc Updates the version and/or image type for the specified node pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 container.projects.locations.clusters.nodePools.update({ * // The name (project, location, cluster, node pool) of the node pool to * // update. Specified in the format - * // 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.nodePools.update * @memberOf! () * @@ -6349,52 +6792,56 @@ export namespace container_v1 { * container.projects.locations.clusters.well-known.getOpenid-configuration * @desc Gets the OIDC discovery document for the cluster. See the [OpenID Connect Discovery 1.0 specification](https://openid.net/specs/openid-connect-discovery-1_0.html) for details. This API is not yet intended for general use, and is not available for all clusters. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // The cluster (project, location, cluster id) to get the discovery document - * // for. Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.clusters.well-known.getOpenid-configuration * @memberOf! () * @@ -6493,53 +6940,55 @@ export namespace container_v1 { * container.projects.locations.operations.cancel * @desc Cancels the specified operation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // The name (project, location, operation id) of the operation to cancel. - * // Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.operations.cancel * @memberOf! () * @@ -6611,52 +7060,71 @@ export namespace container_v1 { * container.projects.locations.operations.get * @desc Gets the specified operation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name (project, location, operation id) of the operation to get. - * // Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.operations.get * @memberOf! () * @@ -6732,53 +7200,57 @@ export namespace container_v1 { * container.projects.locations.operations.list * @desc Lists all operations in a project in a specific zone or all zones. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.operations.list({ * // The parent (project and location) where the operations will be listed. - * // Specified in the format 'projects/ { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.locations.operations.list * @memberOf! () * @@ -6931,58 +7403,59 @@ export namespace container_v1 { * container.projects.zones.getServerconfig * @desc Returns configuration info about the Google Kubernetes Engine service. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.getServerconfig({ + * // The name (project and location) of the server config to get, + * // specified in the format 'projects/x/locations/x'. + * name: 'placeholder-value', * // Deprecated. The Google Developers Console [project ID or project * // number](https://support.google.com/cloud/answer/6158840). * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * + * projectId: 'placeholder-value', * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) to return operations for. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * container.projects.zones.getServerconfig(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // [zone](https://cloud.google.com/compute/docs/zones#available) to return + * // operations for. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "defaultClusterVersion": "my_defaultClusterVersion", + * // "defaultImageType": "my_defaultImageType", + * // "validImageTypes": [], + * // "validMasterVersions": [], + * // "validNodeVersions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.getServerconfig * @memberOf! () * @@ -7091,67 +7564,80 @@ export namespace container_v1 { * container.projects.zones.clusters.addons * @desc Sets the addons for a specific cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.addons({ * // Deprecated. The name of the cluster to upgrade. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * clusterId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "addonsConfig": {}, + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.addons(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.addons * @memberOf! () * @@ -7230,67 +7716,79 @@ export namespace container_v1 { * container.projects.zones.clusters.completeIpRotation * @desc Completes master IP rotation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://developers.google.com/console/help/new/#projectnumber). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.completeIpRotation({ * // Deprecated. The name of the cluster. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * clusterId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://developers.google.com/console/help/new/#projectnumber). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.completeIpRotation(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.completeIpRotation * @memberOf! () * @@ -7369,63 +7867,76 @@ export namespace container_v1 { * container.projects.zones.clusters.create * @desc Creates a cluster, consisting of the specified number and type of Google Compute Engine instances. By default, the cluster is created in the project's [default network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). One firewall is added for the cluster. After cluster creation, the Kubelet creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster. Finally, an entry is added to the project's global metadata indicating which CIDR range the cluster is using. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await container.projects.zones.clusters.create({ * // Deprecated. The Google Developers Console [project ID or project * // number](https://support.google.com/cloud/answer/6158840). * // This field has been deprecated and replaced by the parent field. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * + * projectId: 'placeholder-value', * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the parent field. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the parent + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "cluster": {}, + * // "parent": "my_parent", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.create * @memberOf! () * @@ -7502,63 +8013,71 @@ export namespace container_v1 { * container.projects.zones.clusters.delete * @desc Deletes the cluster, including the Kubernetes endpoint and all worker nodes. Firewalls and routes that were configured during cluster creation are also deleted. Other Google Compute Engine resources that might be in use by the cluster, such as load balancer resources, are not deleted if they weren't present when the cluster was initially created. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.delete({ * // Deprecated. The name of the cluster to delete. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * clusterId: 'placeholder-value', + * // The name (project, location, cluster) of the cluster to delete. + * // Specified in the format 'projects/x/locations/x/clusters/x'. + * name: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.delete * @memberOf! () * @@ -7637,63 +8156,107 @@ export namespace container_v1 { * container.projects.zones.clusters.get * @desc Gets the details of a specific cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.get({ * // Deprecated. The name of the cluster to retrieve. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * clusterId: 'placeholder-value', + * // The name (project, location, cluster) of the cluster to retrieve. + * // Specified in the format 'projects/x/locations/x/clusters/x'. + * name: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "addonsConfig": {}, + * // "authenticatorGroupsConfig": {}, + * // "autoscaling": {}, + * // "binaryAuthorization": {}, + * // "clusterIpv4Cidr": "my_clusterIpv4Cidr", + * // "conditions": [], + * // "createTime": "my_createTime", + * // "currentMasterVersion": "my_currentMasterVersion", + * // "currentNodeCount": 0, + * // "currentNodeVersion": "my_currentNodeVersion", + * // "databaseEncryption": {}, + * // "defaultMaxPodsConstraint": {}, + * // "description": "my_description", + * // "enableKubernetesAlpha": false, + * // "enableTpu": false, + * // "endpoint": "my_endpoint", + * // "expireTime": "my_expireTime", + * // "initialClusterVersion": "my_initialClusterVersion", + * // "initialNodeCount": 0, + * // "instanceGroupUrls": [], + * // "ipAllocationPolicy": {}, + * // "labelFingerprint": "my_labelFingerprint", + * // "legacyAbac": {}, + * // "location": "my_location", + * // "locations": [], + * // "loggingService": "my_loggingService", + * // "maintenancePolicy": {}, + * // "masterAuth": {}, + * // "masterAuthorizedNetworksConfig": {}, + * // "monitoringService": "my_monitoringService", + * // "name": "my_name", + * // "network": "my_network", + * // "networkConfig": {}, + * // "networkPolicy": {}, + * // "nodeConfig": {}, + * // "nodeIpv4CidrSize": 0, + * // "nodePools": [], + * // "privateClusterConfig": {}, + * // "resourceLabels": {}, + * // "resourceUsageExportConfig": {}, + * // "selfLink": "my_selfLink", + * // "servicesIpv4Cidr": "my_servicesIpv4Cidr", + * // "shieldedNodes": {}, + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "subnetwork": "my_subnetwork", + * // "tpuIpv4CidrBlock": "my_tpuIpv4CidrBlock", + * // "verticalPodAutoscaling": {}, + * // "workloadIdentityConfig": {}, + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.get * @memberOf! () * @@ -7770,67 +8333,80 @@ export namespace container_v1 { * container.projects.zones.clusters.legacyAbac * @desc Enables or disables the ABAC authorization mechanism on a cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.legacyAbac({ * // Deprecated. The name of the cluster to update. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * clusterId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "enabled": false, + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.legacyAbac(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.legacyAbac * @memberOf! () * @@ -7909,59 +8485,57 @@ export namespace container_v1 { * container.projects.zones.clusters.list * @desc Lists all clusters owned by a project in either the specified zone or all zones. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.list({ + * // The parent (project and location) where the clusters will be listed. + * // Specified in the format 'projects/x/locations/x'. + * // Location "-" matches all zones and all regions. + * parent: 'placeholder-value', * // Deprecated. The Google Developers Console [project ID or project * // number](https://support.google.com/cloud/answer/6158840). * // This field has been deprecated and replaced by the parent field. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * + * projectId: 'placeholder-value', * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides, or "-" for all zones. - * // This field has been deprecated and replaced by the parent field. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides, or "-" for all zones. This field has been deprecated and + * // replaced by the parent field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); * - * container.projects.zones.clusters.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "clusters": [], + * // "missingZones": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.list * @memberOf! () * @@ -8040,67 +8614,80 @@ export namespace container_v1 { * container.projects.zones.clusters.locations * @desc Sets the locations for a specific cluster. Deprecated. Use [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) instead. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.locations({ * // Deprecated. The name of the cluster to upgrade. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * clusterId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "locations": [], + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.locations(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.locations * @memberOf! () * @@ -8179,67 +8766,80 @@ export namespace container_v1 { * container.projects.zones.clusters.logging * @desc Sets the logging service for a specific cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.logging({ * // Deprecated. The name of the cluster to upgrade. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * clusterId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "loggingService": "my_loggingService", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.logging(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.logging * @memberOf! () * @@ -8318,67 +8918,80 @@ export namespace container_v1 { * container.projects.zones.clusters.master * @desc Updates the master for a specific cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.master({ * // Deprecated. The name of the cluster to upgrade. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * clusterId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "masterVersion": "my_masterVersion", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.master(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.master * @memberOf! () * @@ -8457,67 +9070,80 @@ export namespace container_v1 { * container.projects.zones.clusters.monitoring * @desc Sets the monitoring service for a specific cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.monitoring({ * // Deprecated. The name of the cluster to upgrade. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * clusterId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "monitoringService": "my_monitoringService", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.monitoring(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.monitoring * @memberOf! () * @@ -8596,67 +9222,81 @@ export namespace container_v1 { * container.projects.zones.clusters.resourceLabels * @desc Sets labels on a cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://developers.google.com/console/help/new/#projectnumber). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.resourceLabels({ * // Deprecated. The name of the cluster. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * clusterId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://developers.google.com/console/help/new/#projectnumber). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "labelFingerprint": "my_labelFingerprint", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "resourceLabels": {}, + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.resourceLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.resourceLabels * @memberOf! () * @@ -8735,64 +9375,77 @@ export namespace container_v1 { * container.projects.zones.clusters.setMaintenancePolicy * @desc Sets the maintenance policy for a cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // The name of the cluster to update. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await container.projects.zones.clusters.setMaintenancePolicy({ + * // Required. The name of the cluster to update. + * clusterId: 'placeholder-value', + * // Required. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'placeholder-value', + * // Required. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "maintenancePolicy": {}, + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.setMaintenancePolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.setMaintenancePolicy * @memberOf! () * @@ -8873,67 +9526,81 @@ export namespace container_v1 { * container.projects.zones.clusters.setMasterAuth * @desc Sets master auth materials. Currently supports changing the admin password or a specific cluster, either via password generation or explicitly setting the password. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.setMasterAuth({ * // Deprecated. The name of the cluster to upgrade. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * clusterId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "update": {}, + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.setMasterAuth(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.setMasterAuth * @memberOf! () * @@ -9012,67 +9679,80 @@ export namespace container_v1 { * container.projects.zones.clusters.setNetworkPolicy * @desc Enables or disables Network Policy for a cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://developers.google.com/console/help/new/#projectnumber). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.setNetworkPolicy({ * // Deprecated. The name of the cluster. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * clusterId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://developers.google.com/console/help/new/#projectnumber). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "networkPolicy": {}, + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.setNetworkPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.setNetworkPolicy * @memberOf! () * @@ -9151,67 +9831,80 @@ export namespace container_v1 { * container.projects.zones.clusters.startIpRotation * @desc Starts master IP rotation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://developers.google.com/console/help/new/#projectnumber). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.startIpRotation({ * // Deprecated. The name of the cluster. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * clusterId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://developers.google.com/console/help/new/#projectnumber). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "rotateCredentials": false, + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.startIpRotation(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.startIpRotation * @memberOf! () * @@ -9290,68 +9983,80 @@ export namespace container_v1 { * container.projects.zones.clusters.update * @desc Updates the settings of a specific cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.update({ * // Deprecated. The name of the cluster to upgrade. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * clusterId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "update": {}, + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.update * @memberOf! () * @@ -9852,71 +10557,84 @@ export namespace container_v1 { * container.projects.zones.clusters.nodePools.autoscaling * @desc Sets the autoscaling settings for the specified node pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.nodePools.autoscaling({ * // Deprecated. The name of the cluster to upgrade. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * + * clusterId: 'placeholder-value', * // Deprecated. The name of the node pool to upgrade. * // This field has been deprecated and replaced by the name field. - * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * nodePoolId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscaling": {}, + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "nodePoolId": "my_nodePoolId", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.nodePools.autoscaling(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.nodePools.autoscaling * @memberOf! () * @@ -9996,67 +10714,80 @@ export namespace container_v1 { * container.projects.zones.clusters.nodePools.create * @desc Creates a node pool for a cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://developers.google.com/console/help/new/#projectnumber). - * // This field has been deprecated and replaced by the parent field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the parent field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.nodePools.create({ * // Deprecated. The name of the cluster. * // This field has been deprecated and replaced by the parent field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * clusterId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://developers.google.com/console/help/new/#projectnumber). + * // This field has been deprecated and replaced by the parent field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the parent + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "nodePool": {}, + * // "parent": "my_parent", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.nodePools.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.nodePools.create * @memberOf! () * @@ -10135,67 +10866,75 @@ export namespace container_v1 { * container.projects.zones.clusters.nodePools.delete * @desc Deletes a node pool from a cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://developers.google.com/console/help/new/#projectnumber). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.nodePools.delete({ * // Deprecated. The name of the cluster. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * + * clusterId: 'placeholder-value', + * // The name (project, location, cluster, node pool id) of the node pool to + * // delete. Specified in the format + * // 'projects/x/locations/x/clusters/x/nodePools/x'. + * name: 'placeholder-value', * // Deprecated. The name of the node pool to delete. * // This field has been deprecated and replaced by the name field. - * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.nodePools.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * nodePoolId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://developers.google.com/console/help/new/#projectnumber). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.nodePools.delete * @memberOf! () * @@ -10275,67 +11014,76 @@ export namespace container_v1 { * container.projects.zones.clusters.nodePools.get * @desc Retrieves the requested node pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://developers.google.com/console/help/new/#projectnumber). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.nodePools.get({ * // Deprecated. The name of the cluster. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * + * clusterId: 'placeholder-value', + * // The name (project, location, cluster, node pool id) of the node pool to + * // get. Specified in the format + * // 'projects/x/locations/x/clusters/x/nodePools/x'. + * name: 'placeholder-value', * // Deprecated. The name of the node pool. * // This field has been deprecated and replaced by the name field. - * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.nodePools.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * nodePoolId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://developers.google.com/console/help/new/#projectnumber). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoscaling": {}, + * // "conditions": [], + * // "config": {}, + * // "initialNodeCount": 0, + * // "instanceGroupUrls": [], + * // "locations": [], + * // "management": {}, + * // "maxPodsConstraint": {}, + * // "name": "my_name", + * // "podIpv4CidrSize": 0, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "upgradeSettings": {}, + * // "version": "my_version" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.nodePools.get * @memberOf! () * @@ -10413,63 +11161,58 @@ export namespace container_v1 { * container.projects.zones.clusters.nodePools.list * @desc Lists the node pools for a cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://developers.google.com/console/help/new/#projectnumber). - * // This field has been deprecated and replaced by the parent field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the parent field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.nodePools.list({ * // Deprecated. The name of the cluster. * // This field has been deprecated and replaced by the parent field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * clusterId: 'placeholder-value', + * // The parent (project, location, cluster id) where the node pools will be + * // listed. Specified in the format 'projects/x/locations/x/clusters/x'. + * parent: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://developers.google.com/console/help/new/#projectnumber). + * // This field has been deprecated and replaced by the parent field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the parent + * // field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); * - * container.projects.zones.clusters.nodePools.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "nodePools": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.nodePools.list * @memberOf! () * @@ -10550,71 +11293,83 @@ export namespace container_v1 { * container.projects.zones.clusters.nodePools.rollback * @desc Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.nodePools.rollback({ * // Deprecated. The name of the cluster to rollback. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * + * clusterId: 'placeholder-value', * // Deprecated. The name of the node pool to rollback. * // This field has been deprecated and replaced by the name field. - * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * nodePoolId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "nodePoolId": "my_nodePoolId", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.nodePools.rollback(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.nodePools.rollback * @memberOf! () * @@ -10694,71 +11449,84 @@ export namespace container_v1 { * container.projects.zones.clusters.nodePools.setManagement * @desc Sets the NodeManagement options for a node pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.nodePools.setManagement({ * // Deprecated. The name of the cluster to update. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * + * clusterId: 'placeholder-value', * // Deprecated. The name of the node pool to update. * // This field has been deprecated and replaced by the name field. - * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * nodePoolId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "management": {}, + * // "name": "my_name", + * // "nodePoolId": "my_nodePoolId", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.nodePools.setManagement(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.nodePools.setManagement * @memberOf! () * @@ -10838,71 +11606,84 @@ export namespace container_v1 { * container.projects.zones.clusters.nodePools.setSize * @desc Sets the size for a specific node pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.nodePools.setSize({ * // Deprecated. The name of the cluster to update. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * + * clusterId: 'placeholder-value', * // Deprecated. The name of the node pool to update. * // This field has been deprecated and replaced by the name field. - * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * nodePoolId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "nodeCount": 0, + * // "nodePoolId": "my_nodePoolId", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.nodePools.setSize(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.nodePools.setSize * @memberOf! () * @@ -10982,71 +11763,88 @@ export namespace container_v1 { * container.projects.zones.clusters.nodePools.update * @desc Updates the version and/or image type for the specified node pool. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.clusters.nodePools.update({ * // Deprecated. The name of the cluster to upgrade. * // This field has been deprecated and replaced by the name field. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * + * clusterId: 'placeholder-value', * // Deprecated. The name of the node pool to upgrade. * // This field has been deprecated and replaced by the name field. - * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * nodePoolId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "imageType": "my_imageType", + * // "locations": [], + * // "name": "my_name", + * // "nodePoolId": "my_nodePoolId", + * // "nodeVersion": "my_nodeVersion", + * // "projectId": "my_projectId", + * // "upgradeSettings": {}, + * // "workloadMetadataConfig": {}, + * // "zone": "my_zone" + * // } * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.nodePools.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.clusters.nodePools.update * @memberOf! () * @@ -11384,63 +12182,64 @@ export namespace container_v1 { * container.projects.zones.operations.cancel * @desc Cancels the specified operation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the operation resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.operations.cancel({ * // Deprecated. The server-assigned `name` of the operation. * // This field has been deprecated and replaced by the name field. - * operationId: 'my-operation-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * operationId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // operation resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name", + * // "operationId": "my_operationId", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * container.projects.zones.operations.cancel(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.operations.cancel * @memberOf! () * @@ -11517,63 +12316,71 @@ export namespace container_v1 { * container.projects.zones.operations.get * @desc Gets the specified operation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('v1'); * - * authorize(function(authClient) { - * var request = { - * // Deprecated. The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * // This field has been deprecated and replaced by the name field. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * // This field has been deprecated and replaced by the name field. - * zone: 'my-zone', // TODO: Update placeholder value. + * // 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 container.projects.zones.operations.get({ + * // The name (project, location, operation id) of the operation to get. + * // Specified in the format 'projects/x/locations/x/operations/x'. + * name: 'placeholder-value', * // Deprecated. The server-assigned `name` of the operation. * // This field has been deprecated and replaced by the name field. - * operationId: 'my-operation-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * container.projects.zones.operations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * operationId: 'placeholder-value', + * // Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.operations.get * @memberOf! () * @@ -11652,58 +12459,57 @@ export namespace container_v1 { * container.projects.zones.operations.list * @desc Lists all operations in a project in a specific zone or all zones. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Kubernetes Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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'); - * var container = google.container('v1'); + * const container = google.container('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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await container.projects.zones.operations.list({ + * // The parent (project and location) where the operations will be listed. + * // Specified in the format 'projects/x/locations/x'. + * // Location "-" matches all zones and all regions. + * parent: 'placeholder-value', * // Deprecated. The Google Developers Console [project ID or project * // number](https://support.google.com/cloud/answer/6158840). * // This field has been deprecated and replaced by the parent field. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * + * projectId: 'placeholder-value', * // Deprecated. The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) to return operations for, or `-` for - * // all zones. This field has been deprecated and replaced by the parent field. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * // [zone](https://cloud.google.com/compute/docs/zones#available) to return + * // operations for, or `-` for all zones. This field has been deprecated and + * // replaced by the parent field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); * - * container.projects.zones.operations.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "missingZones": [], + * // "operations": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias container.projects.zones.operations.list * @memberOf! () * diff --git a/src/apis/container/v1beta1.ts b/src/apis/container/v1beta1.ts index dced4bff273..82d95b2196a 100644 --- a/src/apis/container/v1beta1.ts +++ b/src/apis/container/v1beta1.ts @@ -2370,6 +2370,61 @@ export namespace container_v1beta1 { /** * container.projects.aggregated.usableSubnetworks.list * @desc Lists subnetworks that can be used for creating clusters in a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.aggregated.usableSubnetworks.list({ + * // Filtering currently only supports equality on the networkProjectId and must + * // be in the form: "networkProjectId=[PROJECTID]", where `networkProjectId` + * // is the project which owns the listed subnetworks. This defaults to the + * // parent project ID. + * filter: 'placeholder-value', + * // The max number of results per page that should be returned. If the number + * // of available results is larger than `page_size`, a `next_page_token` is + * // returned which can be used to get the next page of results in subsequent + * // requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * pageSize: 'placeholder-value', + * // Specifies a page token to use. Set this to the nextPageToken returned by + * // previous list requests to get the next page of results. + * pageToken: 'placeholder-value', + * // Required. The parent project where subnetworks are usable. + * // Specified in the format 'projects/x'. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "subnetworks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.aggregated.usableSubnetworks.list * @memberOf! () * @@ -2493,6 +2548,61 @@ export namespace container_v1beta1 { /** * container.projects.locations.getServerConfig * @desc Returns configuration info about the Google Kubernetes Engine service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.getServerConfig({ + * // The name (project and location) of the server config to get, + * // specified in the format 'projects/x/locations/x'. + * name: 'projects/my-project/locations/my-location', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) to return + * // operations for. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "channels": [], + * // "defaultClusterVersion": "my_defaultClusterVersion", + * // "defaultImageType": "my_defaultImageType", + * // "validImageTypes": [], + * // "validMasterVersions": [], + * // "validNodeVersions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.getServerConfig * @memberOf! () * @@ -2569,6 +2679,48 @@ export namespace container_v1beta1 { /** * container.projects.locations.list * @desc Fetches locations that offer Google Kubernetes Engine. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.list({ + * // Required. Contains the name of the resource requested. + * // Specified in the format 'projects/x'. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.list * @memberOf! () * @@ -2693,6 +2845,71 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.completeIpRotation * @desc Completes master IP rotation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.completeIpRotation({ + * // The name (project, location, cluster id) of the cluster to complete IP + * // rotation. Specified in the format 'projects/x/locations/x/clusters/x'. + * name: 'projects/my-project/locations/my-location/clusters/my-cluster', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.completeIpRotation * @memberOf! () * @@ -2768,6 +2985,71 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.create * @desc Creates a cluster, consisting of the specified number and type of Google Compute Engine instances. By default, the cluster is created in the project's [default network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). One firewall is added for the cluster. After cluster creation, the Kubelet creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster. Finally, an entry is added to the project's global metadata indicating which CIDR range the cluster is using. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.create({ + * // The parent (project and location) where the cluster will be created. + * // Specified in the format 'projects/x/locations/x'. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "cluster": {}, + * // "parent": "my_parent", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.create * @memberOf! () * @@ -2843,6 +3125,72 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.delete * @desc Deletes the cluster, including the Kubernetes endpoint and all worker nodes. Firewalls and routes that were configured during cluster creation are also deleted. Other Google Compute Engine resources that might be in use by the cluster, such as load balancer resources, are not deleted if they weren't present when the cluster was initially created. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.delete({ + * // Required. Deprecated. The name of the cluster to delete. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // The name (project, location, cluster) of the cluster to delete. + * // Specified in the format 'projects/x/locations/x/clusters/x'. + * name: 'projects/my-project/locations/my-location/clusters/my-cluster', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.delete * @memberOf! () * @@ -2917,6 +3265,114 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.get * @desc Gets the details for a specific cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.get({ + * // Required. Deprecated. The name of the cluster to retrieve. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // The name (project, location, cluster) of the cluster to retrieve. + * // Specified in the format 'projects/x/locations/x/clusters/x'. + * name: 'projects/my-project/locations/my-location/clusters/my-cluster', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "addonsConfig": {}, + * // "authenticatorGroupsConfig": {}, + * // "autoscaling": {}, + * // "binaryAuthorization": {}, + * // "clusterIpv4Cidr": "my_clusterIpv4Cidr", + * // "clusterTelemetry": {}, + * // "conditions": [], + * // "createTime": "my_createTime", + * // "currentMasterVersion": "my_currentMasterVersion", + * // "currentNodeCount": 0, + * // "currentNodeVersion": "my_currentNodeVersion", + * // "databaseEncryption": {}, + * // "defaultMaxPodsConstraint": {}, + * // "description": "my_description", + * // "enableKubernetesAlpha": false, + * // "enableTpu": false, + * // "endpoint": "my_endpoint", + * // "expireTime": "my_expireTime", + * // "initialClusterVersion": "my_initialClusterVersion", + * // "initialNodeCount": 0, + * // "instanceGroupUrls": [], + * // "ipAllocationPolicy": {}, + * // "labelFingerprint": "my_labelFingerprint", + * // "legacyAbac": {}, + * // "location": "my_location", + * // "locations": [], + * // "loggingService": "my_loggingService", + * // "maintenancePolicy": {}, + * // "masterAuth": {}, + * // "masterAuthorizedNetworksConfig": {}, + * // "masterIpv4CidrBlock": "my_masterIpv4CidrBlock", + * // "monitoringService": "my_monitoringService", + * // "name": "my_name", + * // "network": "my_network", + * // "networkConfig": {}, + * // "networkPolicy": {}, + * // "nodeConfig": {}, + * // "nodeIpv4CidrSize": 0, + * // "nodePools": [], + * // "podSecurityPolicyConfig": {}, + * // "privateCluster": false, + * // "privateClusterConfig": {}, + * // "releaseChannel": {}, + * // "resourceLabels": {}, + * // "resourceUsageExportConfig": {}, + * // "selfLink": "my_selfLink", + * // "servicesIpv4Cidr": "my_servicesIpv4Cidr", + * // "shieldedNodes": {}, + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "subnetwork": "my_subnetwork", + * // "tpuConfig": {}, + * // "tpuIpv4CidrBlock": "my_tpuIpv4CidrBlock", + * // "verticalPodAutoscaling": {}, + * // "workloadIdentityConfig": {}, + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.get * @memberOf! () * @@ -2989,6 +3445,48 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.getJwks * @desc Gets the public component of the cluster signing keys in JSON Web Key format. This API is not yet intended for general use, and is not available for all clusters. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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: [], + * }); + * + * // 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 container.projects.locations.clusters.getJwks({ + * // The cluster (project, location, cluster id) to get keys for. Specified in + * // the format 'projects/x/locations/x/clusters/x'. + * parent: 'projects/my-project/locations/my-location/clusters/my-cluster', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cacheHeader": {}, + * // "keys": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.getJwks * @memberOf! () * @@ -3067,6 +3565,58 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.list * @desc Lists all clusters owned by a project in either the specified zone or all zones. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.list({ + * // The parent (project and location) where the clusters will be listed. + * // Specified in the format 'projects/x/locations/x'. + * // Location "-" matches all zones and all regions. + * parent: 'projects/my-project/locations/my-location', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the parent field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides, or "-" for all zones. This field has been deprecated and + * // replaced by the parent field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusters": [], + * // "missingZones": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.list * @memberOf! () * @@ -3145,6 +3695,72 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.setAddons * @desc Sets the addons for a specific cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.setAddons({ + * // The name (project, location, cluster) of the cluster to set addons. + * // Specified in the format 'projects/x/locations/x/clusters/x'. + * name: 'projects/my-project/locations/my-location/clusters/my-cluster', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "addonsConfig": {}, + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.setAddons * @memberOf! () * @@ -3220,6 +3836,72 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.setLegacyAbac * @desc Enables or disables the ABAC authorization mechanism on a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.setLegacyAbac({ + * // The name (project, location, cluster id) of the cluster to set legacy abac. + * // Specified in the format 'projects/x/locations/x/clusters/x'. + * name: 'projects/my-project/locations/my-location/clusters/my-cluster', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "enabled": false, + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.setLegacyAbac * @memberOf! () * @@ -3295,6 +3977,72 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.setLocations * @desc Sets the locations for a specific cluster. Deprecated. Use [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters/update) instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.setLocations({ + * // The name (project, location, cluster) of the cluster to set locations. + * // Specified in the format 'projects/x/locations/x/clusters/x'. + * name: 'projects/my-project/locations/my-location/clusters/my-cluster', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "locations": [], + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.setLocations * @memberOf! () * @@ -3370,6 +4118,72 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.setLogging * @desc Sets the logging service for a specific cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.setLogging({ + * // The name (project, location, cluster) of the cluster to set logging. + * // Specified in the format 'projects/x/locations/x/clusters/x'. + * name: 'projects/my-project/locations/my-location/clusters/my-cluster', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "loggingService": "my_loggingService", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.setLogging * @memberOf! () * @@ -3445,6 +4259,73 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.setMaintenancePolicy * @desc Sets the maintenance policy for a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.setMaintenancePolicy({ + * // The name (project, location, cluster id) of the cluster to set maintenance + * // policy. + * // Specified in the format 'projects/x/locations/x/clusters/x'. + * name: 'projects/my-project/locations/my-location/clusters/my-cluster', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "maintenancePolicy": {}, + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.setMaintenancePolicy * @memberOf! () * @@ -3522,6 +4403,73 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.setMasterAuth * @desc Sets master auth materials. Currently supports changing the admin password or a specific cluster, either via password generation or explicitly setting the password. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.setMasterAuth({ + * // The name (project, location, cluster) of the cluster to set auth. + * // Specified in the format 'projects/x/locations/x/clusters/x'. + * name: 'projects/my-project/locations/my-location/clusters/my-cluster', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "update": {}, + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.setMasterAuth * @memberOf! () * @@ -3597,6 +4545,72 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.setMonitoring * @desc Sets the monitoring service for a specific cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.setMonitoring({ + * // The name (project, location, cluster) of the cluster to set monitoring. + * // Specified in the format 'projects/x/locations/x/clusters/x'. + * name: 'projects/my-project/locations/my-location/clusters/my-cluster', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "monitoringService": "my_monitoringService", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.setMonitoring * @memberOf! () * @@ -3672,6 +4686,72 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.setNetworkPolicy * @desc Enables or disables Network Policy for a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.setNetworkPolicy({ + * // The name (project, location, cluster id) of the cluster to set networking + * // policy. Specified in the format 'projects/x/locations/x/clusters/x'. + * name: 'projects/my-project/locations/my-location/clusters/my-cluster', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "networkPolicy": {}, + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.setNetworkPolicy * @memberOf! () * @@ -3747,6 +4827,73 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.setResourceLabels * @desc Sets labels on a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.setResourceLabels({ + * // The name (project, location, cluster id) of the cluster to set labels. + * // Specified in the format 'projects/x/locations/x/clusters/x'. + * name: 'projects/my-project/locations/my-location/clusters/my-cluster', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "labelFingerprint": "my_labelFingerprint", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "resourceLabels": {}, + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.setResourceLabels * @memberOf! () * @@ -3822,6 +4969,72 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.startIpRotation * @desc Starts master IP rotation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.startIpRotation({ + * // The name (project, location, cluster id) of the cluster to start IP + * // rotation. Specified in the format 'projects/x/locations/x/clusters/x'. + * name: 'projects/my-project/locations/my-location/clusters/my-cluster', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "rotateCredentials": false, + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.startIpRotation * @memberOf! () * @@ -3897,6 +5110,72 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.update * @desc Updates the settings for a specific cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.update({ + * // The name (project, location, cluster) of the cluster to update. + * // Specified in the format 'projects/x/locations/x/clusters/x'. + * name: 'projects/my-project/locations/my-location/clusters/my-cluster', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "update": {}, + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.update * @memberOf! () * @@ -3969,6 +5248,72 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.updateMaster * @desc Updates the master for a specific cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.updateMaster({ + * // The name (project, location, cluster) of the cluster to update. + * // Specified in the format 'projects/x/locations/x/clusters/x'. + * name: 'projects/my-project/locations/my-location/clusters/my-cluster', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "masterVersion": "my_masterVersion", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.updateMaster * @memberOf! () * @@ -4370,6 +5715,73 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.nodePools.create * @desc Creates a node pool for a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.nodePools.create({ + * // The parent (project, location, cluster id) where the node pool will be + * // created. Specified in the format + * // 'projects/x/locations/x/clusters/x'. + * parent: 'projects/my-project/locations/my-location/clusters/my-cluster', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "nodePool": {}, + * // "parent": "my_parent", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.nodePools.create * @memberOf! () * @@ -4445,6 +5857,77 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.nodePools.delete * @desc Deletes a node pool from a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.nodePools.delete({ + * // Required. Deprecated. The name of the cluster. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // The name (project, location, cluster, node pool id) of the node pool to + * // delete. Specified in the format + * // 'projects/x/locations/x/clusters/x/nodePools/x'. + * name: + * 'projects/my-project/locations/my-location/clusters/my-cluster/nodePools/my-nodePool', + * // Required. Deprecated. The name of the node pool to delete. + * // This field has been deprecated and replaced by the name field. + * nodePoolId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://developers.google.com/console/help/new/#projectnumber). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.nodePools.delete * @memberOf! () * @@ -4520,6 +6003,78 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.nodePools.get * @desc Retrieves the requested node pool. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.nodePools.get({ + * // Required. Deprecated. The name of the cluster. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // The name (project, location, cluster, node pool id) of the node pool to + * // get. Specified in the format + * // 'projects/x/locations/x/clusters/x/nodePools/x'. + * name: + * 'projects/my-project/locations/my-location/clusters/my-cluster/nodePools/my-nodePool', + * // Required. Deprecated. The name of the node pool. + * // This field has been deprecated and replaced by the name field. + * nodePoolId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://developers.google.com/console/help/new/#projectnumber). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoscaling": {}, + * // "conditions": [], + * // "config": {}, + * // "initialNodeCount": 0, + * // "instanceGroupUrls": [], + * // "locations": [], + * // "management": {}, + * // "maxPodsConstraint": {}, + * // "name": "my_name", + * // "podIpv4CidrSize": 0, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "upgradeSettings": {}, + * // "version": "my_version" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.nodePools.get * @memberOf! () * @@ -4593,6 +6148,59 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.nodePools.list * @desc Lists the node pools for a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.nodePools.list({ + * // Required. Deprecated. The name of the cluster. + * // This field has been deprecated and replaced by the parent field. + * clusterId: 'placeholder-value', + * // The parent (project, location, cluster id) where the node pools will be + * // listed. Specified in the format 'projects/x/locations/x/clusters/x'. + * parent: 'projects/my-project/locations/my-location/clusters/my-cluster', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://developers.google.com/console/help/new/#projectnumber). + * // This field has been deprecated and replaced by the parent field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the parent + * // field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nodePools": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.nodePools.list * @memberOf! () * @@ -4672,6 +6280,74 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.nodePools.rollback * @desc Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.nodePools.rollback({ + * // The name (project, location, cluster, node pool id) of the node poll to + * // rollback upgrade. + * // Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * name: + * 'projects/my-project/locations/my-location/clusters/my-cluster/nodePools/my-nodePool', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "nodePoolId": "my_nodePoolId", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.nodePools.rollback * @memberOf! () * @@ -4747,6 +6423,77 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.nodePools.setAutoscaling * @desc Sets the autoscaling settings of a specific node pool. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.nodePools.setAutoscaling( + * { + * // The name (project, location, cluster, node pool) of the node pool to set + * // autoscaler settings. Specified in the format + * // 'projects/x/locations/x/clusters/x/nodePools/x'. + * name: + * 'projects/my-project/locations/my-location/clusters/my-cluster/nodePools/my-nodePool', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscaling": {}, + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "nodePoolId": "my_nodePoolId", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.nodePools.setAutoscaling * @memberOf! () * @@ -4822,6 +6569,77 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.nodePools.setManagement * @desc Sets the NodeManagement options for a node pool. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.nodePools.setManagement( + * { + * // The name (project, location, cluster, node pool id) of the node pool to set + * // management properties. Specified in the format + * // 'projects/x/locations/x/clusters/x/nodePools/x'. + * name: + * 'projects/my-project/locations/my-location/clusters/my-cluster/nodePools/my-nodePool', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "management": {}, + * // "name": "my_name", + * // "nodePoolId": "my_nodePoolId", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.nodePools.setManagement * @memberOf! () * @@ -4897,6 +6715,75 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.nodePools.setSize * @desc Sets the size for a specific node pool. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.nodePools.setSize({ + * // The name (project, location, cluster, node pool id) of the node pool to set + * // size. + * // Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * name: + * 'projects/my-project/locations/my-location/clusters/my-cluster/nodePools/my-nodePool', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "nodeCount": 0, + * // "nodePoolId": "my_nodePoolId", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.nodePools.setSize * @memberOf! () * @@ -4972,6 +6859,79 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.nodePools.update * @desc Updates the version and/or image type of a specific node pool. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.clusters.nodePools.update({ + * // The name (project, location, cluster, node pool) of the node pool to + * // update. Specified in the format + * // 'projects/x/locations/x/clusters/x/nodePools/x'. + * name: + * 'projects/my-project/locations/my-location/clusters/my-cluster/nodePools/my-nodePool', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "imageType": "my_imageType", + * // "locations": [], + * // "name": "my_name", + * // "nodePoolId": "my_nodePoolId", + * // "nodeVersion": "my_nodeVersion", + * // "projectId": "my_projectId", + * // "upgradeSettings": {}, + * // "workloadMetadataConfig": {}, + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.nodePools.update * @memberOf! () * @@ -5234,6 +7194,57 @@ export namespace container_v1beta1 { /** * container.projects.locations.clusters.well-known.getOpenid-configuration * @desc Gets the OIDC discovery document for the cluster. See the [OpenID Connect Discovery 1.0 specification](https://openid.net/specs/openid-connect-discovery-1_0.html) for details. This API is not yet intended for general use, and is not available for all clusters. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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: [], + * }); + * + * // 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 container.projects.locations.clusters.well) - + * known.getOpenid - + * configuration({ + * // The cluster (project, location, cluster id) to get the discovery document + * // for. Specified in the format 'projects/x/locations/x/clusters/x'. + * parent: 'projects/my-project/locations/my-location/clusters/my-cluster', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cacheHeader": {}, + * // "claims_supported": [], + * // "grant_types": [], + * // "id_token_signing_alg_values_supported": [], + * // "issuer": "my_issuer", + * // "jwks_uri": "my_jwks_uri", + * // "response_types_supported": [], + * // "subject_types_supported": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.clusters.well-known.getOpenid-configuration * @memberOf! () * @@ -5331,6 +7342,56 @@ export namespace container_v1beta1 { /** * container.projects.locations.operations.cancel * @desc Cancels the specified operation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.operations.cancel({ + * // The name (project, location, operation id) of the operation to cancel. + * // Specified in the format 'projects/x/locations/x/operations/x'. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name", + * // "operationId": "my_operationId", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.operations.cancel * @memberOf! () * @@ -5404,6 +7465,72 @@ export namespace container_v1beta1 { /** * container.projects.locations.operations.get * @desc Gets the specified operation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.operations.get({ + * // The name (project, location, operation id) of the operation to get. + * // Specified in the format 'projects/x/locations/x/operations/x'. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * // Required. Deprecated. The server-assigned `name` of the operation. + * // This field has been deprecated and replaced by the name field. + * operationId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.operations.get * @memberOf! () * @@ -5478,6 +7605,58 @@ export namespace container_v1beta1 { /** * container.projects.locations.operations.list * @desc Lists all operations in a project in the specified zone or all zones. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.locations.operations.list({ + * // The parent (project and location) where the operations will be listed. + * // Specified in the format 'projects/x/locations/x'. + * // Location "-" matches all zones and all regions. + * parent: 'projects/my-project/locations/my-location', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the parent field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) to return + * // operations for, or `-` for all zones. This field has been deprecated and + * // replaced by the parent field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "missingZones": [], + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.locations.operations.list * @memberOf! () * @@ -5629,6 +7808,61 @@ export namespace container_v1beta1 { /** * container.projects.zones.getServerconfig * @desc Returns configuration info about the Google Kubernetes Engine service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.getServerconfig({ + * // The name (project and location) of the server config to get, + * // specified in the format 'projects/x/locations/x'. + * name: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) to return + * // operations for. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "channels": [], + * // "defaultClusterVersion": "my_defaultClusterVersion", + * // "defaultImageType": "my_defaultImageType", + * // "validImageTypes": [], + * // "validMasterVersions": [], + * // "validNodeVersions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.getServerconfig * @memberOf! () * @@ -5737,6 +7971,81 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.addons * @desc Sets the addons for a specific cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.addons({ + * // Required. Deprecated. The name of the cluster to upgrade. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "addonsConfig": {}, + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.addons * @memberOf! () * @@ -5814,6 +8123,80 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.completeIpRotation * @desc Completes master IP rotation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.completeIpRotation({ + * // Required. Deprecated. The name of the cluster. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://developers.google.com/console/help/new/#projectnumber). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.completeIpRotation * @memberOf! () * @@ -5891,6 +8274,77 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.create * @desc Creates a cluster, consisting of the specified number and type of Google Compute Engine instances. By default, the cluster is created in the project's [default network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). One firewall is added for the cluster. After cluster creation, the Kubelet creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster. Finally, an entry is added to the project's global metadata indicating which CIDR range the cluster is using. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.create({ + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the parent field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the parent + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "cluster": {}, + * // "parent": "my_parent", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.create * @memberOf! () * @@ -5966,6 +8420,72 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.delete * @desc Deletes the cluster, including the Kubernetes endpoint and all worker nodes. Firewalls and routes that were configured during cluster creation are also deleted. Other Google Compute Engine resources that might be in use by the cluster, such as load balancer resources, are not deleted if they weren't present when the cluster was initially created. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.delete({ + * // Required. Deprecated. The name of the cluster to delete. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // The name (project, location, cluster) of the cluster to delete. + * // Specified in the format 'projects/x/locations/x/clusters/x'. + * name: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.delete * @memberOf! () * @@ -6043,6 +8563,114 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.get * @desc Gets the details for a specific cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.get({ + * // Required. Deprecated. The name of the cluster to retrieve. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // The name (project, location, cluster) of the cluster to retrieve. + * // Specified in the format 'projects/x/locations/x/clusters/x'. + * name: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "addonsConfig": {}, + * // "authenticatorGroupsConfig": {}, + * // "autoscaling": {}, + * // "binaryAuthorization": {}, + * // "clusterIpv4Cidr": "my_clusterIpv4Cidr", + * // "clusterTelemetry": {}, + * // "conditions": [], + * // "createTime": "my_createTime", + * // "currentMasterVersion": "my_currentMasterVersion", + * // "currentNodeCount": 0, + * // "currentNodeVersion": "my_currentNodeVersion", + * // "databaseEncryption": {}, + * // "defaultMaxPodsConstraint": {}, + * // "description": "my_description", + * // "enableKubernetesAlpha": false, + * // "enableTpu": false, + * // "endpoint": "my_endpoint", + * // "expireTime": "my_expireTime", + * // "initialClusterVersion": "my_initialClusterVersion", + * // "initialNodeCount": 0, + * // "instanceGroupUrls": [], + * // "ipAllocationPolicy": {}, + * // "labelFingerprint": "my_labelFingerprint", + * // "legacyAbac": {}, + * // "location": "my_location", + * // "locations": [], + * // "loggingService": "my_loggingService", + * // "maintenancePolicy": {}, + * // "masterAuth": {}, + * // "masterAuthorizedNetworksConfig": {}, + * // "masterIpv4CidrBlock": "my_masterIpv4CidrBlock", + * // "monitoringService": "my_monitoringService", + * // "name": "my_name", + * // "network": "my_network", + * // "networkConfig": {}, + * // "networkPolicy": {}, + * // "nodeConfig": {}, + * // "nodeIpv4CidrSize": 0, + * // "nodePools": [], + * // "podSecurityPolicyConfig": {}, + * // "privateCluster": false, + * // "privateClusterConfig": {}, + * // "releaseChannel": {}, + * // "resourceLabels": {}, + * // "resourceUsageExportConfig": {}, + * // "selfLink": "my_selfLink", + * // "servicesIpv4Cidr": "my_servicesIpv4Cidr", + * // "shieldedNodes": {}, + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "subnetwork": "my_subnetwork", + * // "tpuConfig": {}, + * // "tpuIpv4CidrBlock": "my_tpuIpv4CidrBlock", + * // "verticalPodAutoscaling": {}, + * // "workloadIdentityConfig": {}, + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.get * @memberOf! () * @@ -6118,6 +8746,81 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.legacyAbac * @desc Enables or disables the ABAC authorization mechanism on a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.legacyAbac({ + * // Required. Deprecated. The name of the cluster to update. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "enabled": false, + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.legacyAbac * @memberOf! () * @@ -6195,6 +8898,58 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.list * @desc Lists all clusters owned by a project in either the specified zone or all zones. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.list({ + * // The parent (project and location) where the clusters will be listed. + * // Specified in the format 'projects/x/locations/x'. + * // Location "-" matches all zones and all regions. + * parent: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the parent field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides, or "-" for all zones. This field has been deprecated and + * // replaced by the parent field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusters": [], + * // "missingZones": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.list * @memberOf! () * @@ -6272,6 +9027,81 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.locations * @desc Sets the locations for a specific cluster. Deprecated. Use [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters/update) instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.locations({ + * // Required. Deprecated. The name of the cluster to upgrade. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "locations": [], + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.locations * @memberOf! () * @@ -6349,6 +9179,81 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.logging * @desc Sets the logging service for a specific cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.logging({ + * // Required. Deprecated. The name of the cluster to upgrade. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "loggingService": "my_loggingService", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.logging * @memberOf! () * @@ -6426,6 +9331,81 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.master * @desc Updates the master for a specific cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.master({ + * // Required. Deprecated. The name of the cluster to upgrade. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "masterVersion": "my_masterVersion", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.master * @memberOf! () * @@ -6503,6 +9483,81 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.monitoring * @desc Sets the monitoring service for a specific cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.monitoring({ + * // Required. Deprecated. The name of the cluster to upgrade. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "monitoringService": "my_monitoringService", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.monitoring * @memberOf! () * @@ -6580,6 +9635,82 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.resourceLabels * @desc Sets labels on a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.resourceLabels({ + * // Required. Deprecated. The name of the cluster. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://developers.google.com/console/help/new/#projectnumber). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "labelFingerprint": "my_labelFingerprint", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "resourceLabels": {}, + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.resourceLabels * @memberOf! () * @@ -6657,6 +9788,78 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.setMaintenancePolicy * @desc Sets the maintenance policy for a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.setMaintenancePolicy({ + * // Required. The name of the cluster to update. + * clusterId: 'placeholder-value', + * // Required. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'placeholder-value', + * // Required. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "maintenancePolicy": {}, + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.setMaintenancePolicy * @memberOf! () * @@ -6736,6 +9939,82 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.setMasterAuth * @desc Sets master auth materials. Currently supports changing the admin password or a specific cluster, either via password generation or explicitly setting the password. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.setMasterAuth({ + * // Required. Deprecated. The name of the cluster to upgrade. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "update": {}, + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.setMasterAuth * @memberOf! () * @@ -6813,6 +10092,81 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.setNetworkPolicy * @desc Enables or disables Network Policy for a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.setNetworkPolicy({ + * // Required. Deprecated. The name of the cluster. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://developers.google.com/console/help/new/#projectnumber). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "networkPolicy": {}, + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.setNetworkPolicy * @memberOf! () * @@ -6890,6 +10244,81 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.startIpRotation * @desc Starts master IP rotation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.startIpRotation({ + * // Required. Deprecated. The name of the cluster. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://developers.google.com/console/help/new/#projectnumber). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "rotateCredentials": false, + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.startIpRotation * @memberOf! () * @@ -6967,6 +10396,81 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.update * @desc Updates the settings for a specific cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.update({ + * // Required. Deprecated. The name of the cluster to upgrade. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "update": {}, + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.update * @memberOf! () * @@ -7466,6 +10970,85 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.nodePools.autoscaling * @desc Sets the autoscaling settings of a specific node pool. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.nodePools.autoscaling({ + * // Required. Deprecated. The name of the cluster to upgrade. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // Required. Deprecated. The name of the node pool to upgrade. + * // This field has been deprecated and replaced by the name field. + * nodePoolId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoscaling": {}, + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "nodePoolId": "my_nodePoolId", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.nodePools.autoscaling * @memberOf! () * @@ -7544,6 +11127,81 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.nodePools.create * @desc Creates a node pool for a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.nodePools.create({ + * // Required. Deprecated. The name of the cluster. + * // This field has been deprecated and replaced by the parent field. + * clusterId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://developers.google.com/console/help/new/#projectnumber). + * // This field has been deprecated and replaced by the parent field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the parent + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "nodePool": {}, + * // "parent": "my_parent", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.nodePools.create * @memberOf! () * @@ -7621,6 +11279,76 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.nodePools.delete * @desc Deletes a node pool from a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.nodePools.delete({ + * // Required. Deprecated. The name of the cluster. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // The name (project, location, cluster, node pool id) of the node pool to + * // delete. Specified in the format + * // 'projects/x/locations/x/clusters/x/nodePools/x'. + * name: 'placeholder-value', + * // Required. Deprecated. The name of the node pool to delete. + * // This field has been deprecated and replaced by the name field. + * nodePoolId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://developers.google.com/console/help/new/#projectnumber). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.nodePools.delete * @memberOf! () * @@ -7699,6 +11427,77 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.nodePools.get * @desc Retrieves the requested node pool. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.nodePools.get({ + * // Required. Deprecated. The name of the cluster. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // The name (project, location, cluster, node pool id) of the node pool to + * // get. Specified in the format + * // 'projects/x/locations/x/clusters/x/nodePools/x'. + * name: 'placeholder-value', + * // Required. Deprecated. The name of the node pool. + * // This field has been deprecated and replaced by the name field. + * nodePoolId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://developers.google.com/console/help/new/#projectnumber). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoscaling": {}, + * // "conditions": [], + * // "config": {}, + * // "initialNodeCount": 0, + * // "instanceGroupUrls": [], + * // "locations": [], + * // "management": {}, + * // "maxPodsConstraint": {}, + * // "name": "my_name", + * // "podIpv4CidrSize": 0, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "upgradeSettings": {}, + * // "version": "my_version" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.nodePools.get * @memberOf! () * @@ -7775,6 +11574,59 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.nodePools.list * @desc Lists the node pools for a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.nodePools.list({ + * // Required. Deprecated. The name of the cluster. + * // This field has been deprecated and replaced by the parent field. + * clusterId: 'placeholder-value', + * // The parent (project, location, cluster id) where the node pools will be + * // listed. Specified in the format 'projects/x/locations/x/clusters/x'. + * parent: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://developers.google.com/console/help/new/#projectnumber). + * // This field has been deprecated and replaced by the parent field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the parent + * // field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nodePools": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.nodePools.list * @memberOf! () * @@ -7854,6 +11706,84 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.nodePools.rollback * @desc Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.nodePools.rollback({ + * // Required. Deprecated. The name of the cluster to rollback. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // Required. Deprecated. The name of the node pool to rollback. + * // This field has been deprecated and replaced by the name field. + * nodePoolId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "nodePoolId": "my_nodePoolId", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.nodePools.rollback * @memberOf! () * @@ -7932,6 +11862,85 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.nodePools.setManagement * @desc Sets the NodeManagement options for a node pool. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.nodePools.setManagement({ + * // Required. Deprecated. The name of the cluster to update. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // Required. Deprecated. The name of the node pool to update. + * // This field has been deprecated and replaced by the name field. + * nodePoolId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "management": {}, + * // "name": "my_name", + * // "nodePoolId": "my_nodePoolId", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.nodePools.setManagement * @memberOf! () * @@ -8010,6 +12019,85 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.nodePools.setSize * @desc Sets the size for a specific node pool. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.nodePools.setSize({ + * // Required. Deprecated. The name of the cluster to update. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // Required. Deprecated. The name of the node pool to update. + * // This field has been deprecated and replaced by the name field. + * nodePoolId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "name": "my_name", + * // "nodeCount": 0, + * // "nodePoolId": "my_nodePoolId", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.nodePools.setSize * @memberOf! () * @@ -8088,6 +12176,89 @@ export namespace container_v1beta1 { /** * container.projects.zones.clusters.nodePools.update * @desc Updates the version and/or image type of a specific node pool. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.clusters.nodePools.update({ + * // Required. Deprecated. The name of the cluster to upgrade. + * // This field has been deprecated and replaced by the name field. + * clusterId: 'placeholder-value', + * // Required. Deprecated. The name of the node pool to upgrade. + * // This field has been deprecated and replaced by the name field. + * nodePoolId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterId": "my_clusterId", + * // "imageType": "my_imageType", + * // "locations": [], + * // "name": "my_name", + * // "nodePoolId": "my_nodePoolId", + * // "nodeVersion": "my_nodeVersion", + * // "projectId": "my_projectId", + * // "upgradeSettings": {}, + * // "workloadMetadataConfig": {}, + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.clusters.nodePools.update * @memberOf! () * @@ -8424,6 +12595,65 @@ export namespace container_v1beta1 { /** * container.projects.zones.operations.cancel * @desc Cancels the specified operation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.operations.cancel({ + * // Required. Deprecated. The server-assigned `name` of the operation. + * // This field has been deprecated and replaced by the name field. + * operationId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // operation resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name", + * // "operationId": "my_operationId", + * // "projectId": "my_projectId", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.operations.cancel * @memberOf! () * @@ -8499,6 +12729,72 @@ export namespace container_v1beta1 { /** * container.projects.zones.operations.get * @desc Gets the specified operation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.operations.get({ + * // The name (project, location, operation id) of the operation to get. + * // Specified in the format 'projects/x/locations/x/operations/x'. + * name: 'placeholder-value', + * // Required. Deprecated. The server-assigned `name` of the operation. + * // This field has been deprecated and replaced by the name field. + * operationId: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the name field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) in which the + * // cluster resides. This field has been deprecated and replaced by the name + * // field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterConditions": [], + * // "detail": "my_detail", + * // "endTime": "my_endTime", + * // "location": "my_location", + * // "name": "my_name", + * // "nodepoolConditions": [], + * // "operationType": "my_operationType", + * // "progress": {}, + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetLink": "my_targetLink", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.operations.get * @memberOf! () * @@ -8576,6 +12872,58 @@ export namespace container_v1beta1 { /** * container.projects.zones.operations.list * @desc Lists all operations in a project in the specified zone or all zones. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/container.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 container = google.container('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 container.projects.zones.operations.list({ + * // The parent (project and location) where the operations will be listed. + * // Specified in the format 'projects/x/locations/x'. + * // Location "-" matches all zones and all regions. + * parent: 'placeholder-value', + * // Required. Deprecated. The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * // This field has been deprecated and replaced by the parent field. + * projectId: 'placeholder-value', + * // Required. Deprecated. The name of the Google Compute Engine + * // [zone](https://cloud.google.com/compute/docs/zones#available) to return + * // operations for, or `-` for all zones. This field has been deprecated and + * // replaced by the parent field. + * zone: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "missingZones": [], + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias container.projects.zones.operations.list * @memberOf! () * diff --git a/src/apis/containeranalysis/v1alpha1.ts b/src/apis/containeranalysis/v1alpha1.ts index f6bfbbed5b7..1b5d33e9667 100644 --- a/src/apis/containeranalysis/v1alpha1.ts +++ b/src/apis/containeranalysis/v1alpha1.ts @@ -1392,6 +1392,91 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.notes.create * @desc Creates a new `Note`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.notes.create({ + * // The name of the project. + * // Should be of the form "providers/{provider_id}". + * // @Deprecated + * name: 'placeholder-value', + * // The ID to use for this note. + * noteId: 'placeholder-value', + * // This field contains the project Id for example: + * // "projects/{project_id} + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "attestationAuthority": {}, + * // "baseImage": {}, + * // "buildType": {}, + * // "createTime": "my_createTime", + * // "deployable": {}, + * // "discovery": {}, + * // "expirationTime": "my_expirationTime", + * // "kind": "my_kind", + * // "longDescription": "my_longDescription", + * // "name": "my_name", + * // "package": {}, + * // "relatedUrl": [], + * // "shortDescription": "my_shortDescription", + * // "updateTime": "my_updateTime", + * // "upgrade": {}, + * // "vulnerabilityType": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestationAuthority": {}, + * // "baseImage": {}, + * // "buildType": {}, + * // "createTime": "my_createTime", + * // "deployable": {}, + * // "discovery": {}, + * // "expirationTime": "my_expirationTime", + * // "kind": "my_kind", + * // "longDescription": "my_longDescription", + * // "name": "my_name", + * // "package": {}, + * // "relatedUrl": [], + * // "shortDescription": "my_shortDescription", + * // "updateTime": "my_updateTime", + * // "upgrade": {}, + * // "vulnerabilityType": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.notes.create * @memberOf! () * @@ -1468,6 +1553,45 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.notes.delete * @desc Deletes the given `Note` from the system. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.notes.delete({ + * // The name of the note in the form of + * // "providers/{provider_id}/notes/{NOTE_ID}" + * name: 'projects/my-project/notes/my-note', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.notes.delete * @memberOf! () * @@ -1538,6 +1662,62 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.notes.get * @desc Returns the requested `Note`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.notes.get({ + * // The name of the note in the form of + * // "providers/{provider_id}/notes/{NOTE_ID}" + * name: 'projects/my-project/notes/my-note', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestationAuthority": {}, + * // "baseImage": {}, + * // "buildType": {}, + * // "createTime": "my_createTime", + * // "deployable": {}, + * // "discovery": {}, + * // "expirationTime": "my_expirationTime", + * // "kind": "my_kind", + * // "longDescription": "my_longDescription", + * // "name": "my_name", + * // "package": {}, + * // "relatedUrl": [], + * // "shortDescription": "my_shortDescription", + * // "updateTime": "my_updateTime", + * // "upgrade": {}, + * // "vulnerabilityType": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.notes.get * @memberOf! () * @@ -1608,6 +1788,57 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.notes.getIamPolicy * @desc Gets the access control policy for a note or an `Occurrence` resource. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or occurrence, respectively. Attempting to call this method on a resource without the required permission will result in a `PERMISSION_DENIED` error. Attempting to call this method on a non-existent resource will result in a `NOT_FOUND` error if the user has list permission on the project, or a `PERMISSION_DENIED` error otherwise. The resource takes the following formats: `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for occurrences and projects/{PROJECT_ID}/notes/{NOTE_ID} for notes + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.notes.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/notes/my-note', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.notes.getIamPolicy * @memberOf! () * @@ -1682,6 +1913,57 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.notes.list * @desc Lists all `Notes` for a given project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.notes.list({ + * // The filter expression. + * filter: 'placeholder-value', + * // The name field will contain the project Id for example: + * // "providers/{provider_id} + * // @Deprecated + * name: 'placeholder-value', + * // Number of notes to return in the list. + * pageSize: 'placeholder-value', + * // Token to provide to skip to a particular spot in the list. + * pageToken: 'placeholder-value', + * // This field contains the project Id for example: "projects/{PROJECT_ID}". + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "notes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.notes.list * @memberOf! () * @@ -1761,6 +2043,87 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.notes.patch * @desc Updates an existing `Note`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.notes.patch({ + * // The name of the note. + * // Should be of the form "projects/{provider_id}/notes/{note_id}". + * name: 'projects/my-project/notes/my-note', + * // The fields to update. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "attestationAuthority": {}, + * // "baseImage": {}, + * // "buildType": {}, + * // "createTime": "my_createTime", + * // "deployable": {}, + * // "discovery": {}, + * // "expirationTime": "my_expirationTime", + * // "kind": "my_kind", + * // "longDescription": "my_longDescription", + * // "name": "my_name", + * // "package": {}, + * // "relatedUrl": [], + * // "shortDescription": "my_shortDescription", + * // "updateTime": "my_updateTime", + * // "upgrade": {}, + * // "vulnerabilityType": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestationAuthority": {}, + * // "baseImage": {}, + * // "buildType": {}, + * // "createTime": "my_createTime", + * // "deployable": {}, + * // "discovery": {}, + * // "expirationTime": "my_expirationTime", + * // "kind": "my_kind", + * // "longDescription": "my_longDescription", + * // "name": "my_name", + * // "package": {}, + * // "relatedUrl": [], + * // "shortDescription": "my_shortDescription", + * // "updateTime": "my_updateTime", + * // "upgrade": {}, + * // "vulnerabilityType": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.notes.patch * @memberOf! () * @@ -1833,6 +2196,57 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.notes.setIamPolicy * @desc Sets the access control policy on the specified `Note` or `Occurrence`. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a `Note` or an `Occurrence`, respectively. Attempting to call this method without these permissions will result in a ` `PERMISSION_DENIED` error. Attempting to call this method on a non-existent resource will result in a `NOT_FOUND` error if the user has `containeranalysis.notes.list` permission on a `Note` or `containeranalysis.occurrences.list` on an `Occurrence`, or a `PERMISSION_DENIED` error otherwise. The resource takes the following formats: `projects/{projectid}/occurrences/{occurrenceid}` for occurrences and projects/{projectid}/notes/{noteid} for notes + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.notes.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/notes/my-note', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.notes.setIamPolicy * @memberOf! () * @@ -1907,6 +2321,55 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.notes.testIamPermissions * @desc Returns the permissions that a caller has on the specified note or occurrence resource. Requires list permission on the project (for example, "storage.objects.list" on the containing bucket for testing permission of an object). Attempting to call this method on a non-existent resource will result in a `NOT_FOUND` error if the user has list permission on the project, or a `PERMISSION_DENIED` error otherwise. The resource takes the following formats: `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for `Occurrences` and `projects/{PROJECT_ID}/notes/{NOTE_ID}` for `Notes` + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.notes.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/notes/my-note', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.notes.testIamPermissions * @memberOf! () * @@ -2147,6 +2610,54 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.notes.occurrences.list * @desc Lists `Occurrences` referencing the specified `Note`. Use this method to get all occurrences referencing your `Note` across all your customer projects. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.notes.occurrences.list({ + * // The filter expression. + * filter: 'placeholder-value', + * // The name field will contain the note name for example: + * // "provider/{provider_id}/notes/{note_id}" + * name: 'projects/my-project/notes/my-note', + * // Number of notes to return in the list. + * pageSize: 'placeholder-value', + * // Token to provide to skip to a particular spot in the list. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "occurrences": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.notes.occurrences.list * @memberOf! () * @@ -2264,6 +2775,87 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.occurrences.create * @desc Creates a new `Occurrence`. Use this method to create `Occurrences` for a resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.create({ + * // The name of the project. Should be of the form "projects/{project_id}". + * // @Deprecated + * name: 'placeholder-value', + * // This field contains the project Id for example: "projects/{project_id}" + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "attestation": {}, + * // "buildDetails": {}, + * // "createTime": "my_createTime", + * // "deployment": {}, + * // "derivedImage": {}, + * // "discovered": {}, + * // "installation": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "noteName": "my_noteName", + * // "remediation": "my_remediation", + * // "resource": {}, + * // "resourceUrl": "my_resourceUrl", + * // "updateTime": "my_updateTime", + * // "upgrade": {}, + * // "vulnerabilityDetails": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestation": {}, + * // "buildDetails": {}, + * // "createTime": "my_createTime", + * // "deployment": {}, + * // "derivedImage": {}, + * // "discovered": {}, + * // "installation": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "noteName": "my_noteName", + * // "remediation": "my_remediation", + * // "resource": {}, + * // "resourceUrl": "my_resourceUrl", + * // "updateTime": "my_updateTime", + * // "upgrade": {}, + * // "vulnerabilityDetails": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.create * @memberOf! () * @@ -2341,6 +2933,45 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.occurrences.delete * @desc Deletes the given `Occurrence` from the system. Use this when an `Occurrence` is no longer applicable for the given resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.delete({ + * // The name of the occurrence in the form of + * // "projects/{project_id}/occurrences/{OCCURRENCE_ID}" + * name: 'projects/my-project/occurrences/my-occurrence', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.delete * @memberOf! () * @@ -2411,6 +3042,62 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.occurrences.get * @desc Returns the requested `Occurrence`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.get({ + * // The name of the occurrence of the form + * // "projects/{project_id}/occurrences/{OCCURRENCE_ID}" + * name: 'projects/my-project/occurrences/my-occurrence', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestation": {}, + * // "buildDetails": {}, + * // "createTime": "my_createTime", + * // "deployment": {}, + * // "derivedImage": {}, + * // "discovered": {}, + * // "installation": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "noteName": "my_noteName", + * // "remediation": "my_remediation", + * // "resource": {}, + * // "resourceUrl": "my_resourceUrl", + * // "updateTime": "my_updateTime", + * // "upgrade": {}, + * // "vulnerabilityDetails": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.get * @memberOf! () * @@ -2483,6 +3170,57 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.occurrences.getIamPolicy * @desc Gets the access control policy for a note or an `Occurrence` resource. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or occurrence, respectively. Attempting to call this method on a resource without the required permission will result in a `PERMISSION_DENIED` error. Attempting to call this method on a non-existent resource will result in a `NOT_FOUND` error if the user has list permission on the project, or a `PERMISSION_DENIED` error otherwise. The resource takes the following formats: `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for occurrences and projects/{PROJECT_ID}/notes/{NOTE_ID} for notes + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/occurrences/my-occurrence', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.getIamPolicy * @memberOf! () * @@ -2557,6 +3295,62 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.occurrences.getNotes * @desc Gets the `Note` attached to the given `Occurrence`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.getNotes({ + * // The name of the occurrence in the form + * // "projects/{project_id}/occurrences/{OCCURRENCE_ID}" + * name: 'projects/my-project/occurrences/my-occurrence', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestationAuthority": {}, + * // "baseImage": {}, + * // "buildType": {}, + * // "createTime": "my_createTime", + * // "deployable": {}, + * // "discovery": {}, + * // "expirationTime": "my_expirationTime", + * // "kind": "my_kind", + * // "longDescription": "my_longDescription", + * // "name": "my_name", + * // "package": {}, + * // "relatedUrl": [], + * // "shortDescription": "my_shortDescription", + * // "updateTime": "my_updateTime", + * // "upgrade": {}, + * // "vulnerabilityType": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.getNotes * @memberOf! () * @@ -2630,6 +3424,50 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.occurrences.getVulnerabilitySummary * @desc Gets a summary of the number and severity of occurrences. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.getVulnerabilitySummary( + * { + * // The filter expression. + * filter: 'placeholder-value', + * // This contains the project Id for example: projects/{project_id} + * parent: 'projects/my-project', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "counts": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.getVulnerabilitySummary * @memberOf! () * @@ -2714,6 +3552,59 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.occurrences.list * @desc Lists active `Occurrences` for a given project matching the filters. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.list({ + * // The filter expression. + * filter: 'placeholder-value', + * // The kind of occurrences to filter on. + * kind: 'placeholder-value', + * // The name field contains the project Id. For example: + * // "projects/{project_id} + * // @Deprecated + * name: 'placeholder-value', + * // Number of occurrences to return in the list. + * pageSize: 'placeholder-value', + * // Token to provide to skip to a particular spot in the list. + * pageToken: 'placeholder-value', + * // This contains the project Id for example: projects/{project_id}. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "occurrences": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.list * @memberOf! () * @@ -2796,6 +3687,87 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.occurrences.patch * @desc Updates an existing occurrence. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.patch({ + * // The name of the occurrence. + * // Should be of the form "projects/{project_id}/occurrences/{OCCURRENCE_ID}". + * name: 'projects/my-project/occurrences/my-occurrence', + * // The fields to update. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "attestation": {}, + * // "buildDetails": {}, + * // "createTime": "my_createTime", + * // "deployment": {}, + * // "derivedImage": {}, + * // "discovered": {}, + * // "installation": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "noteName": "my_noteName", + * // "remediation": "my_remediation", + * // "resource": {}, + * // "resourceUrl": "my_resourceUrl", + * // "updateTime": "my_updateTime", + * // "upgrade": {}, + * // "vulnerabilityDetails": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestation": {}, + * // "buildDetails": {}, + * // "createTime": "my_createTime", + * // "deployment": {}, + * // "derivedImage": {}, + * // "discovered": {}, + * // "installation": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "noteName": "my_noteName", + * // "remediation": "my_remediation", + * // "resource": {}, + * // "resourceUrl": "my_resourceUrl", + * // "updateTime": "my_updateTime", + * // "upgrade": {}, + * // "vulnerabilityDetails": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.patch * @memberOf! () * @@ -2870,6 +3842,57 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.occurrences.setIamPolicy * @desc Sets the access control policy on the specified `Note` or `Occurrence`. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a `Note` or an `Occurrence`, respectively. Attempting to call this method without these permissions will result in a ` `PERMISSION_DENIED` error. Attempting to call this method on a non-existent resource will result in a `NOT_FOUND` error if the user has `containeranalysis.notes.list` permission on a `Note` or `containeranalysis.occurrences.list` on an `Occurrence`, or a `PERMISSION_DENIED` error otherwise. The resource takes the following formats: `projects/{projectid}/occurrences/{occurrenceid}` for occurrences and projects/{projectid}/notes/{noteid} for notes + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/occurrences/my-occurrence', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.setIamPolicy * @memberOf! () * @@ -2944,6 +3967,55 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.occurrences.testIamPermissions * @desc Returns the permissions that a caller has on the specified note or occurrence resource. Requires list permission on the project (for example, "storage.objects.list" on the containing bucket for testing permission of an object). Attempting to call this method on a non-existent resource will result in a `NOT_FOUND` error if the user has list permission on the project, or a `PERMISSION_DENIED` error otherwise. The resource takes the following formats: `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for `Occurrences` and `projects/{PROJECT_ID}/notes/{NOTE_ID}` for `Notes` + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/occurrences/my-occurrence', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.testIamPermissions * @memberOf! () * @@ -3212,6 +4284,59 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.operations.create * @desc Creates a new `Operation`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.operations.create({ + * // The project Id that this operation should be created under. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "operation": {}, + * // "operationId": "my_operationId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.operations.create * @memberOf! () * @@ -3288,6 +4413,60 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.operations.patch * @desc Updates an existing operation returns an error if operation does not exist. The only valid operations are to update mark the done bit change the result. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.operations.patch({ + * // The name of the Operation. + * // Should be of the form "projects/{provider_id}/operations/{operation_id}". + * name: 'projects/my-project/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "operation": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.operations.patch * @memberOf! () * @@ -3403,6 +4582,51 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.scanConfigs.get * @desc Gets a specific scan configuration for a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.scanConfigs.get({ + * // The name of the ScanConfig in the form + * // projects/{project_id}/scanConfigs/{scan_config_id} + * name: 'projects/my-project/scanConfigs/my-scanConfig', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "enabled": false, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.scanConfigs.get * @memberOf! () * @@ -3475,6 +4699,53 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.scanConfigs.list * @desc Lists scan configurations for a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.scanConfigs.list({ + * // The filter expression. + * filter: 'placeholder-value', + * // The number of items to return. + * pageSize: 'placeholder-value', + * // The page token to use for the next request. + * pageToken: 'placeholder-value', + * // This containers the project Id i.e.: projects/{project_id} + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "scanConfigs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.scanConfigs.list * @memberOf! () * @@ -3555,6 +4826,65 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.projects.scanConfigs.patch * @desc Updates the scan configuration to a new value. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.scanConfigs.patch({ + * // The scan config to update of the form + * // projects/{project_id}/scanConfigs/{scan_config_id}. + * name: 'projects/my-project/scanConfigs/my-scanConfig', + * // The fields to update. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "enabled": false, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "enabled": false, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.scanConfigs.patch * @memberOf! () * @@ -3705,6 +5035,91 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.providers.notes.create * @desc Creates a new `Note`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.providers.notes.create({ + * // The name of the project. + * // Should be of the form "providers/{provider_id}". + * // @Deprecated + * name: 'providers/my-provider', + * // The ID to use for this note. + * noteId: 'placeholder-value', + * // This field contains the project Id for example: + * // "projects/{project_id} + * parent: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "attestationAuthority": {}, + * // "baseImage": {}, + * // "buildType": {}, + * // "createTime": "my_createTime", + * // "deployable": {}, + * // "discovery": {}, + * // "expirationTime": "my_expirationTime", + * // "kind": "my_kind", + * // "longDescription": "my_longDescription", + * // "name": "my_name", + * // "package": {}, + * // "relatedUrl": [], + * // "shortDescription": "my_shortDescription", + * // "updateTime": "my_updateTime", + * // "upgrade": {}, + * // "vulnerabilityType": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestationAuthority": {}, + * // "baseImage": {}, + * // "buildType": {}, + * // "createTime": "my_createTime", + * // "deployable": {}, + * // "discovery": {}, + * // "expirationTime": "my_expirationTime", + * // "kind": "my_kind", + * // "longDescription": "my_longDescription", + * // "name": "my_name", + * // "package": {}, + * // "relatedUrl": [], + * // "shortDescription": "my_shortDescription", + * // "updateTime": "my_updateTime", + * // "upgrade": {}, + * // "vulnerabilityType": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.providers.notes.create * @memberOf! () * @@ -3781,6 +5196,45 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.providers.notes.delete * @desc Deletes the given `Note` from the system. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.providers.notes.delete({ + * // The name of the note in the form of + * // "providers/{provider_id}/notes/{NOTE_ID}" + * name: 'providers/my-provider/notes/my-note', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.providers.notes.delete * @memberOf! () * @@ -3851,6 +5305,62 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.providers.notes.get * @desc Returns the requested `Note`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.providers.notes.get({ + * // The name of the note in the form of + * // "providers/{provider_id}/notes/{NOTE_ID}" + * name: 'providers/my-provider/notes/my-note', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestationAuthority": {}, + * // "baseImage": {}, + * // "buildType": {}, + * // "createTime": "my_createTime", + * // "deployable": {}, + * // "discovery": {}, + * // "expirationTime": "my_expirationTime", + * // "kind": "my_kind", + * // "longDescription": "my_longDescription", + * // "name": "my_name", + * // "package": {}, + * // "relatedUrl": [], + * // "shortDescription": "my_shortDescription", + * // "updateTime": "my_updateTime", + * // "upgrade": {}, + * // "vulnerabilityType": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.providers.notes.get * @memberOf! () * @@ -3921,6 +5431,57 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.providers.notes.getIamPolicy * @desc Gets the access control policy for a note or an `Occurrence` resource. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or occurrence, respectively. Attempting to call this method on a resource without the required permission will result in a `PERMISSION_DENIED` error. Attempting to call this method on a non-existent resource will result in a `NOT_FOUND` error if the user has list permission on the project, or a `PERMISSION_DENIED` error otherwise. The resource takes the following formats: `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for occurrences and projects/{PROJECT_ID}/notes/{NOTE_ID} for notes + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.providers.notes.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'providers/my-provider/notes/my-note', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.providers.notes.getIamPolicy * @memberOf! () * @@ -3995,6 +5556,57 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.providers.notes.list * @desc Lists all `Notes` for a given project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.providers.notes.list({ + * // The filter expression. + * filter: 'placeholder-value', + * // The name field will contain the project Id for example: + * // "providers/{provider_id} + * // @Deprecated + * name: 'providers/my-provider', + * // Number of notes to return in the list. + * pageSize: 'placeholder-value', + * // Token to provide to skip to a particular spot in the list. + * pageToken: 'placeholder-value', + * // This field contains the project Id for example: "projects/{PROJECT_ID}". + * parent: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "notes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.providers.notes.list * @memberOf! () * @@ -4074,6 +5686,87 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.providers.notes.patch * @desc Updates an existing `Note`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.providers.notes.patch({ + * // The name of the note. + * // Should be of the form "projects/{provider_id}/notes/{note_id}". + * name: 'providers/my-provider/notes/my-note', + * // The fields to update. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "attestationAuthority": {}, + * // "baseImage": {}, + * // "buildType": {}, + * // "createTime": "my_createTime", + * // "deployable": {}, + * // "discovery": {}, + * // "expirationTime": "my_expirationTime", + * // "kind": "my_kind", + * // "longDescription": "my_longDescription", + * // "name": "my_name", + * // "package": {}, + * // "relatedUrl": [], + * // "shortDescription": "my_shortDescription", + * // "updateTime": "my_updateTime", + * // "upgrade": {}, + * // "vulnerabilityType": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestationAuthority": {}, + * // "baseImage": {}, + * // "buildType": {}, + * // "createTime": "my_createTime", + * // "deployable": {}, + * // "discovery": {}, + * // "expirationTime": "my_expirationTime", + * // "kind": "my_kind", + * // "longDescription": "my_longDescription", + * // "name": "my_name", + * // "package": {}, + * // "relatedUrl": [], + * // "shortDescription": "my_shortDescription", + * // "updateTime": "my_updateTime", + * // "upgrade": {}, + * // "vulnerabilityType": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.providers.notes.patch * @memberOf! () * @@ -4146,6 +5839,57 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.providers.notes.setIamPolicy * @desc Sets the access control policy on the specified `Note` or `Occurrence`. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a `Note` or an `Occurrence`, respectively. Attempting to call this method without these permissions will result in a ` `PERMISSION_DENIED` error. Attempting to call this method on a non-existent resource will result in a `NOT_FOUND` error if the user has `containeranalysis.notes.list` permission on a `Note` or `containeranalysis.occurrences.list` on an `Occurrence`, or a `PERMISSION_DENIED` error otherwise. The resource takes the following formats: `projects/{projectid}/occurrences/{occurrenceid}` for occurrences and projects/{projectid}/notes/{noteid} for notes + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.providers.notes.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'providers/my-provider/notes/my-note', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.providers.notes.setIamPolicy * @memberOf! () * @@ -4220,6 +5964,55 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.providers.notes.testIamPermissions * @desc Returns the permissions that a caller has on the specified note or occurrence resource. Requires list permission on the project (for example, "storage.objects.list" on the containing bucket for testing permission of an object). Attempting to call this method on a non-existent resource will result in a `NOT_FOUND` error if the user has list permission on the project, or a `PERMISSION_DENIED` error otherwise. The resource takes the following formats: `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for `Occurrences` and `projects/{PROJECT_ID}/notes/{NOTE_ID}` for `Notes` + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.providers.notes.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'providers/my-provider/notes/my-note', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.providers.notes.testIamPermissions * @memberOf! () * @@ -4460,6 +6253,54 @@ export namespace containeranalysis_v1alpha1 { /** * containeranalysis.providers.notes.occurrences.list * @desc Lists `Occurrences` referencing the specified `Note`. Use this method to get all occurrences referencing your `Note` across all your customer projects. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.providers.notes.occurrences.list({ + * // The filter expression. + * filter: 'placeholder-value', + * // The name field will contain the note name for example: + * // "provider/{provider_id}/notes/{note_id}" + * name: 'providers/my-provider/notes/my-note', + * // Number of notes to return in the list. + * pageSize: 'placeholder-value', + * // Token to provide to skip to a particular spot in the list. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "occurrences": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.providers.notes.occurrences.list * @memberOf! () * diff --git a/src/apis/containeranalysis/v1beta1.ts b/src/apis/containeranalysis/v1beta1.ts index a9ed28a9b4f..1dff33af282 100644 --- a/src/apis/containeranalysis/v1beta1.ts +++ b/src/apis/containeranalysis/v1beta1.ts @@ -1545,6 +1545,55 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.notes.batchCreate * @desc Creates new notes in batch. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.notes.batchCreate({ + * // Required. The name of the project in the form of `projects/[PROJECT_ID]`, under which + * // the notes are to be created. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "notes": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "notes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.notes.batchCreate * @memberOf! () * @@ -1625,6 +1674,89 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.notes.create * @desc Creates a new note. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.notes.create({ + * // Required. The ID to use for this note. + * noteId: 'placeholder-value', + * // Required. The name of the project in the form of `projects/[PROJECT_ID]`, under which + * // the note is to be created. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "attestationAuthority": {}, + * // "baseImage": {}, + * // "build": {}, + * // "createTime": "my_createTime", + * // "deployable": {}, + * // "discovery": {}, + * // "expirationTime": "my_expirationTime", + * // "intoto": {}, + * // "kind": "my_kind", + * // "longDescription": "my_longDescription", + * // "name": "my_name", + * // "package": {}, + * // "relatedNoteNames": [], + * // "relatedUrl": [], + * // "shortDescription": "my_shortDescription", + * // "updateTime": "my_updateTime", + * // "vulnerability": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestationAuthority": {}, + * // "baseImage": {}, + * // "build": {}, + * // "createTime": "my_createTime", + * // "deployable": {}, + * // "discovery": {}, + * // "expirationTime": "my_expirationTime", + * // "intoto": {}, + * // "kind": "my_kind", + * // "longDescription": "my_longDescription", + * // "name": "my_name", + * // "package": {}, + * // "relatedNoteNames": [], + * // "relatedUrl": [], + * // "shortDescription": "my_shortDescription", + * // "updateTime": "my_updateTime", + * // "vulnerability": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.notes.create * @memberOf! () * @@ -1700,6 +1832,45 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.notes.delete * @desc Deletes the specified note. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.notes.delete({ + * // Required. The name of the note in the form of + * // `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. + * name: 'projects/my-project/notes/my-note', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.notes.delete * @memberOf! () * @@ -1770,6 +1941,63 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.notes.get * @desc Gets the specified note. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.notes.get({ + * // Required. The name of the note in the form of + * // `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. + * name: 'projects/my-project/notes/my-note', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestationAuthority": {}, + * // "baseImage": {}, + * // "build": {}, + * // "createTime": "my_createTime", + * // "deployable": {}, + * // "discovery": {}, + * // "expirationTime": "my_expirationTime", + * // "intoto": {}, + * // "kind": "my_kind", + * // "longDescription": "my_longDescription", + * // "name": "my_name", + * // "package": {}, + * // "relatedNoteNames": [], + * // "relatedUrl": [], + * // "shortDescription": "my_shortDescription", + * // "updateTime": "my_updateTime", + * // "vulnerability": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.notes.get * @memberOf! () * @@ -1840,6 +2068,57 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.notes.getIamPolicy * @desc Gets the access control policy for a note or an occurrence resource. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or occurrence, respectively. The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.notes.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/notes/my-note', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.notes.getIamPolicy * @memberOf! () * @@ -1914,6 +2193,55 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.notes.list * @desc Lists notes for the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.notes.list({ + * // The filter expression. + * filter: 'placeholder-value', + * // Number of notes to return in the list. Must be positive. Max allowed page + * // size is 1000. If not specified, page size defaults to 20. + * pageSize: 'placeholder-value', + * // Token to provide to skip to a particular spot in the list. + * pageToken: 'placeholder-value', + * // Required. The name of the project to list notes for in the form of + * // `projects/[PROJECT_ID]`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "notes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.notes.list * @memberOf! () * @@ -1992,6 +2320,89 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.notes.patch * @desc Updates the specified note. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.notes.patch({ + * // Required. The name of the note in the form of + * // `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. + * name: 'projects/my-project/notes/my-note', + * // The fields to update. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "attestationAuthority": {}, + * // "baseImage": {}, + * // "build": {}, + * // "createTime": "my_createTime", + * // "deployable": {}, + * // "discovery": {}, + * // "expirationTime": "my_expirationTime", + * // "intoto": {}, + * // "kind": "my_kind", + * // "longDescription": "my_longDescription", + * // "name": "my_name", + * // "package": {}, + * // "relatedNoteNames": [], + * // "relatedUrl": [], + * // "shortDescription": "my_shortDescription", + * // "updateTime": "my_updateTime", + * // "vulnerability": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestationAuthority": {}, + * // "baseImage": {}, + * // "build": {}, + * // "createTime": "my_createTime", + * // "deployable": {}, + * // "discovery": {}, + * // "expirationTime": "my_expirationTime", + * // "intoto": {}, + * // "kind": "my_kind", + * // "longDescription": "my_longDescription", + * // "name": "my_name", + * // "package": {}, + * // "relatedNoteNames": [], + * // "relatedUrl": [], + * // "shortDescription": "my_shortDescription", + * // "updateTime": "my_updateTime", + * // "vulnerability": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.notes.patch * @memberOf! () * @@ -2064,6 +2475,57 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.notes.setIamPolicy * @desc Sets the access control policy on the specified note or occurrence. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or an occurrence, respectively. The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.notes.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/notes/my-note', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.notes.setIamPolicy * @memberOf! () * @@ -2138,6 +2600,55 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.notes.testIamPermissions * @desc Returns the permissions that a caller has on the specified note or occurrence. Requires list permission on the project (for example, `containeranalysis.notes.list`). The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.notes.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/notes/my-note', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.notes.testIamPermissions * @memberOf! () * @@ -2387,6 +2898,54 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.notes.occurrences.list * @desc Lists occurrences referencing the specified note. Provider projects can use this method to get all occurrences across consumer projects referencing the specified note. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.notes.occurrences.list({ + * // The filter expression. + * filter: 'placeholder-value', + * // Required. The name of the note to list occurrences for in the form of + * // `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. + * name: 'projects/my-project/notes/my-note', + * // Number of occurrences to return in the list. + * pageSize: 'placeholder-value', + * // Token to provide to skip to a particular spot in the list. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "occurrences": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.notes.occurrences.list * @memberOf! () * @@ -2504,6 +3063,55 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.occurrences.batchCreate * @desc Creates new occurrences in batch. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.batchCreate({ + * // Required. The name of the project in the form of `projects/[PROJECT_ID]`, under which + * // the occurrences are to be created. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "occurrences": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "occurrences": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.batchCreate * @memberOf! () * @@ -2588,6 +3196,83 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.occurrences.create * @desc Creates a new occurrence. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.create({ + * // Required. The name of the project in the form of `projects/[PROJECT_ID]`, under which + * // the occurrence is to be created. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "attestation": {}, + * // "build": {}, + * // "createTime": "my_createTime", + * // "deployment": {}, + * // "derivedImage": {}, + * // "discovered": {}, + * // "installation": {}, + * // "intoto": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "noteName": "my_noteName", + * // "remediation": "my_remediation", + * // "resource": {}, + * // "updateTime": "my_updateTime", + * // "vulnerability": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestation": {}, + * // "build": {}, + * // "createTime": "my_createTime", + * // "deployment": {}, + * // "derivedImage": {}, + * // "discovered": {}, + * // "installation": {}, + * // "intoto": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "noteName": "my_noteName", + * // "remediation": "my_remediation", + * // "resource": {}, + * // "updateTime": "my_updateTime", + * // "vulnerability": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.create * @memberOf! () * @@ -2664,6 +3349,45 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.occurrences.delete * @desc Deletes the specified occurrence. For example, use this method to delete an occurrence when the occurrence is no longer applicable for the given resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.delete({ + * // Required. The name of the occurrence in the form of + * // `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. + * name: 'projects/my-project/occurrences/my-occurrence', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.delete * @memberOf! () * @@ -2734,6 +3458,61 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.occurrences.get * @desc Gets the specified occurrence. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.get({ + * // Required. The name of the occurrence in the form of + * // `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. + * name: 'projects/my-project/occurrences/my-occurrence', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestation": {}, + * // "build": {}, + * // "createTime": "my_createTime", + * // "deployment": {}, + * // "derivedImage": {}, + * // "discovered": {}, + * // "installation": {}, + * // "intoto": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "noteName": "my_noteName", + * // "remediation": "my_remediation", + * // "resource": {}, + * // "updateTime": "my_updateTime", + * // "vulnerability": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.get * @memberOf! () * @@ -2806,6 +3585,57 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.occurrences.getIamPolicy * @desc Gets the access control policy for a note or an occurrence resource. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or occurrence, respectively. The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/occurrences/my-occurrence', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.getIamPolicy * @memberOf! () * @@ -2880,6 +3710,63 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.occurrences.getNotes * @desc Gets the note attached to the specified occurrence. Consumer projects can use this method to get a note that belongs to a provider project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.getNotes({ + * // Required. The name of the occurrence in the form of + * // `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. + * name: 'projects/my-project/occurrences/my-occurrence', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestationAuthority": {}, + * // "baseImage": {}, + * // "build": {}, + * // "createTime": "my_createTime", + * // "deployable": {}, + * // "discovery": {}, + * // "expirationTime": "my_expirationTime", + * // "intoto": {}, + * // "kind": "my_kind", + * // "longDescription": "my_longDescription", + * // "name": "my_name", + * // "package": {}, + * // "relatedNoteNames": [], + * // "relatedUrl": [], + * // "shortDescription": "my_shortDescription", + * // "updateTime": "my_updateTime", + * // "vulnerability": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.getNotes * @memberOf! () * @@ -2953,6 +3840,51 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.occurrences.getVulnerabilitySummary * @desc Gets a summary of the number and severity of occurrences. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.getVulnerabilitySummary( + * { + * // The filter expression. + * filter: 'placeholder-value', + * // Required. The name of the project to get a vulnerability summary for in the form of + * // `projects/[PROJECT_ID]`. + * parent: 'projects/my-project', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "counts": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.getVulnerabilitySummary * @memberOf! () * @@ -3037,6 +3969,55 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.occurrences.list * @desc Lists occurrences for the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.list({ + * // The filter expression. + * filter: 'placeholder-value', + * // Number of occurrences to return in the list. Must be positive. Max allowed + * // page size is 1000. If not specified, page size defaults to 20. + * pageSize: 'placeholder-value', + * // Token to provide to skip to a particular spot in the list. + * pageToken: 'placeholder-value', + * // Required. The name of the project to list occurrences for in the form of + * // `projects/[PROJECT_ID]`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "occurrences": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.list * @memberOf! () * @@ -3117,6 +4098,85 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.occurrences.patch * @desc Updates the specified occurrence. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.patch({ + * // Required. The name of the occurrence in the form of + * // `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. + * name: 'projects/my-project/occurrences/my-occurrence', + * // The fields to update. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "attestation": {}, + * // "build": {}, + * // "createTime": "my_createTime", + * // "deployment": {}, + * // "derivedImage": {}, + * // "discovered": {}, + * // "installation": {}, + * // "intoto": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "noteName": "my_noteName", + * // "remediation": "my_remediation", + * // "resource": {}, + * // "updateTime": "my_updateTime", + * // "vulnerability": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attestation": {}, + * // "build": {}, + * // "createTime": "my_createTime", + * // "deployment": {}, + * // "derivedImage": {}, + * // "discovered": {}, + * // "installation": {}, + * // "intoto": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "noteName": "my_noteName", + * // "remediation": "my_remediation", + * // "resource": {}, + * // "updateTime": "my_updateTime", + * // "vulnerability": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.patch * @memberOf! () * @@ -3191,6 +4251,57 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.occurrences.setIamPolicy * @desc Sets the access control policy on the specified note or occurrence. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or an occurrence, respectively. The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/occurrences/my-occurrence', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.setIamPolicy * @memberOf! () * @@ -3265,6 +4376,55 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.occurrences.testIamPermissions * @desc Returns the permissions that a caller has on the specified note or occurrence. Requires list permission on the project (for example, `containeranalysis.notes.list`). The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.occurrences.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/occurrences/my-occurrence', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.occurrences.testIamPermissions * @memberOf! () * @@ -3538,6 +4698,51 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.scanConfigs.get * @desc Gets the specified scan configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.scanConfigs.get({ + * // Required. The name of the scan configuration in the form of + * // `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`. + * name: 'projects/my-project/scanConfigs/my-scanConfig', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "enabled": false, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.scanConfigs.get * @memberOf! () * @@ -3610,6 +4815,54 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.scanConfigs.list * @desc Lists scan configurations for the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.scanConfigs.list({ + * // Required. The filter expression. + * filter: 'placeholder-value', + * // The number of scan configs to return in the list. + * pageSize: 'placeholder-value', + * // Token to provide to skip to a particular spot in the list. + * pageToken: 'placeholder-value', + * // Required. The name of the project to list scan configurations for in the form of + * // `projects/[PROJECT_ID]`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "scanConfigs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.scanConfigs.list * @memberOf! () * @@ -3690,6 +4943,63 @@ export namespace containeranalysis_v1beta1 { /** * containeranalysis.projects.scanConfigs.update * @desc Updates the specified scan configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/containeranalysis.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 containeranalysis = google.containeranalysis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 containeranalysis.projects.scanConfigs.update({ + * // Required. The name of the scan configuration in the form of + * // `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`. + * name: 'projects/my-project/scanConfigs/my-scanConfig', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "enabled": false, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "enabled": false, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias containeranalysis.projects.scanConfigs.update * @memberOf! () * diff --git a/src/apis/content/v2.1.ts b/src/apis/content/v2.1.ts index 424926bea2a..8896077a8ae 100644 --- a/src/apis/content/v2.1.ts +++ b/src/apis/content/v2.1.ts @@ -5378,6 +5378,44 @@ export namespace content_v2_1 { /** * content.accounts.authinfo * @desc Returns information about the authenticated user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.accounts.authinfo({}); + * console.log(res.data); + * + * // Example response + * // { + * // "accountIdentifiers": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounts.authinfo * @memberOf! () * @@ -5455,6 +5493,50 @@ export namespace content_v2_1 { /** * content.accounts.claimwebsite * @desc Claims the website of a Merchant Center sub-account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.accounts.claimwebsite({ + * // The ID of the account whose website is claimed. + * accountId: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * // Only available to selected merchants. When set to `True`, this flag removes any existing claim on the requested website by another account and replaces it with a claim from this account. + * overwrite: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounts.claimwebsite * @memberOf! () * @@ -5540,6 +5622,52 @@ export namespace content_v2_1 { /** * content.accounts.custombatch * @desc Retrieves, inserts, updates, and deletes multiple Merchant Center (sub-)accounts in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.accounts.custombatch({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounts.custombatch * @memberOf! () * @@ -5621,6 +5749,45 @@ export namespace content_v2_1 { /** * content.accounts.delete * @desc Deletes a Merchant Center sub-account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.accounts.delete({ + * // The ID of the account. + * accountId: 'placeholder-value', + * // Flag to delete sub-accounts with products. The default value is false. + * force: 'placeholder-value', + * // The ID of the managing account. This must be a multi-client account, and accountId must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounts.delete * @memberOf! () * @@ -5693,6 +5860,58 @@ export namespace content_v2_1 { /** * content.accounts.get * @desc Retrieves a Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.accounts.get({ + * // The ID of the account. + * accountId: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adsLinks": [], + * // "adultContent": false, + * // "businessInformation": {}, + * // "googleMyBusinessLink": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "sellerId": "my_sellerId", + * // "users": [], + * // "websiteUrl": "my_websiteUrl", + * // "youtubeChannelLinks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounts.get * @memberOf! () * @@ -5764,6 +5983,74 @@ export namespace content_v2_1 { /** * content.accounts.insert * @desc Creates a Merchant Center sub-account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.accounts.insert({ + * // The ID of the managing account. This must be a multi-client account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adsLinks": [], + * // "adultContent": false, + * // "businessInformation": {}, + * // "googleMyBusinessLink": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "sellerId": "my_sellerId", + * // "users": [], + * // "websiteUrl": "my_websiteUrl", + * // "youtubeChannelLinks": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adsLinks": [], + * // "adultContent": false, + * // "businessInformation": {}, + * // "googleMyBusinessLink": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "sellerId": "my_sellerId", + * // "users": [], + * // "websiteUrl": "my_websiteUrl", + * // "youtubeChannelLinks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounts.insert * @memberOf! () * @@ -5836,6 +6123,59 @@ export namespace content_v2_1 { /** * content.accounts.link * @desc Performs an action on a link between two Merchant Center accounts, namely accountId and linkedAccountId. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.accounts.link({ + * // The ID of the account that should be linked. + * accountId: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "linkType": "my_linkType", + * // "linkedAccountId": "my_linkedAccountId", + * // "services": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounts.link * @memberOf! () * @@ -5912,6 +6252,52 @@ export namespace content_v2_1 { /** * content.accounts.list * @desc Lists the sub-accounts in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.accounts.list({ + * // The maximum number of accounts to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the managing account. This must be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounts.list * @memberOf! () * @@ -5989,6 +6375,54 @@ export namespace content_v2_1 { /** * content.accounts.listlinks * @desc Returns the list of accounts linked to your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.accounts.listlinks({ + * // The ID of the account for which to list links. + * accountId: 'placeholder-value', + * // The maximum number of links to return in the response, used for pagination. + * maxResults: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "links": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounts.listlinks * @memberOf! () * @@ -6073,6 +6507,76 @@ export namespace content_v2_1 { /** * content.accounts.update * @desc Updates a Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.accounts.update({ + * // The ID of the account. + * accountId: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adsLinks": [], + * // "adultContent": false, + * // "businessInformation": {}, + * // "googleMyBusinessLink": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "sellerId": "my_sellerId", + * // "users": [], + * // "websiteUrl": "my_websiteUrl", + * // "youtubeChannelLinks": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adsLinks": [], + * // "adultContent": false, + * // "businessInformation": {}, + * // "googleMyBusinessLink": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "sellerId": "my_sellerId", + * // "users": [], + * // "websiteUrl": "my_websiteUrl", + * // "youtubeChannelLinks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounts.update * @memberOf! () * @@ -6325,6 +6829,52 @@ export namespace content_v2_1 { /** * content.accountstatuses.custombatch * @desc Retrieves multiple Merchant Center account statuses in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.accountstatuses.custombatch({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accountstatuses.custombatch * @memberOf! () * @@ -6408,6 +6958,54 @@ export namespace content_v2_1 { /** * content.accountstatuses.get * @desc Retrieves the status of a Merchant Center account. No itemLevelIssues are returned for multi-client accounts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.accountstatuses.get({ + * // The ID of the account. + * accountId: 'placeholder-value', + * // If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination. + * destinations: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "accountLevelIssues": [], + * // "kind": "my_kind", + * // "products": [], + * // "websiteClaimed": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accountstatuses.get * @memberOf! () * @@ -6483,6 +7081,54 @@ export namespace content_v2_1 { /** * content.accountstatuses.list * @desc Lists the statuses of the sub-accounts in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.accountstatuses.list({ + * // If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination. + * destinations: 'placeholder-value', + * // The maximum number of account statuses to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the managing account. This must be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accountstatuses.list * @memberOf! () * @@ -6630,6 +7276,52 @@ export namespace content_v2_1 { /** * content.accounttax.custombatch * @desc Retrieves and updates tax settings of multiple accounts in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.accounttax.custombatch({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounttax.custombatch * @memberOf! () * @@ -6713,6 +7405,50 @@ export namespace content_v2_1 { /** * content.accounttax.get * @desc Retrieves the tax settings of the account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.accounttax.get({ + * // The ID of the account for which to get/update account tax settings. + * accountId: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "kind": "my_kind", + * // "rules": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounttax.get * @memberOf! () * @@ -6786,6 +7522,52 @@ export namespace content_v2_1 { /** * content.accounttax.list * @desc Lists the tax settings of the sub-accounts in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.accounttax.list({ + * // The maximum number of tax settings to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the managing account. This must be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounttax.list * @memberOf! () * @@ -6863,6 +7645,60 @@ export namespace content_v2_1 { /** * content.accounttax.update * @desc Updates the tax settings of the account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.accounttax.update({ + * // The ID of the account for which to get/update account tax settings. + * accountId: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "kind": "my_kind", + * // "rules": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "kind": "my_kind", + * // "rules": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounttax.update * @memberOf! () * @@ -7013,6 +7849,52 @@ export namespace content_v2_1 { /** * content.datafeeds.custombatch * @desc Deletes, fetches, gets, inserts and updates multiple datafeeds in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.datafeeds.custombatch({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.datafeeds.custombatch * @memberOf! () * @@ -7096,6 +7978,43 @@ export namespace content_v2_1 { /** * content.datafeeds.delete * @desc Deletes a datafeed configuration from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.datafeeds.delete({ + * // The ID of the datafeed. + * datafeedId: 'placeholder-value', + * // The ID of the account that manages the datafeed. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.datafeeds.delete * @memberOf! () * @@ -7167,6 +8086,48 @@ export namespace content_v2_1 { /** * content.datafeeds.fetchnow * @desc Invokes a fetch for the datafeed in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.datafeeds.fetchnow({ + * // The ID of the datafeed to be fetched. + * datafeedId: 'placeholder-value', + * // The ID of the account that manages the datafeed. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.datafeeds.fetchnow * @memberOf! () * @@ -7249,6 +8210,56 @@ export namespace content_v2_1 { /** * content.datafeeds.get * @desc Retrieves a datafeed configuration from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.datafeeds.get({ + * // The ID of the datafeed. + * datafeedId: 'placeholder-value', + * // The ID of the account that manages the datafeed. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attributeLanguage": "my_attributeLanguage", + * // "contentType": "my_contentType", + * // "fetchSchedule": {}, + * // "fileName": "my_fileName", + * // "format": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "targets": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.datafeeds.get * @memberOf! () * @@ -7320,6 +8331,70 @@ export namespace content_v2_1 { /** * content.datafeeds.insert * @desc Registers a datafeed configuration with your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.datafeeds.insert({ + * // The ID of the account that manages the datafeed. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "attributeLanguage": "my_attributeLanguage", + * // "contentType": "my_contentType", + * // "fetchSchedule": {}, + * // "fileName": "my_fileName", + * // "format": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "targets": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attributeLanguage": "my_attributeLanguage", + * // "contentType": "my_contentType", + * // "fetchSchedule": {}, + * // "fileName": "my_fileName", + * // "format": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "targets": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.datafeeds.insert * @memberOf! () * @@ -7392,6 +8467,52 @@ export namespace content_v2_1 { /** * content.datafeeds.list * @desc Lists the configurations for datafeeds in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.datafeeds.list({ + * // The maximum number of products to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the account that manages the datafeeds. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.datafeeds.list * @memberOf! () * @@ -7469,6 +8590,72 @@ export namespace content_v2_1 { /** * content.datafeeds.update * @desc Updates a datafeed configuration of your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.datafeeds.update({ + * // The ID of the datafeed. + * datafeedId: 'placeholder-value', + * // The ID of the account that manages the datafeed. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "attributeLanguage": "my_attributeLanguage", + * // "contentType": "my_contentType", + * // "fetchSchedule": {}, + * // "fileName": "my_fileName", + * // "format": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "targets": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attributeLanguage": "my_attributeLanguage", + * // "contentType": "my_contentType", + * // "fetchSchedule": {}, + * // "fileName": "my_fileName", + * // "format": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "targets": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.datafeeds.update * @memberOf! () * @@ -7662,6 +8849,52 @@ export namespace content_v2_1 { /** * content.datafeedstatuses.custombatch * @desc Gets multiple Merchant Center datafeed statuses in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.datafeedstatuses.custombatch({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.datafeedstatuses.custombatch * @memberOf! () * @@ -7747,6 +8980,61 @@ export namespace content_v2_1 { /** * content.datafeedstatuses.get * @desc Retrieves the status of a datafeed from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.datafeedstatuses.get({ + * // The country for which to get the datafeed status. If this parameter is provided then language must also be provided. Note that this parameter is required for feeds targeting multiple countries and languages, since a feed may have a different status for each target. + * country: 'placeholder-value', + * // The ID of the datafeed. + * datafeedId: 'placeholder-value', + * // The language for which to get the datafeed status. If this parameter is provided then country must also be provided. Note that this parameter is required for feeds targeting multiple countries and languages, since a feed may have a different status for each target. + * language: 'placeholder-value', + * // The ID of the account that manages the datafeed. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "country": "my_country", + * // "datafeedId": "my_datafeedId", + * // "errors": [], + * // "itemsTotal": "my_itemsTotal", + * // "itemsValid": "my_itemsValid", + * // "kind": "my_kind", + * // "language": "my_language", + * // "lastUploadDate": "my_lastUploadDate", + * // "processingStatus": "my_processingStatus", + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.datafeedstatuses.get * @memberOf! () * @@ -7824,6 +9112,52 @@ export namespace content_v2_1 { /** * content.datafeedstatuses.list * @desc Lists the statuses of the datafeeds in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.datafeedstatuses.list({ + * // The maximum number of products to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the account that manages the datafeeds. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.datafeedstatuses.list * @memberOf! () * @@ -7972,6 +9306,52 @@ export namespace content_v2_1 { /** * content.liasettings.custombatch * @desc Retrieves and/or updates the LIA settings of multiple accounts in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.liasettings.custombatch({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.liasettings.custombatch * @memberOf! () * @@ -8055,6 +9435,50 @@ export namespace content_v2_1 { /** * content.liasettings.get * @desc Retrieves the LIA settings of the account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.liasettings.get({ + * // The ID of the account for which to get or update LIA settings. + * accountId: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "countrySettings": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.liasettings.get * @memberOf! () * @@ -8128,6 +9552,50 @@ export namespace content_v2_1 { /** * content.liasettings.getaccessiblegmbaccounts * @desc Retrieves the list of accessible Google My Business accounts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.liasettings.getaccessiblegmbaccounts({ + * // The ID of the account for which to retrieve accessible Google My Business accounts. + * accountId: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "gmbAccounts": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.liasettings.getaccessiblegmbaccounts * @memberOf! () * @@ -8228,6 +9696,52 @@ export namespace content_v2_1 { /** * content.liasettings.list * @desc Lists the LIA settings of the sub-accounts in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.liasettings.list({ + * // The maximum number of LIA settings to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the managing account. This must be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.liasettings.list * @memberOf! () * @@ -8305,6 +9819,44 @@ export namespace content_v2_1 { /** * content.liasettings.listposdataproviders * @desc Retrieves the list of POS data providers that have active settings for the all eiligible countries. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.liasettings.listposdataproviders({}); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "posDataProviders": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.liasettings.listposdataproviders * @memberOf! () * @@ -8394,6 +9946,50 @@ export namespace content_v2_1 { /** * content.liasettings.requestgmbaccess * @desc Requests access to a specified Google My Business account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.liasettings.requestgmbaccess({ + * // The ID of the account for which GMB access is requested. + * accountId: 'placeholder-value', + * // The email of the Google My Business account. + * gmbEmail: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.liasettings.requestgmbaccess * @memberOf! () * @@ -8481,6 +10077,50 @@ export namespace content_v2_1 { /** * content.liasettings.requestinventoryverification * @desc Requests inventory validation for the specified country. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.liasettings.requestinventoryverification({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * accountId: 'placeholder-value', + * // The country for which inventory validation is requested. + * country: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.liasettings.requestinventoryverification * @memberOf! () * @@ -8581,6 +10221,56 @@ export namespace content_v2_1 { /** * content.liasettings.setinventoryverificationcontact * @desc Sets the inventory verification contract for the specified country. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.liasettings.setinventoryverificationcontact({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * accountId: 'placeholder-value', + * // The email of the inventory verification contact. + * contactEmail: 'placeholder-value', + * // The name of the inventory verification contact. + * contactName: 'placeholder-value', + * // The country for which inventory verification is requested. + * country: 'placeholder-value', + * // The language for which inventory verification is requested. + * language: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.liasettings.setinventoryverificationcontact * @memberOf! () * @@ -8691,6 +10381,54 @@ export namespace content_v2_1 { /** * content.liasettings.setposdataprovider * @desc Sets the POS data provider for the specified country. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.liasettings.setposdataprovider({ + * // The ID of the account for which to retrieve accessible Google My Business accounts. + * accountId: 'placeholder-value', + * // The country for which the POS data provider is selected. + * country: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * // The ID of POS data provider. + * posDataProviderId: 'placeholder-value', + * // The account ID by which this merchant is known to the POS data provider. + * posExternalAccountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.liasettings.setposdataprovider * @memberOf! () * @@ -8786,6 +10524,60 @@ export namespace content_v2_1 { /** * content.liasettings.update * @desc Updates the LIA settings of the account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.liasettings.update({ + * // The ID of the account for which to get or update LIA settings. + * accountId: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "countrySettings": [], + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "countrySettings": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.liasettings.update * @memberOf! () * @@ -9059,6 +10851,52 @@ export namespace content_v2_1 { /** * content.localinventory.custombatch * @desc Updates local inventory for multiple products or stores in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.localinventory.custombatch({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.localinventory.custombatch * @memberOf! () * @@ -9142,6 +10980,74 @@ export namespace content_v2_1 { /** * content.localinventory.insert * @desc Update the local inventory of a product in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.localinventory.insert({ + * // The ID of the account that contains the product. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The REST ID of the product for which to update local inventory. + * productId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "availability": "my_availability", + * // "instoreProductLocation": "my_instoreProductLocation", + * // "kind": "my_kind", + * // "pickupMethod": "my_pickupMethod", + * // "pickupSla": "my_pickupSla", + * // "price": {}, + * // "quantity": 0, + * // "salePrice": {}, + * // "salePriceEffectiveDate": "my_salePriceEffectiveDate", + * // "storeCode": "my_storeCode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "availability": "my_availability", + * // "instoreProductLocation": "my_instoreProductLocation", + * // "kind": "my_kind", + * // "pickupMethod": "my_pickupMethod", + * // "pickupSla": "my_pickupSla", + * // "price": {}, + * // "quantity": 0, + * // "salePrice": {}, + * // "salePriceEffectiveDate": "my_salePriceEffectiveDate", + * // "storeCode": "my_storeCode" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.localinventory.insert * @memberOf! () * @@ -9259,6 +11165,61 @@ export namespace content_v2_1 { /** * content.orderinvoices.createchargeinvoice * @desc Creates a charge invoice for a shipment group, and triggers a charge capture for orderinvoice enabled orders. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orderinvoices.createchargeinvoice({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "invoiceId": "my_invoiceId", + * // "invoiceSummary": {}, + * // "lineItemInvoices": [], + * // "operationId": "my_operationId", + * // "shipmentGroupId": "my_shipmentGroupId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orderinvoices.createchargeinvoice * @memberOf! () * @@ -9352,6 +11313,61 @@ export namespace content_v2_1 { /** * content.orderinvoices.createrefundinvoice * @desc Creates a refund invoice for one or more shipment groups, and triggers a refund for orderinvoice enabled orders. This can only be used for line items that have previously been charged using `createChargeInvoice`. All amounts (except for the summary) are incremental with respect to the previous invoice. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orderinvoices.createrefundinvoice({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "invoiceId": "my_invoiceId", + * // "operationId": "my_operationId", + * // "refundOnlyOption": {}, + * // "returnOption": {}, + * // "shipmentInvoices": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orderinvoices.createrefundinvoice * @memberOf! () * @@ -9495,6 +11511,56 @@ export namespace content_v2_1 { /** * content.orderreports.listdisbursements * @desc Retrieves a report for disbursements from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orderreports.listdisbursements({ + * // The last date which disbursements occurred. In ISO 8601 format. Default: current date. + * disbursementEndDate: 'placeholder-value', + * // The first date which disbursements occurred. In ISO 8601 format. + * disbursementStartDate: 'placeholder-value', + * // The maximum number of disbursements to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "disbursements": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orderreports.listdisbursements * @memberOf! () * @@ -9589,6 +11655,58 @@ export namespace content_v2_1 { /** * content.orderreports.listtransactions * @desc Retrieves a list of transactions for a disbursement from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orderreports.listtransactions({ + * // The Google-provided ID of the disbursement (found in Wallet). + * disbursementId: 'placeholder-value', + * // The maximum number of disbursements to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * // The last date in which transaction occurred. In ISO 8601 format. Default: current date. + * transactionEndDate: 'placeholder-value', + * // The first date in which transaction occurred. In ISO 8601 format. + * transactionStartDate: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "transactions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orderreports.listtransactions * @memberOf! () * @@ -9757,6 +11875,57 @@ export namespace content_v2_1 { /** * content.orderreturns.acknowledge * @desc Acks an order return in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orderreturns.acknowledge({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the return. + * returnId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "operationId": "my_operationId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orderreturns.acknowledge * @memberOf! () * @@ -9842,6 +12011,54 @@ export namespace content_v2_1 { /** * content.orderreturns.get * @desc Retrieves an order return from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orderreturns.get({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // Merchant order return ID generated by Google. + * returnId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationDate": "my_creationDate", + * // "merchantOrderId": "my_merchantOrderId", + * // "orderId": "my_orderId", + * // "orderReturnId": "my_orderReturnId", + * // "returnItems": [], + * // "returnPricingInfo": {}, + * // "returnShipments": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orderreturns.get * @memberOf! () * @@ -9915,6 +12132,73 @@ export namespace content_v2_1 { /** * content.orderreturns.list * @desc Lists order returns in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orderreturns.list({ + * // Obtains order returns that match the acknowledgement status. When set to true, obtains order returns that have been acknowledged. When false, obtains order returns that have not been acknowledged. When not provided, obtains order returns regardless of their acknowledgement status. + * // We recommend using this filter set to `false`, in conjunction with the `acknowledge` call, such that only un-acknowledged order returns are returned. + * acknowledged: 'placeholder-value', + * // Obtains order returns created before this date (inclusively), in ISO 8601 format. + * createdEndDate: 'placeholder-value', + * // Obtains order returns created after this date (inclusively), in ISO 8601 format. + * createdStartDate: 'placeholder-value', + * // Obtains order returns with the specified order ids. If this parameter is provided, createdStartDate, createdEndDate, shipmentType, shipmentStatus, shipmentState and acknowledged parameters must be not set. + * // Note: if googleOrderId and shipmentTrackingNumber parameters are provided, the obtained results will include all order returns that either match the specified order id or the specified tracking number. + * googleOrderIds: 'placeholder-value', + * // The maximum number of order returns to return in the response, used for paging. The default value is 25 returns per page, and the maximum allowed value is 250 returns per page. + * maxResults: 'placeholder-value', + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // Return the results in the specified order. + * orderBy: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * // Obtains order returns that match any shipment state provided in this parameter. When this parameter is not provided, order returns are obtained regardless of their shipment states. + * shipmentStates: 'placeholder-value', + * // Obtains order returns that match any shipment status provided in this parameter. When this parameter is not provided, order returns are obtained regardless of their shipment statuses. + * shipmentStatus: 'placeholder-value', + * // Obtains order returns with the specified tracking numbers. If this parameter is provided, createdStartDate, createdEndDate, shipmentType, shipmentStatus, shipmentState and acknowledged parameters must be not set. + * // Note: if googleOrderId and shipmentTrackingNumber parameters are provided, the obtained results will include all order returns that either match the specified order id or the specified tracking number. + * shipmentTrackingNumbers: 'placeholder-value', + * // Obtains order returns that match any shipment type provided in this parameter. When this parameter is not provided, order returns are obtained regardless of their shipment types. + * shipmentTypes: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orderreturns.list * @memberOf! () * @@ -10002,6 +12286,60 @@ export namespace content_v2_1 { /** * content.orderreturns.process * @desc Processes return in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orderreturns.process({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the return. + * returnId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fullChargeReturnShippingCost": false, + * // "operationId": "my_operationId", + * // "refundShippingFee": {}, + * // "returnItems": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orderreturns.process * @memberOf! () * @@ -10206,6 +12544,57 @@ export namespace content_v2_1 { /** * content.orders.acknowledge * @desc Marks an order as acknowledged. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orders.acknowledge({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "operationId": "my_operationId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.acknowledge * @memberOf! () * @@ -10289,6 +12678,48 @@ export namespace content_v2_1 { /** * content.orders.advancetestorder * @desc Sandbox only. Moves a test order from state "`inProgress`" to state "`pendingShipment`". + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orders.advancetestorder({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the test order to modify. + * orderId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.advancetestorder * @memberOf! () * @@ -10373,6 +12804,59 @@ export namespace content_v2_1 { /** * content.orders.cancel * @desc Cancels all line items in an order, making a full refund. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orders.cancel({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order to cancel. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "operationId": "my_operationId", + * // "reason": "my_reason", + * // "reasonText": "my_reasonText" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.cancel * @memberOf! () * @@ -10449,6 +12933,62 @@ export namespace content_v2_1 { /** * content.orders.cancellineitem * @desc Cancels a line item, making a full refund. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orders.cancellineitem({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "lineItemId": "my_lineItemId", + * // "operationId": "my_operationId", + * // "productId": "my_productId", + * // "quantity": 0, + * // "reason": "my_reason", + * // "reasonText": "my_reasonText" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.cancellineitem * @memberOf! () * @@ -10534,6 +13074,56 @@ export namespace content_v2_1 { /** * content.orders.canceltestorderbycustomer * @desc Sandbox only. Cancels a test order for customer-initiated cancellation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orders.canceltestorderbycustomer({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the test order to cancel. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "reason": "my_reason" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.canceltestorderbycustomer * @memberOf! () * @@ -10627,6 +13217,57 @@ export namespace content_v2_1 { /** * content.orders.createtestorder * @desc Sandbox only. Creates a test order. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orders.createtestorder({ + * // The ID of the account that should manage the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "country": "my_country", + * // "templateName": "my_templateName", + * // "testOrder": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "orderId": "my_orderId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.createtestorder * @memberOf! () * @@ -10711,6 +13352,57 @@ export namespace content_v2_1 { /** * content.orders.createtestreturn * @desc Sandbox only. Creates a test return. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orders.createtestreturn({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "items": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "returnId": "my_returnId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.createtestreturn * @memberOf! () * @@ -10795,6 +13487,68 @@ export namespace content_v2_1 { /** * content.orders.get * @desc Retrieves an order from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orders.get({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acknowledged": false, + * // "billingAddress": {}, + * // "customer": {}, + * // "deliveryDetails": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "lineItems": [], + * // "merchantId": "my_merchantId", + * // "merchantOrderId": "my_merchantOrderId", + * // "netPriceAmount": {}, + * // "netTaxAmount": {}, + * // "paymentStatus": "my_paymentStatus", + * // "pickupDetails": {}, + * // "placedDate": "my_placedDate", + * // "promotions": [], + * // "refunds": [], + * // "shipments": [], + * // "shippingCost": {}, + * // "shippingCostTax": {}, + * // "status": "my_status", + * // "taxCollector": "my_taxCollector" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.get * @memberOf! () * @@ -10866,6 +13620,49 @@ export namespace content_v2_1 { /** * content.orders.getbymerchantorderid * @desc Retrieves an order using merchant order ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orders.getbymerchantorderid({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The merchant order ID to be looked for. + * merchantOrderId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "order": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.getbymerchantorderid * @memberOf! () * @@ -10950,6 +13747,51 @@ export namespace content_v2_1 { /** * content.orders.gettestordertemplate * @desc Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orders.gettestordertemplate({ + * // The country of the template to retrieve. Defaults to `US`. + * country: 'placeholder-value', + * // The ID of the account that should manage the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The name of the template to retrieve. + * templateName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "template": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.gettestordertemplate * @memberOf! () * @@ -11035,6 +13877,64 @@ export namespace content_v2_1 { /** * content.orders.instorerefundlineitem * @desc Deprecated. Notifies that item return and refund was handled directly by merchant outside of Google payments processing (e.g. cash refund done in store). Note: We recommend calling the returnrefundlineitem method to refund in-store returns. We will issue the refund directly to the customer. This helps to prevent possible differences arising between merchant and Google transaction records. We also recommend having the point of sale system communicate with Google to ensure that customers do not receive a double refund by first refunding via Google then via an in-store return. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orders.instorerefundlineitem({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "lineItemId": "my_lineItemId", + * // "operationId": "my_operationId", + * // "priceAmount": {}, + * // "productId": "my_productId", + * // "quantity": 0, + * // "reason": "my_reason", + * // "reasonText": "my_reasonText", + * // "taxAmount": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.instorerefundlineitem * @memberOf! () * @@ -11122,6 +14022,67 @@ export namespace content_v2_1 { /** * content.orders.list * @desc Lists the orders in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orders.list({ + * // Obtains orders that match the acknowledgement status. When set to true, obtains orders that have been acknowledged. When false, obtains orders that have not been acknowledged. + * // We recommend using this filter set to `false`, in conjunction with the `acknowledge` call, such that only un-acknowledged orders are returned. + * acknowledged: 'placeholder-value', + * // The maximum number of orders to return in the response, used for paging. The default value is 25 orders per page, and the maximum allowed value is 250 orders per page. + * maxResults: 'placeholder-value', + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // Order results by placement date in descending or ascending order. + * // + * // Acceptable values are: + * // - placedDateAsc + * // - placedDateDesc + * orderBy: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * // Obtains orders placed before this date (exclusively), in ISO 8601 format. + * placedDateEnd: 'placeholder-value', + * // Obtains orders placed after this date (inclusively), in ISO 8601 format. + * placedDateStart: 'placeholder-value', + * // Obtains orders that match any of the specified statuses. Please note that `active` is a shortcut for `pendingShipment` and `partiallyShipped`, and `completed` is a shortcut for `shipped`, `partiallyDelivered`, `delivered`, `partiallyReturned`, `returned`, and `canceled`. + * statuses: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.list * @memberOf! () * @@ -11202,6 +14163,62 @@ export namespace content_v2_1 { /** * content.orders.rejectreturnlineitem * @desc Rejects return on an line item. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orders.rejectreturnlineitem({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "lineItemId": "my_lineItemId", + * // "operationId": "my_operationId", + * // "productId": "my_productId", + * // "quantity": 0, + * // "reason": "my_reason", + * // "reasonText": "my_reasonText" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.rejectreturnlineitem * @memberOf! () * @@ -11287,6 +14304,64 @@ export namespace content_v2_1 { /** * content.orders.returnrefundlineitem * @desc Returns and refunds a line item. Note that this method can only be called on fully shipped orders. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orders.returnrefundlineitem({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "lineItemId": "my_lineItemId", + * // "operationId": "my_operationId", + * // "priceAmount": {}, + * // "productId": "my_productId", + * // "quantity": 0, + * // "reason": "my_reason", + * // "reasonText": "my_reasonText", + * // "taxAmount": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.returnrefundlineitem * @memberOf! () * @@ -11372,6 +14447,60 @@ export namespace content_v2_1 { /** * content.orders.setlineitemmetadata * @desc Sets (or overrides if it already exists) merchant provided annotations in the form of key-value pairs. A common use case would be to supply us with additional structured information about a line item that cannot be provided via other methods. Submitted key-value pairs can be retrieved as part of the orders resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orders.setlineitemmetadata({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "annotations": [], + * // "lineItemId": "my_lineItemId", + * // "operationId": "my_operationId", + * // "productId": "my_productId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.setlineitemmetadata * @memberOf! () * @@ -11457,6 +14586,60 @@ export namespace content_v2_1 { /** * content.orders.shiplineitems * @desc Marks line item(s) as shipped. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orders.shiplineitems({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "lineItems": [], + * // "operationId": "my_operationId", + * // "shipmentGroupId": "my_shipmentGroupId", + * // "shipmentInfos": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.shiplineitems * @memberOf! () * @@ -11540,6 +14723,61 @@ export namespace content_v2_1 { /** * content.orders.updatelineitemshippingdetails * @desc Updates ship by and delivery by dates for a line item. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orders.updatelineitemshippingdetails({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deliverByDate": "my_deliverByDate", + * // "lineItemId": "my_lineItemId", + * // "operationId": "my_operationId", + * // "productId": "my_productId", + * // "shipByDate": "my_shipByDate" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.updatelineitemshippingdetails * @memberOf! () * @@ -11641,6 +14879,58 @@ export namespace content_v2_1 { /** * content.orders.updatemerchantorderid * @desc Updates the merchant order ID for a given order. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orders.updatemerchantorderid({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "merchantOrderId": "my_merchantOrderId", + * // "operationId": "my_operationId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.updatemerchantorderid * @memberOf! () * @@ -11728,6 +15018,62 @@ export namespace content_v2_1 { /** * content.orders.updateshipment * @desc Updates a shipment's status, carrier, and/or tracking ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.orders.updateshipment({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "carrier": "my_carrier", + * // "deliveryDate": "my_deliveryDate", + * // "operationId": "my_operationId", + * // "shipmentId": "my_shipmentId", + * // "status": "my_status", + * // "trackingId": "my_trackingId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.updateshipment * @memberOf! () * @@ -12216,6 +15562,52 @@ export namespace content_v2_1 { /** * content.pos.custombatch * @desc Batches multiple POS-related calls in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.pos.custombatch({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.pos.custombatch * @memberOf! () * @@ -12293,6 +15685,45 @@ export namespace content_v2_1 { /** * content.pos.delete * @desc Deletes a store for the given merchant. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.pos.delete({ + * // The ID of the POS or inventory data provider. + * merchantId: 'placeholder-value', + * // A store code that is unique per merchant. + * storeCode: 'placeholder-value', + * // The ID of the target merchant. + * targetMerchantId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.pos.delete * @memberOf! () * @@ -12366,6 +15797,52 @@ export namespace content_v2_1 { /** * content.pos.get * @desc Retrieves information about the given store. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.pos.get({ + * // The ID of the POS or inventory data provider. + * merchantId: 'placeholder-value', + * // A store code that is unique per merchant. + * storeCode: 'placeholder-value', + * // The ID of the target merchant. + * targetMerchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "storeAddress": "my_storeAddress", + * // "storeCode": "my_storeCode" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.pos.get * @memberOf! () * @@ -12439,6 +15916,60 @@ export namespace content_v2_1 { /** * content.pos.insert * @desc Creates a store for the given merchant. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.pos.insert({ + * // The ID of the POS or inventory data provider. + * merchantId: 'placeholder-value', + * // The ID of the target merchant. + * targetMerchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "storeAddress": "my_storeAddress", + * // "storeCode": "my_storeCode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "storeAddress": "my_storeAddress", + * // "storeCode": "my_storeCode" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.pos.insert * @memberOf! () * @@ -12512,6 +16043,71 @@ export namespace content_v2_1 { /** * content.pos.inventory * @desc Submit inventory for the given merchant. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.pos.inventory({ + * // The ID of the POS or inventory data provider. + * merchantId: 'placeholder-value', + * // The ID of the target merchant. + * targetMerchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentLanguage": "my_contentLanguage", + * // "gtin": "my_gtin", + * // "itemId": "my_itemId", + * // "price": {}, + * // "quantity": "my_quantity", + * // "storeCode": "my_storeCode", + * // "targetCountry": "my_targetCountry", + * // "timestamp": "my_timestamp" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentLanguage": "my_contentLanguage", + * // "gtin": "my_gtin", + * // "itemId": "my_itemId", + * // "kind": "my_kind", + * // "price": {}, + * // "quantity": "my_quantity", + * // "storeCode": "my_storeCode", + * // "targetCountry": "my_targetCountry", + * // "timestamp": "my_timestamp" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.pos.inventory * @memberOf! () * @@ -12591,6 +16187,49 @@ export namespace content_v2_1 { /** * content.pos.list * @desc Lists the stores of the target merchant. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.pos.list({ + * // The ID of the POS or inventory data provider. + * merchantId: 'placeholder-value', + * // The ID of the target merchant. + * targetMerchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.pos.list * @memberOf! () * @@ -12665,6 +16304,73 @@ export namespace content_v2_1 { /** * content.pos.sale * @desc Submit a sale event for the given merchant. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.pos.sale({ + * // The ID of the POS or inventory data provider. + * merchantId: 'placeholder-value', + * // The ID of the target merchant. + * targetMerchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentLanguage": "my_contentLanguage", + * // "gtin": "my_gtin", + * // "itemId": "my_itemId", + * // "price": {}, + * // "quantity": "my_quantity", + * // "saleId": "my_saleId", + * // "storeCode": "my_storeCode", + * // "targetCountry": "my_targetCountry", + * // "timestamp": "my_timestamp" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentLanguage": "my_contentLanguage", + * // "gtin": "my_gtin", + * // "itemId": "my_itemId", + * // "kind": "my_kind", + * // "price": {}, + * // "quantity": "my_quantity", + * // "saleId": "my_saleId", + * // "storeCode": "my_storeCode", + * // "targetCountry": "my_targetCountry", + * // "timestamp": "my_timestamp" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.pos.sale * @memberOf! () * @@ -12871,6 +16577,52 @@ export namespace content_v2_1 { /** * content.products.custombatch * @desc Retrieves, inserts, and deletes multiple products in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.products.custombatch({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.products.custombatch * @memberOf! () * @@ -12952,6 +16704,45 @@ export namespace content_v2_1 { /** * content.products.delete * @desc Deletes a product from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.products.delete({ + * // The Content API Supplemental Feed ID. + * feedId: 'placeholder-value', + * // The ID of the account that contains the product. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The REST ID of the product. + * productId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.products.delete * @memberOf! () * @@ -13024,6 +16815,122 @@ export namespace content_v2_1 { /** * content.products.get * @desc Retrieves a product from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.products.get({ + * // The ID of the account that contains the product. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The REST ID of the product. + * productId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "additionalImageLinks": [], + * // "adsGrouping": "my_adsGrouping", + * // "adsLabels": [], + * // "adsRedirect": "my_adsRedirect", + * // "adult": false, + * // "ageGroup": "my_ageGroup", + * // "availability": "my_availability", + * // "availabilityDate": "my_availabilityDate", + * // "brand": "my_brand", + * // "channel": "my_channel", + * // "color": "my_color", + * // "condition": "my_condition", + * // "contentLanguage": "my_contentLanguage", + * // "costOfGoodsSold": {}, + * // "customAttributes": [], + * // "customLabel0": "my_customLabel0", + * // "customLabel1": "my_customLabel1", + * // "customLabel2": "my_customLabel2", + * // "customLabel3": "my_customLabel3", + * // "customLabel4": "my_customLabel4", + * // "description": "my_description", + * // "displayAdsId": "my_displayAdsId", + * // "displayAdsLink": "my_displayAdsLink", + * // "displayAdsSimilarIds": [], + * // "displayAdsTitle": "my_displayAdsTitle", + * // "displayAdsValue": {}, + * // "energyEfficiencyClass": "my_energyEfficiencyClass", + * // "excludedDestinations": [], + * // "expirationDate": "my_expirationDate", + * // "gender": "my_gender", + * // "googleProductCategory": "my_googleProductCategory", + * // "gtin": "my_gtin", + * // "id": "my_id", + * // "identifierExists": false, + * // "imageLink": "my_imageLink", + * // "includedDestinations": [], + * // "installment": {}, + * // "isBundle": false, + * // "itemGroupId": "my_itemGroupId", + * // "kind": "my_kind", + * // "link": "my_link", + * // "loyaltyPoints": {}, + * // "material": "my_material", + * // "maxEnergyEfficiencyClass": "my_maxEnergyEfficiencyClass", + * // "maxHandlingTime": "my_maxHandlingTime", + * // "minEnergyEfficiencyClass": "my_minEnergyEfficiencyClass", + * // "minHandlingTime": "my_minHandlingTime", + * // "mobileLink": "my_mobileLink", + * // "mpn": "my_mpn", + * // "multipack": "my_multipack", + * // "offerId": "my_offerId", + * // "pattern": "my_pattern", + * // "price": {}, + * // "productTypes": [], + * // "promotionIds": [], + * // "salePrice": {}, + * // "salePriceEffectiveDate": "my_salePriceEffectiveDate", + * // "sellOnGoogleQuantity": "my_sellOnGoogleQuantity", + * // "shipping": [], + * // "shippingHeight": {}, + * // "shippingLabel": "my_shippingLabel", + * // "shippingLength": {}, + * // "shippingWeight": {}, + * // "shippingWidth": {}, + * // "sizeSystem": "my_sizeSystem", + * // "sizeType": "my_sizeType", + * // "sizes": [], + * // "source": "my_source", + * // "targetCountry": "my_targetCountry", + * // "taxCategory": "my_taxCategory", + * // "taxes": [], + * // "title": "my_title", + * // "transitTimeLabel": "my_transitTimeLabel", + * // "unitPricingBaseMeasure": {}, + * // "unitPricingMeasure": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.products.get * @memberOf! () * @@ -13095,6 +17002,204 @@ export namespace content_v2_1 { /** * content.products.insert * @desc Uploads a product to your Merchant Center account. If an item with the same channel, contentLanguage, offerId, and targetCountry already exists, this method updates that entry. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.products.insert({ + * // The Content API Supplemental Feed ID. + * feedId: 'placeholder-value', + * // The ID of the account that contains the product. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "additionalImageLinks": [], + * // "adsGrouping": "my_adsGrouping", + * // "adsLabels": [], + * // "adsRedirect": "my_adsRedirect", + * // "adult": false, + * // "ageGroup": "my_ageGroup", + * // "availability": "my_availability", + * // "availabilityDate": "my_availabilityDate", + * // "brand": "my_brand", + * // "channel": "my_channel", + * // "color": "my_color", + * // "condition": "my_condition", + * // "contentLanguage": "my_contentLanguage", + * // "costOfGoodsSold": {}, + * // "customAttributes": [], + * // "customLabel0": "my_customLabel0", + * // "customLabel1": "my_customLabel1", + * // "customLabel2": "my_customLabel2", + * // "customLabel3": "my_customLabel3", + * // "customLabel4": "my_customLabel4", + * // "description": "my_description", + * // "displayAdsId": "my_displayAdsId", + * // "displayAdsLink": "my_displayAdsLink", + * // "displayAdsSimilarIds": [], + * // "displayAdsTitle": "my_displayAdsTitle", + * // "displayAdsValue": {}, + * // "energyEfficiencyClass": "my_energyEfficiencyClass", + * // "excludedDestinations": [], + * // "expirationDate": "my_expirationDate", + * // "gender": "my_gender", + * // "googleProductCategory": "my_googleProductCategory", + * // "gtin": "my_gtin", + * // "id": "my_id", + * // "identifierExists": false, + * // "imageLink": "my_imageLink", + * // "includedDestinations": [], + * // "installment": {}, + * // "isBundle": false, + * // "itemGroupId": "my_itemGroupId", + * // "kind": "my_kind", + * // "link": "my_link", + * // "loyaltyPoints": {}, + * // "material": "my_material", + * // "maxEnergyEfficiencyClass": "my_maxEnergyEfficiencyClass", + * // "maxHandlingTime": "my_maxHandlingTime", + * // "minEnergyEfficiencyClass": "my_minEnergyEfficiencyClass", + * // "minHandlingTime": "my_minHandlingTime", + * // "mobileLink": "my_mobileLink", + * // "mpn": "my_mpn", + * // "multipack": "my_multipack", + * // "offerId": "my_offerId", + * // "pattern": "my_pattern", + * // "price": {}, + * // "productTypes": [], + * // "promotionIds": [], + * // "salePrice": {}, + * // "salePriceEffectiveDate": "my_salePriceEffectiveDate", + * // "sellOnGoogleQuantity": "my_sellOnGoogleQuantity", + * // "shipping": [], + * // "shippingHeight": {}, + * // "shippingLabel": "my_shippingLabel", + * // "shippingLength": {}, + * // "shippingWeight": {}, + * // "shippingWidth": {}, + * // "sizeSystem": "my_sizeSystem", + * // "sizeType": "my_sizeType", + * // "sizes": [], + * // "source": "my_source", + * // "targetCountry": "my_targetCountry", + * // "taxCategory": "my_taxCategory", + * // "taxes": [], + * // "title": "my_title", + * // "transitTimeLabel": "my_transitTimeLabel", + * // "unitPricingBaseMeasure": {}, + * // "unitPricingMeasure": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "additionalImageLinks": [], + * // "adsGrouping": "my_adsGrouping", + * // "adsLabels": [], + * // "adsRedirect": "my_adsRedirect", + * // "adult": false, + * // "ageGroup": "my_ageGroup", + * // "availability": "my_availability", + * // "availabilityDate": "my_availabilityDate", + * // "brand": "my_brand", + * // "channel": "my_channel", + * // "color": "my_color", + * // "condition": "my_condition", + * // "contentLanguage": "my_contentLanguage", + * // "costOfGoodsSold": {}, + * // "customAttributes": [], + * // "customLabel0": "my_customLabel0", + * // "customLabel1": "my_customLabel1", + * // "customLabel2": "my_customLabel2", + * // "customLabel3": "my_customLabel3", + * // "customLabel4": "my_customLabel4", + * // "description": "my_description", + * // "displayAdsId": "my_displayAdsId", + * // "displayAdsLink": "my_displayAdsLink", + * // "displayAdsSimilarIds": [], + * // "displayAdsTitle": "my_displayAdsTitle", + * // "displayAdsValue": {}, + * // "energyEfficiencyClass": "my_energyEfficiencyClass", + * // "excludedDestinations": [], + * // "expirationDate": "my_expirationDate", + * // "gender": "my_gender", + * // "googleProductCategory": "my_googleProductCategory", + * // "gtin": "my_gtin", + * // "id": "my_id", + * // "identifierExists": false, + * // "imageLink": "my_imageLink", + * // "includedDestinations": [], + * // "installment": {}, + * // "isBundle": false, + * // "itemGroupId": "my_itemGroupId", + * // "kind": "my_kind", + * // "link": "my_link", + * // "loyaltyPoints": {}, + * // "material": "my_material", + * // "maxEnergyEfficiencyClass": "my_maxEnergyEfficiencyClass", + * // "maxHandlingTime": "my_maxHandlingTime", + * // "minEnergyEfficiencyClass": "my_minEnergyEfficiencyClass", + * // "minHandlingTime": "my_minHandlingTime", + * // "mobileLink": "my_mobileLink", + * // "mpn": "my_mpn", + * // "multipack": "my_multipack", + * // "offerId": "my_offerId", + * // "pattern": "my_pattern", + * // "price": {}, + * // "productTypes": [], + * // "promotionIds": [], + * // "salePrice": {}, + * // "salePriceEffectiveDate": "my_salePriceEffectiveDate", + * // "sellOnGoogleQuantity": "my_sellOnGoogleQuantity", + * // "shipping": [], + * // "shippingHeight": {}, + * // "shippingLabel": "my_shippingLabel", + * // "shippingLength": {}, + * // "shippingWeight": {}, + * // "shippingWidth": {}, + * // "sizeSystem": "my_sizeSystem", + * // "sizeType": "my_sizeType", + * // "sizes": [], + * // "source": "my_source", + * // "targetCountry": "my_targetCountry", + * // "taxCategory": "my_taxCategory", + * // "taxes": [], + * // "title": "my_title", + * // "transitTimeLabel": "my_transitTimeLabel", + * // "unitPricingBaseMeasure": {}, + * // "unitPricingMeasure": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.products.insert * @memberOf! () * @@ -13168,6 +17273,52 @@ export namespace content_v2_1 { /** * content.products.list * @desc Lists the products in your Merchant Center account. The response might contain fewer items than specified by maxResults. Rely on nextPageToken to determine if there are more items to be requested. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.products.list({ + * // The maximum number of products to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the account that contains the products. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.products.list * @memberOf! () * @@ -13338,6 +17489,52 @@ export namespace content_v2_1 { /** * content.productstatuses.custombatch * @desc Gets the statuses of multiple products in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.productstatuses.custombatch({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.productstatuses.custombatch * @memberOf! () * @@ -13421,6 +17618,58 @@ export namespace content_v2_1 { /** * content.productstatuses.get * @desc Gets the status of a product from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.productstatuses.get({ + * // If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination. + * destinations: 'placeholder-value', + * // The ID of the account that contains the product. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The REST ID of the product. + * productId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationDate": "my_creationDate", + * // "destinationStatuses": [], + * // "googleExpirationDate": "my_googleExpirationDate", + * // "itemLevelIssues": [], + * // "kind": "my_kind", + * // "lastUpdateDate": "my_lastUpdateDate", + * // "link": "my_link", + * // "productId": "my_productId", + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.productstatuses.get * @memberOf! () * @@ -13496,6 +17745,54 @@ export namespace content_v2_1 { /** * content.productstatuses.list * @desc Lists the statuses of the products in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.productstatuses.list({ + * // If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination. + * destinations: 'placeholder-value', + * // The maximum number of product statuses to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the account that contains the products. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.productstatuses.list * @memberOf! () * @@ -13643,6 +17940,48 @@ export namespace content_v2_1 { /** * content.pubsubnotificationsettings.get * @desc Retrieves a Merchant Center account's pubsub notification settings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.pubsubnotificationsettings.get({ + * // The ID of the account for which to get pubsub notification settings. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cloudTopicName": "my_cloudTopicName", + * // "kind": "my_kind", + * // "registeredEvents": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.pubsubnotificationsettings.get * @memberOf! () * @@ -13723,6 +18062,58 @@ export namespace content_v2_1 { /** * content.pubsubnotificationsettings.update * @desc Register a Merchant Center account for pubsub notifications. Note that cloud topic name should not be provided as part of the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.pubsubnotificationsettings.update({ + * // The ID of the account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "cloudTopicName": "my_cloudTopicName", + * // "kind": "my_kind", + * // "registeredEvents": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cloudTopicName": "my_cloudTopicName", + * // "kind": "my_kind", + * // "registeredEvents": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.pubsubnotificationsettings.update * @memberOf! () * @@ -13841,6 +18232,52 @@ export namespace content_v2_1 { /** * content.regionalinventory.custombatch * @desc Updates regional inventory for multiple products or regions in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.regionalinventory.custombatch({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.regionalinventory.custombatch * @memberOf! () * @@ -13932,6 +18369,68 @@ export namespace content_v2_1 { /** * content.regionalinventory.insert * @desc Update the regional inventory of a product in your Merchant Center account. If a regional inventory with the same region ID already exists, this method updates that entry. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.regionalinventory.insert({ + * // The ID of the account that contains the product. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The REST ID of the product for which to update the regional inventory. + * productId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "availability": "my_availability", + * // "customAttributes": [], + * // "kind": "my_kind", + * // "price": {}, + * // "regionId": "my_regionId", + * // "salePrice": {}, + * // "salePriceEffectiveDate": "my_salePriceEffectiveDate" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "availability": "my_availability", + * // "customAttributes": [], + * // "kind": "my_kind", + * // "price": {}, + * // "regionId": "my_regionId", + * // "salePrice": {}, + * // "salePriceEffectiveDate": "my_salePriceEffectiveDate" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.regionalinventory.insert * @memberOf! () * @@ -14049,6 +18548,52 @@ export namespace content_v2_1 { /** * content.returnaddress.custombatch * @desc Batches multiple return address related calls in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.returnaddress.custombatch({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.returnaddress.custombatch * @memberOf! () * @@ -14132,6 +18677,43 @@ export namespace content_v2_1 { /** * content.returnaddress.delete * @desc Deletes a return address for the given Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.returnaddress.delete({ + * // The Merchant Center account from which to delete the given return address. + * merchantId: 'placeholder-value', + * // Return address ID generated by Google. + * returnAddressId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.returnaddress.delete * @memberOf! () * @@ -14205,6 +18787,53 @@ export namespace content_v2_1 { /** * content.returnaddress.get * @desc Gets a return address of the Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.returnaddress.get({ + * // The Merchant Center account to get a return address for. + * merchantId: 'placeholder-value', + * // Return address ID generated by Google. + * returnAddressId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": {}, + * // "country": "my_country", + * // "kind": "my_kind", + * // "label": "my_label", + * // "phoneNumber": "my_phoneNumber", + * // "returnAddressId": "my_returnAddressId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.returnaddress.get * @memberOf! () * @@ -14280,6 +18909,64 @@ export namespace content_v2_1 { /** * content.returnaddress.insert * @desc Inserts a return address for the Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.returnaddress.insert({ + * // The Merchant Center account to insert a return address for. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": {}, + * // "country": "my_country", + * // "kind": "my_kind", + * // "label": "my_label", + * // "phoneNumber": "my_phoneNumber", + * // "returnAddressId": "my_returnAddressId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": {}, + * // "country": "my_country", + * // "kind": "my_kind", + * // "label": "my_label", + * // "phoneNumber": "my_phoneNumber", + * // "returnAddressId": "my_returnAddressId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.returnaddress.insert * @memberOf! () * @@ -14355,6 +19042,54 @@ export namespace content_v2_1 { /** * content.returnaddress.list * @desc Lists the return addresses of the Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.returnaddress.list({ + * // List only return addresses applicable to the given country of sale. When omitted, all return addresses are listed. + * country: 'placeholder-value', + * // The maximum number of addresses in the response, used for paging. + * maxResults: 'placeholder-value', + * // The Merchant Center account to list return addresses for. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.returnaddress.list * @memberOf! () * @@ -14532,6 +19267,52 @@ export namespace content_v2_1 { /** * content.returnpolicy.custombatch * @desc Batches multiple return policy related calls in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.returnpolicy.custombatch({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.returnpolicy.custombatch * @memberOf! () * @@ -14615,6 +19396,43 @@ export namespace content_v2_1 { /** * content.returnpolicy.delete * @desc Deletes a return policy for the given Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.returnpolicy.delete({ + * // The Merchant Center account from which to delete the given return policy. + * merchantId: 'placeholder-value', + * // Return policy ID generated by Google. + * returnPolicyId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.returnpolicy.delete * @memberOf! () * @@ -14688,6 +19506,55 @@ export namespace content_v2_1 { /** * content.returnpolicy.get * @desc Gets a return policy of the Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.returnpolicy.get({ + * // The Merchant Center account to get a return policy for. + * merchantId: 'placeholder-value', + * // Return policy ID generated by Google. + * returnPolicyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "country": "my_country", + * // "kind": "my_kind", + * // "label": "my_label", + * // "name": "my_name", + * // "nonFreeReturnReasons": [], + * // "policy": {}, + * // "returnPolicyId": "my_returnPolicyId", + * // "seasonalOverrides": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.returnpolicy.get * @memberOf! () * @@ -14762,6 +19629,68 @@ export namespace content_v2_1 { /** * content.returnpolicy.insert * @desc Inserts a return policy for the Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.returnpolicy.insert({ + * // The Merchant Center account to insert a return policy for. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "country": "my_country", + * // "kind": "my_kind", + * // "label": "my_label", + * // "name": "my_name", + * // "nonFreeReturnReasons": [], + * // "policy": {}, + * // "returnPolicyId": "my_returnPolicyId", + * // "seasonalOverrides": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "country": "my_country", + * // "kind": "my_kind", + * // "label": "my_label", + * // "name": "my_name", + * // "nonFreeReturnReasons": [], + * // "policy": {}, + * // "returnPolicyId": "my_returnPolicyId", + * // "seasonalOverrides": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.returnpolicy.insert * @memberOf! () * @@ -14837,6 +19766,47 @@ export namespace content_v2_1 { /** * content.returnpolicy.list * @desc Lists the return policies of the Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.returnpolicy.list({ + * // The Merchant Center account to list return policies for. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.returnpolicy.list * @memberOf! () * @@ -14993,6 +19963,55 @@ export namespace content_v2_1 { /** * content.settlementreports.get * @desc Retrieves a settlement report from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.settlementreports.get({ + * // The Merchant Center account of the settlement report. + * merchantId: 'placeholder-value', + * // The Google-provided ID of the settlement. + * settlementId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endDate": "my_endDate", + * // "kind": "my_kind", + * // "previousBalance": {}, + * // "settlementId": "my_settlementId", + * // "startDate": "my_startDate", + * // "transferAmount": {}, + * // "transferDate": "my_transferDate", + * // "transferIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.settlementreports.get * @memberOf! () * @@ -15068,6 +20087,56 @@ export namespace content_v2_1 { /** * content.settlementreports.list * @desc Retrieves a list of settlement reports from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.settlementreports.list({ + * // The maximum number of settlements to return in the response, used for paging. The default value is 200 returns per page, and the maximum allowed value is 5000 returns per page. + * maxResults: 'placeholder-value', + * // The Merchant Center account to list settlements for. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * // Obtains settlements which have transactions before this date (inclusively), in ISO 8601 format. + * transferEndDate: 'placeholder-value', + * // Obtains settlements which have transactions after this date (inclusively), in ISO 8601 format. + * transferStartDate: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.settlementreports.list * @memberOf! () * @@ -15206,6 +20275,56 @@ export namespace content_v2_1 { /** * content.settlementtransactions.list * @desc Retrieves a list of transactions for the settlement. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.settlementtransactions.list({ + * // The maximum number of transactions to return in the response, used for paging. The default value is 200 transactions per page, and the maximum allowed value is 5000 transactions per page. + * maxResults: 'placeholder-value', + * // The Merchant Center account to list transactions for. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * // The Google-provided ID of the settlement. + * settlementId: 'placeholder-value', + * // The list of transactions to return. If not set, all transactions will be returned. + * transactionIds: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.settlementtransactions.list * @memberOf! () * @@ -15329,6 +20448,52 @@ export namespace content_v2_1 { /** * content.shippingsettings.custombatch * @desc Retrieves and updates the shipping settings of multiple accounts in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.shippingsettings.custombatch({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.shippingsettings.custombatch * @memberOf! () * @@ -15414,6 +20579,50 @@ export namespace content_v2_1 { /** * content.shippingsettings.get * @desc Retrieves the shipping settings of the account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.shippingsettings.get({ + * // The ID of the account for which to get/update shipping settings. + * accountId: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "postalCodeGroups": [], + * // "services": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.shippingsettings.get * @memberOf! () * @@ -15489,6 +20698,47 @@ export namespace content_v2_1 { /** * content.shippingsettings.getsupportedcarriers * @desc Retrieves supported carriers and carrier services for an account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.shippingsettings.getsupportedcarriers({ + * // The ID of the account for which to retrieve the supported carriers. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "carriers": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.shippingsettings.getsupportedcarriers * @memberOf! () * @@ -15587,6 +20837,47 @@ export namespace content_v2_1 { /** * content.shippingsettings.getsupportedholidays * @desc Retrieves supported holidays for an account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.shippingsettings.getsupportedholidays({ + * // The ID of the account for which to retrieve the supported holidays. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "holidays": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.shippingsettings.getsupportedholidays * @memberOf! () * @@ -15685,6 +20976,47 @@ export namespace content_v2_1 { /** * content.shippingsettings.getsupportedpickupservices * @desc Retrieves supported pickup services for an account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.shippingsettings.getsupportedpickupservices({ + * // The ID of the account for which to retrieve the supported pickup services. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "pickupServices": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.shippingsettings.getsupportedpickupservices * @memberOf! () * @@ -15782,6 +21114,52 @@ export namespace content_v2_1 { /** * content.shippingsettings.list * @desc Lists the shipping settings of the sub-accounts in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.shippingsettings.list({ + * // The maximum number of shipping settings to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the managing account. This must be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.shippingsettings.list * @memberOf! () * @@ -15866,6 +21244,60 @@ export namespace content_v2_1 { /** * content.shippingsettings.update * @desc Updates the shipping settings of the account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2.1'); + * + * 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/content'], + * }); + * + * // 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 content.shippingsettings.update({ + * // The ID of the account for which to get/update shipping settings. + * accountId: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "postalCodeGroups": [], + * // "services": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "postalCodeGroups": [], + * // "services": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.shippingsettings.update * @memberOf! () * diff --git a/src/apis/content/v2.ts b/src/apis/content/v2.ts index 25bcae65a61..8529e768db1 100644 --- a/src/apis/content/v2.ts +++ b/src/apis/content/v2.ts @@ -5410,6 +5410,44 @@ export namespace content_v2 { /** * content.accounts.authinfo * @desc Returns information about the authenticated user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.accounts.authinfo({}); + * console.log(res.data); + * + * // Example response + * // { + * // "accountIdentifiers": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounts.authinfo * @memberOf! () * @@ -5487,6 +5525,50 @@ export namespace content_v2 { /** * content.accounts.claimwebsite * @desc Claims the website of a Merchant Center sub-account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.accounts.claimwebsite({ + * // The ID of the account whose website is claimed. + * accountId: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * // Only available to selected merchants. When set to `True`, this flag removes any existing claim on the requested website by another account and replaces it with a claim from this account. + * overwrite: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounts.claimwebsite * @memberOf! () * @@ -5572,6 +5654,55 @@ export namespace content_v2 { /** * content.accounts.custombatch * @desc Retrieves, inserts, updates, and deletes multiple Merchant Center (sub-)accounts in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.accounts.custombatch({ + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounts.custombatch * @memberOf! () * @@ -5654,6 +5785,47 @@ export namespace content_v2 { /** * content.accounts.delete * @desc Deletes a Merchant Center sub-account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.accounts.delete({ + * // The ID of the account. + * accountId: 'placeholder-value', + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * // Flag to delete sub-accounts with products. The default value is false. + * force: 'placeholder-value', + * // The ID of the managing account. This must be a multi-client account, and accountId must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounts.delete * @memberOf! () * @@ -5727,6 +5899,59 @@ export namespace content_v2 { /** * content.accounts.get * @desc Retrieves a Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.accounts.get({ + * // The ID of the account. + * accountId: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adultContent": false, + * // "adwordsLinks": [], + * // "businessInformation": {}, + * // "googleMyBusinessLink": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "reviewsUrl": "my_reviewsUrl", + * // "sellerId": "my_sellerId", + * // "users": [], + * // "websiteUrl": "my_websiteUrl", + * // "youtubeChannelLinks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounts.get * @memberOf! () * @@ -5798,6 +6023,78 @@ export namespace content_v2 { /** * content.accounts.insert * @desc Creates a Merchant Center sub-account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.accounts.insert({ + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * // The ID of the managing account. This must be a multi-client account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adultContent": false, + * // "adwordsLinks": [], + * // "businessInformation": {}, + * // "googleMyBusinessLink": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "reviewsUrl": "my_reviewsUrl", + * // "sellerId": "my_sellerId", + * // "users": [], + * // "websiteUrl": "my_websiteUrl", + * // "youtubeChannelLinks": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adultContent": false, + * // "adwordsLinks": [], + * // "businessInformation": {}, + * // "googleMyBusinessLink": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "reviewsUrl": "my_reviewsUrl", + * // "sellerId": "my_sellerId", + * // "users": [], + * // "websiteUrl": "my_websiteUrl", + * // "youtubeChannelLinks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounts.insert * @memberOf! () * @@ -5871,6 +6168,58 @@ export namespace content_v2 { /** * content.accounts.link * @desc Performs an action on a link between two Merchant Center accounts, namely accountId and linkedAccountId. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.accounts.link({ + * // The ID of the account that should be linked. + * accountId: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "linkType": "my_linkType", + * // "linkedAccountId": "my_linkedAccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounts.link * @memberOf! () * @@ -5947,6 +6296,52 @@ export namespace content_v2 { /** * content.accounts.list * @desc Lists the sub-accounts in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.accounts.list({ + * // The maximum number of accounts to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the managing account. This must be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounts.list * @memberOf! () * @@ -6024,6 +6419,80 @@ export namespace content_v2 { /** * content.accounts.update * @desc Updates a Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.accounts.update({ + * // The ID of the account. + * accountId: 'placeholder-value', + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adultContent": false, + * // "adwordsLinks": [], + * // "businessInformation": {}, + * // "googleMyBusinessLink": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "reviewsUrl": "my_reviewsUrl", + * // "sellerId": "my_sellerId", + * // "users": [], + * // "websiteUrl": "my_websiteUrl", + * // "youtubeChannelLinks": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adultContent": false, + * // "adwordsLinks": [], + * // "businessInformation": {}, + * // "googleMyBusinessLink": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "reviewsUrl": "my_reviewsUrl", + * // "sellerId": "my_sellerId", + * // "users": [], + * // "websiteUrl": "my_websiteUrl", + * // "youtubeChannelLinks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounts.update * @memberOf! () * @@ -6270,6 +6739,52 @@ export namespace content_v2 { /** * content.accountstatuses.custombatch * @desc Retrieves multiple Merchant Center account statuses in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.accountstatuses.custombatch({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accountstatuses.custombatch * @memberOf! () * @@ -6353,6 +6868,55 @@ export namespace content_v2 { /** * content.accountstatuses.get * @desc Retrieves the status of a Merchant Center account. No itemLevelIssues are returned for multi-client accounts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.accountstatuses.get({ + * // The ID of the account. + * accountId: 'placeholder-value', + * // If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination. + * destinations: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "accountLevelIssues": [], + * // "dataQualityIssues": [], + * // "kind": "my_kind", + * // "products": [], + * // "websiteClaimed": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accountstatuses.get * @memberOf! () * @@ -6428,6 +6992,54 @@ export namespace content_v2 { /** * content.accountstatuses.list * @desc Lists the statuses of the sub-accounts in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.accountstatuses.list({ + * // If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination. + * destinations: 'placeholder-value', + * // The maximum number of account statuses to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the managing account. This must be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accountstatuses.list * @memberOf! () * @@ -6576,6 +7188,55 @@ export namespace content_v2 { /** * content.accounttax.custombatch * @desc Retrieves and updates tax settings of multiple accounts in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.accounttax.custombatch({ + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounttax.custombatch * @memberOf! () * @@ -6660,6 +7321,50 @@ export namespace content_v2 { /** * content.accounttax.get * @desc Retrieves the tax settings of the account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.accounttax.get({ + * // The ID of the account for which to get/update account tax settings. + * accountId: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "kind": "my_kind", + * // "rules": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounttax.get * @memberOf! () * @@ -6733,6 +7438,52 @@ export namespace content_v2 { /** * content.accounttax.list * @desc Lists the tax settings of the sub-accounts in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.accounttax.list({ + * // The maximum number of tax settings to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the managing account. This must be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounttax.list * @memberOf! () * @@ -6810,6 +7561,62 @@ export namespace content_v2 { /** * content.accounttax.update * @desc Updates the tax settings of the account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.accounttax.update({ + * // The ID of the account for which to get/update account tax settings. + * accountId: 'placeholder-value', + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "kind": "my_kind", + * // "rules": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "kind": "my_kind", + * // "rules": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.accounttax.update * @memberOf! () * @@ -6970,6 +7777,55 @@ export namespace content_v2 { /** * content.datafeeds.custombatch * @desc Deletes, fetches, gets, inserts and updates multiple datafeeds in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.datafeeds.custombatch({ + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.datafeeds.custombatch * @memberOf! () * @@ -7054,6 +7910,45 @@ export namespace content_v2 { /** * content.datafeeds.delete * @desc Deletes a datafeed configuration from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.datafeeds.delete({ + * // The ID of the datafeed. + * datafeedId: 'placeholder-value', + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * // The ID of the account that manages the datafeed. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.datafeeds.delete * @memberOf! () * @@ -7126,6 +8021,50 @@ export namespace content_v2 { /** * content.datafeeds.fetchnow * @desc Invokes a fetch for the datafeed in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.datafeeds.fetchnow({ + * // The ID of the datafeed to be fetched. + * datafeedId: 'placeholder-value', + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * // The ID of the account that manages the datafeed. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.datafeeds.fetchnow * @memberOf! () * @@ -7209,6 +8148,59 @@ export namespace content_v2 { /** * content.datafeeds.get * @desc Retrieves a datafeed configuration from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.datafeeds.get({ + * // The ID of the datafeed. + * datafeedId: 'placeholder-value', + * // The ID of the account that manages the datafeed. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attributeLanguage": "my_attributeLanguage", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "fetchSchedule": {}, + * // "fileName": "my_fileName", + * // "format": {}, + * // "id": "my_id", + * // "intendedDestinations": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "targetCountry": "my_targetCountry", + * // "targets": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.datafeeds.get * @memberOf! () * @@ -7280,6 +8272,78 @@ export namespace content_v2 { /** * content.datafeeds.insert * @desc Registers a datafeed configuration with your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.datafeeds.insert({ + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * // The ID of the account that manages the datafeed. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "attributeLanguage": "my_attributeLanguage", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "fetchSchedule": {}, + * // "fileName": "my_fileName", + * // "format": {}, + * // "id": "my_id", + * // "intendedDestinations": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "targetCountry": "my_targetCountry", + * // "targets": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attributeLanguage": "my_attributeLanguage", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "fetchSchedule": {}, + * // "fileName": "my_fileName", + * // "format": {}, + * // "id": "my_id", + * // "intendedDestinations": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "targetCountry": "my_targetCountry", + * // "targets": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.datafeeds.insert * @memberOf! () * @@ -7353,6 +8417,52 @@ export namespace content_v2 { /** * content.datafeeds.list * @desc Lists the configurations for datafeeds in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.datafeeds.list({ + * // The maximum number of products to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the account that manages the datafeeds. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.datafeeds.list * @memberOf! () * @@ -7430,6 +8540,80 @@ export namespace content_v2 { /** * content.datafeeds.update * @desc Updates a datafeed configuration of your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.datafeeds.update({ + * // The ID of the datafeed. + * datafeedId: 'placeholder-value', + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * // The ID of the account that manages the datafeed. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "attributeLanguage": "my_attributeLanguage", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "fetchSchedule": {}, + * // "fileName": "my_fileName", + * // "format": {}, + * // "id": "my_id", + * // "intendedDestinations": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "targetCountry": "my_targetCountry", + * // "targets": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attributeLanguage": "my_attributeLanguage", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "fetchSchedule": {}, + * // "fileName": "my_fileName", + * // "format": {}, + * // "id": "my_id", + * // "intendedDestinations": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "targetCountry": "my_targetCountry", + * // "targets": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.datafeeds.update * @memberOf! () * @@ -7645,6 +8829,52 @@ export namespace content_v2 { /** * content.datafeedstatuses.custombatch * @desc Gets multiple Merchant Center datafeed statuses in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.datafeedstatuses.custombatch({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.datafeedstatuses.custombatch * @memberOf! () * @@ -7730,6 +8960,61 @@ export namespace content_v2 { /** * content.datafeedstatuses.get * @desc Retrieves the status of a datafeed from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.datafeedstatuses.get({ + * // The country for which to get the datafeed status. If this parameter is provided then language must also be provided. Note that this parameter is required for feeds targeting multiple countries and languages, since a feed may have a different status for each target. + * country: 'placeholder-value', + * // The ID of the datafeed. + * datafeedId: 'placeholder-value', + * // The language for which to get the datafeed status. If this parameter is provided then country must also be provided. Note that this parameter is required for feeds targeting multiple countries and languages, since a feed may have a different status for each target. + * language: 'placeholder-value', + * // The ID of the account that manages the datafeed. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "country": "my_country", + * // "datafeedId": "my_datafeedId", + * // "errors": [], + * // "itemsTotal": "my_itemsTotal", + * // "itemsValid": "my_itemsValid", + * // "kind": "my_kind", + * // "language": "my_language", + * // "lastUploadDate": "my_lastUploadDate", + * // "processingStatus": "my_processingStatus", + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.datafeedstatuses.get * @memberOf! () * @@ -7806,6 +9091,52 @@ export namespace content_v2 { /** * content.datafeedstatuses.list * @desc Lists the statuses of the datafeeds in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.datafeedstatuses.list({ + * // The maximum number of products to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the account that manages the datafeeds. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.datafeedstatuses.list * @memberOf! () * @@ -7954,6 +9285,55 @@ export namespace content_v2 { /** * content.inventory.custombatch * @desc Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.inventory.custombatch({ + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.inventory.custombatch * @memberOf! () * @@ -8038,6 +9418,74 @@ export namespace content_v2 { /** * content.inventory.set * @desc Updates price and availability of a product in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.inventory.set({ + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * // The ID of the account that contains the product. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The REST ID of the product for which to update price and availability. + * productId: 'placeholder-value', + * // The code of the store for which to update price and availability. Use `online` to update price and availability of an online product. + * storeCode: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "availability": "my_availability", + * // "customLabel0": "my_customLabel0", + * // "customLabel1": "my_customLabel1", + * // "customLabel2": "my_customLabel2", + * // "customLabel3": "my_customLabel3", + * // "customLabel4": "my_customLabel4", + * // "installment": {}, + * // "instoreProductLocation": "my_instoreProductLocation", + * // "loyaltyPoints": {}, + * // "pickup": {}, + * // "price": {}, + * // "quantity": 0, + * // "salePrice": {}, + * // "salePriceEffectiveDate": "my_salePriceEffectiveDate", + * // "sellOnGoogleQuantity": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.inventory.set * @memberOf! () * @@ -8170,6 +9618,55 @@ export namespace content_v2 { /** * content.liasettings.custombatch * @desc Retrieves and/or updates the LIA settings of multiple accounts in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.liasettings.custombatch({ + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.liasettings.custombatch * @memberOf! () * @@ -8254,6 +9751,50 @@ export namespace content_v2 { /** * content.liasettings.get * @desc Retrieves the LIA settings of the account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.liasettings.get({ + * // The ID of the account for which to get or update LIA settings. + * accountId: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "countrySettings": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.liasettings.get * @memberOf! () * @@ -8327,6 +9868,50 @@ export namespace content_v2 { /** * content.liasettings.getaccessiblegmbaccounts * @desc Retrieves the list of accessible Google My Business accounts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.liasettings.getaccessiblegmbaccounts({ + * // The ID of the account for which to retrieve accessible Google My Business accounts. + * accountId: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "gmbAccounts": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.liasettings.getaccessiblegmbaccounts * @memberOf! () * @@ -8427,6 +10012,52 @@ export namespace content_v2 { /** * content.liasettings.list * @desc Lists the LIA settings of the sub-accounts in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.liasettings.list({ + * // The maximum number of LIA settings to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the managing account. This must be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.liasettings.list * @memberOf! () * @@ -8504,6 +10135,44 @@ export namespace content_v2 { /** * content.liasettings.listposdataproviders * @desc Retrieves the list of POS data providers that have active settings for the all eiligible countries. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.liasettings.listposdataproviders({}); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "posDataProviders": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.liasettings.listposdataproviders * @memberOf! () * @@ -8594,6 +10263,50 @@ export namespace content_v2 { /** * content.liasettings.requestgmbaccess * @desc Requests access to a specified Google My Business account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.liasettings.requestgmbaccess({ + * // The ID of the account for which GMB access is requested. + * accountId: 'placeholder-value', + * // The email of the Google My Business account. + * gmbEmail: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.liasettings.requestgmbaccess * @memberOf! () * @@ -8681,6 +10394,50 @@ export namespace content_v2 { /** * content.liasettings.requestinventoryverification * @desc Requests inventory validation for the specified country. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.liasettings.requestinventoryverification({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * accountId: 'placeholder-value', + * // The country for which inventory validation is requested. + * country: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.liasettings.requestinventoryverification * @memberOf! () * @@ -8781,6 +10538,56 @@ export namespace content_v2 { /** * content.liasettings.setinventoryverificationcontact * @desc Sets the inventory verification contract for the specified country. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.liasettings.setinventoryverificationcontact({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * accountId: 'placeholder-value', + * // The email of the inventory verification contact. + * contactEmail: 'placeholder-value', + * // The name of the inventory verification contact. + * contactName: 'placeholder-value', + * // The country for which inventory verification is requested. + * country: 'placeholder-value', + * // The language for which inventory verification is requested. + * language: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.liasettings.setinventoryverificationcontact * @memberOf! () * @@ -8891,6 +10698,54 @@ export namespace content_v2 { /** * content.liasettings.setposdataprovider * @desc Sets the POS data provider for the specified country. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.liasettings.setposdataprovider({ + * // The ID of the account for which to retrieve accessible Google My Business accounts. + * accountId: 'placeholder-value', + * // The country for which the POS data provider is selected. + * country: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * // The ID of POS data provider. + * posDataProviderId: 'placeholder-value', + * // The account ID by which this merchant is known to the POS data provider. + * posExternalAccountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.liasettings.setposdataprovider * @memberOf! () * @@ -8986,6 +10841,62 @@ export namespace content_v2 { /** * content.liasettings.update * @desc Updates the LIA settings of the account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.liasettings.update({ + * // The ID of the account for which to get or update LIA settings. + * accountId: 'placeholder-value', + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "countrySettings": [], + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "countrySettings": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.liasettings.update * @memberOf! () * @@ -9269,6 +11180,61 @@ export namespace content_v2 { /** * content.orderinvoices.createchargeinvoice * @desc Creates a charge invoice for a shipment group, and triggers a charge capture for orderinvoice enabled orders. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orderinvoices.createchargeinvoice({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "invoiceId": "my_invoiceId", + * // "invoiceSummary": {}, + * // "lineItemInvoices": [], + * // "operationId": "my_operationId", + * // "shipmentGroupId": "my_shipmentGroupId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orderinvoices.createchargeinvoice * @memberOf! () * @@ -9362,6 +11328,61 @@ export namespace content_v2 { /** * content.orderinvoices.createrefundinvoice * @desc Creates a refund invoice for one or more shipment groups, and triggers a refund for orderinvoice enabled orders. This can only be used for line items that have previously been charged using `createChargeInvoice`. All amounts (except for the summary) are incremental with respect to the previous invoice. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orderinvoices.createrefundinvoice({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "invoiceId": "my_invoiceId", + * // "operationId": "my_operationId", + * // "refundOnlyOption": {}, + * // "returnOption": {}, + * // "shipmentInvoices": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orderinvoices.createrefundinvoice * @memberOf! () * @@ -9505,6 +11526,56 @@ export namespace content_v2 { /** * content.orderreports.listdisbursements * @desc Retrieves a report for disbursements from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orderreports.listdisbursements({ + * // The last date which disbursements occurred. In ISO 8601 format. Default: current date. + * disbursementEndDate: 'placeholder-value', + * // The first date which disbursements occurred. In ISO 8601 format. + * disbursementStartDate: 'placeholder-value', + * // The maximum number of disbursements to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "disbursements": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orderreports.listdisbursements * @memberOf! () * @@ -9599,6 +11670,58 @@ export namespace content_v2 { /** * content.orderreports.listtransactions * @desc Retrieves a list of transactions for a disbursement from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orderreports.listtransactions({ + * // The Google-provided ID of the disbursement (found in Wallet). + * disbursementId: 'placeholder-value', + * // The maximum number of disbursements to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * // The last date in which transaction occurred. In ISO 8601 format. Default: current date. + * transactionEndDate: 'placeholder-value', + * // The first date in which transaction occurred. In ISO 8601 format. + * transactionStartDate: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "transactions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orderreports.listtransactions * @memberOf! () * @@ -9767,6 +11890,53 @@ export namespace content_v2 { /** * content.orderreturns.get * @desc Retrieves an order return from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orderreturns.get({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // Merchant order return ID generated by Google. + * returnId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationDate": "my_creationDate", + * // "merchantOrderId": "my_merchantOrderId", + * // "orderId": "my_orderId", + * // "orderReturnId": "my_orderReturnId", + * // "returnItems": [], + * // "returnShipments": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orderreturns.get * @memberOf! () * @@ -9840,6 +12010,58 @@ export namespace content_v2 { /** * content.orderreturns.list * @desc Lists order returns in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orderreturns.list({ + * // Obtains order returns created before this date (inclusively), in ISO 8601 format. + * createdEndDate: 'placeholder-value', + * // Obtains order returns created after this date (inclusively), in ISO 8601 format. + * createdStartDate: 'placeholder-value', + * // The maximum number of order returns to return in the response, used for paging. The default value is 25 returns per page, and the maximum allowed value is 250 returns per page. + * maxResults: 'placeholder-value', + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // Return the results in the specified order. + * orderBy: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orderreturns.list * @memberOf! () * @@ -9976,6 +12198,57 @@ export namespace content_v2 { /** * content.orders.acknowledge * @desc Marks an order as acknowledged. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.acknowledge({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "operationId": "my_operationId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.acknowledge * @memberOf! () * @@ -10058,6 +12331,48 @@ export namespace content_v2 { /** * content.orders.advancetestorder * @desc Sandbox only. Moves a test order from state "`inProgress`" to state "`pendingShipment`". + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.advancetestorder({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the test order to modify. + * orderId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.advancetestorder * @memberOf! () * @@ -10141,6 +12456,59 @@ export namespace content_v2 { /** * content.orders.cancel * @desc Cancels all line items in an order, making a full refund. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.cancel({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order to cancel. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "operationId": "my_operationId", + * // "reason": "my_reason", + * // "reasonText": "my_reasonText" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.cancel * @memberOf! () * @@ -10217,6 +12585,65 @@ export namespace content_v2 { /** * content.orders.cancellineitem * @desc Cancels a line item, making a full refund. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.cancellineitem({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "amount": {}, + * // "amountPretax": {}, + * // "amountTax": {}, + * // "lineItemId": "my_lineItemId", + * // "operationId": "my_operationId", + * // "productId": "my_productId", + * // "quantity": 0, + * // "reason": "my_reason", + * // "reasonText": "my_reasonText" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.cancellineitem * @memberOf! () * @@ -10302,6 +12729,56 @@ export namespace content_v2 { /** * content.orders.canceltestorderbycustomer * @desc Sandbox only. Cancels a test order for customer-initiated cancellation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.canceltestorderbycustomer({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the test order to cancel. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "reason": "my_reason" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.canceltestorderbycustomer * @memberOf! () * @@ -10395,6 +12872,57 @@ export namespace content_v2 { /** * content.orders.createtestorder * @desc Sandbox only. Creates a test order. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.createtestorder({ + * // The ID of the account that should manage the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "country": "my_country", + * // "templateName": "my_templateName", + * // "testOrder": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "orderId": "my_orderId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.createtestorder * @memberOf! () * @@ -10479,6 +13007,57 @@ export namespace content_v2 { /** * content.orders.createtestreturn * @desc Sandbox only. Creates a test return. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.createtestreturn({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "items": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "returnId": "my_returnId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.createtestreturn * @memberOf! () * @@ -10563,6 +13142,52 @@ export namespace content_v2 { /** * content.orders.custombatch * @desc Retrieves or modifies multiple orders in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.custombatch({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.custombatch * @memberOf! () * @@ -10644,6 +13269,69 @@ export namespace content_v2 { /** * content.orders.get * @desc Retrieves an order from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.get({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acknowledged": false, + * // "channelType": "my_channelType", + * // "customer": {}, + * // "deliveryDetails": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "lineItems": [], + * // "merchantId": "my_merchantId", + * // "merchantOrderId": "my_merchantOrderId", + * // "netAmount": {}, + * // "paymentMethod": {}, + * // "paymentStatus": "my_paymentStatus", + * // "pickupDetails": {}, + * // "placedDate": "my_placedDate", + * // "promotions": [], + * // "refunds": [], + * // "shipments": [], + * // "shippingCost": {}, + * // "shippingCostTax": {}, + * // "shippingOption": "my_shippingOption", + * // "status": "my_status", + * // "taxCollector": "my_taxCollector" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.get * @memberOf! () * @@ -10715,6 +13403,49 @@ export namespace content_v2 { /** * content.orders.getbymerchantorderid * @desc Retrieves an order using merchant order ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.getbymerchantorderid({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The merchant order ID to be looked for. + * merchantOrderId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "order": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.getbymerchantorderid * @memberOf! () * @@ -10799,6 +13530,51 @@ export namespace content_v2 { /** * content.orders.gettestordertemplate * @desc Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.gettestordertemplate({ + * // The country of the template to retrieve. Defaults to `US`. + * country: 'placeholder-value', + * // The ID of the account that should manage the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The name of the template to retrieve. + * templateName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "template": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.gettestordertemplate * @memberOf! () * @@ -10884,6 +13660,64 @@ export namespace content_v2 { /** * content.orders.instorerefundlineitem * @desc Deprecated. Notifies that item return and refund was handled directly by merchant outside of Google payments processing (e.g. cash refund done in store). Note: We recommend calling the returnrefundlineitem method to refund in-store returns. We will issue the refund directly to the customer. This helps to prevent possible differences arising between merchant and Google transaction records. We also recommend having the point of sale system communicate with Google to ensure that customers do not receive a double refund by first refunding via Google then via an in-store return. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.instorerefundlineitem({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "amountPretax": {}, + * // "amountTax": {}, + * // "lineItemId": "my_lineItemId", + * // "operationId": "my_operationId", + * // "productId": "my_productId", + * // "quantity": 0, + * // "reason": "my_reason", + * // "reasonText": "my_reasonText" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.instorerefundlineitem * @memberOf! () * @@ -10971,6 +13805,67 @@ export namespace content_v2 { /** * content.orders.list * @desc Lists the orders in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.list({ + * // Obtains orders that match the acknowledgement status. When set to true, obtains orders that have been acknowledged. When false, obtains orders that have not been acknowledged. + * // We recommend using this filter set to `false`, in conjunction with the `acknowledge` call, such that only un-acknowledged orders are returned. + * acknowledged: 'placeholder-value', + * // The maximum number of orders to return in the response, used for paging. The default value is 25 orders per page, and the maximum allowed value is 250 orders per page. + * maxResults: 'placeholder-value', + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // Order results by placement date in descending or ascending order. + * // + * // Acceptable values are: + * // - placedDateAsc + * // - placedDateDesc + * orderBy: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * // Obtains orders placed before this date (exclusively), in ISO 8601 format. + * placedDateEnd: 'placeholder-value', + * // Obtains orders placed after this date (inclusively), in ISO 8601 format. + * placedDateStart: 'placeholder-value', + * // Obtains orders that match any of the specified statuses. Please note that `active` is a shortcut for `pendingShipment` and `partiallyShipped`, and `completed` is a shortcut for `shipped`, `partiallyDelivered`, `delivered`, `partiallyReturned`, `returned`, and `canceled`. + * statuses: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.list * @memberOf! () * @@ -11051,6 +13946,62 @@ export namespace content_v2 { /** * content.orders.refund * @desc Deprecated, please use returnRefundLineItem instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.refund({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order to refund. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "amount": {}, + * // "amountPretax": {}, + * // "amountTax": {}, + * // "operationId": "my_operationId", + * // "reason": "my_reason", + * // "reasonText": "my_reasonText" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.refund * @memberOf! () * @@ -11127,6 +14078,62 @@ export namespace content_v2 { /** * content.orders.rejectreturnlineitem * @desc Rejects return on an line item. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.rejectreturnlineitem({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "lineItemId": "my_lineItemId", + * // "operationId": "my_operationId", + * // "productId": "my_productId", + * // "quantity": 0, + * // "reason": "my_reason", + * // "reasonText": "my_reasonText" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.rejectreturnlineitem * @memberOf! () * @@ -11212,6 +14219,62 @@ export namespace content_v2 { /** * content.orders.returnlineitem * @desc Returns a line item. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.returnlineitem({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "lineItemId": "my_lineItemId", + * // "operationId": "my_operationId", + * // "productId": "my_productId", + * // "quantity": 0, + * // "reason": "my_reason", + * // "reasonText": "my_reasonText" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.returnlineitem * @memberOf! () * @@ -11297,6 +14360,64 @@ export namespace content_v2 { /** * content.orders.returnrefundlineitem * @desc Returns and refunds a line item. Note that this method can only be called on fully shipped orders. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.returnrefundlineitem({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "amountPretax": {}, + * // "amountTax": {}, + * // "lineItemId": "my_lineItemId", + * // "operationId": "my_operationId", + * // "productId": "my_productId", + * // "quantity": 0, + * // "reason": "my_reason", + * // "reasonText": "my_reasonText" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.returnrefundlineitem * @memberOf! () * @@ -11382,6 +14503,60 @@ export namespace content_v2 { /** * content.orders.setlineitemmetadata * @desc Sets (or overrides if it already exists) merchant provided annotations in the form of key-value pairs. A common use case would be to supply us with additional structured information about a line item that cannot be provided via other methods. Submitted key-value pairs can be retrieved as part of the orders resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.setlineitemmetadata({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "annotations": [], + * // "lineItemId": "my_lineItemId", + * // "operationId": "my_operationId", + * // "productId": "my_productId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.setlineitemmetadata * @memberOf! () * @@ -11467,6 +14642,63 @@ export namespace content_v2 { /** * content.orders.shiplineitems * @desc Marks line item(s) as shipped. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.shiplineitems({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "carrier": "my_carrier", + * // "lineItems": [], + * // "operationId": "my_operationId", + * // "shipmentGroupId": "my_shipmentGroupId", + * // "shipmentId": "my_shipmentId", + * // "shipmentInfos": [], + * // "trackingId": "my_trackingId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.shiplineitems * @memberOf! () * @@ -11550,6 +14782,61 @@ export namespace content_v2 { /** * content.orders.updatelineitemshippingdetails * @desc Updates ship by and delivery by dates for a line item. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.updatelineitemshippingdetails({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deliverByDate": "my_deliverByDate", + * // "lineItemId": "my_lineItemId", + * // "operationId": "my_operationId", + * // "productId": "my_productId", + * // "shipByDate": "my_shipByDate" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.updatelineitemshippingdetails * @memberOf! () * @@ -11651,6 +14938,58 @@ export namespace content_v2 { /** * content.orders.updatemerchantorderid * @desc Updates the merchant order ID for a given order. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.updatemerchantorderid({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "merchantOrderId": "my_merchantOrderId", + * // "operationId": "my_operationId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.updatemerchantorderid * @memberOf! () * @@ -11738,6 +15077,62 @@ export namespace content_v2 { /** * content.orders.updateshipment * @desc Updates a shipment's status, carrier, and/or tracking ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.orders.updateshipment({ + * // The ID of the account that manages the order. This cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The ID of the order. + * orderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "carrier": "my_carrier", + * // "deliveryDate": "my_deliveryDate", + * // "operationId": "my_operationId", + * // "shipmentId": "my_shipmentId", + * // "status": "my_status", + * // "trackingId": "my_trackingId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionStatus": "my_executionStatus", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.orders.updateshipment * @memberOf! () * @@ -12279,6 +15674,55 @@ export namespace content_v2 { /** * content.pos.custombatch * @desc Batches multiple POS-related calls in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.pos.custombatch({ + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.pos.custombatch * @memberOf! () * @@ -12357,6 +15801,47 @@ export namespace content_v2 { /** * content.pos.delete * @desc Deletes a store for the given merchant. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.pos.delete({ + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * // The ID of the POS or inventory data provider. + * merchantId: 'placeholder-value', + * // A store code that is unique per merchant. + * storeCode: 'placeholder-value', + * // The ID of the target merchant. + * targetMerchantId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.pos.delete * @memberOf! () * @@ -12431,6 +15916,52 @@ export namespace content_v2 { /** * content.pos.get * @desc Retrieves information about the given store. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.pos.get({ + * // The ID of the POS or inventory data provider. + * merchantId: 'placeholder-value', + * // A store code that is unique per merchant. + * storeCode: 'placeholder-value', + * // The ID of the target merchant. + * targetMerchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "storeAddress": "my_storeAddress", + * // "storeCode": "my_storeCode" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.pos.get * @memberOf! () * @@ -12504,6 +16035,62 @@ export namespace content_v2 { /** * content.pos.insert * @desc Creates a store for the given merchant. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.pos.insert({ + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * // The ID of the POS or inventory data provider. + * merchantId: 'placeholder-value', + * // The ID of the target merchant. + * targetMerchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "storeAddress": "my_storeAddress", + * // "storeCode": "my_storeCode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "storeAddress": "my_storeAddress", + * // "storeCode": "my_storeCode" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.pos.insert * @memberOf! () * @@ -12577,6 +16164,73 @@ export namespace content_v2 { /** * content.pos.inventory * @desc Submit inventory for the given merchant. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.pos.inventory({ + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * // The ID of the POS or inventory data provider. + * merchantId: 'placeholder-value', + * // The ID of the target merchant. + * targetMerchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentLanguage": "my_contentLanguage", + * // "gtin": "my_gtin", + * // "itemId": "my_itemId", + * // "price": {}, + * // "quantity": "my_quantity", + * // "storeCode": "my_storeCode", + * // "targetCountry": "my_targetCountry", + * // "timestamp": "my_timestamp" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentLanguage": "my_contentLanguage", + * // "gtin": "my_gtin", + * // "itemId": "my_itemId", + * // "kind": "my_kind", + * // "price": {}, + * // "quantity": "my_quantity", + * // "storeCode": "my_storeCode", + * // "targetCountry": "my_targetCountry", + * // "timestamp": "my_timestamp" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.pos.inventory * @memberOf! () * @@ -12657,6 +16311,49 @@ export namespace content_v2 { /** * content.pos.list * @desc Lists the stores of the target merchant. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.pos.list({ + * // The ID of the POS or inventory data provider. + * merchantId: 'placeholder-value', + * // The ID of the target merchant. + * targetMerchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.pos.list * @memberOf! () * @@ -12730,6 +16427,75 @@ export namespace content_v2 { /** * content.pos.sale * @desc Submit a sale event for the given merchant. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.pos.sale({ + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * // The ID of the POS or inventory data provider. + * merchantId: 'placeholder-value', + * // The ID of the target merchant. + * targetMerchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentLanguage": "my_contentLanguage", + * // "gtin": "my_gtin", + * // "itemId": "my_itemId", + * // "price": {}, + * // "quantity": "my_quantity", + * // "saleId": "my_saleId", + * // "storeCode": "my_storeCode", + * // "targetCountry": "my_targetCountry", + * // "timestamp": "my_timestamp" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentLanguage": "my_contentLanguage", + * // "gtin": "my_gtin", + * // "itemId": "my_itemId", + * // "kind": "my_kind", + * // "price": {}, + * // "quantity": "my_quantity", + * // "saleId": "my_saleId", + * // "storeCode": "my_storeCode", + * // "targetCountry": "my_targetCountry", + * // "timestamp": "my_timestamp" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.pos.sale * @memberOf! () * @@ -12958,6 +16724,55 @@ export namespace content_v2 { /** * content.products.custombatch * @desc Retrieves, inserts, and deletes multiple products in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.products.custombatch({ + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.products.custombatch * @memberOf! () * @@ -13040,6 +16855,45 @@ export namespace content_v2 { /** * content.products.delete * @desc Deletes a product from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.products.delete({ + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * // The ID of the account that contains the product. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The REST ID of the product. + * productId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.products.delete * @memberOf! () * @@ -13112,6 +16966,125 @@ export namespace content_v2 { /** * content.products.get * @desc Retrieves a product from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.products.get({ + * // The ID of the account that contains the product. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The REST ID of the product. + * productId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "additionalImageLinks": [], + * // "additionalProductTypes": [], + * // "adult": false, + * // "adwordsGrouping": "my_adwordsGrouping", + * // "adwordsLabels": [], + * // "adwordsRedirect": "my_adwordsRedirect", + * // "ageGroup": "my_ageGroup", + * // "aspects": [], + * // "availability": "my_availability", + * // "availabilityDate": "my_availabilityDate", + * // "brand": "my_brand", + * // "channel": "my_channel", + * // "color": "my_color", + * // "condition": "my_condition", + * // "contentLanguage": "my_contentLanguage", + * // "costOfGoodsSold": {}, + * // "customAttributes": [], + * // "customGroups": [], + * // "customLabel0": "my_customLabel0", + * // "customLabel1": "my_customLabel1", + * // "customLabel2": "my_customLabel2", + * // "customLabel3": "my_customLabel3", + * // "customLabel4": "my_customLabel4", + * // "description": "my_description", + * // "destinations": [], + * // "displayAdsId": "my_displayAdsId", + * // "displayAdsLink": "my_displayAdsLink", + * // "displayAdsSimilarIds": [], + * // "displayAdsTitle": "my_displayAdsTitle", + * // "displayAdsValue": {}, + * // "energyEfficiencyClass": "my_energyEfficiencyClass", + * // "expirationDate": "my_expirationDate", + * // "gender": "my_gender", + * // "googleProductCategory": "my_googleProductCategory", + * // "gtin": "my_gtin", + * // "id": "my_id", + * // "identifierExists": false, + * // "imageLink": "my_imageLink", + * // "installment": {}, + * // "isBundle": false, + * // "itemGroupId": "my_itemGroupId", + * // "kind": "my_kind", + * // "link": "my_link", + * // "loyaltyPoints": {}, + * // "material": "my_material", + * // "maxEnergyEfficiencyClass": "my_maxEnergyEfficiencyClass", + * // "maxHandlingTime": "my_maxHandlingTime", + * // "minEnergyEfficiencyClass": "my_minEnergyEfficiencyClass", + * // "minHandlingTime": "my_minHandlingTime", + * // "mobileLink": "my_mobileLink", + * // "mpn": "my_mpn", + * // "multipack": "my_multipack", + * // "offerId": "my_offerId", + * // "onlineOnly": false, + * // "pattern": "my_pattern", + * // "price": {}, + * // "productType": "my_productType", + * // "promotionIds": [], + * // "salePrice": {}, + * // "salePriceEffectiveDate": "my_salePriceEffectiveDate", + * // "sellOnGoogleQuantity": "my_sellOnGoogleQuantity", + * // "shipping": [], + * // "shippingHeight": {}, + * // "shippingLabel": "my_shippingLabel", + * // "shippingLength": {}, + * // "shippingWeight": {}, + * // "shippingWidth": {}, + * // "sizeSystem": "my_sizeSystem", + * // "sizeType": "my_sizeType", + * // "sizes": [], + * // "source": "my_source", + * // "targetCountry": "my_targetCountry", + * // "taxes": [], + * // "title": "my_title", + * // "unitPricingBaseMeasure": {}, + * // "unitPricingMeasure": {}, + * // "validatedDestinations": [], + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.products.get * @memberOf! () * @@ -13183,6 +17156,210 @@ export namespace content_v2 { /** * content.products.insert * @desc Uploads a product to your Merchant Center account. If an item with the same channel, contentLanguage, offerId, and targetCountry already exists, this method updates that entry. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.products.insert({ + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * // The ID of the account that contains the product. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "additionalImageLinks": [], + * // "additionalProductTypes": [], + * // "adult": false, + * // "adwordsGrouping": "my_adwordsGrouping", + * // "adwordsLabels": [], + * // "adwordsRedirect": "my_adwordsRedirect", + * // "ageGroup": "my_ageGroup", + * // "aspects": [], + * // "availability": "my_availability", + * // "availabilityDate": "my_availabilityDate", + * // "brand": "my_brand", + * // "channel": "my_channel", + * // "color": "my_color", + * // "condition": "my_condition", + * // "contentLanguage": "my_contentLanguage", + * // "costOfGoodsSold": {}, + * // "customAttributes": [], + * // "customGroups": [], + * // "customLabel0": "my_customLabel0", + * // "customLabel1": "my_customLabel1", + * // "customLabel2": "my_customLabel2", + * // "customLabel3": "my_customLabel3", + * // "customLabel4": "my_customLabel4", + * // "description": "my_description", + * // "destinations": [], + * // "displayAdsId": "my_displayAdsId", + * // "displayAdsLink": "my_displayAdsLink", + * // "displayAdsSimilarIds": [], + * // "displayAdsTitle": "my_displayAdsTitle", + * // "displayAdsValue": {}, + * // "energyEfficiencyClass": "my_energyEfficiencyClass", + * // "expirationDate": "my_expirationDate", + * // "gender": "my_gender", + * // "googleProductCategory": "my_googleProductCategory", + * // "gtin": "my_gtin", + * // "id": "my_id", + * // "identifierExists": false, + * // "imageLink": "my_imageLink", + * // "installment": {}, + * // "isBundle": false, + * // "itemGroupId": "my_itemGroupId", + * // "kind": "my_kind", + * // "link": "my_link", + * // "loyaltyPoints": {}, + * // "material": "my_material", + * // "maxEnergyEfficiencyClass": "my_maxEnergyEfficiencyClass", + * // "maxHandlingTime": "my_maxHandlingTime", + * // "minEnergyEfficiencyClass": "my_minEnergyEfficiencyClass", + * // "minHandlingTime": "my_minHandlingTime", + * // "mobileLink": "my_mobileLink", + * // "mpn": "my_mpn", + * // "multipack": "my_multipack", + * // "offerId": "my_offerId", + * // "onlineOnly": false, + * // "pattern": "my_pattern", + * // "price": {}, + * // "productType": "my_productType", + * // "promotionIds": [], + * // "salePrice": {}, + * // "salePriceEffectiveDate": "my_salePriceEffectiveDate", + * // "sellOnGoogleQuantity": "my_sellOnGoogleQuantity", + * // "shipping": [], + * // "shippingHeight": {}, + * // "shippingLabel": "my_shippingLabel", + * // "shippingLength": {}, + * // "shippingWeight": {}, + * // "shippingWidth": {}, + * // "sizeSystem": "my_sizeSystem", + * // "sizeType": "my_sizeType", + * // "sizes": [], + * // "source": "my_source", + * // "targetCountry": "my_targetCountry", + * // "taxes": [], + * // "title": "my_title", + * // "unitPricingBaseMeasure": {}, + * // "unitPricingMeasure": {}, + * // "validatedDestinations": [], + * // "warnings": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "additionalImageLinks": [], + * // "additionalProductTypes": [], + * // "adult": false, + * // "adwordsGrouping": "my_adwordsGrouping", + * // "adwordsLabels": [], + * // "adwordsRedirect": "my_adwordsRedirect", + * // "ageGroup": "my_ageGroup", + * // "aspects": [], + * // "availability": "my_availability", + * // "availabilityDate": "my_availabilityDate", + * // "brand": "my_brand", + * // "channel": "my_channel", + * // "color": "my_color", + * // "condition": "my_condition", + * // "contentLanguage": "my_contentLanguage", + * // "costOfGoodsSold": {}, + * // "customAttributes": [], + * // "customGroups": [], + * // "customLabel0": "my_customLabel0", + * // "customLabel1": "my_customLabel1", + * // "customLabel2": "my_customLabel2", + * // "customLabel3": "my_customLabel3", + * // "customLabel4": "my_customLabel4", + * // "description": "my_description", + * // "destinations": [], + * // "displayAdsId": "my_displayAdsId", + * // "displayAdsLink": "my_displayAdsLink", + * // "displayAdsSimilarIds": [], + * // "displayAdsTitle": "my_displayAdsTitle", + * // "displayAdsValue": {}, + * // "energyEfficiencyClass": "my_energyEfficiencyClass", + * // "expirationDate": "my_expirationDate", + * // "gender": "my_gender", + * // "googleProductCategory": "my_googleProductCategory", + * // "gtin": "my_gtin", + * // "id": "my_id", + * // "identifierExists": false, + * // "imageLink": "my_imageLink", + * // "installment": {}, + * // "isBundle": false, + * // "itemGroupId": "my_itemGroupId", + * // "kind": "my_kind", + * // "link": "my_link", + * // "loyaltyPoints": {}, + * // "material": "my_material", + * // "maxEnergyEfficiencyClass": "my_maxEnergyEfficiencyClass", + * // "maxHandlingTime": "my_maxHandlingTime", + * // "minEnergyEfficiencyClass": "my_minEnergyEfficiencyClass", + * // "minHandlingTime": "my_minHandlingTime", + * // "mobileLink": "my_mobileLink", + * // "mpn": "my_mpn", + * // "multipack": "my_multipack", + * // "offerId": "my_offerId", + * // "onlineOnly": false, + * // "pattern": "my_pattern", + * // "price": {}, + * // "productType": "my_productType", + * // "promotionIds": [], + * // "salePrice": {}, + * // "salePriceEffectiveDate": "my_salePriceEffectiveDate", + * // "sellOnGoogleQuantity": "my_sellOnGoogleQuantity", + * // "shipping": [], + * // "shippingHeight": {}, + * // "shippingLabel": "my_shippingLabel", + * // "shippingLength": {}, + * // "shippingWeight": {}, + * // "shippingWidth": {}, + * // "sizeSystem": "my_sizeSystem", + * // "sizeType": "my_sizeType", + * // "sizes": [], + * // "source": "my_source", + * // "targetCountry": "my_targetCountry", + * // "taxes": [], + * // "title": "my_title", + * // "unitPricingBaseMeasure": {}, + * // "unitPricingMeasure": {}, + * // "validatedDestinations": [], + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.products.insert * @memberOf! () * @@ -13256,6 +17433,54 @@ export namespace content_v2 { /** * content.products.list * @desc Lists the products in your Merchant Center account. The response might contain fewer items than specified by maxResults. Rely on nextPageToken to determine if there are more items to be requested. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.products.list({ + * // Flag to include the invalid inserted items in the result of the list request. By default the invalid items are not shown (the default value is false). + * includeInvalidInsertedItems: 'placeholder-value', + * // The maximum number of products to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the account that contains the products. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.products.list * @memberOf! () * @@ -13436,6 +17661,55 @@ export namespace content_v2 { /** * content.productstatuses.custombatch * @desc Gets the statuses of multiple products in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.productstatuses.custombatch({ + * // Flag to include full product data in the results of this request. The default value is false. + * includeAttributes: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.productstatuses.custombatch * @memberOf! () * @@ -13520,6 +17794,62 @@ export namespace content_v2 { /** * content.productstatuses.get * @desc Gets the status of a product from your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.productstatuses.get({ + * // If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination. + * destinations: 'placeholder-value', + * // Flag to include full product data in the result of this get request. The default value is false. + * includeAttributes: 'placeholder-value', + * // The ID of the account that contains the product. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The REST ID of the product. + * productId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationDate": "my_creationDate", + * // "dataQualityIssues": [], + * // "destinationStatuses": [], + * // "googleExpirationDate": "my_googleExpirationDate", + * // "itemLevelIssues": [], + * // "kind": "my_kind", + * // "lastUpdateDate": "my_lastUpdateDate", + * // "link": "my_link", + * // "product": {}, + * // "productId": "my_productId", + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.productstatuses.get * @memberOf! () * @@ -13596,6 +17926,58 @@ export namespace content_v2 { /** * content.productstatuses.list * @desc Lists the statuses of the products in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.productstatuses.list({ + * // If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination. + * destinations: 'placeholder-value', + * // Flag to include full product data in the results of the list request. The default value is false. + * includeAttributes: 'placeholder-value', + * // Flag to include the invalid inserted items in the result of the list request. By default the invalid items are not shown (the default value is false). + * includeInvalidInsertedItems: 'placeholder-value', + * // The maximum number of product statuses to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the account that contains the products. This account cannot be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.productstatuses.list * @memberOf! () * @@ -13763,6 +18145,55 @@ export namespace content_v2 { /** * content.shippingsettings.custombatch * @desc Retrieves and updates the shipping settings of multiple accounts in a single request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.shippingsettings.custombatch({ + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entries": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.shippingsettings.custombatch * @memberOf! () * @@ -13849,6 +18280,50 @@ export namespace content_v2 { /** * content.shippingsettings.get * @desc Retrieves the shipping settings of the account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.shippingsettings.get({ + * // The ID of the account for which to get/update shipping settings. + * accountId: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "postalCodeGroups": [], + * // "services": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.shippingsettings.get * @memberOf! () * @@ -13923,6 +18398,47 @@ export namespace content_v2 { /** * content.shippingsettings.getsupportedcarriers * @desc Retrieves supported carriers and carrier services for an account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.shippingsettings.getsupportedcarriers({ + * // The ID of the account for which to retrieve the supported carriers. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "carriers": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.shippingsettings.getsupportedcarriers * @memberOf! () * @@ -14021,6 +18537,47 @@ export namespace content_v2 { /** * content.shippingsettings.getsupportedholidays * @desc Retrieves supported holidays for an account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.shippingsettings.getsupportedholidays({ + * // The ID of the account for which to retrieve the supported holidays. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "holidays": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.shippingsettings.getsupportedholidays * @memberOf! () * @@ -14119,6 +18676,47 @@ export namespace content_v2 { /** * content.shippingsettings.getsupportedpickupservices * @desc Retrieves supported pickup services for an account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.shippingsettings.getsupportedpickupservices({ + * // The ID of the account for which to retrieve the supported pickup services. + * merchantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "pickupServices": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.shippingsettings.getsupportedpickupservices * @memberOf! () * @@ -14216,6 +18814,52 @@ export namespace content_v2 { /** * content.shippingsettings.list * @desc Lists the shipping settings of the sub-accounts in your Merchant Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.shippingsettings.list({ + * // The maximum number of shipping settings to return in the response, used for paging. + * maxResults: 'placeholder-value', + * // The ID of the managing account. This must be a multi-client account. + * merchantId: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.shippingsettings.list * @memberOf! () * @@ -14300,6 +18944,62 @@ export namespace content_v2 { /** * content.shippingsettings.update * @desc Updates the shipping settings of the account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/content.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 content = google.content('v2'); + * + * 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/content'], + * }); + * + * // 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 content.shippingsettings.update({ + * // The ID of the account for which to get/update shipping settings. + * accountId: 'placeholder-value', + * // Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + * dryRun: 'placeholder-value', + * // The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and `accountId` must be the ID of a sub-account of this account. + * merchantId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "postalCodeGroups": [], + * // "services": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "postalCodeGroups": [], + * // "services": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias content.shippingsettings.update * @memberOf! () * diff --git a/src/apis/customsearch/v1.ts b/src/apis/customsearch/v1.ts index ab8e1b3e10b..b61388b6a80 100644 --- a/src/apis/customsearch/v1.ts +++ b/src/apis/customsearch/v1.ts @@ -210,6 +210,113 @@ export namespace customsearch_v1 { /** * search.cse.list * @desc Returns metadata about the search performed, metadata about the custom search engine used for the search, and the search results. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/customsearch.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 customsearch = google.customsearch('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: [], + * }); + * + * // 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 search.cse.list({ + * // Turns off the translation between zh-CN and zh-TW. + * c2coff: 'placeholder-value', + * // Country restrict(s). + * cr: 'placeholder-value', + * // The custom search engine ID to scope this search query + * cx: 'placeholder-value', + * // Specifies all search results are from a time period + * dateRestrict: 'placeholder-value', + * // Identifies a phrase that all documents in the search results must contain + * exactTerms: 'placeholder-value', + * // Identifies a word or phrase that should not appear in any documents in the search results + * excludeTerms: 'placeholder-value', + * // Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ... + * fileType: 'placeholder-value', + * // Controls turning on or off the duplicate content filter. + * filter: 'placeholder-value', + * // Geolocation of end user. + * gl: 'placeholder-value', + * // The local Google domain to use to perform the search. + * googlehost: 'placeholder-value', + * // Creates a range in form as_nlo value..as_nhi value and attempts to append it to query + * highRange: 'placeholder-value', + * // Sets the user interface language. + * hl: 'placeholder-value', + * // Appends the extra query terms to the query. + * hq: 'placeholder-value', + * // Returns black and white, grayscale, or color images: mono, gray, and color. + * imgColorType: 'placeholder-value', + * // Returns images of a specific dominant color: red, orange, yellow, green, teal, blue, purple, pink, white, gray, black and brown. + * imgDominantColor: 'placeholder-value', + * // Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge. + * imgSize: 'placeholder-value', + * // Returns images of a type, which can be one of: clipart, face, lineart, news, and photo. + * imgType: 'placeholder-value', + * // Specifies that all search results should contain a link to a particular URL + * linkSite: 'placeholder-value', + * // Creates a range in form as_nlo value..as_nhi value and attempts to append it to query + * lowRange: 'placeholder-value', + * // The language restriction for the search results + * lr: 'placeholder-value', + * // Number of search results to return + * num: 'placeholder-value', + * // Provides additional search terms to check for in a document, where each document in the search results must contain at least one of the additional search terms + * orTerms: 'placeholder-value', + * // Query + * q: 'placeholder-value', + * // Specifies that all search results should be pages that are related to the specified URL + * relatedSite: 'placeholder-value', + * // Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these. + * rights: 'placeholder-value', + * // Search safety level + * safe: 'placeholder-value', + * // Specifies the search type: image. + * searchType: 'placeholder-value', + * // Specifies all search results should be pages from a given site + * siteSearch: 'placeholder-value', + * // Controls whether to include or exclude results from the site named in the as_sitesearch parameter + * siteSearchFilter: 'placeholder-value', + * // The sort expression to apply to the results + * sort: 'placeholder-value', + * // The index of the first result to return + * start: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "context": {}, + * // "items": [], + * // "kind": "my_kind", + * // "promotions": [], + * // "queries": {}, + * // "searchInformation": {}, + * // "spelling": {}, + * // "url": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias search.cse.list * @memberOf! () * @@ -447,6 +554,113 @@ export namespace customsearch_v1 { /** * search.cse.siterestrict.list * @desc Returns metadata about the search performed, metadata about the custom search engine used for the search, and the search results. Uses a small set of url patterns. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/customsearch.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 customsearch = google.customsearch('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: [], + * }); + * + * // 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 search.cse.siterestrict.list({ + * // Turns off the translation between zh-CN and zh-TW. + * c2coff: 'placeholder-value', + * // Country restrict(s). + * cr: 'placeholder-value', + * // The custom search engine ID to scope this search query + * cx: 'placeholder-value', + * // Specifies all search results are from a time period + * dateRestrict: 'placeholder-value', + * // Identifies a phrase that all documents in the search results must contain + * exactTerms: 'placeholder-value', + * // Identifies a word or phrase that should not appear in any documents in the search results + * excludeTerms: 'placeholder-value', + * // Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ... + * fileType: 'placeholder-value', + * // Controls turning on or off the duplicate content filter. + * filter: 'placeholder-value', + * // Geolocation of end user. + * gl: 'placeholder-value', + * // The local Google domain to use to perform the search. + * googlehost: 'placeholder-value', + * // Creates a range in form as_nlo value..as_nhi value and attempts to append it to query + * highRange: 'placeholder-value', + * // Sets the user interface language. + * hl: 'placeholder-value', + * // Appends the extra query terms to the query. + * hq: 'placeholder-value', + * // Returns black and white, grayscale, or color images: mono, gray, and color. + * imgColorType: 'placeholder-value', + * // Returns images of a specific dominant color: red, orange, yellow, green, teal, blue, purple, pink, white, gray, black and brown. + * imgDominantColor: 'placeholder-value', + * // Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge. + * imgSize: 'placeholder-value', + * // Returns images of a type, which can be one of: clipart, face, lineart, news, and photo. + * imgType: 'placeholder-value', + * // Specifies that all search results should contain a link to a particular URL + * linkSite: 'placeholder-value', + * // Creates a range in form as_nlo value..as_nhi value and attempts to append it to query + * lowRange: 'placeholder-value', + * // The language restriction for the search results + * lr: 'placeholder-value', + * // Number of search results to return + * num: 'placeholder-value', + * // Provides additional search terms to check for in a document, where each document in the search results must contain at least one of the additional search terms + * orTerms: 'placeholder-value', + * // Query + * q: 'placeholder-value', + * // Specifies that all search results should be pages that are related to the specified URL + * relatedSite: 'placeholder-value', + * // Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these. + * rights: 'placeholder-value', + * // Search safety level + * safe: 'placeholder-value', + * // Specifies the search type: image. + * searchType: 'placeholder-value', + * // Specifies all search results should be pages from a given site + * siteSearch: 'placeholder-value', + * // Controls whether to include or exclude results from the site named in the as_sitesearch parameter + * siteSearchFilter: 'placeholder-value', + * // The sort expression to apply to the results + * sort: 'placeholder-value', + * // The index of the first result to return + * start: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "context": {}, + * // "items": [], + * // "kind": "my_kind", + * // "promotions": [], + * // "queries": {}, + * // "searchInformation": {}, + * // "spelling": {}, + * // "url": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias search.cse.siterestrict.list * @memberOf! () * diff --git a/src/apis/datacatalog/v1beta1.ts b/src/apis/datacatalog/v1beta1.ts index 9a97079d151..d70d7c724fc 100644 --- a/src/apis/datacatalog/v1beta1.ts +++ b/src/apis/datacatalog/v1beta1.ts @@ -843,6 +843,56 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.catalog.search * @desc Searches Data Catalog for multiple resources like entries, tags that match a query. This is a custom method (https://cloud.google.com/apis/design/custom_methods) and does not return the complete resource, only the resource identifier and high level fields. Clients can subsequentally call `Get` methods. Note that Data Catalog search queries do not guarantee full recall. Query results that match your query may not be returned, even in subsequent result pages. Also note that results returned (and not returned) can vary across repeated search queries. See [Data Catalog Search Syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference) for more information. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.catalog.search({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "orderBy": "my_orderBy", + * // "pageSize": 0, + * // "pageToken": "my_pageToken", + * // "query": "my_query", + * // "scope": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "results": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.catalog.search * @memberOf! () * @@ -959,6 +1009,79 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.entries.lookup * @desc Get an entry by target resource name. This method allows clients to use the resource name from the source Google Cloud Platform service to get the Data Catalog Entry. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.entries.lookup({ + * // The full name of the Google Cloud Platform resource the Data Catalog + * // entry represents. See: + * // https://cloud.google.com/apis/design/resource_names#full_resource_name. + * // Full names are case-sensitive. + * // + * // Examples: + * // + * // * //bigquery.googleapis.com/projects/projectId/datasets/datasetId/tables/tableId + * // * //pubsub.googleapis.com/projects/projectId/topics/topicId + * linkedResource: 'placeholder-value', + * // The SQL name of the entry. SQL names are case-sensitive. + * // + * // Examples: + * // + * // * `pubsub.project_id.topic_id` + * // * ``pubsub.project_id.`topic.id.with.dots` `` + * // * `bigquery.table.project_id.dataset_id.table_id` + * // * `bigquery.dataset.project_id.dataset_id` + * // * `datacatalog.entry.project_id.location_id.entry_group_id.entry_id` + * // + * // `*_id`s shoud satisfy the standard SQL rules for identifiers. + * // https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical. + * sqlResource: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryDateShardedSpec": {}, + * // "bigqueryTableSpec": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "gcsFilesetSpec": {}, + * // "integratedSystem": "my_integratedSystem", + * // "linkedResource": "my_linkedResource", + * // "name": "my_name", + * // "schema": {}, + * // "sourceSystemTimestamps": {}, + * // "type": "my_type", + * // "userSpecifiedSystem": "my_userSpecifiedSystem", + * // "userSpecifiedType": "my_userSpecifiedType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.entries.lookup * @memberOf! () * @@ -1101,6 +1224,69 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.create * @desc A maximum of 10,000 entry groups may be created per organization across all locations. Users should enable the Data Catalog API in the project identified by the `parent` parameter (see [Data Catalog Resource Project] (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.create({ + * // Required. The id of the entry group to create. + * // The id must begin with a letter or underscore, contain only English + * // letters, numbers and underscores, and be at most 64 characters. + * entryGroupId: 'placeholder-value', + * // Required. The name of the project this entry group is in. Example: + * // + * // * projects/{project_id}/locations/{location} + * // + * // Note that this EntryGroup and its child resources may not actually be + * // stored in the location in this name. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dataCatalogTimestamps": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dataCatalogTimestamps": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.create * @memberOf! () * @@ -1194,6 +1380,47 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.delete * @desc Deletes an EntryGroup. Only entry groups that do not contain entries can be deleted. Users should enable the Data Catalog API in the project identified by the `name` parameter (see [Data Catalog Resource Project] (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.delete({ + * // Optional. If true, deletes all entries in the entry group. + * force: 'placeholder-value', + * // Required. The name of the entry group. For example, + * // `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}`. + * name: 'projects/my-project/locations/my-location/entryGroups/my-entryGroup', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.delete * @memberOf! () * @@ -1264,6 +1491,52 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.get * @desc Gets an EntryGroup. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.get({ + * // Required. The name of the entry group. For example, + * // `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}`. + * name: 'projects/my-project/locations/my-location/entryGroups/my-entryGroup', + * // The fields to return. If not set or empty, all fields are returned. + * readMask: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dataCatalogTimestamps": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.get * @memberOf! () * @@ -1353,6 +1626,58 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.getIamPolicy * @desc Gets the access control policy for a resource. A `NOT_FOUND` error is returned if the resource does not exist. An empty policy is returned if the resource exists but does not have a policy set on it. Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform resources synced to Data Catalog. Callers must have following Google IAM permission - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag templates. - `datacatalog.entries.getIamPolicy` to get policies on entries. - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/entryGroups/my-entryGroup', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.getIamPolicy * @memberOf! () * @@ -1426,6 +1751,56 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.list * @desc Lists entry groups. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.list({ + * // Optional. The maximum number of items to return. Default is 10. Max limit is 1000. + * // Throws an invalid argument for `page_size > 1000`. + * pageSize: 'placeholder-value', + * // Optional. Token that specifies which page is requested. If empty, the first page is + * // returned. + * pageToken: 'placeholder-value', + * // Required. The name of the location that contains the entry groups, which can be + * // provided in URL format. Example: + * // + * // * projects/{project_id}/locations/{location} + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entryGroups": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.list * @memberOf! () * @@ -1528,6 +1903,68 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.patch * @desc Updates an EntryGroup. The user should enable the Data Catalog API in the project identified by the `entry_group.name` parameter (see [Data Catalog Resource Project] (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.patch({ + * // The resource name of the entry group in URL format. Example: + * // + * // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id} + * // + * // Note that this EntryGroup and its child resources may not actually be + * // stored in the location in this name. + * name: 'projects/my-project/locations/my-location/entryGroups/my-entryGroup', + * // The fields to update on the entry group. If absent or empty, all modifiable + * // fields are updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dataCatalogTimestamps": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dataCatalogTimestamps": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.patch * @memberOf! () * @@ -1618,6 +2055,58 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.setIamPolicy * @desc Sets the access control policy for a resource. Replaces any existing policy. Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform resources synced to Data Catalog. Callers must have following Google IAM permission - `datacatalog.tagTemplates.setIamPolicy` to set policies on tag templates. - `datacatalog.entries.setIamPolicy` to set policies on entries. - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/entryGroups/my-entryGroup', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.setIamPolicy * @memberOf! () * @@ -1691,6 +2180,58 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.testIamPermissions * @desc Returns the caller's permissions on a resource. If the resource does not exist, an empty set of permissions is returned (We don't return a `NOT_FOUND` error). Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform resources synced to Data Catalog. A caller is not required to have Google IAM permission to make this request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/entryGroups/my-entryGroup', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.testIamPermissions * @memberOf! () * @@ -1930,6 +2471,86 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.entries.create * @desc Creates an entry. Only entries of 'FILESET' type or user-specified type can be created. Users should enable the Data Catalog API in the project identified by the `parent` parameter (see [Data Catalog Resource Project] (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). A maximum of 100,000 entries may be created per entry group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.entries.create({ + * // Required. The id of the entry to create. + * entryId: 'placeholder-value', + * // Required. The name of the entry group this entry is in. Example: + * // + * // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id} + * // + * // Note that this Entry and its child resources may not actually be stored in + * // the location in this name. + * parent: + * 'projects/my-project/locations/my-location/entryGroups/my-entryGroup', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bigqueryDateShardedSpec": {}, + * // "bigqueryTableSpec": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "gcsFilesetSpec": {}, + * // "integratedSystem": "my_integratedSystem", + * // "linkedResource": "my_linkedResource", + * // "name": "my_name", + * // "schema": {}, + * // "sourceSystemTimestamps": {}, + * // "type": "my_type", + * // "userSpecifiedSystem": "my_userSpecifiedSystem", + * // "userSpecifiedType": "my_userSpecifiedType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryDateShardedSpec": {}, + * // "bigqueryTableSpec": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "gcsFilesetSpec": {}, + * // "integratedSystem": "my_integratedSystem", + * // "linkedResource": "my_linkedResource", + * // "name": "my_name", + * // "schema": {}, + * // "sourceSystemTimestamps": {}, + * // "type": "my_type", + * // "userSpecifiedSystem": "my_userSpecifiedSystem", + * // "userSpecifiedType": "my_userSpecifiedType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.entries.create * @memberOf! () * @@ -2015,6 +2636,47 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.entries.delete * @desc Deletes an existing entry. Only entries created through CreateEntry method can be deleted. Users should enable the Data Catalog API in the project identified by the `name` parameter (see [Data Catalog Resource Project] (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.entries.delete({ + * // Required. The name of the entry. Example: + * // + * // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} + * name: + * 'projects/my-project/locations/my-location/entryGroups/my-entryGroup/entries/my-entrie', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.entries.delete * @memberOf! () * @@ -2084,6 +2746,61 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.entries.get * @desc Gets an entry. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.entries.get({ + * // Required. The name of the entry. Example: + * // + * // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} + * name: + * 'projects/my-project/locations/my-location/entryGroups/my-entryGroup/entries/my-entrie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryDateShardedSpec": {}, + * // "bigqueryTableSpec": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "gcsFilesetSpec": {}, + * // "integratedSystem": "my_integratedSystem", + * // "linkedResource": "my_linkedResource", + * // "name": "my_name", + * // "schema": {}, + * // "sourceSystemTimestamps": {}, + * // "type": "my_type", + * // "userSpecifiedSystem": "my_userSpecifiedSystem", + * // "userSpecifiedType": "my_userSpecifiedType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.entries.get * @memberOf! () * @@ -2164,6 +2881,60 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.entries.getIamPolicy * @desc Gets the access control policy for a resource. A `NOT_FOUND` error is returned if the resource does not exist. An empty policy is returned if the resource exists but does not have a policy set on it. Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform resources synced to Data Catalog. Callers must have following Google IAM permission - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag templates. - `datacatalog.entries.getIamPolicy` to get policies on entries. - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.entries.getIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/entryGroups/my-entryGroup/entries/my-entrie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.entries.getIamPolicy * @memberOf! () * @@ -2237,6 +3008,62 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.entries.list * @desc Lists entries. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.entries.list({ + * // The maximum number of items to return. Default is 10. Max limit is 1000. + * // Throws an invalid argument for `page_size > 1000`. + * pageSize: 'placeholder-value', + * // Token that specifies which page is requested. If empty, the first page is + * // returned. + * pageToken: 'placeholder-value', + * // Required. The name of the entry group that contains the entries, which can + * // be provided in URL format. Example: + * // + * // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id} + * parent: + * 'projects/my-project/locations/my-location/entryGroups/my-entryGroup', + * // The fields to return for each Entry. If not set or empty, all + * // fields are returned. + * // For example, setting read_mask to contain only one path "name" will cause + * // ListEntries to return a list of Entries with only "name" field. + * readMask: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.entries.list * @memberOf! () * @@ -2338,6 +3165,105 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.entries.patch * @desc Updates an existing entry. Users should enable the Data Catalog API in the project identified by the `entry.name` parameter (see [Data Catalog Resource Project] (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.entries.patch({ + * // The Data Catalog resource name of the entry in URL format. Example: + * // + * // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} + * // + * // Note that this Entry and its child resources may not actually be stored in + * // the location in this name. + * name: + * 'projects/my-project/locations/my-location/entryGroups/my-entryGroup/entries/my-entrie', + * // The fields to update on the entry. If absent or empty, all modifiable + * // fields are updated. + * // + * // The following fields are modifiable: + * // * For entries with type `DATA_STREAM`: + * // * `schema` + * // * For entries with type `FILESET` + * // * `schema` + * // * `display_name` + * // * `description` + * // * `gcs_fileset_spec` + * // * `gcs_fileset_spec.file_patterns` + * // * For entries with `user_specified_type` + * // * `schema` + * // * `display_name` + * // * `description` + * // * user_specified_type + * // * user_specified_system + * // * linked_resource + * // * source_system_timestamps + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bigqueryDateShardedSpec": {}, + * // "bigqueryTableSpec": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "gcsFilesetSpec": {}, + * // "integratedSystem": "my_integratedSystem", + * // "linkedResource": "my_linkedResource", + * // "name": "my_name", + * // "schema": {}, + * // "sourceSystemTimestamps": {}, + * // "type": "my_type", + * // "userSpecifiedSystem": "my_userSpecifiedSystem", + * // "userSpecifiedType": "my_userSpecifiedType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryDateShardedSpec": {}, + * // "bigqueryTableSpec": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "gcsFilesetSpec": {}, + * // "integratedSystem": "my_integratedSystem", + * // "linkedResource": "my_linkedResource", + * // "name": "my_name", + * // "schema": {}, + * // "sourceSystemTimestamps": {}, + * // "type": "my_type", + * // "userSpecifiedSystem": "my_userSpecifiedSystem", + * // "userSpecifiedType": "my_userSpecifiedType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.entries.patch * @memberOf! () * @@ -2420,6 +3346,58 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.entries.testIamPermissions * @desc Returns the caller's permissions on a resource. If the resource does not exist, an empty set of permissions is returned (We don't return a `NOT_FOUND` error). Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform resources synced to Data Catalog. A caller is not required to have Google IAM permission to make this request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.entries.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/entryGroups/my-entryGroup/entries/my-entrie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.entries.testIamPermissions * @memberOf! () * @@ -2634,6 +3612,71 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.entries.tags.create * @desc Creates a tag on an Entry. Note: The project identified by the `parent` parameter for the [tag](https://cloud.google.com/data-catalog/docs/reference/rest/v1beta1/projects.locations.entryGroups.entries.tags/create#path-parameters) and the [tag template](https://cloud.google.com/data-catalog/docs/reference/rest/v1beta1/projects.locations.tagTemplates/create#path-parameters) used to create the tag must be from the same organization. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.entries.tags.create( + * { + * // Required. The name of the resource to attach this tag to. Tags can be attached to + * // Entries. Example: + * // + * // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} + * // + * // Note that this Tag and its child resources may not actually be stored in + * // the location in this name. + * parent: + * 'projects/my-project/locations/my-location/entryGroups/my-entryGroup/entries/my-entrie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "column": "my_column", + * // "fields": {}, + * // "name": "my_name", + * // "template": "my_template", + * // "templateDisplayName": "my_templateDisplayName" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "column": "my_column", + * // "fields": {}, + * // "name": "my_name", + * // "template": "my_template", + * // "templateDisplayName": "my_templateDisplayName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.entries.tags.create * @memberOf! () * @@ -2718,6 +3761,49 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.entries.tags.delete * @desc Deletes a tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.entries.tags.delete( + * { + * // Required. The name of the tag to delete. Example: + * // + * // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id} + * name: + * 'projects/my-project/locations/my-location/entryGroups/my-entryGroup/entries/my-entrie/tags/my-tag', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.entries.tags.delete * @memberOf! () * @@ -2787,6 +3873,62 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.entries.tags.list * @desc Lists the tags on an Entry. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.entries.tags.list( + * { + * // The maximum number of tags to return. Default is 10. Max limit is 1000. + * pageSize: 'placeholder-value', + * // Token that specifies which page is requested. If empty, the first page is + * // returned. + * pageToken: 'placeholder-value', + * // Required. The name of the Data Catalog resource to list the tags of. The resource + * // could be an Entry or an + * // EntryGroup. + * // + * // Examples: + * // + * // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id} + * // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} + * parent: + * 'projects/my-project/locations/my-location/entryGroups/my-entryGroup/entries/my-entrie', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "tags": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.entries.tags.list * @memberOf! () * @@ -2888,6 +4030,73 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.entries.tags.patch * @desc Updates an existing tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.entries.tags.patch( + * { + * // The resource name of the tag in URL format. Example: + * // + * // * projects/{project_id}/locations/{location}/entrygroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id} + * // + * // where `tag_id` is a system-generated identifier. + * // Note that this Tag may not actually be stored in the location in this name. + * name: + * 'projects/my-project/locations/my-location/entryGroups/my-entryGroup/entries/my-entrie/tags/my-tag', + * // The fields to update on the Tag. If absent or empty, all modifiable fields + * // are updated. Currently the only modifiable field is the field `fields`. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "column": "my_column", + * // "fields": {}, + * // "name": "my_name", + * // "template": "my_template", + * // "templateDisplayName": "my_templateDisplayName" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "column": "my_column", + * // "fields": {}, + * // "name": "my_name", + * // "template": "my_template", + * // "templateDisplayName": "my_templateDisplayName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.entries.tags.patch * @memberOf! () * @@ -3048,6 +4257,69 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.tags.create * @desc Creates a tag on an Entry. Note: The project identified by the `parent` parameter for the [tag](https://cloud.google.com/data-catalog/docs/reference/rest/v1beta1/projects.locations.entryGroups.entries.tags/create#path-parameters) and the [tag template](https://cloud.google.com/data-catalog/docs/reference/rest/v1beta1/projects.locations.tagTemplates/create#path-parameters) used to create the tag must be from the same organization. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.tags.create({ + * // Required. The name of the resource to attach this tag to. Tags can be attached to + * // Entries. Example: + * // + * // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} + * // + * // Note that this Tag and its child resources may not actually be stored in + * // the location in this name. + * parent: + * 'projects/my-project/locations/my-location/entryGroups/my-entryGroup', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "column": "my_column", + * // "fields": {}, + * // "name": "my_name", + * // "template": "my_template", + * // "templateDisplayName": "my_templateDisplayName" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "column": "my_column", + * // "fields": {}, + * // "name": "my_name", + * // "template": "my_template", + * // "templateDisplayName": "my_templateDisplayName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.tags.create * @memberOf! () * @@ -3132,6 +4404,47 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.tags.delete * @desc Deletes a tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.tags.delete({ + * // Required. The name of the tag to delete. Example: + * // + * // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id} + * name: + * 'projects/my-project/locations/my-location/entryGroups/my-entryGroup/tags/my-tag', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.tags.delete * @memberOf! () * @@ -3201,6 +4514,60 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.tags.list * @desc Lists the tags on an Entry. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.tags.list({ + * // The maximum number of tags to return. Default is 10. Max limit is 1000. + * pageSize: 'placeholder-value', + * // Token that specifies which page is requested. If empty, the first page is + * // returned. + * pageToken: 'placeholder-value', + * // Required. The name of the Data Catalog resource to list the tags of. The resource + * // could be an Entry or an + * // EntryGroup. + * // + * // Examples: + * // + * // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id} + * // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} + * parent: + * 'projects/my-project/locations/my-location/entryGroups/my-entryGroup', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "tags": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.tags.list * @memberOf! () * @@ -3302,6 +4669,71 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.entryGroups.tags.patch * @desc Updates an existing tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.entryGroups.tags.patch({ + * // The resource name of the tag in URL format. Example: + * // + * // * projects/{project_id}/locations/{location}/entrygroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id} + * // + * // where `tag_id` is a system-generated identifier. + * // Note that this Tag may not actually be stored in the location in this name. + * name: + * 'projects/my-project/locations/my-location/entryGroups/my-entryGroup/tags/my-tag', + * // The fields to update on the Tag. If absent or empty, all modifiable fields + * // are updated. Currently the only modifiable field is the field `fields`. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "column": "my_column", + * // "fields": {}, + * // "name": "my_name", + * // "template": "my_template", + * // "templateDisplayName": "my_templateDisplayName" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "column": "my_column", + * // "fields": {}, + * // "name": "my_name", + * // "template": "my_template", + * // "templateDisplayName": "my_templateDisplayName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.entryGroups.tags.patch * @memberOf! () * @@ -3466,6 +4898,65 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.tagTemplates.create * @desc Creates a tag template. The user should enable the Data Catalog API in the project identified by the `parent` parameter (see [Data Catalog Resource Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.tagTemplates.create({ + * // Required. The name of the project and the template location + * // [region](https://cloud.google.com/data-catalog/docs/concepts/regions. + * // + * // Example: + * // + * // * projects/{project_id}/locations/us-central1 + * parent: 'projects/my-project/locations/my-location', + * // Required. The id of the tag template to create. + * tagTemplateId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "fields": {}, + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "fields": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.tagTemplates.create * @memberOf! () * @@ -3559,6 +5050,51 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.tagTemplates.delete * @desc Deletes a tag template and all tags using the template. Users should enable the Data Catalog API in the project identified by the `name` parameter (see [Data Catalog Resource Project] (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.tagTemplates.delete({ + * // Required. Currently, this field must always be set to `true`. + * // This confirms the deletion of any possible tags using this template. + * // `force = false` will be supported in the future. + * force: 'placeholder-value', + * // Required. The name of the tag template to delete. Example: + * // + * // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id} + * name: + * 'projects/my-project/locations/my-location/tagTemplates/my-tagTemplate', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.tagTemplates.delete * @memberOf! () * @@ -3629,6 +5165,51 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.tagTemplates.get * @desc Gets a tag template. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.tagTemplates.get({ + * // Required. The name of the tag template. Example: + * // + * // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id} + * name: + * 'projects/my-project/locations/my-location/tagTemplates/my-tagTemplate', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "fields": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.tagTemplates.get * @memberOf! () * @@ -3717,6 +5298,58 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.tagTemplates.getIamPolicy * @desc Gets the access control policy for a resource. A `NOT_FOUND` error is returned if the resource does not exist. An empty policy is returned if the resource exists but does not have a policy set on it. Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform resources synced to Data Catalog. Callers must have following Google IAM permission - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag templates. - `datacatalog.entries.getIamPolicy` to get policies on entries. - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.tagTemplates.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/tagTemplates/my-tagTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.tagTemplates.getIamPolicy * @memberOf! () * @@ -3790,6 +5423,72 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.tagTemplates.patch * @desc Updates a tag template. This method cannot be used to update the fields of a template. The tag template fields are represented as separate resources and should be updated using their own create/update/delete methods. Users should enable the Data Catalog API in the project identified by the `tag_template.name` parameter (see [Data Catalog Resource Project] (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.tagTemplates.patch({ + * // The resource name of the tag template in URL format. Example: + * // + * // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id} + * // + * // Note that this TagTemplate and its child resources may not actually be + * // stored in the location in this name. + * name: + * 'projects/my-project/locations/my-location/tagTemplates/my-tagTemplate', + * // The field mask specifies the parts of the template to overwrite. + * // + * // Allowed fields: + * // + * // * `display_name` + * // + * // If absent or empty, all of the allowed fields above will be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "fields": {}, + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "fields": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.tagTemplates.patch * @memberOf! () * @@ -3880,6 +5579,58 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.tagTemplates.setIamPolicy * @desc Sets the access control policy for a resource. Replaces any existing policy. Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform resources synced to Data Catalog. Callers must have following Google IAM permission - `datacatalog.tagTemplates.setIamPolicy` to set policies on tag templates. - `datacatalog.entries.setIamPolicy` to set policies on entries. - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.tagTemplates.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/tagTemplates/my-tagTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.tagTemplates.setIamPolicy * @memberOf! () * @@ -3953,6 +5704,58 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.tagTemplates.testIamPermissions * @desc Returns the caller's permissions on a resource. If the resource does not exist, an empty set of permissions is returned (We don't return a `NOT_FOUND` error). Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform resources synced to Data Catalog. A caller is not required to have Google IAM permission to make this request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.tagTemplates.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/tagTemplates/my-tagTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.tagTemplates.testIamPermissions * @memberOf! () * @@ -4164,6 +5967,74 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.tagTemplates.fields.create * @desc Creates a field in a tag template. The user should enable the Data Catalog API in the project identified by the `parent` parameter (see [Data Catalog Resource Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.tagTemplates.fields.create({ + * // Required. The name of the project and the template location + * // [region](https://cloud.google.com/data-catalog/docs/concepts/regions). + * // + * // Example: + * // + * // * projects/{project_id}/locations/us-central1/tagTemplates/{tag_template_id} + * parent: + * 'projects/my-project/locations/my-location/tagTemplates/my-tagTemplate', + * // Required. The ID of the tag template field to create. + * // Field ids can contain letters (both uppercase and lowercase), numbers + * // (0-9), underscores (_) and dashes (-). Field IDs must be at least 1 + * // character long and at most 128 characters long. Field IDs must also be + * // unique within their template. + * tagTemplateFieldId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "isRequired": false, + * // "name": "my_name", + * // "order": 0, + * // "type": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "isRequired": false, + * // "name": "my_name", + * // "order": 0, + * // "type": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.tagTemplates.fields.create * @memberOf! () * @@ -4265,6 +6136,51 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.tagTemplates.fields.delete * @desc Deletes a field in a tag template and all uses of that field. Users should enable the Data Catalog API in the project identified by the `name` parameter (see [Data Catalog Resource Project] (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.tagTemplates.fields.delete({ + * // Required. Currently, this field must always be set to `true`. + * // This confirms the deletion of this field from any tags using this field. + * // `force = false` will be supported in the future. + * force: 'placeholder-value', + * // Required. The name of the tag template field to delete. Example: + * // + * // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id} + * name: + * 'projects/my-project/locations/my-location/tagTemplates/my-tagTemplate/fields/my-field', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.tagTemplates.fields.delete * @memberOf! () * @@ -4335,6 +6251,80 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.tagTemplates.fields.patch * @desc Updates a field in a tag template. This method cannot be used to update the field type. Users should enable the Data Catalog API in the project identified by the `name` parameter (see [Data Catalog Resource Project] (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.tagTemplates.fields.patch({ + * // Required. The name of the tag template field. Example: + * // + * // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id} + * name: + * 'projects/my-project/locations/my-location/tagTemplates/my-tagTemplate/fields/my-field', + * // Optional. The field mask specifies the parts of the template to be updated. + * // Allowed fields: + * // + * // * `display_name` + * // * `type.enum_type` + * // * `is_required` + * // + * // If `update_mask` is not set or empty, all of the allowed fields above will + * // be updated. + * // + * // When updating an enum type, the provided values will be merged with the + * // existing values. Therefore, enum values can only be added, existing enum + * // values cannot be deleted nor renamed. Updating a template field from + * // optional to required is NOT allowed. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "isRequired": false, + * // "name": "my_name", + * // "order": 0, + * // "type": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "isRequired": false, + * // "name": "my_name", + * // "order": 0, + * // "type": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.tagTemplates.fields.patch * @memberOf! () * @@ -4433,6 +6423,61 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.tagTemplates.fields.rename * @desc Renames a field in a tag template. The user should enable the Data Catalog API in the project identified by the `name` parameter (see [Data Catalog Resource Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.tagTemplates.fields.rename({ + * // Required. The name of the tag template. Example: + * // + * // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id} + * name: + * 'projects/my-project/locations/my-location/tagTemplates/my-tagTemplate/fields/my-field', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "newTagTemplateFieldId": "my_newTagTemplateFieldId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "isRequired": false, + * // "name": "my_name", + * // "order": 0, + * // "type": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.tagTemplates.fields.rename * @memberOf! () * @@ -4620,6 +6665,60 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.taxonomies.create * @desc Creates a taxonomy in the specified project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.taxonomies.create({ + * // Required. Resource name of the project that the taxonomy will belong to. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "activatedPolicyTypes": [], + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activatedPolicyTypes": [], + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.taxonomies.create * @memberOf! () * @@ -4712,6 +6811,45 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.taxonomies.delete * @desc Deletes a taxonomy. This operation will also delete all policy tags in this taxonomy along with their associated policies. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.taxonomies.delete({ + * // Required. Resource name of the taxonomy to be deleted. All policy tags in + * // this taxonomy will also be deleted. + * name: 'projects/my-project/locations/my-location/taxonomies/my-taxonomie', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.taxonomies.delete * @memberOf! () * @@ -4781,6 +6919,51 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.taxonomies.export * @desc Exports all taxonomies and their policy tags in a project. This method generates SerializedTaxonomy protos with nested policy tags that can be used as an input for future ImportTaxonomies calls. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.taxonomies.export({ + * // Required. Resource name of the project that taxonomies to be exported + * // will share. + * parent: 'projects/my-project/locations/my-location', + * // Export taxonomies as serialized taxonomies. + * serializedTaxonomies: 'placeholder-value', + * // Required. Resource names of the taxonomies to be exported. + * taxonomies: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "taxonomies": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.taxonomies.export * @memberOf! () * @@ -4883,6 +7066,49 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.taxonomies.get * @desc Gets a taxonomy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.taxonomies.get({ + * // Required. Resource name of the requested taxonomy. + * name: 'projects/my-project/locations/my-location/taxonomies/my-taxonomie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activatedPolicyTypes": [], + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.taxonomies.get * @memberOf! () * @@ -4971,6 +7197,58 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.taxonomies.getIamPolicy * @desc Gets the IAM policy for a taxonomy or a policy tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.taxonomies.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/taxonomies/my-taxonomie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.taxonomies.getIamPolicy * @memberOf! () * @@ -5044,6 +7322,55 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.taxonomies.import * @desc Imports all taxonomies and their policy tags to a project as new taxonomies. This method provides a bulk taxonomy / policy tag creation using nested proto structure. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.taxonomies.import({ + * // Required. Resource name of project that the newly created taxonomies will + * // belong to. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inlineSource": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "taxonomies": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.taxonomies.import * @memberOf! () * @@ -5145,6 +7472,53 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.taxonomies.list * @desc Lists all taxonomies in a project in a particular location that the caller has permission to view. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.taxonomies.list({ + * // The maximum number of items to return. Must be a value between 1 and 1000. + * // If not set, defaults to 50. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous list request, if any. If + * // not set, defaults to an empty string. + * pageToken: 'placeholder-value', + * // Required. Resource name of the project to list the taxonomies of. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "taxonomies": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.taxonomies.list * @memberOf! () * @@ -5247,6 +7621,66 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.taxonomies.patch * @desc Updates a taxonomy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.taxonomies.patch({ + * // Output only. Resource name of this taxonomy, whose format is: + * // "projects/{project_number}/locations/{location_id}/taxonomies/{id}". + * name: 'projects/my-project/locations/my-location/taxonomies/my-taxonomie', + * // The update mask applies to the resource. For the `FieldMask` definition, + * // see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * // If not set, defaults to all of the fields that are allowed to update. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "activatedPolicyTypes": [], + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activatedPolicyTypes": [], + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.taxonomies.patch * @memberOf! () * @@ -5337,6 +7771,58 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.taxonomies.setIamPolicy * @desc Sets the IAM policy for a taxonomy or a policy tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.taxonomies.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/taxonomies/my-taxonomie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.taxonomies.setIamPolicy * @memberOf! () * @@ -5410,6 +7896,58 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.taxonomies.testIamPermissions * @desc Returns the permissions that a caller has on the specified taxonomy or policy tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.taxonomies.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/taxonomies/my-taxonomie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.taxonomies.testIamPermissions * @memberOf! () * @@ -5670,6 +8208,65 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.taxonomies.policyTags.create * @desc Creates a policy tag in the specified taxonomy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.taxonomies.policyTags.create( + * { + * // Required. Resource name of the taxonomy that the policy tag will belong to. + * parent: + * 'projects/my-project/locations/my-location/taxonomies/my-taxonomie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "childPolicyTags": [], + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "parentPolicyTag": "my_parentPolicyTag" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "childPolicyTags": [], + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "parentPolicyTag": "my_parentPolicyTag" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.taxonomies.policyTags.create * @memberOf! () * @@ -5762,6 +8359,48 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.taxonomies.policyTags.delete * @desc Deletes a policy tag. Also deletes all of its descendant policy tags. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.taxonomies.policyTags.delete( + * { + * // Required. Resource name of the policy tag to be deleted. All of its descendant + * // policy tags will also be deleted. + * name: + * 'projects/my-project/locations/my-location/taxonomies/my-taxonomie/policyTags/my-policyTag', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.taxonomies.policyTags.delete * @memberOf! () * @@ -5831,6 +8470,51 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.taxonomies.policyTags.get * @desc Gets a policy tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.taxonomies.policyTags.get({ + * // Required. Resource name of the requested policy tag. + * name: + * 'projects/my-project/locations/my-location/taxonomies/my-taxonomie/policyTags/my-policyTag', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "childPolicyTags": [], + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "parentPolicyTag": "my_parentPolicyTag" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.taxonomies.policyTags.get * @memberOf! () * @@ -5919,6 +8603,60 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.taxonomies.policyTags.getIamPolicy * @desc Gets the IAM policy for a taxonomy or a policy tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.taxonomies.policyTags.getIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/taxonomies/my-taxonomie/policyTags/my-policyTag', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.taxonomies.policyTags.getIamPolicy * @memberOf! () * @@ -5992,6 +8730,53 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.taxonomies.policyTags.list * @desc Lists all policy tags in a taxonomy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.taxonomies.policyTags.list({ + * // The maximum number of items to return. Must be a value between 1 and 1000. + * // If not set, defaults to 50. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. If + * // not set, defaults to an empty string. + * pageToken: 'placeholder-value', + * // Required. Resource name of the taxonomy to list the policy tags of. + * parent: 'projects/my-project/locations/my-location/taxonomies/my-taxonomie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "policyTags": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.taxonomies.policyTags.list * @memberOf! () * @@ -6094,6 +8879,72 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.taxonomies.policyTags.patch * @desc Updates a policy tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.taxonomies.policyTags.patch({ + * // Output only. Resource name of this policy tag, whose format is: + * // "projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{id}". + * name: + * 'projects/my-project/locations/my-location/taxonomies/my-taxonomie/policyTags/my-policyTag', + * // The update mask applies to the resource. Only display_name, description and + * // parent_policy_tag can be updated and thus can be listed in the mask. If + * // update_mask is not provided, all allowed fields (i.e. display_name, + * // description and parent) will be updated. For more information including the + * // `FieldMask` definition, see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * // If not set, defaults to all of the fields that are allowed to update. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "childPolicyTags": [], + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "parentPolicyTag": "my_parentPolicyTag" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "childPolicyTags": [], + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "parentPolicyTag": "my_parentPolicyTag" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.taxonomies.policyTags.patch * @memberOf! () * @@ -6184,6 +9035,60 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.taxonomies.policyTags.setIamPolicy * @desc Sets the IAM policy for a taxonomy or a policy tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.taxonomies.policyTags.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/taxonomies/my-taxonomie/policyTags/my-policyTag', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.taxonomies.policyTags.setIamPolicy * @memberOf! () * @@ -6257,6 +9162,58 @@ export namespace datacatalog_v1beta1 { /** * datacatalog.projects.locations.taxonomies.policyTags.testIamPermissions * @desc Returns the permissions that a caller has on the specified taxonomy or policy tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datacatalog.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 datacatalog = google.datacatalog('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datacatalog.projects.locations.taxonomies.policyTags.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/taxonomies/my-taxonomie/policyTags/my-policyTag', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datacatalog.projects.locations.taxonomies.policyTags.testIamPermissions * @memberOf! () * diff --git a/src/apis/dataflow/v1b3.ts b/src/apis/dataflow/v1b3.ts index 195c70b97e5..937299b8d71 100644 --- a/src/apis/dataflow/v1b3.ts +++ b/src/apis/dataflow/v1b3.ts @@ -3290,6 +3290,53 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.deleteSnapshots * @desc Deletes a snapshot. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.deleteSnapshots({ + * // The location that contains this snapshot. + * location: 'placeholder-value', + * // The ID of the Cloud Platform project that the snapshot belongs to. + * projectId: 'placeholder-value', + * // The ID of the snapshot. + * snapshotId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.deleteSnapshots * @memberOf! () * @@ -3370,6 +3417,60 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.workerMessages * @desc Send a worker_message to the service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.workerMessages({ + * // The project to send the WorkerMessages to. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "location": "my_location", + * // "workerMessages": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "workerMessageResponses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.workerMessages * @memberOf! () * @@ -3502,6 +3603,68 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.jobs.aggregated * @desc List the jobs of a project across all regions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.jobs.aggregated({ + * // The kind of filter to use. + * filter: 'placeholder-value', + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * // contains this job. + * location: 'placeholder-value', + * // If there are many jobs, limit response to at most this many. + * // The actual number of jobs returned will be the lesser of max_responses + * // and an unspecified server-defined limit. + * pageSize: 'placeholder-value', + * // Set this to the 'next_page_token' field of a previous response + * // to request additional results in a long list. + * pageToken: 'placeholder-value', + * // The project which owns the jobs. + * projectId: 'placeholder-value', + * // Level of information requested in response. Default is `JOB_VIEW_SUMMARY`. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "failedLocation": [], + * // "jobs": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.jobs.aggregated * @memberOf! () * @@ -3580,6 +3743,113 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.jobs.create * @desc Creates a Cloud Dataflow job. To create a job, we recommend using `projects.locations.jobs.create` with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using `projects.jobs.create` is not recommended, as your job will always start in `us-central1`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.jobs.create({ + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * // contains this job. + * location: 'placeholder-value', + * // The ID of the Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // Deprecated. This field is now in the Job message. + * replaceJobId: 'placeholder-value', + * // The level of information requested in response. + * view: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clientRequestId": "my_clientRequestId", + * // "createTime": "my_createTime", + * // "createdFromSnapshotId": "my_createdFromSnapshotId", + * // "currentState": "my_currentState", + * // "currentStateTime": "my_currentStateTime", + * // "environment": {}, + * // "executionInfo": {}, + * // "id": "my_id", + * // "jobMetadata": {}, + * // "labels": {}, + * // "location": "my_location", + * // "name": "my_name", + * // "pipelineDescription": {}, + * // "projectId": "my_projectId", + * // "replaceJobId": "my_replaceJobId", + * // "replacedByJobId": "my_replacedByJobId", + * // "requestedState": "my_requestedState", + * // "stageStates": [], + * // "startTime": "my_startTime", + * // "steps": [], + * // "stepsLocation": "my_stepsLocation", + * // "tempFiles": [], + * // "transformNameMapping": {}, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientRequestId": "my_clientRequestId", + * // "createTime": "my_createTime", + * // "createdFromSnapshotId": "my_createdFromSnapshotId", + * // "currentState": "my_currentState", + * // "currentStateTime": "my_currentStateTime", + * // "environment": {}, + * // "executionInfo": {}, + * // "id": "my_id", + * // "jobMetadata": {}, + * // "labels": {}, + * // "location": "my_location", + * // "name": "my_name", + * // "pipelineDescription": {}, + * // "projectId": "my_projectId", + * // "replaceJobId": "my_replaceJobId", + * // "replacedByJobId": "my_replacedByJobId", + * // "requestedState": "my_requestedState", + * // "stageStates": [], + * // "startTime": "my_startTime", + * // "steps": [], + * // "stepsLocation": "my_stepsLocation", + * // "tempFiles": [], + * // "transformNameMapping": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.jobs.create * @memberOf! () * @@ -3656,6 +3926,82 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.jobs.get * @desc Gets the state of the specified Cloud Dataflow job. To get the state of a job, we recommend using `projects.locations.jobs.get` with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using `projects.jobs.get` is not recommended, as you can only get the state of jobs that are running in `us-central1`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.jobs.get({ + * // The job ID. + * jobId: 'placeholder-value', + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * // contains this job. + * location: 'placeholder-value', + * // The ID of the Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // The level of information requested in response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientRequestId": "my_clientRequestId", + * // "createTime": "my_createTime", + * // "createdFromSnapshotId": "my_createdFromSnapshotId", + * // "currentState": "my_currentState", + * // "currentStateTime": "my_currentStateTime", + * // "environment": {}, + * // "executionInfo": {}, + * // "id": "my_id", + * // "jobMetadata": {}, + * // "labels": {}, + * // "location": "my_location", + * // "name": "my_name", + * // "pipelineDescription": {}, + * // "projectId": "my_projectId", + * // "replaceJobId": "my_replaceJobId", + * // "replacedByJobId": "my_replacedByJobId", + * // "requestedState": "my_requestedState", + * // "stageStates": [], + * // "startTime": "my_startTime", + * // "steps": [], + * // "stepsLocation": "my_stepsLocation", + * // "tempFiles": [], + * // "transformNameMapping": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.jobs.get * @memberOf! () * @@ -3731,6 +4077,61 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.jobs.getMetrics * @desc Request the job status. To request the status of a job, we recommend using `projects.locations.jobs.getMetrics` with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using `projects.jobs.getMetrics` is not recommended, as you can only request the status of jobs that are running in `us-central1`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.jobs.getMetrics({ + * // The job to get messages for. + * jobId: 'placeholder-value', + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * // contains the job specified by job_id. + * location: 'placeholder-value', + * // A project id. + * projectId: 'placeholder-value', + * // Return only metric data that has changed since this time. + * // Default is to return all information about all metrics for the job. + * startTime: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "metricTime": "my_metricTime", + * // "metrics": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.jobs.getMetrics * @memberOf! () * @@ -3807,6 +4208,68 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.jobs.list * @desc List the jobs of a project. To list the jobs of a project in a region, we recommend using `projects.locations.jobs.get` with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). To list the all jobs across all regions, use `projects.jobs.aggregated`. Using `projects.jobs.list` is not recommended, as you can only get the list of jobs that are running in `us-central1`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.jobs.list({ + * // The kind of filter to use. + * filter: 'placeholder-value', + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * // contains this job. + * location: 'placeholder-value', + * // If there are many jobs, limit response to at most this many. + * // The actual number of jobs returned will be the lesser of max_responses + * // and an unspecified server-defined limit. + * pageSize: 'placeholder-value', + * // Set this to the 'next_page_token' field of a previous response + * // to request additional results in a long list. + * pageToken: 'placeholder-value', + * // The project which owns the jobs. + * projectId: 'placeholder-value', + * // Level of information requested in response. Default is `JOB_VIEW_SUMMARY`. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "failedLocation": [], + * // "jobs": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.jobs.list * @memberOf! () * @@ -3886,6 +4349,72 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.jobs.snapshot * @desc Snapshot the state of a streaming job. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.jobs.snapshot({ + * // The job to be snapshotted. + * jobId: 'placeholder-value', + * // The project which owns the job to be snapshotted. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "location": "my_location", + * // "snapshotSources": false, + * // "ttl": "my_ttl" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "diskSizeBytes": "my_diskSizeBytes", + * // "id": "my_id", + * // "projectId": "my_projectId", + * // "pubsubMetadata": [], + * // "sourceJobId": "my_sourceJobId", + * // "state": "my_state", + * // "ttl": "my_ttl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.jobs.snapshot * @memberOf! () * @@ -3959,6 +4488,111 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.jobs.update * @desc Updates the state of an existing Cloud Dataflow job. To update the state of an existing job, we recommend using `projects.locations.jobs.update` with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using `projects.jobs.update` is not recommended, as you can only update the state of jobs that are running in `us-central1`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.jobs.update({ + * // The job ID. + * jobId: 'placeholder-value', + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * // contains this job. + * location: 'placeholder-value', + * // The ID of the Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clientRequestId": "my_clientRequestId", + * // "createTime": "my_createTime", + * // "createdFromSnapshotId": "my_createdFromSnapshotId", + * // "currentState": "my_currentState", + * // "currentStateTime": "my_currentStateTime", + * // "environment": {}, + * // "executionInfo": {}, + * // "id": "my_id", + * // "jobMetadata": {}, + * // "labels": {}, + * // "location": "my_location", + * // "name": "my_name", + * // "pipelineDescription": {}, + * // "projectId": "my_projectId", + * // "replaceJobId": "my_replaceJobId", + * // "replacedByJobId": "my_replacedByJobId", + * // "requestedState": "my_requestedState", + * // "stageStates": [], + * // "startTime": "my_startTime", + * // "steps": [], + * // "stepsLocation": "my_stepsLocation", + * // "tempFiles": [], + * // "transformNameMapping": {}, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientRequestId": "my_clientRequestId", + * // "createTime": "my_createTime", + * // "createdFromSnapshotId": "my_createdFromSnapshotId", + * // "currentState": "my_currentState", + * // "currentStateTime": "my_currentStateTime", + * // "environment": {}, + * // "executionInfo": {}, + * // "id": "my_id", + * // "jobMetadata": {}, + * // "labels": {}, + * // "location": "my_location", + * // "name": "my_name", + * // "pipelineDescription": {}, + * // "projectId": "my_projectId", + * // "replaceJobId": "my_replaceJobId", + * // "replacedByJobId": "my_replacedByJobId", + * // "requestedState": "my_requestedState", + * // "stageStates": [], + * // "startTime": "my_startTime", + * // "steps": [], + * // "stepsLocation": "my_stepsLocation", + * // "tempFiles": [], + * // "transformNameMapping": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.jobs.update * @memberOf! () * @@ -4229,6 +4863,63 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.jobs.debug.getConfig * @desc Get encoded debug configuration for component. Not cacheable. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.jobs.debug.getConfig({ + * // The job id. + * jobId: 'placeholder-value', + * // The project id. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "componentId": "my_componentId", + * // "location": "my_location", + * // "workerId": "my_workerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "config": "my_config" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.jobs.debug.getConfig * @memberOf! () * @@ -4309,6 +5000,62 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.jobs.debug.sendCapture * @desc Send encoded debug capture data for component. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.jobs.debug.sendCapture({ + * // The job id. + * jobId: 'placeholder-value', + * // The project id. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "componentId": "my_componentId", + * // "data": "my_data", + * // "location": "my_location", + * // "workerId": "my_workerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.jobs.debug.sendCapture * @memberOf! () * @@ -4439,6 +5186,75 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.jobs.messages.list * @desc Request the job status. To request the status of a job, we recommend using `projects.locations.jobs.messages.list` with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using `projects.jobs.messages.list` is not recommended, as you can only request the status of jobs that are running in `us-central1`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.jobs.messages.list({ + * // Return only messages with timestamps < end_time. The default is now + * // (i.e. return up to the latest messages available). + * endTime: 'placeholder-value', + * // The job to get messages about. + * jobId: 'placeholder-value', + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * // contains the job specified by job_id. + * location: 'placeholder-value', + * // Filter to only get messages with importance >= level + * minimumImportance: 'placeholder-value', + * // If specified, determines the maximum number of messages to + * // return. If unspecified, the service may choose an appropriate + * // default, or may return an arbitrarily large number of results. + * pageSize: 'placeholder-value', + * // If supplied, this should be the value of next_page_token returned + * // by an earlier call. This will cause the next page of results to + * // be returned. + * pageToken: 'placeholder-value', + * // A project id. + * projectId: 'placeholder-value', + * // If specified, return only messages with timestamps >= start_time. + * // The default is the job creation time (i.e. beginning of messages). + * startTime: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoscalingEvents": [], + * // "jobMessages": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.jobs.messages.list * @memberOf! () * @@ -4569,6 +5385,68 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.jobs.workItems.lease * @desc Leases a dataflow WorkItem to run. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.jobs.workItems.lease({ + * // Identifies the workflow job this worker belongs to. + * jobId: 'placeholder-value', + * // Identifies the project this worker belongs to. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "currentWorkerTime": "my_currentWorkerTime", + * // "location": "my_location", + * // "requestedLeaseDuration": "my_requestedLeaseDuration", + * // "unifiedWorkerRequest": {}, + * // "workItemTypes": [], + * // "workerCapabilities": [], + * // "workerId": "my_workerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "unifiedWorkerResponse": {}, + * // "workItems": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.jobs.workItems.lease * @memberOf! () * @@ -4647,6 +5525,66 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.jobs.workItems.reportStatus * @desc Reports the status of dataflow WorkItems leased by a worker. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.jobs.workItems.reportStatus({ + * // The job which the WorkItem is part of. + * jobId: 'placeholder-value', + * // The project which owns the WorkItem's job. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "currentWorkerTime": "my_currentWorkerTime", + * // "location": "my_location", + * // "unifiedWorkerRequest": {}, + * // "workItemStatuses": [], + * // "workerId": "my_workerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "unifiedWorkerResponse": {}, + * // "workItemServiceStates": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.jobs.workItems.reportStatus * @memberOf! () * @@ -4794,6 +5732,64 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.workerMessages * @desc Send a worker_message to the service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.workerMessages({ + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * // contains the job. + * location: 'placeholder-value', + * // The project to send the WorkerMessages to. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "location": "my_location", + * // "workerMessages": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "workerMessageResponses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.workerMessages * @memberOf! () * @@ -4906,6 +5902,64 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.flexTemplates.launch * @desc Launch a job with a FlexTemplate. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.flexTemplates.launch({ + * // Required. The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to + * // which to direct the request. E.g., us-central1, us-west1. + * location: 'placeholder-value', + * // Required. The ID of the Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "launchParameter": {}, + * // "validateOnly": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "job": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.flexTemplates.launch * @memberOf! () * @@ -5032,6 +6086,113 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.jobs.create * @desc Creates a Cloud Dataflow job. To create a job, we recommend using `projects.locations.jobs.create` with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using `projects.jobs.create` is not recommended, as your job will always start in `us-central1`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.jobs.create({ + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * // contains this job. + * location: 'placeholder-value', + * // The ID of the Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // Deprecated. This field is now in the Job message. + * replaceJobId: 'placeholder-value', + * // The level of information requested in response. + * view: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clientRequestId": "my_clientRequestId", + * // "createTime": "my_createTime", + * // "createdFromSnapshotId": "my_createdFromSnapshotId", + * // "currentState": "my_currentState", + * // "currentStateTime": "my_currentStateTime", + * // "environment": {}, + * // "executionInfo": {}, + * // "id": "my_id", + * // "jobMetadata": {}, + * // "labels": {}, + * // "location": "my_location", + * // "name": "my_name", + * // "pipelineDescription": {}, + * // "projectId": "my_projectId", + * // "replaceJobId": "my_replaceJobId", + * // "replacedByJobId": "my_replacedByJobId", + * // "requestedState": "my_requestedState", + * // "stageStates": [], + * // "startTime": "my_startTime", + * // "steps": [], + * // "stepsLocation": "my_stepsLocation", + * // "tempFiles": [], + * // "transformNameMapping": {}, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientRequestId": "my_clientRequestId", + * // "createTime": "my_createTime", + * // "createdFromSnapshotId": "my_createdFromSnapshotId", + * // "currentState": "my_currentState", + * // "currentStateTime": "my_currentStateTime", + * // "environment": {}, + * // "executionInfo": {}, + * // "id": "my_id", + * // "jobMetadata": {}, + * // "labels": {}, + * // "location": "my_location", + * // "name": "my_name", + * // "pipelineDescription": {}, + * // "projectId": "my_projectId", + * // "replaceJobId": "my_replaceJobId", + * // "replacedByJobId": "my_replacedByJobId", + * // "requestedState": "my_requestedState", + * // "stageStates": [], + * // "startTime": "my_startTime", + * // "steps": [], + * // "stepsLocation": "my_stepsLocation", + * // "tempFiles": [], + * // "transformNameMapping": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.jobs.create * @memberOf! () * @@ -5107,6 +6268,82 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.jobs.get * @desc Gets the state of the specified Cloud Dataflow job. To get the state of a job, we recommend using `projects.locations.jobs.get` with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using `projects.jobs.get` is not recommended, as you can only get the state of jobs that are running in `us-central1`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.jobs.get({ + * // The job ID. + * jobId: 'placeholder-value', + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * // contains this job. + * location: 'placeholder-value', + * // The ID of the Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // The level of information requested in response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientRequestId": "my_clientRequestId", + * // "createTime": "my_createTime", + * // "createdFromSnapshotId": "my_createdFromSnapshotId", + * // "currentState": "my_currentState", + * // "currentStateTime": "my_currentStateTime", + * // "environment": {}, + * // "executionInfo": {}, + * // "id": "my_id", + * // "jobMetadata": {}, + * // "labels": {}, + * // "location": "my_location", + * // "name": "my_name", + * // "pipelineDescription": {}, + * // "projectId": "my_projectId", + * // "replaceJobId": "my_replaceJobId", + * // "replacedByJobId": "my_replacedByJobId", + * // "requestedState": "my_requestedState", + * // "stageStates": [], + * // "startTime": "my_startTime", + * // "steps": [], + * // "stepsLocation": "my_stepsLocation", + * // "tempFiles": [], + * // "transformNameMapping": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.jobs.get * @memberOf! () * @@ -5182,6 +6419,61 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.jobs.getMetrics * @desc Request the job status. To request the status of a job, we recommend using `projects.locations.jobs.getMetrics` with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using `projects.jobs.getMetrics` is not recommended, as you can only request the status of jobs that are running in `us-central1`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.jobs.getMetrics({ + * // The job to get messages for. + * jobId: 'placeholder-value', + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * // contains the job specified by job_id. + * location: 'placeholder-value', + * // A project id. + * projectId: 'placeholder-value', + * // Return only metric data that has changed since this time. + * // Default is to return all information about all metrics for the job. + * startTime: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "metricTime": "my_metricTime", + * // "metrics": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.jobs.getMetrics * @memberOf! () * @@ -5259,6 +6551,68 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.jobs.list * @desc List the jobs of a project. To list the jobs of a project in a region, we recommend using `projects.locations.jobs.get` with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). To list the all jobs across all regions, use `projects.jobs.aggregated`. Using `projects.jobs.list` is not recommended, as you can only get the list of jobs that are running in `us-central1`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.jobs.list({ + * // The kind of filter to use. + * filter: 'placeholder-value', + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * // contains this job. + * location: 'placeholder-value', + * // If there are many jobs, limit response to at most this many. + * // The actual number of jobs returned will be the lesser of max_responses + * // and an unspecified server-defined limit. + * pageSize: 'placeholder-value', + * // Set this to the 'next_page_token' field of a previous response + * // to request additional results in a long list. + * pageToken: 'placeholder-value', + * // The project which owns the jobs. + * projectId: 'placeholder-value', + * // Level of information requested in response. Default is `JOB_VIEW_SUMMARY`. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "failedLocation": [], + * // "jobs": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.jobs.list * @memberOf! () * @@ -5337,6 +6691,74 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.jobs.snapshot * @desc Snapshot the state of a streaming job. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.jobs.snapshot({ + * // The job to be snapshotted. + * jobId: 'placeholder-value', + * // The location that contains this job. + * location: 'placeholder-value', + * // The project which owns the job to be snapshotted. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "location": "my_location", + * // "snapshotSources": false, + * // "ttl": "my_ttl" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "diskSizeBytes": "my_diskSizeBytes", + * // "id": "my_id", + * // "projectId": "my_projectId", + * // "pubsubMetadata": [], + * // "sourceJobId": "my_sourceJobId", + * // "state": "my_state", + * // "ttl": "my_ttl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.jobs.snapshot * @memberOf! () * @@ -5412,6 +6834,111 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.jobs.update * @desc Updates the state of an existing Cloud Dataflow job. To update the state of an existing job, we recommend using `projects.locations.jobs.update` with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using `projects.jobs.update` is not recommended, as you can only update the state of jobs that are running in `us-central1`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.jobs.update({ + * // The job ID. + * jobId: 'placeholder-value', + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * // contains this job. + * location: 'placeholder-value', + * // The ID of the Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clientRequestId": "my_clientRequestId", + * // "createTime": "my_createTime", + * // "createdFromSnapshotId": "my_createdFromSnapshotId", + * // "currentState": "my_currentState", + * // "currentStateTime": "my_currentStateTime", + * // "environment": {}, + * // "executionInfo": {}, + * // "id": "my_id", + * // "jobMetadata": {}, + * // "labels": {}, + * // "location": "my_location", + * // "name": "my_name", + * // "pipelineDescription": {}, + * // "projectId": "my_projectId", + * // "replaceJobId": "my_replaceJobId", + * // "replacedByJobId": "my_replacedByJobId", + * // "requestedState": "my_requestedState", + * // "stageStates": [], + * // "startTime": "my_startTime", + * // "steps": [], + * // "stepsLocation": "my_stepsLocation", + * // "tempFiles": [], + * // "transformNameMapping": {}, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientRequestId": "my_clientRequestId", + * // "createTime": "my_createTime", + * // "createdFromSnapshotId": "my_createdFromSnapshotId", + * // "currentState": "my_currentState", + * // "currentStateTime": "my_currentStateTime", + * // "environment": {}, + * // "executionInfo": {}, + * // "id": "my_id", + * // "jobMetadata": {}, + * // "labels": {}, + * // "location": "my_location", + * // "name": "my_name", + * // "pipelineDescription": {}, + * // "projectId": "my_projectId", + * // "replaceJobId": "my_replaceJobId", + * // "replacedByJobId": "my_replacedByJobId", + * // "requestedState": "my_requestedState", + * // "stageStates": [], + * // "startTime": "my_startTime", + * // "steps": [], + * // "stepsLocation": "my_stepsLocation", + * // "tempFiles": [], + * // "transformNameMapping": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.jobs.update * @memberOf! () * @@ -5654,6 +7181,67 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.jobs.debug.getConfig * @desc Get encoded debug configuration for component. Not cacheable. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.jobs.debug.getConfig({ + * // The job id. + * jobId: 'placeholder-value', + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * // contains the job specified by job_id. + * location: 'placeholder-value', + * // The project id. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "componentId": "my_componentId", + * // "location": "my_location", + * // "workerId": "my_workerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "config": "my_config" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.jobs.debug.getConfig * @memberOf! () * @@ -5735,6 +7323,66 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.jobs.debug.sendCapture * @desc Send encoded debug capture data for component. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.jobs.debug.sendCapture({ + * // The job id. + * jobId: 'placeholder-value', + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * // contains the job specified by job_id. + * location: 'placeholder-value', + * // The project id. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "componentId": "my_componentId", + * // "data": "my_data", + * // "location": "my_location", + * // "workerId": "my_workerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.jobs.debug.sendCapture * @memberOf! () * @@ -5874,6 +7522,75 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.jobs.messages.list * @desc Request the job status. To request the status of a job, we recommend using `projects.locations.jobs.messages.list` with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using `projects.jobs.messages.list` is not recommended, as you can only request the status of jobs that are running in `us-central1`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.jobs.messages.list({ + * // Return only messages with timestamps < end_time. The default is now + * // (i.e. return up to the latest messages available). + * endTime: 'placeholder-value', + * // The job to get messages about. + * jobId: 'placeholder-value', + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * // contains the job specified by job_id. + * location: 'placeholder-value', + * // Filter to only get messages with importance >= level + * minimumImportance: 'placeholder-value', + * // If specified, determines the maximum number of messages to + * // return. If unspecified, the service may choose an appropriate + * // default, or may return an arbitrarily large number of results. + * pageSize: 'placeholder-value', + * // If supplied, this should be the value of next_page_token returned + * // by an earlier call. This will cause the next page of results to + * // be returned. + * pageToken: 'placeholder-value', + * // A project id. + * projectId: 'placeholder-value', + * // If specified, return only messages with timestamps >= start_time. + * // The default is the job creation time (i.e. beginning of messages). + * startTime: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoscalingEvents": [], + * // "jobMessages": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.jobs.messages.list * @memberOf! () * @@ -6005,6 +7722,55 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.jobs.snapshots.list * @desc Lists snapshots. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.jobs.snapshots.list({ + * // If specified, list snapshots created from this job. + * jobId: 'placeholder-value', + * // The location to list snapshots in. + * location: 'placeholder-value', + * // The project ID to list snapshots for. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "snapshots": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.jobs.snapshots.list * @memberOf! () * @@ -6111,6 +7877,72 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.jobs.workItems.lease * @desc Leases a dataflow WorkItem to run. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.jobs.workItems.lease({ + * // Identifies the workflow job this worker belongs to. + * jobId: 'placeholder-value', + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * // contains the WorkItem's job. + * location: 'placeholder-value', + * // Identifies the project this worker belongs to. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "currentWorkerTime": "my_currentWorkerTime", + * // "location": "my_location", + * // "requestedLeaseDuration": "my_requestedLeaseDuration", + * // "unifiedWorkerRequest": {}, + * // "workItemTypes": [], + * // "workerCapabilities": [], + * // "workerId": "my_workerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "unifiedWorkerResponse": {}, + * // "workItems": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.jobs.workItems.lease * @memberOf! () * @@ -6190,6 +8022,70 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.jobs.workItems.reportStatus * @desc Reports the status of dataflow WorkItems leased by a worker. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.jobs.workItems.reportStatus({ + * // The job which the WorkItem is part of. + * jobId: 'placeholder-value', + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * // contains the WorkItem's job. + * location: 'placeholder-value', + * // The project which owns the WorkItem's job. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "currentWorkerTime": "my_currentWorkerTime", + * // "location": "my_location", + * // "unifiedWorkerRequest": {}, + * // "workItemStatuses": [], + * // "workerId": "my_workerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "unifiedWorkerResponse": {}, + * // "workItemServiceStates": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.jobs.workItems.reportStatus * @memberOf! () * @@ -6334,6 +8230,53 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.snapshots.delete * @desc Deletes a snapshot. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.snapshots.delete({ + * // The location that contains this snapshot. + * location: 'placeholder-value', + * // The ID of the Cloud Platform project that the snapshot belongs to. + * projectId: 'placeholder-value', + * // The ID of the snapshot. + * snapshotId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.snapshots.delete * @memberOf! () * @@ -6412,6 +8355,63 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.snapshots.get * @desc Gets information about a snapshot. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.snapshots.get({ + * // The location that contains this snapshot. + * location: 'placeholder-value', + * // The ID of the Cloud Platform project that the snapshot belongs to. + * projectId: 'placeholder-value', + * // The ID of the snapshot. + * snapshotId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "diskSizeBytes": "my_diskSizeBytes", + * // "id": "my_id", + * // "projectId": "my_projectId", + * // "pubsubMetadata": [], + * // "sourceJobId": "my_sourceJobId", + * // "state": "my_state", + * // "ttl": "my_ttl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.snapshots.get * @memberOf! () * @@ -6486,6 +8486,55 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.snapshots.list * @desc Lists snapshots. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.snapshots.list({ + * // If specified, list snapshots created from this job. + * jobId: 'placeholder-value', + * // The location to list snapshots in. + * location: 'placeholder-value', + * // The project ID to list snapshots for. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "snapshots": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.snapshots.list * @memberOf! () * @@ -6632,6 +8681,55 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.sql.validate * @desc Validates a GoogleSQL query for Cloud Dataflow syntax. Will always confirm the given query parses correctly, and if able to look up schema information from DataCatalog, will validate that the query analyzes properly as well. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.sql.validate({ + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to + * // which to direct the request. + * location: 'placeholder-value', + * // Required. The ID of the Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // The sql query to validate. + * query: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "errorMessage": "my_errorMessage" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.sql.validate * @memberOf! () * @@ -6736,6 +8834,90 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.templates.create * @desc Creates a Cloud Dataflow job from a template. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.templates.create({ + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to + * // which to direct the request. + * location: 'placeholder-value', + * // Required. The ID of the Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "environment": {}, + * // "gcsPath": "my_gcsPath", + * // "jobName": "my_jobName", + * // "location": "my_location", + * // "parameters": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientRequestId": "my_clientRequestId", + * // "createTime": "my_createTime", + * // "createdFromSnapshotId": "my_createdFromSnapshotId", + * // "currentState": "my_currentState", + * // "currentStateTime": "my_currentStateTime", + * // "environment": {}, + * // "executionInfo": {}, + * // "id": "my_id", + * // "jobMetadata": {}, + * // "labels": {}, + * // "location": "my_location", + * // "name": "my_name", + * // "pipelineDescription": {}, + * // "projectId": "my_projectId", + * // "replaceJobId": "my_replaceJobId", + * // "replacedByJobId": "my_replacedByJobId", + * // "requestedState": "my_requestedState", + * // "stageStates": [], + * // "startTime": "my_startTime", + * // "steps": [], + * // "stepsLocation": "my_stepsLocation", + * // "tempFiles": [], + * // "transformNameMapping": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.templates.create * @memberOf! () * @@ -6810,6 +8992,64 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.templates.get * @desc Get the template associated with a template. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.templates.get({ + * // Required. A Cloud Storage path to the template from which to + * // create the job. + * // Must be valid Cloud Storage URL, beginning with 'gs://'. + * gcsPath: 'placeholder-value', + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to + * // which to direct the request. + * location: 'placeholder-value', + * // Required. The ID of the Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // The view to retrieve. Defaults to METADATA_ONLY. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "metadata": {}, + * // "runtimeMetadata": {}, + * // "status": {}, + * // "templateType": "my_templateType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.templates.get * @memberOf! () * @@ -6887,6 +9127,80 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.locations.templates.launch * @desc Launch a template. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.locations.templates.launch({ + * // Path to dynamic template spec file on GCS. + * // The file must be a Json serialized DynamicTemplateFieSpec object. + * 'dynamicTemplate.gcsPath': 'placeholder-value', + * // Cloud Storage path for staging dependencies. + * // Must be a valid Cloud Storage URL, beginning with `gs://`. + * 'dynamicTemplate.stagingLocation': 'placeholder-value', + * // A Cloud Storage path to the template from which to create + * // the job. + * // Must be valid Cloud Storage URL, beginning with 'gs://'. + * gcsPath: 'placeholder-value', + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to + * // which to direct the request. + * location: 'placeholder-value', + * // Required. The ID of the Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // If true, the request is validated but not actually executed. + * // Defaults to false. + * validateOnly: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "environment": {}, + * // "jobName": "my_jobName", + * // "parameters": {}, + * // "transformNameMapping": {}, + * // "update": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "job": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.locations.templates.launch * @memberOf! () * @@ -7059,6 +9373,63 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.snapshots.get * @desc Gets information about a snapshot. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.snapshots.get({ + * // The location that contains this snapshot. + * location: 'placeholder-value', + * // The ID of the Cloud Platform project that the snapshot belongs to. + * projectId: 'placeholder-value', + * // The ID of the snapshot. + * snapshotId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "diskSizeBytes": "my_diskSizeBytes", + * // "id": "my_id", + * // "projectId": "my_projectId", + * // "pubsubMetadata": [], + * // "sourceJobId": "my_sourceJobId", + * // "state": "my_state", + * // "ttl": "my_ttl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.snapshots.get * @memberOf! () * @@ -7132,6 +9503,55 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.snapshots.list * @desc Lists snapshots. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.snapshots.list({ + * // If specified, list snapshots created from this job. + * jobId: 'placeholder-value', + * // The location to list snapshots in. + * location: 'placeholder-value', + * // The project ID to list snapshots for. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "snapshots": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.snapshots.list * @memberOf! () * @@ -7258,6 +9678,86 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.templates.create * @desc Creates a Cloud Dataflow job from a template. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.templates.create({ + * // Required. The ID of the Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "environment": {}, + * // "gcsPath": "my_gcsPath", + * // "jobName": "my_jobName", + * // "location": "my_location", + * // "parameters": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientRequestId": "my_clientRequestId", + * // "createTime": "my_createTime", + * // "createdFromSnapshotId": "my_createdFromSnapshotId", + * // "currentState": "my_currentState", + * // "currentStateTime": "my_currentStateTime", + * // "environment": {}, + * // "executionInfo": {}, + * // "id": "my_id", + * // "jobMetadata": {}, + * // "labels": {}, + * // "location": "my_location", + * // "name": "my_name", + * // "pipelineDescription": {}, + * // "projectId": "my_projectId", + * // "replaceJobId": "my_replaceJobId", + * // "replacedByJobId": "my_replacedByJobId", + * // "requestedState": "my_requestedState", + * // "stageStates": [], + * // "startTime": "my_startTime", + * // "steps": [], + * // "stepsLocation": "my_stepsLocation", + * // "tempFiles": [], + * // "transformNameMapping": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.templates.create * @memberOf! () * @@ -7331,6 +9831,64 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.templates.get * @desc Get the template associated with a template. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.templates.get({ + * // Required. A Cloud Storage path to the template from which to + * // create the job. + * // Must be valid Cloud Storage URL, beginning with 'gs://'. + * gcsPath: 'placeholder-value', + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to + * // which to direct the request. + * location: 'placeholder-value', + * // Required. The ID of the Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // The view to retrieve. Defaults to METADATA_ONLY. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "metadata": {}, + * // "runtimeMetadata": {}, + * // "status": {}, + * // "templateType": "my_templateType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.templates.get * @memberOf! () * @@ -7408,6 +9966,80 @@ export namespace dataflow_v1b3 { /** * dataflow.projects.templates.launch * @desc Launch a template. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataflow.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 dataflow = google.dataflow('v1b3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.readonly', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 dataflow.projects.templates.launch({ + * // Path to dynamic template spec file on GCS. + * // The file must be a Json serialized DynamicTemplateFieSpec object. + * 'dynamicTemplate.gcsPath': 'placeholder-value', + * // Cloud Storage path for staging dependencies. + * // Must be a valid Cloud Storage URL, beginning with `gs://`. + * 'dynamicTemplate.stagingLocation': 'placeholder-value', + * // A Cloud Storage path to the template from which to create + * // the job. + * // Must be valid Cloud Storage URL, beginning with 'gs://'. + * gcsPath: 'placeholder-value', + * // The [regional endpoint] + * // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to + * // which to direct the request. + * location: 'placeholder-value', + * // Required. The ID of the Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // If true, the request is validated but not actually executed. + * // Defaults to false. + * validateOnly: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "environment": {}, + * // "jobName": "my_jobName", + * // "parameters": {}, + * // "transformNameMapping": {}, + * // "update": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "job": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataflow.projects.templates.launch * @memberOf! () * diff --git a/src/apis/datafusion/v1beta1.ts b/src/apis/datafusion/v1beta1.ts index 5b296a4fc3a..bb8ac52c21b 100644 --- a/src/apis/datafusion/v1beta1.ts +++ b/src/apis/datafusion/v1beta1.ts @@ -537,6 +537,50 @@ export namespace datafusion_v1beta1 { /** * datafusion.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datafusion.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 datafusion = google.datafusion('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datafusion.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datafusion.projects.locations.get * @memberOf! () * @@ -606,6 +650,56 @@ export namespace datafusion_v1beta1 { /** * datafusion.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datafusion.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 datafusion = google.datafusion('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datafusion.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // If true, the returned list will include locations which are not yet + * // revealed. + * includeUnrevealedLocations: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datafusion.projects.locations.list * @memberOf! () * @@ -734,6 +828,82 @@ export namespace datafusion_v1beta1 { /** * datafusion.projects.locations.instances.create * @desc Creates a new Data Fusion instance in the specified project and location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datafusion.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 datafusion = google.datafusion('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datafusion.projects.locations.instances.create({ + * // The name of the instance to create. + * instanceId: 'placeholder-value', + * // The instance's project and location in the format + * // projects/{project}/locations/{location}. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accelerators": [], + * // "apiEndpoint": "my_apiEndpoint", + * // "availableVersion": [], + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "enableStackdriverLogging": false, + * // "enableStackdriverMonitoring": false, + * // "gcsBucket": "my_gcsBucket", + * // "labels": {}, + * // "name": "my_name", + * // "networkConfig": {}, + * // "options": {}, + * // "privateInstance": false, + * // "serviceAccount": "my_serviceAccount", + * // "serviceEndpoint": "my_serviceEndpoint", + * // "state": "my_state", + * // "stateMessage": "my_stateMessage", + * // "type": "my_type", + * // "updateTime": "my_updateTime", + * // "version": "my_version", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datafusion.projects.locations.instances.create * @memberOf! () * @@ -810,6 +980,51 @@ export namespace datafusion_v1beta1 { /** * datafusion.projects.locations.instances.delete * @desc Deletes a single Date Fusion instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datafusion.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 datafusion = google.datafusion('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datafusion.projects.locations.instances.delete({ + * // The instance resource name in the format + * // projects/{project}/locations/{location}/instances/{instance} + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datafusion.projects.locations.instances.delete * @memberOf! () * @@ -881,6 +1096,68 @@ export namespace datafusion_v1beta1 { /** * datafusion.projects.locations.instances.get * @desc Gets details of a single Data Fusion instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datafusion.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 datafusion = google.datafusion('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datafusion.projects.locations.instances.get({ + * // The instance resource name in the format + * // projects/{project}/locations/{location}/instances/{instance}. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accelerators": [], + * // "apiEndpoint": "my_apiEndpoint", + * // "availableVersion": [], + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "enableStackdriverLogging": false, + * // "enableStackdriverMonitoring": false, + * // "gcsBucket": "my_gcsBucket", + * // "labels": {}, + * // "name": "my_name", + * // "networkConfig": {}, + * // "options": {}, + * // "privateInstance": false, + * // "serviceAccount": "my_serviceAccount", + * // "serviceEndpoint": "my_serviceEndpoint", + * // "state": "my_state", + * // "stateMessage": "my_stateMessage", + * // "type": "my_type", + * // "updateTime": "my_updateTime", + * // "version": "my_version", + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datafusion.projects.locations.instances.get * @memberOf! () * @@ -950,6 +1227,59 @@ export namespace datafusion_v1beta1 { /** * datafusion.projects.locations.instances.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datafusion.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 datafusion = google.datafusion('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datafusion.projects.locations.instances.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/my-location/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datafusion.projects.locations.instances.getIamPolicy * @memberOf! () * @@ -1023,6 +1353,60 @@ export namespace datafusion_v1beta1 { /** * datafusion.projects.locations.instances.list * @desc Lists Data Fusion instances in the specified project and location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datafusion.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 datafusion = google.datafusion('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datafusion.projects.locations.instances.list({ + * // List filter. + * filter: 'placeholder-value', + * // Sort results. Supported values are "name", "name desc", or "" (unsorted). + * orderBy: 'placeholder-value', + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value to use if there are additional + * // results to retrieve for this list request. + * pageToken: 'placeholder-value', + * // The project and location for which to retrieve instance information + * // in the format projects/{project}/locations/{location}. If the location is + * // specified as '-' (wildcard), then all regions available to the project + * // are queried, and the results are aggregated. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "instances": [], + * // "nextPageToken": "my_nextPageToken", + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datafusion.projects.locations.instances.list * @memberOf! () * @@ -1103,6 +1487,87 @@ export namespace datafusion_v1beta1 { /** * datafusion.projects.locations.instances.patch * @desc Updates a single Data Fusion instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datafusion.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 datafusion = google.datafusion('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datafusion.projects.locations.instances.patch({ + * // Output only. The name of this instance is in the form of + * // projects/{project}/locations/{location}/instances/{instance}. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * // Field mask is used to specify the fields that the update will overwrite + * // in an instance resource. The fields specified in the update_mask are + * // relative to the resource, not the full request. + * // A field will be overwritten if it is in the mask. + * // If the user does not provide a mask, all the supported fields (labels and + * // options currently) will be overwritten. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accelerators": [], + * // "apiEndpoint": "my_apiEndpoint", + * // "availableVersion": [], + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "enableStackdriverLogging": false, + * // "enableStackdriverMonitoring": false, + * // "gcsBucket": "my_gcsBucket", + * // "labels": {}, + * // "name": "my_name", + * // "networkConfig": {}, + * // "options": {}, + * // "privateInstance": false, + * // "serviceAccount": "my_serviceAccount", + * // "serviceEndpoint": "my_serviceEndpoint", + * // "state": "my_state", + * // "stateMessage": "my_stateMessage", + * // "type": "my_type", + * // "updateTime": "my_updateTime", + * // "version": "my_version", + * // "zone": "my_zone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datafusion.projects.locations.instances.patch * @memberOf! () * @@ -1176,6 +1641,57 @@ export namespace datafusion_v1beta1 { /** * datafusion.projects.locations.instances.restart * @desc Restart a single Data Fusion instance. At the end of an operation instance is fully restarted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datafusion.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 datafusion = google.datafusion('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datafusion.projects.locations.instances.restart({ + * // Name of the Data Fusion instance which need to be restarted in the form of + * // projects/{project}/locations/{location}/instances/{instance} + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datafusion.projects.locations.instances.restart * @memberOf! () * @@ -1251,6 +1767,59 @@ export namespace datafusion_v1beta1 { /** * datafusion.projects.locations.instances.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datafusion.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 datafusion = google.datafusion('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datafusion.projects.locations.instances.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/my-location/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datafusion.projects.locations.instances.setIamPolicy * @memberOf! () * @@ -1324,6 +1893,55 @@ export namespace datafusion_v1beta1 { /** * datafusion.projects.locations.instances.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datafusion.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 datafusion = google.datafusion('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datafusion.projects.locations.instances.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/my-location/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datafusion.projects.locations.instances.testIamPermissions * @memberOf! () * @@ -1406,6 +2024,59 @@ export namespace datafusion_v1beta1 { /** * datafusion.projects.locations.instances.upgrade * @desc Upgrade a single Data Fusion instance. At the end of an operation instance is fully upgraded. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datafusion.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 datafusion = google.datafusion('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datafusion.projects.locations.instances.upgrade({ + * // Name of the Data Fusion instance which need to be upgraded in the form of + * // projects/{project}/locations/{location}/instances/{instance} + * // Instance will be upgraded with the latest stable version of the Data + * // Fusion. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datafusion.projects.locations.instances.upgrade * @memberOf! () * @@ -1667,6 +2338,50 @@ export namespace datafusion_v1beta1 { /** * datafusion.projects.locations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datafusion.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 datafusion = google.datafusion('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datafusion.projects.locations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datafusion.projects.locations.operations.cancel * @memberOf! () * @@ -1740,6 +2455,44 @@ export namespace datafusion_v1beta1 { /** * datafusion.projects.locations.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datafusion.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 datafusion = google.datafusion('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datafusion.projects.locations.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datafusion.projects.locations.operations.delete * @memberOf! () * @@ -1809,6 +2562,50 @@ export namespace datafusion_v1beta1 { /** * datafusion.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datafusion.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 datafusion = google.datafusion('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datafusion.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datafusion.projects.locations.operations.get * @memberOf! () * @@ -1880,6 +2677,53 @@ export namespace datafusion_v1beta1 { /** * datafusion.projects.locations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datafusion.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 datafusion = google.datafusion('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 datafusion.projects.locations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datafusion.projects.locations.operations.list * @memberOf! () * diff --git a/src/apis/dataproc/v1.ts b/src/apis/dataproc/v1.ts index ef4d700d4a2..860b7cd3539 100644 --- a/src/apis/dataproc/v1.ts +++ b/src/apis/dataproc/v1.ts @@ -1698,6 +1698,64 @@ export namespace dataproc_v1 { /** * dataproc.projects.locations.autoscalingPolicies.create * @desc Creates new autoscaling policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.autoscalingPolicies.create({ + * // Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.autoscalingPolicies.create, the resource name of the region has the following format: projects/{project_id}/regions/{region} + * // For projects.locations.autoscalingPolicies.create, the resource name of the location has the following format: projects/{project_id}/locations/{location} + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "basicAlgorithm": {}, + * // "id": "my_id", + * // "name": "my_name", + * // "secondaryWorkerConfig": {}, + * // "workerConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "basicAlgorithm": {}, + * // "id": "my_id", + * // "name": "my_name", + * // "secondaryWorkerConfig": {}, + * // "workerConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.autoscalingPolicies.create * @memberOf! () * @@ -1773,6 +1831,47 @@ export namespace dataproc_v1 { /** * dataproc.projects.locations.autoscalingPolicies.delete * @desc Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.autoscalingPolicies.delete({ + * // Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + * // For projects.locations.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + * name: + * 'projects/my-project/locations/my-location/autoscalingPolicies/my-autoscalingPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.autoscalingPolicies.delete * @memberOf! () * @@ -1842,6 +1941,53 @@ export namespace dataproc_v1 { /** * dataproc.projects.locations.autoscalingPolicies.get * @desc Retrieves autoscaling policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.autoscalingPolicies.get({ + * // Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + * // For projects.locations.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + * name: + * 'projects/my-project/locations/my-location/autoscalingPolicies/my-autoscalingPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "basicAlgorithm": {}, + * // "id": "my_id", + * // "name": "my_name", + * // "secondaryWorkerConfig": {}, + * // "workerConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.autoscalingPolicies.get * @memberOf! () * @@ -1914,56 +2060,58 @@ export namespace dataproc_v1 { * dataproc.projects.locations.autoscalingPolicies.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for - * // the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/autoscalingPolicies/my-autoscaling-policy', // TODO: Update placeholder value. + * const dataproc = google.dataproc('v1'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * dataproc.projects.locations.autoscalingPolicies.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * // 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 dataproc.projects.locations.autoscalingPolicies.getIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/autoscalingPolicies/my-autoscalingPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.locations.autoscalingPolicies.getIamPolicy * @memberOf! () * @@ -2037,6 +2185,53 @@ export namespace dataproc_v1 { /** * dataproc.projects.locations.autoscalingPolicies.list * @desc Lists autoscaling policies in the project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.autoscalingPolicies.list({ + * // Optional. The maximum number of results to return in each response. Must be less than or equal to 1000. Defaults to 100. + * pageSize: 'placeholder-value', + * // Optional. The page token, returned by a previous call, to request the next page of results. + * pageToken: 'placeholder-value', + * // Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.autoscalingPolicies.list, the resource name of the region has the following format: projects/{project_id}/regions/{region} + * // For projects.locations.autoscalingPolicies.list, the resource name of the location has the following format: projects/{project_id}/locations/{location} + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "policies": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.autoscalingPolicies.list * @memberOf! () * @@ -2123,56 +2318,58 @@ export namespace dataproc_v1 { * dataproc.projects.locations.autoscalingPolicies.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for - * // the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/autoscalingPolicies/my-autoscaling-policy', // TODO: Update placeholder value. + * const dataproc = google.dataproc('v1'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * dataproc.projects.locations.autoscalingPolicies.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * // 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 dataproc.projects.locations.autoscalingPolicies.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/autoscalingPolicies/my-autoscalingPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.locations.autoscalingPolicies.setIamPolicy * @memberOf! () * @@ -2247,56 +2444,56 @@ export namespace dataproc_v1 { * dataproc.projects.locations.autoscalingPolicies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy detail is being requested. See the operation - * // documentation for the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/autoscalingPolicies/my-autoscaling-policy', // TODO: Update placeholder value. + * const dataproc = google.dataproc('v1'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * dataproc.projects.locations.autoscalingPolicies.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * // 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 dataproc.projects.locations.autoscalingPolicies.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/autoscalingPolicies/my-autoscalingPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, * } + * ); + * console.log(res.data); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.locations.autoscalingPolicies.testIamPermissions * @memberOf! () * @@ -2379,6 +2576,65 @@ export namespace dataproc_v1 { /** * dataproc.projects.locations.autoscalingPolicies.update * @desc Updates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.autoscalingPolicies.update({ + * // Output only. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + * // For projects.locations.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + * name: + * 'projects/my-project/locations/my-location/autoscalingPolicies/my-autoscalingPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "basicAlgorithm": {}, + * // "id": "my_id", + * // "name": "my_name", + * // "secondaryWorkerConfig": {}, + * // "workerConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "basicAlgorithm": {}, + * // "id": "my_id", + * // "name": "my_name", + * // "secondaryWorkerConfig": {}, + * // "workerConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.autoscalingPolicies.update * @memberOf! () * @@ -2589,57 +2845,71 @@ export namespace dataproc_v1 { * dataproc.projects.locations.workflowTemplates.create * @desc Creates new workflow template. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // Required. The "resource name" of the region, as described in - * // https://cloud.google.com/apis/design/resource_names of the form - * // projects/{project_id}/regions/{region} - * parent: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 dataproc.projects.locations.workflowTemplates.create({ + * // Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates,create, the resource name of the region has the following format: projects/{project_id}/regions/{region} + * // For projects.locations.workflowTemplates.create, the resource name of the location has the following format: projects/{project_id}/locations/{location} + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.locations.workflowTemplates.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.locations.workflowTemplates.create * @memberOf! () * @@ -2716,50 +2986,48 @@ export namespace dataproc_v1 { * dataproc.projects.locations.workflowTemplates.delete * @desc Deletes a workflow template. It does not cancel in-progress workflows. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The "resource name" of the workflow template, as described in - * // https://cloud.google.com/apis/design/resource_names of the form - * // projects/{project_id}/regions/{region}/workflowTemplates/{template_id} - * name: 'projects/my-project/locations/my-location/workflowTemplates/my-workflow-template', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dataproc.projects.locations.workflowTemplates.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * const dataproc = google.dataproc('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/cloud-platform'], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 dataproc.projects.locations.workflowTemplates.delete({ + * // Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates.delete, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * // For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} + * name: + * 'projects/my-project/locations/my-location/workflowTemplates/my-workflowTemplate', + * // Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version. + * version: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.workflowTemplates.delete * @memberOf! () * @@ -2831,53 +3099,58 @@ export namespace dataproc_v1 { * dataproc.projects.locations.workflowTemplates.get * @desc Retrieves the latest workflow template.Can retrieve previously instantiated template by specifying optional version parameter. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The "resource name" of the workflow template, as described in - * // https://cloud.google.com/apis/design/resource_names of the form - * // projects/{project_id}/regions/{region}/workflowTemplates/{template_id} - * name: 'projects/my-project/locations/my-location/workflowTemplates/my-workflow-template', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dataproc.projects.locations.workflowTemplates.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * const dataproc = google.dataproc('v1'); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * 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/cloud-platform'], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 dataproc.projects.locations.workflowTemplates.get({ + * // Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * // For projects.locations.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} + * name: + * 'projects/my-project/locations/my-location/workflowTemplates/my-workflowTemplate', + * // Optional. The version of workflow template to retrieve. Only previously instantiated versions can be retrieved.If unspecified, retrieves the current version. + * version: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.workflowTemplates.get * @memberOf! () * @@ -2951,56 +3224,56 @@ export namespace dataproc_v1 { * dataproc.projects.locations.workflowTemplates.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for - * // the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/workflowTemplates/my-workflow-template', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 dataproc.projects.locations.workflowTemplates.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/workflowTemplates/my-workflowTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.locations.workflowTemplates.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.locations.workflowTemplates.getIamPolicy * @memberOf! () * @@ -3075,57 +3348,62 @@ export namespace dataproc_v1 { * dataproc.projects.locations.workflowTemplates.instantiate * @desc Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // Required. The "resource name" of the workflow template, as described in - * // https://cloud.google.com/apis/design/resource_names of the form - * // projects/{project_id}/regions/{region}/workflowTemplates/{template_id} - * name: 'projects/my-project/locations/my-location/workflowTemplates/my-workflow-template', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 dataproc.projects.locations.workflowTemplates.instantiate({ + * // Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * // For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} + * name: + * 'projects/my-project/locations/my-location/workflowTemplates/my-workflowTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parameters": {}, + * // "requestId": "my_requestId", + * // "version": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.locations.workflowTemplates.instantiate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.locations.workflowTemplates.instantiate * @memberOf! () * @@ -3202,57 +3480,71 @@ export namespace dataproc_v1 { * dataproc.projects.locations.workflowTemplates.instantiateInline * @desc Instantiates a template and begins execution.This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The "resource name" of the workflow template region, as described in - * // https://cloud.google.com/apis/design/resource_names of the form - * // projects/{project_id}/regions/{region} - * parent: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. + * const dataproc = google.dataproc('v1'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * dataproc.projects.locations.workflowTemplates.instantiateInline(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * // 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 dataproc.projects.locations.workflowTemplates.instantiateInline( + * { + * // Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates,instantiateinline, the resource name of the region has the following format: projects/{project_id}/regions/{region} + * // For projects.locations.workflowTemplates.instantiateinline, the resource name of the location has the following format: projects/{project_id}/locations/{location} + * parent: 'projects/my-project/locations/my-location', + * // Optional. A tag that prevents multiple concurrent workflow instances with the same tag from running. This mitigates risk of concurrent instances started due to retries.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * }, * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.locations.workflowTemplates.instantiateInline * @memberOf! () * @@ -3329,66 +3621,52 @@ export namespace dataproc_v1 { * dataproc.projects.locations.workflowTemplates.list * @desc Lists workflows that match the specified filter in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The "resource name" of the region, as described in - * // https://cloud.google.com/apis/design/resource_names of the form - * // projects/{project_id}/regions/{region} - * parent: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * const dataproc = google.dataproc('v1'); * - * var templatesPage = response['templates']; - * if (!templatesPage) { - * return; - * } - * for (var i = 0; i < templatesPage.length; i++) { - * // TODO: Change code below to process each resource in `templatesPage`: - * console.log(JSON.stringify(templatesPage[i], null, 2)); - * } + * 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/cloud-platform'], + * }); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dataproc.projects.locations.workflowTemplates.list(request, handlePage); - * } - * }; + * // 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 dataproc.projects.locations.workflowTemplates.list({ + * // Optional. The maximum number of results to return in each response. + * pageSize: 'placeholder-value', + * // Optional. The page token, returned by a previous call, to request the next page of results. + * pageToken: 'placeholder-value', + * // Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates,list, the resource name of the region has the following format: projects/{project_id}/regions/{region} + * // For projects.locations.workflowTemplates.list, the resource name of the location has the following format: projects/{project_id}/locations/{location} + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "templates": [] + * // } + * } * - * dataproc.projects.locations.workflowTemplates.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.locations.workflowTemplates.list * @memberOf! () * @@ -3475,56 +3753,56 @@ export namespace dataproc_v1 { * dataproc.projects.locations.workflowTemplates.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for - * // the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/workflowTemplates/my-workflow-template', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 dataproc.projects.locations.workflowTemplates.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/workflowTemplates/my-workflowTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.locations.workflowTemplates.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.locations.workflowTemplates.setIamPolicy * @memberOf! () * @@ -3599,56 +3877,56 @@ export namespace dataproc_v1 { * dataproc.projects.locations.workflowTemplates.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy detail is being requested. See the operation - * // documentation for the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/workflowTemplates/my-workflow-template', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * const dataproc = google.dataproc('v1'); * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * dataproc.projects.locations.workflowTemplates.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * // 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 dataproc.projects.locations.workflowTemplates.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/workflowTemplates/my-workflowTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, * } + * ); + * console.log(res.data); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.locations.workflowTemplates.testIamPermissions * @memberOf! () * @@ -3732,58 +4010,72 @@ export namespace dataproc_v1 { * dataproc.projects.locations.workflowTemplates.update * @desc Updates (replaces) workflow template. The updated template must contain version that matches the current server version. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Output only. The "resource name" of the template, as described in - * // https://cloud.google.com/apis/design/resource_names of the form - * // projects/{project_id}/regions/{region}/workflowTemplates/{template_id} - * name: 'projects/my-project/locations/my-location/workflowTemplates/my-workflow-template', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. - * }, + * const dataproc = google.dataproc('v1'); * - * auth: authClient, - * }; - * - * dataproc.projects.locations.workflowTemplates.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * 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/cloud-platform'], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 dataproc.projects.locations.workflowTemplates.update({ + * // Output only. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * // For projects.locations.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} + * name: + * 'projects/my-project/locations/my-location/workflowTemplates/my-workflowTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.workflowTemplates.update * @memberOf! () * @@ -4060,6 +4352,64 @@ export namespace dataproc_v1 { /** * dataproc.projects.regions.autoscalingPolicies.create * @desc Creates new autoscaling policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.autoscalingPolicies.create({ + * // Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.autoscalingPolicies.create, the resource name of the region has the following format: projects/{project_id}/regions/{region} + * // For projects.locations.autoscalingPolicies.create, the resource name of the location has the following format: projects/{project_id}/locations/{location} + * parent: 'projects/my-project/regions/my-region', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "basicAlgorithm": {}, + * // "id": "my_id", + * // "name": "my_name", + * // "secondaryWorkerConfig": {}, + * // "workerConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "basicAlgorithm": {}, + * // "id": "my_id", + * // "name": "my_name", + * // "secondaryWorkerConfig": {}, + * // "workerConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.autoscalingPolicies.create * @memberOf! () * @@ -4135,6 +4485,47 @@ export namespace dataproc_v1 { /** * dataproc.projects.regions.autoscalingPolicies.delete * @desc Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.autoscalingPolicies.delete({ + * // Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + * // For projects.locations.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + * name: + * 'projects/my-project/regions/my-region/autoscalingPolicies/my-autoscalingPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.autoscalingPolicies.delete * @memberOf! () * @@ -4204,6 +4595,53 @@ export namespace dataproc_v1 { /** * dataproc.projects.regions.autoscalingPolicies.get * @desc Retrieves autoscaling policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.autoscalingPolicies.get({ + * // Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + * // For projects.locations.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + * name: + * 'projects/my-project/regions/my-region/autoscalingPolicies/my-autoscalingPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "basicAlgorithm": {}, + * // "id": "my_id", + * // "name": "my_name", + * // "secondaryWorkerConfig": {}, + * // "workerConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.autoscalingPolicies.get * @memberOf! () * @@ -4276,56 +4714,56 @@ export namespace dataproc_v1 { * dataproc.projects.regions.autoscalingPolicies.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for - * // the appropriate value for this field. - * resource_: 'projects/my-project/regions/my-region/autoscalingPolicies/my-autoscaling-policy', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 dataproc.projects.regions.autoscalingPolicies.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/regions/my-region/autoscalingPolicies/my-autoscalingPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.autoscalingPolicies.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.autoscalingPolicies.getIamPolicy * @memberOf! () * @@ -4399,6 +4837,53 @@ export namespace dataproc_v1 { /** * dataproc.projects.regions.autoscalingPolicies.list * @desc Lists autoscaling policies in the project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.autoscalingPolicies.list({ + * // Optional. The maximum number of results to return in each response. Must be less than or equal to 1000. Defaults to 100. + * pageSize: 'placeholder-value', + * // Optional. The page token, returned by a previous call, to request the next page of results. + * pageToken: 'placeholder-value', + * // Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.autoscalingPolicies.list, the resource name of the region has the following format: projects/{project_id}/regions/{region} + * // For projects.locations.autoscalingPolicies.list, the resource name of the location has the following format: projects/{project_id}/locations/{location} + * parent: 'projects/my-project/regions/my-region', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "policies": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.autoscalingPolicies.list * @memberOf! () * @@ -4485,56 +4970,56 @@ export namespace dataproc_v1 { * dataproc.projects.regions.autoscalingPolicies.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for - * // the appropriate value for this field. - * resource_: 'projects/my-project/regions/my-region/autoscalingPolicies/my-autoscaling-policy', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 dataproc.projects.regions.autoscalingPolicies.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/regions/my-region/autoscalingPolicies/my-autoscalingPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.autoscalingPolicies.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.autoscalingPolicies.setIamPolicy * @memberOf! () * @@ -4609,56 +5094,56 @@ export namespace dataproc_v1 { * dataproc.projects.regions.autoscalingPolicies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy detail is being requested. See the operation - * // documentation for the appropriate value for this field. - * resource_: 'projects/my-project/regions/my-region/autoscalingPolicies/my-autoscaling-policy', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * const dataproc = google.dataproc('v1'); * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * dataproc.projects.regions.autoscalingPolicies.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * // 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 dataproc.projects.regions.autoscalingPolicies.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/regions/my-region/autoscalingPolicies/my-autoscalingPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, * } + * ); + * console.log(res.data); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.autoscalingPolicies.testIamPermissions * @memberOf! () * @@ -4741,6 +5226,65 @@ export namespace dataproc_v1 { /** * dataproc.projects.regions.autoscalingPolicies.update * @desc Updates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.autoscalingPolicies.update({ + * // Output only. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + * // For projects.locations.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + * name: + * 'projects/my-project/regions/my-region/autoscalingPolicies/my-autoscalingPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "basicAlgorithm": {}, + * // "id": "my_id", + * // "name": "my_name", + * // "secondaryWorkerConfig": {}, + * // "workerConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "basicAlgorithm": {}, + * // "id": "my_id", + * // "name": "my_name", + * // "secondaryWorkerConfig": {}, + * // "workerConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.autoscalingPolicies.update * @memberOf! () * @@ -4951,58 +5495,68 @@ export namespace dataproc_v1 { * dataproc.projects.regions.clusters.create * @desc Creates a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the cluster belongs to. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await dataproc.projects.regions.clusters.create({ + * // Required. The ID of the Google Cloud Platform project that the cluster belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * // Optional. A unique id used to identify the request. If the server receives two CreateClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterName": "my_clusterName", + * // "clusterUuid": "my_clusterUuid", + * // "config": {}, + * // "labels": {}, + * // "metrics": {}, + * // "projectId": "my_projectId", + * // "status": {}, + * // "statusHistory": [] + * // } * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.clusters.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.clusters.create * @memberOf! () * @@ -5080,57 +5634,57 @@ export namespace dataproc_v1 { * dataproc.projects.regions.clusters.delete * @desc Deletes a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the cluster belongs to. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. + * // 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 dataproc.projects.regions.clusters.delete({ * // Required. The cluster name. - * clusterName: 'my-cluster-name', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.clusters.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * clusterName: 'placeholder-value', + * // Optional. Specifying the cluster_uuid means the RPC should fail (with error NOT_FOUND) if cluster with specified UUID does not exist. + * clusterUuid: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project that the cluster belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * // Optional. A unique id used to identify the request. If the server receives two DeleteClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. + * requestId: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.clusters.delete * @memberOf! () * @@ -5210,61 +5764,59 @@ export namespace dataproc_v1 { * dataproc.projects.regions.clusters.diagnose * @desc Gets cluster diagnostic information. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). After the operation completes, Operation.response contains DiagnoseClusterResults (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the cluster belongs to. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. + * // 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 dataproc.projects.regions.clusters.diagnose({ * // Required. The cluster name. - * clusterName: 'my-cluster-name', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * clusterName: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project that the cluster belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.clusters.diagnose(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.clusters.diagnose * @memberOf! () * @@ -5343,57 +5895,56 @@ export namespace dataproc_v1 { * dataproc.projects.regions.clusters.get * @desc Gets the resource representation for a cluster in a project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the cluster belongs to. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. + * // 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 dataproc.projects.regions.clusters.get({ * // Required. The cluster name. - * clusterName: 'my-cluster-name', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.clusters.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * clusterName: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project that the cluster belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterName": "my_clusterName", + * // "clusterUuid": "my_clusterUuid", + * // "config": {}, + * // "labels": {}, + * // "metrics": {}, + * // "projectId": "my_projectId", + * // "status": {}, + * // "statusHistory": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.clusters.get * @memberOf! () * @@ -5469,56 +6020,55 @@ export namespace dataproc_v1 { * dataproc.projects.regions.clusters.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for - * // the appropriate value for this field. - * resource_: 'projects/my-project/regions/my-region/clusters/my-cluster', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 dataproc.projects.regions.clusters.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/regions/my-region/clusters/my-cluster', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.clusters.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.clusters.getIamPolicy * @memberOf! () * @@ -5593,67 +6143,54 @@ export namespace dataproc_v1 { * dataproc.projects.regions.clusters.list * @desc Lists all regions/{region}/clusters in a project alphabetically. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the cluster belongs to. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * const dataproc = google.dataproc('v1'); * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * 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/cloud-platform'], + * }); * - * var clustersPage = response['clusters']; - * if (!clustersPage) { - * return; - * } - * for (var i = 0; i < clustersPage.length; i++) { - * // TODO: Change code below to process each resource in `clustersPage`: - * console.log(JSON.stringify(clustersPage[i], null, 2)); - * } + * // 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 dataproc.projects.regions.clusters.list({ + * // Optional. A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE contains the DELETING and ERROR states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND clusterName = mycluster AND labels.env = staging AND labels.starred = * + * filter: 'placeholder-value', + * // Optional. The standard List page size. + * pageSize: 'placeholder-value', + * // Optional. The standard List page token. + * pageToken: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project that the cluster belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * }); + * console.log(res.data); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dataproc.projects.regions.clusters.list(request, handlePage); - * } - * }; + * // Example response + * // { + * // "clusters": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } * - * dataproc.projects.regions.clusters.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.clusters.list * @memberOf! () * @@ -5734,62 +6271,90 @@ export namespace dataproc_v1 { * dataproc.projects.regions.clusters.patch * @desc Updates a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project the cluster belongs to. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. + * // 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 dataproc.projects.regions.clusters.patch({ * // Required. The cluster name. - * clusterName: 'my-cluster-name', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * clusterName: 'placeholder-value', + * // Optional. Timeout for graceful YARN decomissioning. Graceful decommissioning allows removing nodes from the cluster without interrupting jobs in progress. Timeout specifies how long to wait for jobs in progress to finish before forcefully removing nodes (and potentially interrupting jobs). Default timeout is 0 (for forceful decommission), and the maximum allowed timeout is 1 day. (see JSON representation of Duration (https://developers.google.com/protocol-buffers/docs/proto3#json)).Only supported on Dataproc image versions 1.2 and higher. + * gracefulDecommissionTimeout: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project the cluster belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * // Optional. A unique id used to identify the request. If the server receives two UpdateClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. + * requestId: 'placeholder-value', + * // Required. Specifies the path, relative to Cluster, of the field to update. For example, to change the number of workers in a cluster to 5, the update_mask parameter would be specified as config.worker_config.num_instances, and the PATCH request body would specify the new value, as follows: + * // { + * // "config":{ + * // "workerConfig":{ + * // "numInstances":"5" + * // } + * // } + * // } + * // Similarly, to change the number of preemptible workers in a cluster to 5, the update_mask parameter would be config.secondary_worker_config.num_instances, and the PATCH request body would be set as follows: + * // { + * // "config":{ + * // "secondaryWorkerConfig":{ + * // "numInstances":"5" + * // } + * // } + * // } + * // Note: Currently, only the following fields can be updated:
                          Mask Purpose
                          labels Update labels
                          config.worker_config.num_instances Resize primary worker group
                          config.secondary_worker_config.num_instances Resize secondary worker group
                          config.autoscaling_config.policy_uriUse, stop using, or change autoscaling policies
                          + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterName": "my_clusterName", + * // "clusterUuid": "my_clusterUuid", + * // "config": {}, + * // "labels": {}, + * // "metrics": {}, + * // "projectId": "my_projectId", + * // "status": {}, + * // "statusHistory": [] + * // } * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.clusters.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.clusters.patch * @memberOf! () * @@ -5871,56 +6436,55 @@ export namespace dataproc_v1 { * dataproc.projects.regions.clusters.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for - * // the appropriate value for this field. - * resource_: 'projects/my-project/regions/my-region/clusters/my-cluster', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 dataproc.projects.regions.clusters.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/regions/my-region/clusters/my-cluster', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.clusters.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.clusters.setIamPolicy * @memberOf! () * @@ -5995,56 +6559,53 @@ export namespace dataproc_v1 { * dataproc.projects.regions.clusters.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy detail is being requested. See the operation - * // documentation for the appropriate value for this field. - * resource_: 'projects/my-project/regions/my-region/clusters/my-cluster', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 dataproc.projects.regions.clusters.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/regions/my-region/clusters/my-cluster', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * dataproc.projects.regions.clusters.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.clusters.testIamPermissions * @memberOf! () * @@ -6350,61 +6911,73 @@ export namespace dataproc_v1 { * dataproc.projects.regions.jobs.cancel * @desc Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list (https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) or regions/{region}/jobs.get (https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get). * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the job belongs to. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. + * // 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 dataproc.projects.regions.jobs.cancel({ * // Required. The job ID. - * jobId: 'my-job-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * jobId: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.jobs.cancel(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "driverControlFilesUri": "my_driverControlFilesUri", + * // "driverOutputResourceUri": "my_driverOutputResourceUri", + * // "hadoopJob": {}, + * // "hiveJob": {}, + * // "jobUuid": "my_jobUuid", + * // "labels": {}, + * // "pigJob": {}, + * // "placement": {}, + * // "prestoJob": {}, + * // "pysparkJob": {}, + * // "reference": {}, + * // "scheduling": {}, + * // "sparkJob": {}, + * // "sparkRJob": {}, + * // "sparkSqlJob": {}, + * // "status": {}, + * // "statusHistory": [], + * // "yarnApplications": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.jobs.cancel * @memberOf! () * @@ -6481,54 +7054,47 @@ export namespace dataproc_v1 { * dataproc.projects.regions.jobs.delete * @desc Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the job belongs to. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. + * // 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 dataproc.projects.regions.jobs.delete({ * // Required. The job ID. - * jobId: 'my-job-id', // TODO: Update placeholder value. + * jobId: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * dataproc.projects.regions.jobs.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.jobs.delete * @memberOf! () * @@ -6603,57 +7169,67 @@ export namespace dataproc_v1 { * dataproc.projects.regions.jobs.get * @desc Gets the resource representation for a job in a project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the job belongs to. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. + * // 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 dataproc.projects.regions.jobs.get({ * // Required. The job ID. - * jobId: 'my-job-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.jobs.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * jobId: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "driverControlFilesUri": "my_driverControlFilesUri", + * // "driverOutputResourceUri": "my_driverOutputResourceUri", + * // "hadoopJob": {}, + * // "hiveJob": {}, + * // "jobUuid": "my_jobUuid", + * // "labels": {}, + * // "pigJob": {}, + * // "placement": {}, + * // "prestoJob": {}, + * // "pysparkJob": {}, + * // "reference": {}, + * // "scheduling": {}, + * // "sparkJob": {}, + * // "sparkRJob": {}, + * // "sparkSqlJob": {}, + * // "status": {}, + * // "statusHistory": [], + * // "yarnApplications": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.jobs.get * @memberOf! () * @@ -6728,56 +7304,55 @@ export namespace dataproc_v1 { * dataproc.projects.regions.jobs.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for - * // the appropriate value for this field. - * resource_: 'projects/my-project/regions/my-region/jobs/my-job', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 dataproc.projects.regions.jobs.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/regions/my-region/jobs/my-job', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.jobs.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.jobs.getIamPolicy * @memberOf! () * @@ -6852,67 +7427,58 @@ export namespace dataproc_v1 { * dataproc.projects.regions.jobs.list * @desc Lists regions/{region}/jobs in a project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the job belongs to. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. + * const dataproc = google.dataproc('v1'); * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * 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/cloud-platform'], + * }); * - * var jobsPage = response['jobs']; - * if (!jobsPage) { - * return; - * } - * for (var i = 0; i < jobsPage.length; i++) { - * // TODO: Change code below to process each resource in `jobsPage`: - * console.log(JSON.stringify(jobsPage[i], null, 2)); - * } + * // 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 dataproc.projects.regions.jobs.list({ + * // Optional. If set, the returned jobs list includes only jobs that were submitted to the named cluster. + * clusterName: 'placeholder-value', + * // Optional. A filter constraining the jobs to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is status.state or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be either ACTIVE or NON_ACTIVE. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND labels.env = staging AND labels.starred = * + * filter: 'placeholder-value', + * // Optional. Specifies enumerated categories of jobs to list. (default = match ALL jobs).If filter is provided, jobStateMatcher will be ignored. + * jobStateMatcher: 'placeholder-value', + * // Optional. The number of results to return in each response. + * pageSize: 'placeholder-value', + * // Optional. The page token, returned by a previous call, to request the next page of results. + * pageToken: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * }); + * console.log(res.data); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dataproc.projects.regions.jobs.list(request, handlePage); - * } - * }; + * // Example response + * // { + * // "jobs": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } * - * dataproc.projects.regions.jobs.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.jobs.list * @memberOf! () * @@ -6993,62 +7559,95 @@ export namespace dataproc_v1 { * dataproc.projects.regions.jobs.patch * @desc Updates a job in a project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the job belongs to. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. + * // 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 dataproc.projects.regions.jobs.patch({ * // Required. The job ID. - * jobId: 'my-job-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * jobId: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * // Required. Specifies the path, relative to Job, of the field to update. For example, to update the labels of a Job the update_mask parameter would be specified as labels, and the PATCH request body would specify the new value. Note: Currently, labels is the only field that can be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "done": false, + * // "driverControlFilesUri": "my_driverControlFilesUri", + * // "driverOutputResourceUri": "my_driverOutputResourceUri", + * // "hadoopJob": {}, + * // "hiveJob": {}, + * // "jobUuid": "my_jobUuid", + * // "labels": {}, + * // "pigJob": {}, + * // "placement": {}, + * // "prestoJob": {}, + * // "pysparkJob": {}, + * // "reference": {}, + * // "scheduling": {}, + * // "sparkJob": {}, + * // "sparkRJob": {}, + * // "sparkSqlJob": {}, + * // "status": {}, + * // "statusHistory": [], + * // "yarnApplications": [] + * // } * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.jobs.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "driverControlFilesUri": "my_driverControlFilesUri", + * // "driverOutputResourceUri": "my_driverOutputResourceUri", + * // "hadoopJob": {}, + * // "hiveJob": {}, + * // "jobUuid": "my_jobUuid", + * // "labels": {}, + * // "pigJob": {}, + * // "placement": {}, + * // "prestoJob": {}, + * // "pysparkJob": {}, + * // "reference": {}, + * // "scheduling": {}, + * // "sparkJob": {}, + * // "sparkRJob": {}, + * // "sparkSqlJob": {}, + * // "status": {}, + * // "statusHistory": [], + * // "yarnApplications": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.jobs.patch * @memberOf! () * @@ -7125,56 +7724,55 @@ export namespace dataproc_v1 { * dataproc.projects.regions.jobs.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for - * // the appropriate value for this field. - * resource_: 'projects/my-project/regions/my-region/jobs/my-job', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 dataproc.projects.regions.jobs.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/regions/my-region/jobs/my-job', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.jobs.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.jobs.setIamPolicy * @memberOf! () * @@ -7249,58 +7847,74 @@ export namespace dataproc_v1 { * dataproc.projects.regions.jobs.submit * @desc Submits a job to a cluster. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the job belongs to. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await dataproc.projects.regions.jobs.submit({ + * // Required. The ID of the Google Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "job": {}, + * // "requestId": "my_requestId" + * // } * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.jobs.submit(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "driverControlFilesUri": "my_driverControlFilesUri", + * // "driverOutputResourceUri": "my_driverOutputResourceUri", + * // "hadoopJob": {}, + * // "hiveJob": {}, + * // "jobUuid": "my_jobUuid", + * // "labels": {}, + * // "pigJob": {}, + * // "placement": {}, + * // "prestoJob": {}, + * // "pysparkJob": {}, + * // "reference": {}, + * // "scheduling": {}, + * // "sparkJob": {}, + * // "sparkRJob": {}, + * // "sparkSqlJob": {}, + * // "status": {}, + * // "statusHistory": [], + * // "yarnApplications": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.jobs.submit * @memberOf! () * @@ -7374,6 +7988,61 @@ export namespace dataproc_v1 { /** * dataproc.projects.regions.jobs.submitAsOperation * @desc Submits job to a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.jobs.submitAsOperation({ + * // Required. The ID of the Google Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "job": {}, + * // "requestId": "my_requestId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.jobs.submitAsOperation * @memberOf! () * @@ -7451,56 +8120,53 @@ export namespace dataproc_v1 { * dataproc.projects.regions.jobs.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy detail is being requested. See the operation - * // documentation for the appropriate value for this field. - * resource_: 'projects/my-project/regions/my-region/jobs/my-job', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 dataproc.projects.regions.jobs.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/regions/my-region/jobs/my-job', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * dataproc.projects.regions.jobs.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.jobs.testIamPermissions * @memberOf! () * @@ -7815,48 +8481,43 @@ export namespace dataproc_v1 { * dataproc.projects.regions.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource to be cancelled. - * name: 'projects/my-project/regions/my-region/operations/my-operation', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * dataproc.projects.regions.operations.cancel(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await dataproc.projects.regions.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/regions/my-region/operations/my-operation', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.operations.cancel * @memberOf! () * @@ -7927,48 +8588,43 @@ export namespace dataproc_v1 { * dataproc.projects.regions.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource to be deleted. - * name: 'projects/my-project/regions/my-region/operations/my-operation', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * dataproc.projects.regions.operations.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await dataproc.projects.regions.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/regions/my-region/operations/my-operation', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.operations.delete * @memberOf! () * @@ -8039,51 +8695,49 @@ export namespace dataproc_v1 { * dataproc.projects.regions.operations.get * @desc 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. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource. - * name: 'projects/my-project/regions/my-region/operations/my-operation', // TODO: Update placeholder value. + * const dataproc = google.dataproc('v1'); * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * dataproc.projects.regions.operations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await dataproc.projects.regions.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/regions/my-region/operations/my-operation', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.operations.get * @memberOf! () * @@ -8156,56 +8810,55 @@ export namespace dataproc_v1 { * dataproc.projects.regions.operations.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for - * // the appropriate value for this field. - * resource_: 'projects/my-project/regions/my-region/operations/my-operation', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 dataproc.projects.regions.operations.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/regions/my-region/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.operations.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.operations.getIamPolicy * @memberOf! () * @@ -8280,64 +8933,52 @@ export namespace dataproc_v1 { * dataproc.projects.regions.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/x/operations. To override the binding, API services can add a binding such as "/v1/{name=users/x}/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // The name of the operation's parent resource. - * name: 'projects/my-project/regions/my-region/operations', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * var operationsPage = response['operations']; - * if (!operationsPage) { - * return; - * } - * for (var i = 0; i < operationsPage.length; i++) { - * // TODO: Change code below to process each resource in `operationsPage`: - * console.log(JSON.stringify(operationsPage[i], null, 2)); - * } + * // Do the magic + * const res = await dataproc.projects.regions.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/regions/my-region/operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dataproc.projects.regions.operations.list(request, handlePage); - * } - * }; + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } * - * dataproc.projects.regions.operations.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.operations.list * @memberOf! () * @@ -8415,56 +9056,55 @@ export namespace dataproc_v1 { * dataproc.projects.regions.operations.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for - * // the appropriate value for this field. - * resource_: 'projects/my-project/regions/my-region/operations/my-operation', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 dataproc.projects.regions.operations.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/regions/my-region/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.operations.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.operations.setIamPolicy * @memberOf! () * @@ -8539,56 +9179,53 @@ export namespace dataproc_v1 { * dataproc.projects.regions.operations.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy detail is being requested. See the operation - * // documentation for the appropriate value for this field. - * resource_: 'projects/my-project/regions/my-region/operations/my-operation', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 dataproc.projects.regions.operations.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/regions/my-region/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * dataproc.projects.regions.operations.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.operations.testIamPermissions * @memberOf! () * @@ -8791,57 +9428,71 @@ export namespace dataproc_v1 { * dataproc.projects.regions.workflowTemplates.create * @desc Creates new workflow template. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // Required. The "resource name" of the region, as described in - * // https://cloud.google.com/apis/design/resource_names of the form - * // projects/{project_id}/regions/{region} - * parent: 'projects/my-project/regions/my-region', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 dataproc.projects.regions.workflowTemplates.create({ + * // Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates,create, the resource name of the region has the following format: projects/{project_id}/regions/{region} + * // For projects.locations.workflowTemplates.create, the resource name of the location has the following format: projects/{project_id}/locations/{location} + * parent: 'projects/my-project/regions/my-region', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.workflowTemplates.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.workflowTemplates.create * @memberOf! () * @@ -8918,50 +9569,48 @@ export namespace dataproc_v1 { * dataproc.projects.regions.workflowTemplates.delete * @desc Deletes a workflow template. It does not cancel in-progress workflows. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The "resource name" of the workflow template, as described in - * // https://cloud.google.com/apis/design/resource_names of the form - * // projects/{project_id}/regions/{region}/workflowTemplates/{template_id} - * name: 'projects/my-project/regions/my-region/workflowTemplates/my-workflow-template', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.workflowTemplates.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * const dataproc = google.dataproc('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/cloud-platform'], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 dataproc.projects.regions.workflowTemplates.delete({ + * // Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates.delete, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * // For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} + * name: + * 'projects/my-project/regions/my-region/workflowTemplates/my-workflowTemplate', + * // Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version. + * version: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.workflowTemplates.delete * @memberOf! () * @@ -9033,53 +9682,58 @@ export namespace dataproc_v1 { * dataproc.projects.regions.workflowTemplates.get * @desc Retrieves the latest workflow template.Can retrieve previously instantiated template by specifying optional version parameter. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The "resource name" of the workflow template, as described in - * // https://cloud.google.com/apis/design/resource_names of the form - * // projects/{project_id}/regions/{region}/workflowTemplates/{template_id} - * name: 'projects/my-project/regions/my-region/workflowTemplates/my-workflow-template', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.workflowTemplates.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * const dataproc = google.dataproc('v1'); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * 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/cloud-platform'], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 dataproc.projects.regions.workflowTemplates.get({ + * // Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * // For projects.locations.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} + * name: + * 'projects/my-project/regions/my-region/workflowTemplates/my-workflowTemplate', + * // Optional. The version of workflow template to retrieve. Only previously instantiated versions can be retrieved.If unspecified, retrieves the current version. + * version: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.workflowTemplates.get * @memberOf! () * @@ -9153,56 +9807,56 @@ export namespace dataproc_v1 { * dataproc.projects.regions.workflowTemplates.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for - * // the appropriate value for this field. - * resource_: 'projects/my-project/regions/my-region/workflowTemplates/my-workflow-template', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 dataproc.projects.regions.workflowTemplates.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/regions/my-region/workflowTemplates/my-workflowTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.workflowTemplates.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.workflowTemplates.getIamPolicy * @memberOf! () * @@ -9277,57 +9931,62 @@ export namespace dataproc_v1 { * dataproc.projects.regions.workflowTemplates.instantiate * @desc Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // Required. The "resource name" of the workflow template, as described in - * // https://cloud.google.com/apis/design/resource_names of the form - * // projects/{project_id}/regions/{region}/workflowTemplates/{template_id} - * name: 'projects/my-project/regions/my-region/workflowTemplates/my-workflow-template', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 dataproc.projects.regions.workflowTemplates.instantiate({ + * // Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * // For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} + * name: + * 'projects/my-project/regions/my-region/workflowTemplates/my-workflowTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parameters": {}, + * // "requestId": "my_requestId", + * // "version": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.workflowTemplates.instantiate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.workflowTemplates.instantiate * @memberOf! () * @@ -9404,57 +10063,71 @@ export namespace dataproc_v1 { * dataproc.projects.regions.workflowTemplates.instantiateInline * @desc Instantiates a template and begins execution.This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The "resource name" of the workflow template region, as described in - * // https://cloud.google.com/apis/design/resource_names of the form - * // projects/{project_id}/regions/{region} - * parent: 'projects/my-project/regions/my-region', // TODO: Update placeholder value. + * const dataproc = google.dataproc('v1'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * dataproc.projects.regions.workflowTemplates.instantiateInline(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * // 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 dataproc.projects.regions.workflowTemplates.instantiateInline( + * { + * // Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates,instantiateinline, the resource name of the region has the following format: projects/{project_id}/regions/{region} + * // For projects.locations.workflowTemplates.instantiateinline, the resource name of the location has the following format: projects/{project_id}/locations/{location} + * parent: 'projects/my-project/regions/my-region', + * // Optional. A tag that prevents multiple concurrent workflow instances with the same tag from running. This mitigates risk of concurrent instances started due to retries.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * }, * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.workflowTemplates.instantiateInline * @memberOf! () * @@ -9531,66 +10204,52 @@ export namespace dataproc_v1 { * dataproc.projects.regions.workflowTemplates.list * @desc Lists workflows that match the specified filter in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The "resource name" of the region, as described in - * // https://cloud.google.com/apis/design/resource_names of the form - * // projects/{project_id}/regions/{region} - * parent: 'projects/my-project/regions/my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * const dataproc = google.dataproc('v1'); * - * var templatesPage = response['templates']; - * if (!templatesPage) { - * return; - * } - * for (var i = 0; i < templatesPage.length; i++) { - * // TODO: Change code below to process each resource in `templatesPage`: - * console.log(JSON.stringify(templatesPage[i], null, 2)); - * } + * 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/cloud-platform'], + * }); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dataproc.projects.regions.workflowTemplates.list(request, handlePage); - * } - * }; + * // 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 dataproc.projects.regions.workflowTemplates.list({ + * // Optional. The maximum number of results to return in each response. + * pageSize: 'placeholder-value', + * // Optional. The page token, returned by a previous call, to request the next page of results. + * pageToken: 'placeholder-value', + * // Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates,list, the resource name of the region has the following format: projects/{project_id}/regions/{region} + * // For projects.locations.workflowTemplates.list, the resource name of the location has the following format: projects/{project_id}/locations/{location} + * parent: 'projects/my-project/regions/my-region', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "templates": [] + * // } + * } * - * dataproc.projects.regions.workflowTemplates.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.workflowTemplates.list * @memberOf! () * @@ -9677,56 +10336,56 @@ export namespace dataproc_v1 { * dataproc.projects.regions.workflowTemplates.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); + * const dataproc = google.dataproc('v1'); * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for - * // the appropriate value for this field. - * resource_: 'projects/my-project/regions/my-region/workflowTemplates/my-workflow-template', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 dataproc.projects.regions.workflowTemplates.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/regions/my-region/workflowTemplates/my-workflowTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.workflowTemplates.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.workflowTemplates.setIamPolicy * @memberOf! () * @@ -9801,56 +10460,56 @@ export namespace dataproc_v1 { * dataproc.projects.regions.workflowTemplates.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy detail is being requested. See the operation - * // documentation for the appropriate value for this field. - * resource_: 'projects/my-project/regions/my-region/workflowTemplates/my-workflow-template', // TODO: Update placeholder value. + * const dataproc = google.dataproc('v1'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * dataproc.projects.regions.workflowTemplates.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * // 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 dataproc.projects.regions.workflowTemplates.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/regions/my-region/workflowTemplates/my-workflowTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, * } + * ); + * console.log(res.data); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dataproc.projects.regions.workflowTemplates.testIamPermissions * @memberOf! () * @@ -9934,58 +10593,72 @@ export namespace dataproc_v1 { * dataproc.projects.regions.workflowTemplates.update * @desc Updates (replaces) workflow template. The updated template must contain version that matches the current server version. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Output only. The "resource name" of the template, as described in - * // https://cloud.google.com/apis/design/resource_names of the form - * // projects/{project_id}/regions/{region}/workflowTemplates/{template_id} - * name: 'projects/my-project/regions/my-region/workflowTemplates/my-workflow-template', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.workflowTemplates.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * const dataproc = google.dataproc('v1'); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * 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/cloud-platform'], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 dataproc.projects.regions.workflowTemplates.update({ + * // Output only. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * // For projects.locations.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} + * name: + * 'projects/my-project/regions/my-region/workflowTemplates/my-workflowTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.workflowTemplates.update * @memberOf! () * diff --git a/src/apis/dataproc/v1beta2.ts b/src/apis/dataproc/v1beta2.ts index 5337c0d681d..3e23a491a39 100644 --- a/src/apis/dataproc/v1beta2.ts +++ b/src/apis/dataproc/v1beta2.ts @@ -1778,6 +1778,64 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.locations.autoscalingPolicies.create * @desc Creates new autoscaling policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.autoscalingPolicies.create({ + * // Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.autoscalingPolicies.create, the resource name has the following format: projects/{project_id}/regions/{region} + * // For projects.locations.autoscalingPolicies.create, the resource name has the following format: projects/{project_id}/locations/{location} + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "basicAlgorithm": {}, + * // "id": "my_id", + * // "name": "my_name", + * // "secondaryWorkerConfig": {}, + * // "workerConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "basicAlgorithm": {}, + * // "id": "my_id", + * // "name": "my_name", + * // "secondaryWorkerConfig": {}, + * // "workerConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.autoscalingPolicies.create * @memberOf! () * @@ -1853,6 +1911,47 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.locations.autoscalingPolicies.delete * @desc Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.autoscalingPolicies.delete({ + * // Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + * // For projects.locations.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + * name: + * 'projects/my-project/locations/my-location/autoscalingPolicies/my-autoscalingPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.autoscalingPolicies.delete * @memberOf! () * @@ -1922,6 +2021,53 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.locations.autoscalingPolicies.get * @desc Retrieves autoscaling policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.autoscalingPolicies.get({ + * // Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + * // For projects.locations.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + * name: + * 'projects/my-project/locations/my-location/autoscalingPolicies/my-autoscalingPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "basicAlgorithm": {}, + * // "id": "my_id", + * // "name": "my_name", + * // "secondaryWorkerConfig": {}, + * // "workerConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.autoscalingPolicies.get * @memberOf! () * @@ -1993,6 +2139,53 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.locations.autoscalingPolicies.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.autoscalingPolicies.getIamPolicy( + * { + * // Optional. The policy format version to be returned.Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected.Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/autoscalingPolicies/my-autoscalingPolicie', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.autoscalingPolicies.getIamPolicy * @memberOf! () * @@ -2066,6 +2259,53 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.locations.autoscalingPolicies.list * @desc Lists autoscaling policies in the project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.autoscalingPolicies.list({ + * // Optional. The maximum number of results to return in each response. Must be less than or equal to 1000. Defaults to 100. + * pageSize: 'placeholder-value', + * // Optional. The page token, returned by a previous call, to request the next page of results. + * pageToken: 'placeholder-value', + * // Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.autoscalingPolicies.list, the resource name of the region has the following format: projects/{project_id}/regions/{region} + * // For projects.locations.autoscalingPolicies.list, the resource name of the location has the following format: projects/{project_id}/locations/{location} + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "policies": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.autoscalingPolicies.list * @memberOf! () * @@ -2151,6 +2391,59 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.locations.autoscalingPolicies.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.autoscalingPolicies.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/autoscalingPolicies/my-autoscalingPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.autoscalingPolicies.setIamPolicy * @memberOf! () * @@ -2224,6 +2517,57 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.locations.autoscalingPolicies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.autoscalingPolicies.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/autoscalingPolicies/my-autoscalingPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.autoscalingPolicies.testIamPermissions * @memberOf! () * @@ -2306,6 +2650,65 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.locations.autoscalingPolicies.update * @desc Updates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.autoscalingPolicies.update({ + * // Output only. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + * // For projects.locations.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + * name: + * 'projects/my-project/locations/my-location/autoscalingPolicies/my-autoscalingPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "basicAlgorithm": {}, + * // "id": "my_id", + * // "name": "my_name", + * // "secondaryWorkerConfig": {}, + * // "workerConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "basicAlgorithm": {}, + * // "id": "my_id", + * // "name": "my_name", + * // "secondaryWorkerConfig": {}, + * // "workerConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.autoscalingPolicies.update * @memberOf! () * @@ -2514,6 +2917,72 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.locations.workflowTemplates.create * @desc Creates new workflow template. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.workflowTemplates.create({ + * // Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates,create, the resource name of the region has the following format: projects/{project_id}/regions/{region} + * // For projects.locations.workflowTemplates.create, the resource name of the location has the following format: projects/{project_id}/locations/{location} + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.workflowTemplates.create * @memberOf! () * @@ -2589,6 +3058,49 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.locations.workflowTemplates.delete * @desc Deletes a workflow template. It does not cancel in-progress workflows. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.workflowTemplates.delete({ + * // Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates.delete, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * // For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} + * name: + * 'projects/my-project/locations/my-location/workflowTemplates/my-workflowTemplate', + * // Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version. + * version: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.workflowTemplates.delete * @memberOf! () * @@ -2659,6 +3171,59 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.locations.workflowTemplates.get * @desc Retrieves the latest workflow template.Can retrieve previously instantiated template by specifying optional version parameter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.workflowTemplates.get({ + * // Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * // For projects.locations.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} + * name: + * 'projects/my-project/locations/my-location/workflowTemplates/my-workflowTemplate', + * // Optional. The version of workflow template to retrieve. Only previously instantiated versions can be retrieved.If unspecified, retrieves the current version. + * version: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.workflowTemplates.get * @memberOf! () * @@ -2731,6 +3296,51 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.locations.workflowTemplates.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.workflowTemplates.getIamPolicy({ + * // Optional. The policy format version to be returned.Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected.Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/workflowTemplates/my-workflowTemplate', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.workflowTemplates.getIamPolicy * @memberOf! () * @@ -2804,6 +3414,64 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.locations.workflowTemplates.instantiate * @desc Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.workflowTemplates.instantiate({ + * // Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * // For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} + * name: + * 'projects/my-project/locations/my-location/workflowTemplates/my-workflowTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instanceId": "my_instanceId", + * // "parameters": {}, + * // "requestId": "my_requestId", + * // "version": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.workflowTemplates.instantiate * @memberOf! () * @@ -2879,6 +3547,74 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.locations.workflowTemplates.instantiateInline * @desc Instantiates a template and begins execution.This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.workflowTemplates.instantiateInline( + * { + * // Deprecated. Please use request_id field instead. + * instanceId: 'placeholder-value', + * // Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates,instantiateinline, the resource name of the region has the following format: projects/{project_id}/regions/{region} + * // For projects.locations.workflowTemplates.instantiateinline, the resource name of the location has the following format: projects/{project_id}/locations/{location} + * parent: 'projects/my-project/locations/my-location', + * // Optional. A tag that prevents multiple concurrent workflow instances with the same tag from running. This mitigates risk of concurrent instances started due to retries.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.workflowTemplates.instantiateInline * @memberOf! () * @@ -2955,6 +3691,53 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.locations.workflowTemplates.list * @desc Lists workflows that match the specified filter in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.workflowTemplates.list({ + * // Optional. The maximum number of results to return in each response. + * pageSize: 'placeholder-value', + * // Optional. The page token, returned by a previous call, to request the next page of results. + * pageToken: 'placeholder-value', + * // Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates,list, the resource name of the region has the following format: projects/{project_id}/regions/{region} + * // For projects.locations.workflowTemplates.list, the resource name of the location has the following format: projects/{project_id}/locations/{location} + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "templates": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.workflowTemplates.list * @memberOf! () * @@ -3040,6 +3823,57 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.locations.workflowTemplates.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.workflowTemplates.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/workflowTemplates/my-workflowTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.workflowTemplates.setIamPolicy * @memberOf! () * @@ -3113,6 +3947,57 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.locations.workflowTemplates.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.workflowTemplates.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/workflowTemplates/my-workflowTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.workflowTemplates.testIamPermissions * @memberOf! () * @@ -3195,6 +4080,73 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.locations.workflowTemplates.update * @desc Updates (replaces) workflow template. The updated template must contain version that matches the current server version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.locations.workflowTemplates.update({ + * // Output only. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * // For projects.locations.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} + * name: + * 'projects/my-project/locations/my-location/workflowTemplates/my-workflowTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.locations.workflowTemplates.update * @memberOf! () * @@ -3474,6 +4426,64 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.autoscalingPolicies.create * @desc Creates new autoscaling policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.autoscalingPolicies.create({ + * // Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.autoscalingPolicies.create, the resource name has the following format: projects/{project_id}/regions/{region} + * // For projects.locations.autoscalingPolicies.create, the resource name has the following format: projects/{project_id}/locations/{location} + * parent: 'projects/my-project/regions/my-region', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "basicAlgorithm": {}, + * // "id": "my_id", + * // "name": "my_name", + * // "secondaryWorkerConfig": {}, + * // "workerConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "basicAlgorithm": {}, + * // "id": "my_id", + * // "name": "my_name", + * // "secondaryWorkerConfig": {}, + * // "workerConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.autoscalingPolicies.create * @memberOf! () * @@ -3549,6 +4559,47 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.autoscalingPolicies.delete * @desc Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.autoscalingPolicies.delete({ + * // Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + * // For projects.locations.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + * name: + * 'projects/my-project/regions/my-region/autoscalingPolicies/my-autoscalingPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.autoscalingPolicies.delete * @memberOf! () * @@ -3618,6 +4669,53 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.autoscalingPolicies.get * @desc Retrieves autoscaling policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.autoscalingPolicies.get({ + * // Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + * // For projects.locations.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + * name: + * 'projects/my-project/regions/my-region/autoscalingPolicies/my-autoscalingPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "basicAlgorithm": {}, + * // "id": "my_id", + * // "name": "my_name", + * // "secondaryWorkerConfig": {}, + * // "workerConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.autoscalingPolicies.get * @memberOf! () * @@ -3689,6 +4787,51 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.autoscalingPolicies.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.autoscalingPolicies.getIamPolicy({ + * // Optional. The policy format version to be returned.Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected.Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/regions/my-region/autoscalingPolicies/my-autoscalingPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.autoscalingPolicies.getIamPolicy * @memberOf! () * @@ -3762,6 +4905,53 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.autoscalingPolicies.list * @desc Lists autoscaling policies in the project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.autoscalingPolicies.list({ + * // Optional. The maximum number of results to return in each response. Must be less than or equal to 1000. Defaults to 100. + * pageSize: 'placeholder-value', + * // Optional. The page token, returned by a previous call, to request the next page of results. + * pageToken: 'placeholder-value', + * // Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.autoscalingPolicies.list, the resource name of the region has the following format: projects/{project_id}/regions/{region} + * // For projects.locations.autoscalingPolicies.list, the resource name of the location has the following format: projects/{project_id}/locations/{location} + * parent: 'projects/my-project/regions/my-region', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "policies": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.autoscalingPolicies.list * @memberOf! () * @@ -3847,6 +5037,57 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.autoscalingPolicies.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.autoscalingPolicies.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/regions/my-region/autoscalingPolicies/my-autoscalingPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.autoscalingPolicies.setIamPolicy * @memberOf! () * @@ -3920,6 +5161,57 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.autoscalingPolicies.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.autoscalingPolicies.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/regions/my-region/autoscalingPolicies/my-autoscalingPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.autoscalingPolicies.testIamPermissions * @memberOf! () * @@ -4002,6 +5294,65 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.autoscalingPolicies.update * @desc Updates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.autoscalingPolicies.update({ + * // Output only. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + * // For projects.locations.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + * name: + * 'projects/my-project/regions/my-region/autoscalingPolicies/my-autoscalingPolicie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "basicAlgorithm": {}, + * // "id": "my_id", + * // "name": "my_name", + * // "secondaryWorkerConfig": {}, + * // "workerConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "basicAlgorithm": {}, + * // "id": "my_id", + * // "name": "my_name", + * // "secondaryWorkerConfig": {}, + * // "workerConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.autoscalingPolicies.update * @memberOf! () * @@ -4210,6 +5561,69 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.clusters.create * @desc Creates a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.clusters.create({ + * // Required. The ID of the Google Cloud Platform project that the cluster belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * // Optional. A unique id used to identify the request. If the server receives two CreateClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterName": "my_clusterName", + * // "clusterUuid": "my_clusterUuid", + * // "config": {}, + * // "labels": {}, + * // "metrics": {}, + * // "projectId": "my_projectId", + * // "status": {}, + * // "statusHistory": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.clusters.create * @memberOf! () * @@ -4287,6 +5701,58 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.clusters.delete * @desc Deletes a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.clusters.delete({ + * // Required. The cluster name. + * clusterName: 'placeholder-value', + * // Optional. Specifying the cluster_uuid means the RPC should fail (with error NOT_FOUND) if cluster with specified UUID does not exist. + * clusterUuid: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project that the cluster belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * // Optional. A unique id used to identify the request. If the server receives two DeleteClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.clusters.delete * @memberOf! () * @@ -4365,6 +5831,60 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.clusters.diagnose * @desc Gets cluster diagnostic information. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). After the operation completes, Operation.response contains Empty. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.clusters.diagnose({ + * // Required. The cluster name. + * clusterName: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project that the cluster belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.clusters.diagnose * @memberOf! () * @@ -4442,6 +5962,57 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.clusters.get * @desc Gets the resource representation for a cluster in a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.clusters.get({ + * // Required. The cluster name. + * clusterName: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project that the cluster belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterName": "my_clusterName", + * // "clusterUuid": "my_clusterUuid", + * // "config": {}, + * // "labels": {}, + * // "metrics": {}, + * // "projectId": "my_projectId", + * // "status": {}, + * // "statusHistory": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.clusters.get * @memberOf! () * @@ -4516,6 +6087,50 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.clusters.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.clusters.getIamPolicy({ + * // Optional. The policy format version to be returned.Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected.Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/regions/my-region/clusters/my-cluster', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.clusters.getIamPolicy * @memberOf! () * @@ -4589,6 +6204,55 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.clusters.list * @desc Lists all regions/{region}/clusters in a project alphabetically. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.clusters.list({ + * // Optional. A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE contains the DELETING and ERROR states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND clusterName = mycluster AND labels.env = staging AND labels.starred = * + * filter: 'placeholder-value', + * // Optional. The standard List page size. + * pageSize: 'placeholder-value', + * // Optional. The standard List page token. + * pageToken: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project that the cluster belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusters": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.clusters.list * @memberOf! () * @@ -4669,6 +6333,123 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.clusters.patch * @desc Updates a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.clusters.patch({ + * // Required. The cluster name. + * clusterName: 'placeholder-value', + * // Optional. Timeout for graceful YARN decomissioning. Graceful decommissioning allows removing nodes from the cluster without interrupting jobs in progress. Timeout specifies how long to wait for jobs in progress to finish before forcefully removing nodes (and potentially interrupting jobs). Default timeout is 0 (for forceful decommission), and the maximum allowed timeout is 1 day (see JSON representation of Duration (https://developers.google.com/protocol-buffers/docs/proto3#json)).Only supported on Dataproc image versions 1.2 and higher. + * gracefulDecommissionTimeout: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project the cluster belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * // Optional. A unique id used to identify the request. If the server receives two UpdateClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. + * requestId: 'placeholder-value', + * // Required. Specifies the path, relative to Cluster, of the field to update. For example, to change the number of workers in a cluster to 5, the update_mask parameter would be specified as config.worker_config.num_instances, and the PATCH request body would specify the new value, as follows: + * // { + * // "config":{ + * // "workerConfig":{ + * // "numInstances":"5" + * // } + * // } + * // } + * // Similarly, to change the number of preemptible workers in a cluster to 5, the update_mask parameter would be config.secondary_worker_config.num_instances, and the PATCH request body would be set as follows: + * // { + * // "config":{ + * // "secondaryWorkerConfig":{ + * // "numInstances":"5" + * // } + * // } + * // } + * // Note: currently only the following fields can be updated: + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * // + * //
                          MaskPurpose
                          labelsUpdates labels
                          config.worker_config.num_instancesResize primary worker + * // group
                          config.secondary_worker_config.num_instancesResize secondary + * // worker group
                          config.lifecycle_config.auto_delete_ttlReset MAX TTL + * // duration
                          config.lifecycle_config.auto_delete_timeUpdate MAX TTL + * // deletion timestamp
                          config.lifecycle_config.idle_delete_ttlUpdate Idle TTL + * // duration
                          config.autoscaling_config.policy_uriUse, stop using, or change + * // autoscaling policies
                          + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterName": "my_clusterName", + * // "clusterUuid": "my_clusterUuid", + * // "config": {}, + * // "labels": {}, + * // "metrics": {}, + * // "projectId": "my_projectId", + * // "status": {}, + * // "statusHistory": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.clusters.patch * @memberOf! () * @@ -4749,6 +6530,56 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.clusters.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.clusters.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/regions/my-region/clusters/my-cluster', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.clusters.setIamPolicy * @memberOf! () * @@ -4822,6 +6653,63 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.clusters.start * @desc Starts a cluster in a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.clusters.start({ + * // Required. The cluster name. + * clusterName: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project the cluster belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterUuid": "my_clusterUuid", + * // "requestId": "my_requestId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.clusters.start * @memberOf! () * @@ -4899,6 +6787,63 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.clusters.stop * @desc Stops a cluster in a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.clusters.stop({ + * // Required. The cluster name. + * clusterName: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project the cluster belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clusterUuid": "my_clusterUuid", + * // "requestId": "my_requestId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.clusters.stop * @memberOf! () * @@ -4976,6 +6921,54 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.clusters.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.clusters.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/regions/my-region/clusters/my-cluster', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.clusters.testIamPermissions * @memberOf! () * @@ -5329,6 +7322,75 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.jobs.cancel * @desc Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list (https://cloud.google.com/dataproc/docs/reference/rest/v1beta2/projects.regions.jobs/list) or regions/{region}/jobs.get (https://cloud.google.com/dataproc/docs/reference/rest/v1beta2/projects.regions.jobs/get). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.jobs.cancel({ + * // Required. The job ID. + * jobId: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "driverControlFilesUri": "my_driverControlFilesUri", + * // "driverOutputResourceUri": "my_driverOutputResourceUri", + * // "hadoopJob": {}, + * // "hiveJob": {}, + * // "jobUuid": "my_jobUuid", + * // "labels": {}, + * // "pigJob": {}, + * // "placement": {}, + * // "prestoJob": {}, + * // "pysparkJob": {}, + * // "reference": {}, + * // "scheduling": {}, + * // "sparkJob": {}, + * // "sparkRJob": {}, + * // "sparkSqlJob": {}, + * // "status": {}, + * // "statusHistory": [], + * // "submittedBy": "my_submittedBy", + * // "yarnApplications": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.jobs.cancel * @memberOf! () * @@ -5404,6 +7466,48 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.jobs.delete * @desc Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.jobs.delete({ + * // Required. The job ID. + * jobId: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.jobs.delete * @memberOf! () * @@ -5478,6 +7582,69 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.jobs.get * @desc Gets the resource representation for a job in a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.jobs.get({ + * // Required. The job ID. + * jobId: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "driverControlFilesUri": "my_driverControlFilesUri", + * // "driverOutputResourceUri": "my_driverOutputResourceUri", + * // "hadoopJob": {}, + * // "hiveJob": {}, + * // "jobUuid": "my_jobUuid", + * // "labels": {}, + * // "pigJob": {}, + * // "placement": {}, + * // "prestoJob": {}, + * // "pysparkJob": {}, + * // "reference": {}, + * // "scheduling": {}, + * // "sparkJob": {}, + * // "sparkRJob": {}, + * // "sparkSqlJob": {}, + * // "status": {}, + * // "statusHistory": [], + * // "submittedBy": "my_submittedBy", + * // "yarnApplications": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.jobs.get * @memberOf! () * @@ -5552,6 +7719,50 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.jobs.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.jobs.getIamPolicy({ + * // Optional. The policy format version to be returned.Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected.Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/regions/my-region/jobs/my-job', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.jobs.getIamPolicy * @memberOf! () * @@ -5625,6 +7836,59 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.jobs.list * @desc Lists regions/{region}/jobs in a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.jobs.list({ + * // Optional. If set, the returned jobs list includes only jobs that were submitted to the named cluster. + * clusterName: 'placeholder-value', + * // Optional. A filter constraining the jobs to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is status.state or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be either ACTIVE or NON_ACTIVE. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND labels.env = staging AND labels.starred = * + * filter: 'placeholder-value', + * // Optional. Specifies enumerated categories of jobs to list. (default = match ALL jobs).If filter is provided, jobStateMatcher will be ignored. + * jobStateMatcher: 'placeholder-value', + * // Optional. The number of results to return in each response. + * pageSize: 'placeholder-value', + * // Optional. The page token, returned by a previous call, to request the next page of results. + * pageToken: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "jobs": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.jobs.list * @memberOf! () * @@ -5704,6 +7968,98 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.jobs.patch * @desc Updates a job in a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.jobs.patch({ + * // Required. The job ID. + * jobId: 'placeholder-value', + * // Required. The ID of the Google Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * // Required. Specifies the path, relative to Job, of the field to update. For example, to update the labels of a Job the update_mask parameter would be specified as labels, and the PATCH request body would specify the new value. Note: Currently, labels is the only field that can be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "done": false, + * // "driverControlFilesUri": "my_driverControlFilesUri", + * // "driverOutputResourceUri": "my_driverOutputResourceUri", + * // "hadoopJob": {}, + * // "hiveJob": {}, + * // "jobUuid": "my_jobUuid", + * // "labels": {}, + * // "pigJob": {}, + * // "placement": {}, + * // "prestoJob": {}, + * // "pysparkJob": {}, + * // "reference": {}, + * // "scheduling": {}, + * // "sparkJob": {}, + * // "sparkRJob": {}, + * // "sparkSqlJob": {}, + * // "status": {}, + * // "statusHistory": [], + * // "submittedBy": "my_submittedBy", + * // "yarnApplications": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "driverControlFilesUri": "my_driverControlFilesUri", + * // "driverOutputResourceUri": "my_driverOutputResourceUri", + * // "hadoopJob": {}, + * // "hiveJob": {}, + * // "jobUuid": "my_jobUuid", + * // "labels": {}, + * // "pigJob": {}, + * // "placement": {}, + * // "prestoJob": {}, + * // "pysparkJob": {}, + * // "reference": {}, + * // "scheduling": {}, + * // "sparkJob": {}, + * // "sparkRJob": {}, + * // "sparkSqlJob": {}, + * // "status": {}, + * // "statusHistory": [], + * // "submittedBy": "my_submittedBy", + * // "yarnApplications": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.jobs.patch * @memberOf! () * @@ -5780,6 +8136,56 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.jobs.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.jobs.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/regions/my-region/jobs/my-job', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.jobs.setIamPolicy * @memberOf! () * @@ -5853,6 +8259,76 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.jobs.submit * @desc Submits a job to a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.jobs.submit({ + * // Required. The ID of the Google Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "job": {}, + * // "requestId": "my_requestId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "driverControlFilesUri": "my_driverControlFilesUri", + * // "driverOutputResourceUri": "my_driverOutputResourceUri", + * // "hadoopJob": {}, + * // "hiveJob": {}, + * // "jobUuid": "my_jobUuid", + * // "labels": {}, + * // "pigJob": {}, + * // "placement": {}, + * // "prestoJob": {}, + * // "pysparkJob": {}, + * // "reference": {}, + * // "scheduling": {}, + * // "sparkJob": {}, + * // "sparkRJob": {}, + * // "sparkSqlJob": {}, + * // "status": {}, + * // "statusHistory": [], + * // "submittedBy": "my_submittedBy", + * // "yarnApplications": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.jobs.submit * @memberOf! () * @@ -5927,6 +8403,61 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.jobs.submitAsOperation * @desc Submits job to a cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.jobs.submitAsOperation({ + * // Required. The ID of the Google Cloud Platform project that the job belongs to. + * projectId: 'placeholder-value', + * // Required. The Dataproc region in which to handle the request. + * region: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "job": {}, + * // "requestId": "my_requestId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.jobs.submitAsOperation * @memberOf! () * @@ -6003,6 +8534,54 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.jobs.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.jobs.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/regions/my-region/jobs/my-job', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.jobs.testIamPermissions * @memberOf! () * @@ -6315,6 +8894,44 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/regions/my-region/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.operations.cancel * @memberOf! () * @@ -6387,6 +9004,44 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/regions/my-region/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.operations.delete * @memberOf! () * @@ -6456,6 +9111,50 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/regions/my-region/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.operations.get * @memberOf! () * @@ -6527,6 +9226,50 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.operations.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.operations.getIamPolicy({ + * // Optional. The policy format version to be returned.Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected.Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/regions/my-region/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.operations.getIamPolicy * @memberOf! () * @@ -6600,6 +9343,53 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/x/operations. To override the binding, API services can add a binding such as "/v1/{name=users/x}/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/regions/my-region/operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.operations.list * @memberOf! () * @@ -6676,6 +9466,56 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.operations.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.operations.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/regions/my-region/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.operations.setIamPolicy * @memberOf! () * @@ -6749,6 +9589,54 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.operations.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.operations.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/regions/my-region/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.operations.testIamPermissions * @memberOf! () * @@ -6949,6 +9837,72 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.workflowTemplates.create * @desc Creates new workflow template. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.workflowTemplates.create({ + * // Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates,create, the resource name of the region has the following format: projects/{project_id}/regions/{region} + * // For projects.locations.workflowTemplates.create, the resource name of the location has the following format: projects/{project_id}/locations/{location} + * parent: 'projects/my-project/regions/my-region', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.workflowTemplates.create * @memberOf! () * @@ -7024,6 +9978,49 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.workflowTemplates.delete * @desc Deletes a workflow template. It does not cancel in-progress workflows. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.workflowTemplates.delete({ + * // Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates.delete, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * // For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} + * name: + * 'projects/my-project/regions/my-region/workflowTemplates/my-workflowTemplate', + * // Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version. + * version: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.workflowTemplates.delete * @memberOf! () * @@ -7094,6 +10091,59 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.workflowTemplates.get * @desc Retrieves the latest workflow template.Can retrieve previously instantiated template by specifying optional version parameter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.workflowTemplates.get({ + * // Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * // For projects.locations.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} + * name: + * 'projects/my-project/regions/my-region/workflowTemplates/my-workflowTemplate', + * // Optional. The version of workflow template to retrieve. Only previously instantiated versions can be retrieved.If unspecified, retrieves the current version. + * version: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.workflowTemplates.get * @memberOf! () * @@ -7166,6 +10216,51 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.workflowTemplates.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.workflowTemplates.getIamPolicy({ + * // Optional. The policy format version to be returned.Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected.Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/regions/my-region/workflowTemplates/my-workflowTemplate', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.workflowTemplates.getIamPolicy * @memberOf! () * @@ -7239,6 +10334,64 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.workflowTemplates.instantiate * @desc Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.workflowTemplates.instantiate({ + * // Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * // For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} + * name: + * 'projects/my-project/regions/my-region/workflowTemplates/my-workflowTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instanceId": "my_instanceId", + * // "parameters": {}, + * // "requestId": "my_requestId", + * // "version": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.workflowTemplates.instantiate * @memberOf! () * @@ -7314,6 +10467,74 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.workflowTemplates.instantiateInline * @desc Instantiates a template and begins execution.This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.workflowTemplates.instantiateInline( + * { + * // Deprecated. Please use request_id field instead. + * instanceId: 'placeholder-value', + * // Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates,instantiateinline, the resource name of the region has the following format: projects/{project_id}/regions/{region} + * // For projects.locations.workflowTemplates.instantiateinline, the resource name of the location has the following format: projects/{project_id}/locations/{location} + * parent: 'projects/my-project/regions/my-region', + * // Optional. A tag that prevents multiple concurrent workflow instances with the same tag from running. This mitigates risk of concurrent instances started due to retries.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.workflowTemplates.instantiateInline * @memberOf! () * @@ -7390,6 +10611,53 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.workflowTemplates.list * @desc Lists workflows that match the specified filter in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.workflowTemplates.list({ + * // Optional. The maximum number of results to return in each response. + * pageSize: 'placeholder-value', + * // Optional. The page token, returned by a previous call, to request the next page of results. + * pageToken: 'placeholder-value', + * // Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates,list, the resource name of the region has the following format: projects/{project_id}/regions/{region} + * // For projects.locations.workflowTemplates.list, the resource name of the location has the following format: projects/{project_id}/locations/{location} + * parent: 'projects/my-project/regions/my-region', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "templates": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.workflowTemplates.list * @memberOf! () * @@ -7475,6 +10743,57 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.workflowTemplates.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.workflowTemplates.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/regions/my-region/workflowTemplates/my-workflowTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.workflowTemplates.setIamPolicy * @memberOf! () * @@ -7548,6 +10867,57 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.workflowTemplates.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.workflowTemplates.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/regions/my-region/workflowTemplates/my-workflowTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.workflowTemplates.testIamPermissions * @memberOf! () * @@ -7630,6 +11000,73 @@ export namespace dataproc_v1beta2 { /** * dataproc.projects.regions.workflowTemplates.update * @desc Updates (replaces) workflow template. The updated template must contain version that matches the current server version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dataproc.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 dataproc = google.dataproc('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dataproc.projects.regions.workflowTemplates.update({ + * // Output only. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + * // For projects.regions.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * // For projects.locations.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} + * name: + * 'projects/my-project/regions/my-region/workflowTemplates/my-workflowTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "id": "my_id", + * // "jobs": [], + * // "labels": {}, + * // "name": "my_name", + * // "parameters": [], + * // "placement": {}, + * // "updateTime": "my_updateTime", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dataproc.projects.regions.workflowTemplates.update * @memberOf! () * diff --git a/src/apis/datastore/v1.ts b/src/apis/datastore/v1.ts index 8cad928da4c..6a0e8ebfccb 100644 --- a/src/apis/datastore/v1.ts +++ b/src/apis/datastore/v1.ts @@ -1096,6 +1096,57 @@ export namespace datastore_v1 { /** * datastore.projects.allocateIds * @desc Allocates IDs for the given keys, which is useful for referencing an entity before it is inserted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.allocateIds({ + * // Required. The ID of the project against which to make the request. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "keys": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "keys": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.allocateIds * @memberOf! () * @@ -1173,6 +1224,57 @@ export namespace datastore_v1 { /** * datastore.projects.beginTransaction * @desc Begins a new transaction. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.beginTransaction({ + * // Required. The ID of the project against which to make the request. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "transactionOptions": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "transaction": "my_transaction" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.beginTransaction * @memberOf! () * @@ -1251,6 +1353,60 @@ export namespace datastore_v1 { /** * datastore.projects.commit * @desc Commits a transaction, optionally creating, deleting or modifying some entities. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.commit({ + * // Required. The ID of the project against which to make the request. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "mode": "my_mode", + * // "mutations": [], + * // "transaction": "my_transaction" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "indexUpdates": 0, + * // "mutationResults": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.commit * @memberOf! () * @@ -1325,6 +1481,63 @@ export namespace datastore_v1 { /** * datastore.projects.export * @desc Exports a copy of all or a subset of entities from Google Cloud Datastore to another storage system, such as Google Cloud Storage. Recent updates to entities may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.export({ + * // Required. Project ID against which to make the request. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entityFilter": {}, + * // "labels": {}, + * // "outputUrlPrefix": "my_outputUrlPrefix" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.export * @memberOf! () * @@ -1406,6 +1619,63 @@ export namespace datastore_v1 { /** * datastore.projects.import * @desc Imports entities into Google Cloud Datastore. Existing entities with the same key are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportEntities operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Datastore. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.import({ + * // Required. Project ID against which to make the request. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entityFilter": {}, + * // "inputUrl": "my_inputUrl", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.import * @memberOf! () * @@ -1487,6 +1757,60 @@ export namespace datastore_v1 { /** * datastore.projects.lookup * @desc Looks up entities by key. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.lookup({ + * // Required. The ID of the project against which to make the request. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "keys": [], + * // "readOptions": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deferred": [], + * // "found": [], + * // "missing": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.lookup * @memberOf! () * @@ -1561,6 +1885,56 @@ export namespace datastore_v1 { /** * datastore.projects.reserveIds * @desc Prevents the supplied keys' IDs from being auto-allocated by Cloud Datastore. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.reserveIds({ + * // Required. The ID of the project against which to make the request. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "databaseId": "my_databaseId", + * // "keys": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.reserveIds * @memberOf! () * @@ -1636,6 +2010,55 @@ export namespace datastore_v1 { /** * datastore.projects.rollback * @desc Rolls back a transaction. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.rollback({ + * // Required. The ID of the project against which to make the request. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "transaction": "my_transaction" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.rollback * @memberOf! () * @@ -1711,6 +2134,61 @@ export namespace datastore_v1 { /** * datastore.projects.runQuery * @desc Queries for entities. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.runQuery({ + * // Required. The ID of the project against which to make the request. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "gqlQuery": {}, + * // "partitionId": {}, + * // "query": {}, + * // "readOptions": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "batch": {}, + * // "query": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.runQuery * @memberOf! () * @@ -1943,6 +2421,66 @@ export namespace datastore_v1 { /** * datastore.projects.indexes.create * @desc Creates the specified index. A newly created index's initial state is `CREATING`. On completion of the returned google.longrunning.Operation, the state will be `READY`. If the index already exists, the call will return an `ALREADY_EXISTS` status. During index creation, the process could result in an error, in which case the index will move to the `ERROR` state. The process can be recovered by fixing the data that caused the error, removing the index with delete, then re-creating the index with create. Indexes with a single property cannot be created. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.indexes.create({ + * // Project ID against which to make the request. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ancestor": "my_ancestor", + * // "indexId": "my_indexId", + * // "kind": "my_kind", + * // "projectId": "my_projectId", + * // "properties": [], + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.indexes.create * @memberOf! () * @@ -2025,6 +2563,55 @@ export namespace datastore_v1 { /** * datastore.projects.indexes.delete * @desc Deletes an existing index. An index can only be deleted if it is in a `READY` or `ERROR` state. On successful execution of the request, the index will be in a `DELETING` state. And on completion of the returned google.longrunning.Operation, the index will be removed. During index deletion, the process could result in an error, in which case the index will move to the `ERROR` state. The process can be recovered by fixing the data that caused the error, followed by calling delete again. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.indexes.delete({ + * // The resource ID of the index to delete. + * indexId: 'placeholder-value', + * // Project ID against which to make the request. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.indexes.delete * @memberOf! () * @@ -2106,6 +2693,56 @@ export namespace datastore_v1 { /** * datastore.projects.indexes.get * @desc Gets an index. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.indexes.get({ + * // The resource ID of the index to get. + * indexId: 'placeholder-value', + * // Project ID against which to make the request. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ancestor": "my_ancestor", + * // "indexId": "my_indexId", + * // "kind": "my_kind", + * // "projectId": "my_projectId", + * // "properties": [], + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.indexes.get * @memberOf! () * @@ -2187,6 +2824,56 @@ export namespace datastore_v1 { /** * datastore.projects.indexes.list * @desc Lists the indexes that match the specified filters. Datastore uses an eventually consistent query to fetch the list of indexes and may occasionally return stale results. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.indexes.list({ + * filter: 'placeholder-value', + * // The maximum number of items to return. If zero, then all results will be + * // returned. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // Project ID against which to make the request. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "indexes": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.indexes.list * @memberOf! () * @@ -2368,6 +3055,47 @@ export namespace datastore_v1 { /** * datastore.projects.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.operations.cancel * @memberOf! () * @@ -2437,6 +3165,47 @@ export namespace datastore_v1 { /** * datastore.projects.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.operations.delete * @memberOf! () * @@ -2506,6 +3275,53 @@ export namespace datastore_v1 { /** * datastore.projects.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.operations.get * @memberOf! () * @@ -2584,6 +3400,56 @@ export namespace datastore_v1 { /** * datastore.projects.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.operations.list * @memberOf! () * diff --git a/src/apis/datastore/v1beta1.ts b/src/apis/datastore/v1beta1.ts index 42a95851683..2f24b1a29ac 100644 --- a/src/apis/datastore/v1beta1.ts +++ b/src/apis/datastore/v1beta1.ts @@ -436,6 +436,63 @@ export namespace datastore_v1beta1 { /** * datastore.projects.export * @desc Exports a copy of all or a subset of entities from Google Cloud Datastore to another storage system, such as Google Cloud Storage. Recent updates to entities may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.export({ + * // Project ID against which to make the request. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entityFilter": {}, + * // "labels": {}, + * // "outputUrlPrefix": "my_outputUrlPrefix" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.export * @memberOf! () * @@ -517,6 +574,63 @@ export namespace datastore_v1beta1 { /** * datastore.projects.import * @desc Imports entities into Google Cloud Datastore. Existing entities with the same key are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportEntities operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Datastore. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.import({ + * // Project ID against which to make the request. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entityFilter": {}, + * // "inputUrl": "my_inputUrl", + * // "labels": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.import * @memberOf! () * diff --git a/src/apis/datastore/v1beta3.ts b/src/apis/datastore/v1beta3.ts index ca88a323972..e3440484224 100644 --- a/src/apis/datastore/v1beta3.ts +++ b/src/apis/datastore/v1beta3.ts @@ -944,6 +944,57 @@ export namespace datastore_v1beta3 { /** * datastore.projects.allocateIds * @desc Allocates IDs for the given keys, which is useful for referencing an entity before it is inserted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('v1beta3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.allocateIds({ + * // Required. The ID of the project against which to make the request. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "keys": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "keys": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.allocateIds * @memberOf! () * @@ -1020,6 +1071,57 @@ export namespace datastore_v1beta3 { /** * datastore.projects.beginTransaction * @desc Begins a new transaction. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('v1beta3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.beginTransaction({ + * // Required. The ID of the project against which to make the request. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "transactionOptions": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "transaction": "my_transaction" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.beginTransaction * @memberOf! () * @@ -1098,6 +1200,60 @@ export namespace datastore_v1beta3 { /** * datastore.projects.commit * @desc Commits a transaction, optionally creating, deleting or modifying some entities. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('v1beta3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.commit({ + * // Required. The ID of the project against which to make the request. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "mode": "my_mode", + * // "mutations": [], + * // "transaction": "my_transaction" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "indexUpdates": 0, + * // "mutationResults": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.commit * @memberOf! () * @@ -1172,6 +1328,60 @@ export namespace datastore_v1beta3 { /** * datastore.projects.lookup * @desc Looks up entities by key. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('v1beta3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.lookup({ + * // Required. The ID of the project against which to make the request. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "keys": [], + * // "readOptions": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deferred": [], + * // "found": [], + * // "missing": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.lookup * @memberOf! () * @@ -1246,6 +1456,56 @@ export namespace datastore_v1beta3 { /** * datastore.projects.reserveIds * @desc Prevents the supplied keys' IDs from being auto-allocated by Cloud Datastore. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('v1beta3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.reserveIds({ + * // Required. The ID of the project against which to make the request. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "databaseId": "my_databaseId", + * // "keys": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.reserveIds * @memberOf! () * @@ -1321,6 +1581,55 @@ export namespace datastore_v1beta3 { /** * datastore.projects.rollback * @desc Rolls back a transaction. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('v1beta3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.rollback({ + * // Required. The ID of the project against which to make the request. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "transaction": "my_transaction" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.rollback * @memberOf! () * @@ -1396,6 +1705,61 @@ export namespace datastore_v1beta3 { /** * datastore.projects.runQuery * @desc Queries for entities. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/datastore.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 datastore = google.datastore('v1beta3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 datastore.projects.runQuery({ + * // Required. The ID of the project against which to make the request. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "gqlQuery": {}, + * // "partitionId": {}, + * // "query": {}, + * // "readOptions": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "batch": {}, + * // "query": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias datastore.projects.runQuery * @memberOf! () * diff --git a/src/apis/deploymentmanager/alpha.ts b/src/apis/deploymentmanager/alpha.ts index 7c998285907..b42971bcf98 100644 --- a/src/apis/deploymentmanager/alpha.ts +++ b/src/apis/deploymentmanager/alpha.ts @@ -1227,6 +1227,74 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.compositeTypes.delete * @desc Deletes a composite type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.compositeTypes.delete({ + * // The name of the type for this request. + * compositeType: '[a-z](?:[-a-z0-9_.]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.compositeTypes.delete * @memberOf! () * @@ -1302,6 +1370,62 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.compositeTypes.get * @desc Gets information about a specific composite type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.compositeTypes.get({ + * // The name of the composite type for this request. + * compositeType: '[a-z](?:[-a-z0-9_.]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "name": "my_name", + * // "operation": {}, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "templateContents": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.compositeTypes.get * @memberOf! () * @@ -1377,6 +1501,88 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.compositeTypes.insert * @desc Creates a composite type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.compositeTypes.insert({ + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "name": "my_name", + * // "operation": {}, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "templateContents": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.compositeTypes.insert * @memberOf! () * @@ -1452,6 +1658,71 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.compositeTypes.list * @desc Lists all composite types for Deployment Manager. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.compositeTypes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "compositeTypes": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.compositeTypes.list * @memberOf! () * @@ -1537,6 +1808,90 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.compositeTypes.patch * @desc Updates a composite type. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.compositeTypes.patch({ + * // The name of the composite type for this request. + * compositeType: '[a-z](?:[-a-z0-9_.]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "name": "my_name", + * // "operation": {}, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "templateContents": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.compositeTypes.patch * @memberOf! () * @@ -1613,6 +1968,90 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.compositeTypes.update * @desc Updates a composite type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.compositeTypes.update({ + * // The name of the composite type for this request. + * compositeType: '[a-z](?:[-a-z0-9_.]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "name": "my_name", + * // "operation": {}, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "templateContents": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.compositeTypes.update * @memberOf! () * @@ -1816,6 +2255,82 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.deployments.cancelPreview * @desc Cancels and removes the preview currently associated with the deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.deployments.cancelPreview({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.cancelPreview * @memberOf! () * @@ -1892,6 +2407,76 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.deployments.delete * @desc Deletes a deployment and all of the resources in the deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.deployments.delete({ + * // Sets the policy to use for deleting resources. + * deletePolicy: 'placeholder-value', + * // The name of the deployment for this request. + * deployment: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.delete * @memberOf! () * @@ -1968,6 +2553,67 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.deployments.get * @desc Gets information about a specific deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.deployments.get({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "credential": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "manifest": "my_manifest", + * // "name": "my_name", + * // "operation": {}, + * // "outputs": [], + * // "selfLink": "my_selfLink", + * // "target": {}, + * // "update": {}, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.get * @memberOf! () * @@ -2042,6 +2688,57 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.deployments.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.deployments.getIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.getIamPolicy * @memberOf! () * @@ -2115,6 +2812,97 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.deployments.insert * @desc Creates a deployment and all of the resources described by the deployment manifest. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.deployments.insert({ + * // Sets the policy to use for creating new resources. + * createPolicy: 'placeholder-value', + * // If set to true, creates a deployment and creates "shell" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the update() method or you can use the cancelPreview() method to cancel the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. + * preview: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "credential": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "manifest": "my_manifest", + * // "name": "my_name", + * // "operation": {}, + * // "outputs": [], + * // "selfLink": "my_selfLink", + * // "target": {}, + * // "update": {}, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.insert * @memberOf! () * @@ -2192,6 +2980,71 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.deployments.list * @desc Lists all deployments for a given project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.deployments.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deployments": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.list * @memberOf! () * @@ -2271,6 +3124,101 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.deployments.patch * @desc Updates a deployment and all of the resources described by the deployment manifest. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.deployments.patch({ + * // Sets the policy to use for creating new resources. + * createPolicy: 'placeholder-value', + * // Sets the policy to use for deleting resources. + * deletePolicy: 'placeholder-value', + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. + * preview: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "credential": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "manifest": "my_manifest", + * // "name": "my_name", + * // "operation": {}, + * // "outputs": [], + * // "selfLink": "my_selfLink", + * // "target": {}, + * // "update": {}, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.patch * @memberOf! () * @@ -2350,6 +3298,67 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.deployments.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.deployments.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.setIamPolicy * @memberOf! () * @@ -2424,6 +3433,82 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.deployments.stop * @desc Stops an ongoing operation. This does not roll back any work that has already been completed, but prevents any new work from being started. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.deployments.stop({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.stop * @memberOf! () * @@ -2499,6 +3584,60 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.deployments.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.deployments.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.testIamPermissions * @memberOf! () * @@ -2579,6 +3718,101 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.deployments.update * @desc Updates a deployment and all of the resources described by the deployment manifest. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.deployments.update({ + * // Sets the policy to use for creating new resources. + * createPolicy: 'placeholder-value', + * // Sets the policy to use for deleting resources. + * deletePolicy: 'placeholder-value', + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. + * preview: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "credential": {}, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "manifest": "my_manifest", + * // "name": "my_name", + * // "operation": {}, + * // "outputs": [], + * // "selfLink": "my_selfLink", + * // "target": {}, + * // "update": {}, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.update * @memberOf! () * @@ -2918,6 +4152,63 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.manifests.get * @desc Gets information about a specific manifest. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.manifests.get({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // The name of the manifest for this request. + * manifest: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "config": {}, + * // "expandedConfig": "my_expandedConfig", + * // "id": "my_id", + * // "imports": [], + * // "insertTime": "my_insertTime", + * // "layout": "my_layout", + * // "name": "my_name", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.manifests.get * @memberOf! () * @@ -2991,6 +4282,73 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.manifests.list * @desc Lists all manifests for a given deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.manifests.list({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "manifests": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.manifests.list * @memberOf! () * @@ -3129,6 +4487,76 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.operations.get * @desc Gets information about a specific operation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.operations.get({ + * // The name of the operation for this request. + * operation: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.operations.get * @memberOf! () * @@ -3203,6 +4631,71 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.operations.list * @desc Lists all operations for a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.operations.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.operations.list * @memberOf! () * @@ -3332,6 +4825,69 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.resources.get * @desc Gets information about a single resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.resources.get({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the resource for this request. + * resource: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accessControl": {}, + * // "finalProperties": "my_finalProperties", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "lastUsedCredential": {}, + * // "manifest": "my_manifest", + * // "name": "my_name", + * // "properties": "my_properties", + * // "runtimePolicies": [], + * // "type": "my_type", + * // "update": {}, + * // "updateTime": "my_updateTime", + * // "url": "my_url", + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.resources.get * @memberOf! () * @@ -3405,6 +4961,73 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.resources.list * @desc Lists all resources in a given deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.resources.list({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.resources.list * @memberOf! () * @@ -3543,6 +5166,74 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.typeProviders.delete * @desc Deletes a type provider. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.typeProviders.delete({ + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the type provider for this request. + * typeProvider: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.typeProviders.delete * @memberOf! () * @@ -3618,6 +5309,64 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.typeProviders.get * @desc Gets information about a specific type provider. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.typeProviders.get({ + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the type provider for this request. + * typeProvider: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "collectionOverrides": [], + * // "credential": {}, + * // "description": "my_description", + * // "descriptorUrl": "my_descriptorUrl", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "name": "my_name", + * // "operation": {}, + * // "options": {}, + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.typeProviders.get * @memberOf! () * @@ -3693,6 +5442,62 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.typeProviders.getType * @desc Gets a type info for a type provided by a TypeProvider. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.typeProviders.getType({ + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the type provider type for this request. + * type: 'placeholder-value', + * // The name of the type provider for this request. + * typeProvider: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "documentationLink": "my_documentationLink", + * // "kind": "my_kind", + * // "name": "my_name", + * // "schema": {}, + * // "selfLink": "my_selfLink", + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.typeProviders.getType * @memberOf! () * @@ -3767,6 +5572,90 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.typeProviders.insert * @desc Creates a type provider. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.typeProviders.insert({ + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "collectionOverrides": [], + * // "credential": {}, + * // "description": "my_description", + * // "descriptorUrl": "my_descriptorUrl", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "name": "my_name", + * // "operation": {}, + * // "options": {}, + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.typeProviders.insert * @memberOf! () * @@ -3842,6 +5731,71 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.typeProviders.list * @desc Lists all resource type providers for Deployment Manager. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.typeProviders.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "typeProviders": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.typeProviders.list * @memberOf! () * @@ -3927,6 +5881,73 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.typeProviders.listTypes * @desc Lists all the type info for a TypeProvider. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.typeProviders.listTypes({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the type provider for this request. + * typeProvider: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "types": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.typeProviders.listTypes * @memberOf! () * @@ -4015,6 +6036,92 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.typeProviders.patch * @desc Updates a type provider. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.typeProviders.patch({ + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the type provider for this request. + * typeProvider: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "collectionOverrides": [], + * // "credential": {}, + * // "description": "my_description", + * // "descriptorUrl": "my_descriptorUrl", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "name": "my_name", + * // "operation": {}, + * // "options": {}, + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.typeProviders.patch * @memberOf! () * @@ -4091,6 +6198,92 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.typeProviders.update * @desc Updates a type provider. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.typeProviders.update({ + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the type provider for this request. + * typeProvider: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "collectionOverrides": [], + * // "credential": {}, + * // "description": "my_description", + * // "descriptorUrl": "my_descriptorUrl", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "name": "my_name", + * // "operation": {}, + * // "options": {}, + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.typeProviders.update * @memberOf! () * @@ -4346,6 +6539,74 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.types.delete * @desc Deletes a type and all of the resources in the type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.types.delete({ + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the type for this request. + * type: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.types.delete * @memberOf! () * @@ -4420,6 +6681,61 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.types.get * @desc Gets information about a specific type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.types.get({ + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the type for this request. + * type: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "configurableService": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "name": "my_name", + * // "operation": {}, + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.types.get * @memberOf! () * @@ -4492,6 +6808,87 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.types.insert * @desc Creates a type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.types.insert({ + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "configurableService": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "name": "my_name", + * // "operation": {}, + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.types.insert * @memberOf! () * @@ -4566,6 +6963,71 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.types.list * @desc Lists all resource types for Deployment Manager. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.types.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "types": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.types.list * @memberOf! () * @@ -4643,6 +7105,89 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.types.patch * @desc Updates a type. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.types.patch({ + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the type for this request. + * type: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "configurableService": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "name": "my_name", + * // "operation": {}, + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.types.patch * @memberOf! () * @@ -4718,6 +7263,89 @@ export namespace deploymentmanager_alpha { /** * deploymentmanager.types.update * @desc Updates a type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.types.update({ + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the type for this request. + * type: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "configurableService": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "name": "my_name", + * // "operation": {}, + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.types.update * @memberOf! () * diff --git a/src/apis/deploymentmanager/v2.ts b/src/apis/deploymentmanager/v2.ts index f5161cfa203..4ef3de0e41b 100644 --- a/src/apis/deploymentmanager/v2.ts +++ b/src/apis/deploymentmanager/v2.ts @@ -784,62 +784,81 @@ export namespace deploymentmanager_v2 { * deploymentmanager.deployments.cancelPreview * @desc Cancels and removes the preview currently associated with the deployment. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); * - * // The name of the deployment for this request. - * deployment: 'my-deployment', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await deploymentmanager.deployments.cancelPreview({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint" + * // } * }, - * - * auth: authClient, - * }; - * - * deploymentManager.deployments.cancelPreview(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias deploymentmanager.deployments.cancelPreview * @memberOf! () * @@ -917,58 +936,75 @@ export namespace deploymentmanager_v2 { * deploymentmanager.deployments.delete * @desc Deletes a deployment and all of the resources in the deployment. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the deployment for this request. - * deployment: 'my-deployment', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); * - * deploymentManager.deployments.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await deploymentmanager.deployments.delete({ + * // Sets the policy to use for deleting resources. + * deletePolicy: 'placeholder-value', + * // The name of the deployment for this request. + * deployment: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias deploymentmanager.deployments.delete * @memberOf! () * @@ -1046,58 +1082,64 @@ export namespace deploymentmanager_v2 { * deploymentmanager.deployments.get * @desc Gets information about a specific deployment. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the deployment for this request. - * deployment: 'my-deployment', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.readonly', + * ], + * }); * - * deploymentManager.deployments.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await deploymentmanager.deployments.get({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "manifest": "my_manifest", + * // "name": "my_name", + * // "operation": {}, + * // "selfLink": "my_selfLink", + * // "target": {}, + * // "update": {}, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias deploymentmanager.deployments.get * @memberOf! () * @@ -1173,58 +1215,56 @@ export namespace deploymentmanager_v2 { * deploymentmanager.deployments.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); * - * deploymentManager.deployments.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await deploymentmanager.deployments.getIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias deploymentmanager.deployments.getIamPolicy * @memberOf! () * @@ -1299,59 +1339,94 @@ export namespace deploymentmanager_v2 { * deploymentmanager.deployments.insert * @desc Creates a deployment and all of the resources described by the deployment manifest. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); * - * deploymentManager.deployments.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await deploymentmanager.deployments.insert({ + * // Sets the policy to use for creating new resources. + * createPolicy: 'placeholder-value', + * // If set to true, creates a deployment and creates "shell" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the update() method or you can use the cancelPreview() method to cancel the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. + * preview: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "manifest": "my_manifest", + * // "name": "my_name", + * // "operation": {}, + * // "selfLink": "my_selfLink", + * // "target": {}, + * // "update": {}, + * // "updateTime": "my_updateTime" + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias deploymentmanager.deployments.insert * @memberOf! () * @@ -1430,68 +1505,70 @@ export namespace deploymentmanager_v2 { * deploymentmanager.deployments.list * @desc Lists all deployments for a given project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var deploymentsPage = response['deployments']; - * if (!deploymentsPage) { - * return; - * } - * for (var i = 0; i < deploymentsPage.length; i++) { - * // TODO: Change code below to process each resource in `deploymentsPage`: - * console.log(JSON.stringify(deploymentsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * deploymentManager.deployments.list(request, handlePage); - * } - * }; - * - * deploymentManager.deployments.list(request, handlePage); - * }); + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.readonly', + * ], + * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); + * // 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 deploymentmanager.deployments.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deployments": [], + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.list * @memberOf! () * @@ -1572,63 +1649,98 @@ export namespace deploymentmanager_v2 { * deploymentmanager.deployments.patch * @desc Updates a deployment and all of the resources described by the deployment manifest. This method supports patch semantics. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); * - * // The name of the deployment for this request. - * deployment: 'my-deployment', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * // Do the magic + * const res = await deploymentmanager.deployments.patch({ + * // Sets the policy to use for creating new resources. + * createPolicy: 'placeholder-value', + * // Sets the policy to use for deleting resources. + * deletePolicy: 'placeholder-value', + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. + * preview: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "manifest": "my_manifest", + * // "name": "my_name", + * // "operation": {}, + * // "selfLink": "my_selfLink", + * // "target": {}, + * // "update": {}, + * // "updateTime": "my_updateTime" + * // } * }, - * - * auth: authClient, - * }; - * - * deploymentManager.deployments.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias deploymentmanager.deployments.patch * @memberOf! () * @@ -1709,62 +1821,66 @@ export namespace deploymentmanager_v2 { * deploymentmanager.deployments.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await deploymentmanager.deployments.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } * }, - * - * auth: authClient, - * }; - * - * deploymentManager.deployments.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias deploymentmanager.deployments.setIamPolicy * @memberOf! () * @@ -1840,62 +1956,81 @@ export namespace deploymentmanager_v2 { * deploymentmanager.deployments.stop * @desc Stops an ongoing operation. This does not roll back any work that has already been completed, but prevents any new work from being started. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); * - * // The name of the deployment for this request. - * deployment: 'my-deployment', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await deploymentmanager.deployments.stop({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint" + * // } * }, - * - * auth: authClient, - * }; - * - * deploymentManager.deployments.stop(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias deploymentmanager.deployments.stop * @memberOf! () * @@ -1972,62 +2107,59 @@ export namespace deploymentmanager_v2 { * deploymentmanager.deployments.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await deploymentmanager.deployments.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * deploymentManager.deployments.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias deploymentmanager.deployments.testIamPermissions * @memberOf! () * @@ -2109,63 +2241,98 @@ export namespace deploymentmanager_v2 { * deploymentmanager.deployments.update * @desc Updates a deployment and all of the resources described by the deployment manifest. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); * - * // The name of the deployment for this request. - * deployment: 'my-deployment', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * // Do the magic + * const res = await deploymentmanager.deployments.update({ + * // Sets the policy to use for creating new resources. + * createPolicy: 'placeholder-value', + * // Sets the policy to use for deleting resources. + * deletePolicy: 'placeholder-value', + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. + * preview: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "manifest": "my_manifest", + * // "name": "my_name", + * // "operation": {}, + * // "selfLink": "my_selfLink", + * // "target": {}, + * // "update": {}, + * // "updateTime": "my_updateTime" + * // } * }, - * - * auth: authClient, - * }; - * - * deploymentManager.deployments.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias deploymentmanager.deployments.update * @memberOf! () * @@ -2506,61 +2673,62 @@ export namespace deploymentmanager_v2 { * deploymentmanager.manifests.get * @desc Gets information about a specific manifest. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.readonly', + * ], + * }); * - * // The name of the deployment for this request. - * deployment: 'my-deployment', // TODO: Update placeholder value. + * // 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 deploymentmanager.manifests.get({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', * // The name of the manifest for this request. - * manifest: 'my-manifest', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * deploymentManager.manifests.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * manifest: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "config": {}, + * // "expandedConfig": "my_expandedConfig", + * // "id": "my_id", + * // "imports": [], + * // "insertTime": "my_insertTime", + * // "layout": "my_layout", + * // "name": "my_name", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias deploymentmanager.manifests.get * @memberOf! () * @@ -2635,71 +2803,72 @@ export namespace deploymentmanager_v2 { * deploymentmanager.manifests.list * @desc Lists all manifests for a given deployment. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.readonly', + * ], + * }); * - * // The name of the deployment for this request. - * deployment: 'my-deployment', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var manifestsPage = response['manifests']; - * if (!manifestsPage) { - * return; - * } - * for (var i = 0; i < manifestsPage.length; i++) { - * // TODO: Change code below to process each resource in `manifestsPage`: - * console.log(JSON.stringify(manifestsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * deploymentManager.manifests.list(request, handlePage); - * } - * }; - * - * deploymentManager.manifests.list(request, handlePage); - * }); + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); + * // Do the magic + * const res = await deploymentmanager.manifests.list({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "manifests": [], + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.manifests.list * @memberOf! () * @@ -2839,58 +3008,75 @@ export namespace deploymentmanager_v2 { * deploymentmanager.operations.get * @desc Gets information about a specific operation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the operation for this request. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.readonly', + * ], + * }); * - * deploymentManager.operations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await deploymentmanager.operations.get({ + * // The name of the operation for this request. + * operation: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias deploymentmanager.operations.get * @memberOf! () * @@ -2966,68 +3152,70 @@ export namespace deploymentmanager_v2 { * deploymentmanager.operations.list * @desc Lists all operations for a project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var operationsPage = response['operations']; - * if (!operationsPage) { - * return; - * } - * for (var i = 0; i < operationsPage.length; i++) { - * // TODO: Change code below to process each resource in `operationsPage`: - * console.log(JSON.stringify(operationsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * deploymentManager.operations.list(request, handlePage); - * } - * }; - * - * deploymentManager.operations.list(request, handlePage); - * }); + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.readonly', + * ], + * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); + * // 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 deploymentmanager.operations.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.operations.list * @memberOf! () * @@ -3158,61 +3346,66 @@ export namespace deploymentmanager_v2 { * deploymentmanager.resources.get * @desc Gets information about a single resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.readonly', + * ], + * }); * - * // The name of the deployment for this request. - * deployment: 'my-deployment', // TODO: Update placeholder value. + * // 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 deploymentmanager.resources.get({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', * // The name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * deploymentManager.resources.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * resource: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accessControl": {}, + * // "finalProperties": "my_finalProperties", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "manifest": "my_manifest", + * // "name": "my_name", + * // "properties": "my_properties", + * // "type": "my_type", + * // "update": {}, + * // "updateTime": "my_updateTime", + * // "url": "my_url", + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } * @alias deploymentmanager.resources.get * @memberOf! () * @@ -3287,71 +3480,72 @@ export namespace deploymentmanager_v2 { * deploymentmanager.resources.list * @desc Lists all resources in a given deployment. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.readonly', + * ], + * }); * - * // The name of the deployment for this request. - * deployment: 'my-deployment', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var resourcesPage = response['resources']; - * if (!resourcesPage) { - * return; - * } - * for (var i = 0; i < resourcesPage.length; i++) { - * // TODO: Change code below to process each resource in `resourcesPage`: - * console.log(JSON.stringify(resourcesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * deploymentManager.resources.list(request, handlePage); - * } - * }; - * - * deploymentManager.resources.list(request, handlePage); - * }); + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); + * // Do the magic + * const res = await deploymentmanager.resources.list({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.resources.list * @memberOf! () * @@ -3491,68 +3685,70 @@ export namespace deploymentmanager_v2 { * deploymentmanager.types.list * @desc Lists all resource types for Deployment Manager. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var typesPage = response['types']; - * if (!typesPage) { - * return; - * } - * for (var i = 0; i < typesPage.length; i++) { - * // TODO: Change code below to process each resource in `typesPage`: - * console.log(JSON.stringify(typesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * deploymentManager.types.list(request, handlePage); - * } - * }; - * - * deploymentManager.types.list(request, handlePage); - * }); + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.readonly', + * ], + * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); + * // 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 deploymentmanager.types.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "types": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.types.list * @memberOf! () * diff --git a/src/apis/deploymentmanager/v2beta.ts b/src/apis/deploymentmanager/v2beta.ts index 58dc9dcb1e4..786ea54d5f3 100644 --- a/src/apis/deploymentmanager/v2beta.ts +++ b/src/apis/deploymentmanager/v2beta.ts @@ -1166,6 +1166,74 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.compositeTypes.delete * @desc Deletes a composite type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.compositeTypes.delete({ + * // The name of the type for this request. + * compositeType: '[a-z](?:[-a-z0-9_.]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.compositeTypes.delete * @memberOf! () * @@ -1241,6 +1309,62 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.compositeTypes.get * @desc Gets information about a specific composite type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.compositeTypes.get({ + * // The name of the composite type for this request. + * compositeType: '[a-z](?:[-a-z0-9_.]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "name": "my_name", + * // "operation": {}, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "templateContents": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.compositeTypes.get * @memberOf! () * @@ -1316,6 +1440,88 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.compositeTypes.insert * @desc Creates a composite type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.compositeTypes.insert({ + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "name": "my_name", + * // "operation": {}, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "templateContents": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.compositeTypes.insert * @memberOf! () * @@ -1391,6 +1597,71 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.compositeTypes.list * @desc Lists all composite types for Deployment Manager. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.compositeTypes.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "compositeTypes": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.compositeTypes.list * @memberOf! () * @@ -1476,6 +1747,90 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.compositeTypes.patch * @desc Updates a composite type. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.compositeTypes.patch({ + * // The name of the composite type for this request. + * compositeType: '[a-z](?:[-a-z0-9_.]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "name": "my_name", + * // "operation": {}, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "templateContents": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.compositeTypes.patch * @memberOf! () * @@ -1552,6 +1907,90 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.compositeTypes.update * @desc Updates a composite type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.compositeTypes.update({ + * // The name of the composite type for this request. + * compositeType: '[a-z](?:[-a-z0-9_.]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "name": "my_name", + * // "operation": {}, + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "templateContents": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.compositeTypes.update * @memberOf! () * @@ -1755,6 +2194,82 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.deployments.cancelPreview * @desc Cancels and removes the preview currently associated with the deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.deployments.cancelPreview({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.cancelPreview * @memberOf! () * @@ -1831,6 +2346,76 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.deployments.delete * @desc Deletes a deployment and all of the resources in the deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.deployments.delete({ + * // Sets the policy to use for deleting resources. + * deletePolicy: 'placeholder-value', + * // The name of the deployment for this request. + * deployment: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.delete * @memberOf! () * @@ -1907,6 +2492,65 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.deployments.get * @desc Gets information about a specific deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.deployments.get({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "manifest": "my_manifest", + * // "name": "my_name", + * // "operation": {}, + * // "selfLink": "my_selfLink", + * // "target": {}, + * // "update": {}, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.get * @memberOf! () * @@ -1981,6 +2625,57 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.deployments.getIamPolicy * @desc Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.deployments.getIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.getIamPolicy * @memberOf! () * @@ -2054,6 +2749,95 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.deployments.insert * @desc Creates a deployment and all of the resources described by the deployment manifest. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.deployments.insert({ + * // Sets the policy to use for creating new resources. + * createPolicy: 'placeholder-value', + * // If set to true, creates a deployment and creates "shell" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the update() method or you can use the cancelPreview() method to cancel the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. + * preview: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "manifest": "my_manifest", + * // "name": "my_name", + * // "operation": {}, + * // "selfLink": "my_selfLink", + * // "target": {}, + * // "update": {}, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.insert * @memberOf! () * @@ -2131,6 +2915,71 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.deployments.list * @desc Lists all deployments for a given project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.deployments.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deployments": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.list * @memberOf! () * @@ -2210,6 +3059,99 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.deployments.patch * @desc Updates a deployment and all of the resources described by the deployment manifest. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.deployments.patch({ + * // Sets the policy to use for creating new resources. + * createPolicy: 'placeholder-value', + * // Sets the policy to use for deleting resources. + * deletePolicy: 'placeholder-value', + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. + * preview: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "manifest": "my_manifest", + * // "name": "my_name", + * // "operation": {}, + * // "selfLink": "my_selfLink", + * // "target": {}, + * // "update": {}, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.patch * @memberOf! () * @@ -2289,6 +3231,67 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.deployments.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.deployments.setIamPolicy({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.setIamPolicy * @memberOf! () * @@ -2363,6 +3366,82 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.deployments.stop * @desc Stops an ongoing operation. This does not roll back any work that has already been completed, but prevents any new work from being started. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.deployments.stop({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fingerprint": "my_fingerprint" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.stop * @memberOf! () * @@ -2438,6 +3517,60 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.deployments.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.deployments.testIamPermissions({ + * // Project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // Name or id of the resource for this request. + * resource: '[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.testIamPermissions * @memberOf! () * @@ -2518,6 +3651,99 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.deployments.update * @desc Updates a deployment and all of the resources described by the deployment manifest. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.deployments.update({ + * // Sets the policy to use for creating new resources. + * createPolicy: 'placeholder-value', + * // Sets the policy to use for deleting resources. + * deletePolicy: 'placeholder-value', + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. + * preview: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "manifest": "my_manifest", + * // "name": "my_name", + * // "operation": {}, + * // "selfLink": "my_selfLink", + * // "target": {}, + * // "update": {}, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.deployments.update * @memberOf! () * @@ -2857,6 +4083,63 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.manifests.get * @desc Gets information about a specific manifest. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.manifests.get({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // The name of the manifest for this request. + * manifest: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "config": {}, + * // "expandedConfig": "my_expandedConfig", + * // "id": "my_id", + * // "imports": [], + * // "insertTime": "my_insertTime", + * // "layout": "my_layout", + * // "name": "my_name", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.manifests.get * @memberOf! () * @@ -2930,6 +4213,73 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.manifests.list * @desc Lists all manifests for a given deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.manifests.list({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "manifests": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.manifests.list * @memberOf! () * @@ -3068,6 +4418,76 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.operations.get * @desc Gets information about a specific operation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.operations.get({ + * // The name of the operation for this request. + * operation: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.operations.get * @memberOf! () * @@ -3142,6 +4562,71 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.operations.list * @desc Lists all operations for a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.operations.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.operations.list * @memberOf! () * @@ -3271,6 +4756,67 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.resources.get * @desc Gets information about a single resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.resources.get({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the resource for this request. + * resource: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accessControl": {}, + * // "finalProperties": "my_finalProperties", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "manifest": "my_manifest", + * // "name": "my_name", + * // "properties": "my_properties", + * // "type": "my_type", + * // "update": {}, + * // "updateTime": "my_updateTime", + * // "url": "my_url", + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.resources.get * @memberOf! () * @@ -3344,6 +4890,73 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.resources.list * @desc Lists all resources in a given deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.resources.list({ + * // The name of the deployment for this request. + * deployment: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "resources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.resources.list * @memberOf! () * @@ -3482,6 +5095,74 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.typeProviders.delete * @desc Deletes a type provider. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.typeProviders.delete({ + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the type provider for this request. + * typeProvider: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.typeProviders.delete * @memberOf! () * @@ -3557,6 +5238,64 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.typeProviders.get * @desc Gets information about a specific type provider. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.typeProviders.get({ + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the type provider for this request. + * typeProvider: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "collectionOverrides": [], + * // "credential": {}, + * // "description": "my_description", + * // "descriptorUrl": "my_descriptorUrl", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "name": "my_name", + * // "operation": {}, + * // "options": {}, + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.typeProviders.get * @memberOf! () * @@ -3632,6 +5371,62 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.typeProviders.getType * @desc Gets a type info for a type provided by a TypeProvider. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.typeProviders.getType({ + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the type provider type for this request. + * type: 'placeholder-value', + * // The name of the type provider for this request. + * typeProvider: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "documentationLink": "my_documentationLink", + * // "kind": "my_kind", + * // "name": "my_name", + * // "schema": {}, + * // "selfLink": "my_selfLink", + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.typeProviders.getType * @memberOf! () * @@ -3706,6 +5501,90 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.typeProviders.insert * @desc Creates a type provider. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.typeProviders.insert({ + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "collectionOverrides": [], + * // "credential": {}, + * // "description": "my_description", + * // "descriptorUrl": "my_descriptorUrl", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "name": "my_name", + * // "operation": {}, + * // "options": {}, + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.typeProviders.insert * @memberOf! () * @@ -3781,6 +5660,71 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.typeProviders.list * @desc Lists all resource type providers for Deployment Manager. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.typeProviders.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "typeProviders": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.typeProviders.list * @memberOf! () * @@ -3866,6 +5810,73 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.typeProviders.listTypes * @desc Lists all the type info for a TypeProvider. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.typeProviders.listTypes({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the type provider for this request. + * typeProvider: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "types": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.typeProviders.listTypes * @memberOf! () * @@ -3954,6 +5965,92 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.typeProviders.patch * @desc Updates a type provider. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.typeProviders.patch({ + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the type provider for this request. + * typeProvider: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "collectionOverrides": [], + * // "credential": {}, + * // "description": "my_description", + * // "descriptorUrl": "my_descriptorUrl", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "name": "my_name", + * // "operation": {}, + * // "options": {}, + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.typeProviders.patch * @memberOf! () * @@ -4030,6 +6127,92 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.typeProviders.update * @desc Updates a type provider. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * ], + * }); + * + * // 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 deploymentmanager.typeProviders.update({ + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * // The name of the type provider for this request. + * typeProvider: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "collectionOverrides": [], + * // "credential": {}, + * // "description": "my_description", + * // "descriptorUrl": "my_descriptorUrl", + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "labels": [], + * // "name": "my_name", + * // "operation": {}, + * // "options": {}, + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientOperationId": "my_clientOperationId", + * // "creationTimestamp": "my_creationTimestamp", + * // "description": "my_description", + * // "endTime": "my_endTime", + * // "error": {}, + * // "httpErrorMessage": "my_httpErrorMessage", + * // "httpErrorStatusCode": 0, + * // "id": "my_id", + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "progress": 0, + * // "region": "my_region", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "statusMessage": "my_statusMessage", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "user": "my_user", + * // "warnings": [], + * // "zone": "my_zone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.typeProviders.update * @memberOf! () * @@ -4285,6 +6468,71 @@ export namespace deploymentmanager_v2beta { /** * deploymentmanager.types.list * @desc Lists all resource types for Deployment Manager. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/deploymentmanager.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 deploymentmanager = google.deploymentmanager('v2beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.cloudman', + * 'https://www.googleapis.com/auth/ndev.cloudman.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 deploymentmanager.types.list({ + * // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + * // + * // For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + * // + * // You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * // + * // To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * filter: 'placeholder-value', + * // The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * maxResults: 'placeholder-value', + * // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * // + * // You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * // + * // Currently, only sorting by name or creationTimestamp desc is supported. + * orderBy: 'placeholder-value', + * // Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The project ID for this request. + * project: + * '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "types": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias deploymentmanager.types.list * @memberOf! () * diff --git a/src/apis/dfareporting/v3.3.ts b/src/apis/dfareporting/v3.3.ts index 9af75afece6..a4bc0f3ac5c 100644 --- a/src/apis/dfareporting/v3.3.ts +++ b/src/apis/dfareporting/v3.3.ts @@ -6477,6 +6477,52 @@ export namespace dfareporting_v3_3 { /** * dfareporting.accountActiveAdSummaries.get * @desc Gets the account's active ad summary by account ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accountActiveAdSummaries.get({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Account ID. + * summaryAccountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "activeAds": "my_activeAds", + * // "activeAdsLimitTier": "my_activeAdsLimitTier", + * // "availableAds": "my_availableAds", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accountActiveAdSummaries.get * @memberOf! () * @@ -6578,6 +6624,50 @@ export namespace dfareporting_v3_3 { /** * dfareporting.accountPermissionGroups.get * @desc Gets one account permission group by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accountPermissionGroups.get({ + * // Account permission group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accountPermissionGroups.get * @memberOf! () * @@ -6655,6 +6745,47 @@ export namespace dfareporting_v3_3 { /** * dfareporting.accountPermissionGroups.list * @desc Retrieves the list of account permission groups. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accountPermissionGroups.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountPermissionGroups": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accountPermissionGroups.list * @memberOf! () * @@ -6776,6 +6907,53 @@ export namespace dfareporting_v3_3 { /** * dfareporting.accountPermissions.get * @desc Gets one account permission by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accountPermissions.get({ + * // Account permission ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountProfiles": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "level": "my_level", + * // "name": "my_name", + * // "permissionGroupId": "my_permissionGroupId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accountPermissions.get * @memberOf! () * @@ -6851,6 +7029,47 @@ export namespace dfareporting_v3_3 { /** * dfareporting.accountPermissions.list * @desc Retrieves the list of account permissions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accountPermissions.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountPermissions": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accountPermissions.list * @memberOf! () * @@ -6970,6 +7189,66 @@ export namespace dfareporting_v3_3 { /** * dfareporting.accounts.get * @desc Gets one account by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accounts.get({ + * // Account ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountPermissionIds": [], + * // "accountProfile": "my_accountProfile", + * // "active": false, + * // "activeAdsLimitTier": "my_activeAdsLimitTier", + * // "activeViewOptOut": false, + * // "availablePermissionIds": [], + * // "countryId": "my_countryId", + * // "currencyId": "my_currencyId", + * // "defaultCreativeSizeId": "my_defaultCreativeSizeId", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "maximumImageSize": "my_maximumImageSize", + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "reportsConfiguration": {}, + * // "shareReportsWithTwitter": false, + * // "teaserSizeLimit": "my_teaserSizeLimit" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accounts.get * @memberOf! () * @@ -7042,6 +7321,62 @@ export namespace dfareporting_v3_3 { /** * dfareporting.accounts.list * @desc Retrieves the list of accounts, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accounts.list({ + * // Select only active accounts. Don't set this field to select both active and non-active accounts. + * active: 'placeholder-value', + * // Select only accounts with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "account*2015" will return objects with names like "account June 2015", "account April 2015", or simply "account 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "account" will match objects with name "my account", "account 2015", or simply "account". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accounts": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accounts.list * @memberOf! () * @@ -7123,6 +7458,92 @@ export namespace dfareporting_v3_3 { /** * dfareporting.accounts.patch * @desc Updates an existing account. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accounts.patch({ + * // Account ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountPermissionIds": [], + * // "accountProfile": "my_accountProfile", + * // "active": false, + * // "activeAdsLimitTier": "my_activeAdsLimitTier", + * // "activeViewOptOut": false, + * // "availablePermissionIds": [], + * // "countryId": "my_countryId", + * // "currencyId": "my_currencyId", + * // "defaultCreativeSizeId": "my_defaultCreativeSizeId", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "maximumImageSize": "my_maximumImageSize", + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "reportsConfiguration": {}, + * // "shareReportsWithTwitter": false, + * // "teaserSizeLimit": "my_teaserSizeLimit" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountPermissionIds": [], + * // "accountProfile": "my_accountProfile", + * // "active": false, + * // "activeAdsLimitTier": "my_activeAdsLimitTier", + * // "activeViewOptOut": false, + * // "availablePermissionIds": [], + * // "countryId": "my_countryId", + * // "currencyId": "my_currencyId", + * // "defaultCreativeSizeId": "my_defaultCreativeSizeId", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "maximumImageSize": "my_maximumImageSize", + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "reportsConfiguration": {}, + * // "shareReportsWithTwitter": false, + * // "teaserSizeLimit": "my_teaserSizeLimit" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accounts.patch * @memberOf! () * @@ -7195,6 +7616,90 @@ export namespace dfareporting_v3_3 { /** * dfareporting.accounts.update * @desc Updates an existing account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accounts.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountPermissionIds": [], + * // "accountProfile": "my_accountProfile", + * // "active": false, + * // "activeAdsLimitTier": "my_activeAdsLimitTier", + * // "activeViewOptOut": false, + * // "availablePermissionIds": [], + * // "countryId": "my_countryId", + * // "currencyId": "my_currencyId", + * // "defaultCreativeSizeId": "my_defaultCreativeSizeId", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "maximumImageSize": "my_maximumImageSize", + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "reportsConfiguration": {}, + * // "shareReportsWithTwitter": false, + * // "teaserSizeLimit": "my_teaserSizeLimit" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountPermissionIds": [], + * // "accountProfile": "my_accountProfile", + * // "active": false, + * // "activeAdsLimitTier": "my_activeAdsLimitTier", + * // "activeViewOptOut": false, + * // "availablePermissionIds": [], + * // "countryId": "my_countryId", + * // "currencyId": "my_currencyId", + * // "defaultCreativeSizeId": "my_defaultCreativeSizeId", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "maximumImageSize": "my_maximumImageSize", + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "reportsConfiguration": {}, + * // "shareReportsWithTwitter": false, + * // "teaserSizeLimit": "my_teaserSizeLimit" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accounts.update * @memberOf! () * @@ -7364,6 +7869,63 @@ export namespace dfareporting_v3_3 { /** * dfareporting.accountUserProfiles.get * @desc Gets one account user profile by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accountUserProfiles.get({ + * // User profile ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserFilter": {}, + * // "campaignFilter": {}, + * // "comments": "my_comments", + * // "email": "my_email", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "name": "my_name", + * // "siteFilter": {}, + * // "subaccountId": "my_subaccountId", + * // "traffickerType": "my_traffickerType", + * // "userAccessType": "my_userAccessType", + * // "userRoleFilter": {}, + * // "userRoleId": "my_userRoleId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accountUserProfiles.get * @memberOf! () * @@ -7439,6 +8001,84 @@ export namespace dfareporting_v3_3 { /** * dfareporting.accountUserProfiles.insert * @desc Inserts a new account user profile. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accountUserProfiles.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserFilter": {}, + * // "campaignFilter": {}, + * // "comments": "my_comments", + * // "email": "my_email", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "name": "my_name", + * // "siteFilter": {}, + * // "subaccountId": "my_subaccountId", + * // "traffickerType": "my_traffickerType", + * // "userAccessType": "my_userAccessType", + * // "userRoleFilter": {}, + * // "userRoleId": "my_userRoleId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserFilter": {}, + * // "campaignFilter": {}, + * // "comments": "my_comments", + * // "email": "my_email", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "name": "my_name", + * // "siteFilter": {}, + * // "subaccountId": "my_subaccountId", + * // "traffickerType": "my_traffickerType", + * // "userAccessType": "my_userAccessType", + * // "userRoleFilter": {}, + * // "userRoleId": "my_userRoleId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accountUserProfiles.insert * @memberOf! () * @@ -7514,6 +8154,66 @@ export namespace dfareporting_v3_3 { /** * dfareporting.accountUserProfiles.list * @desc Retrieves a list of account user profiles, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accountUserProfiles.list({ + * // Select only active user profiles. + * active: 'placeholder-value', + * // Select only user profiles with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, "user profile*2015" will return objects with names like "user profile June 2015", "user profile April 2015", or simply "user profile 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "user profile" will match objects with name "my user profile", "user profile 2015", or simply "user profile". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only user profiles with the specified subaccount ID. + * subaccountId: 'placeholder-value', + * // Select only user profiles with the specified user role ID. + * userRoleId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountUserProfiles": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accountUserProfiles.list * @memberOf! () * @@ -7606,6 +8306,86 @@ export namespace dfareporting_v3_3 { /** * dfareporting.accountUserProfiles.patch * @desc Updates an existing account user profile. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accountUserProfiles.patch({ + * // User profile ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserFilter": {}, + * // "campaignFilter": {}, + * // "comments": "my_comments", + * // "email": "my_email", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "name": "my_name", + * // "siteFilter": {}, + * // "subaccountId": "my_subaccountId", + * // "traffickerType": "my_traffickerType", + * // "userAccessType": "my_userAccessType", + * // "userRoleFilter": {}, + * // "userRoleId": "my_userRoleId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserFilter": {}, + * // "campaignFilter": {}, + * // "comments": "my_comments", + * // "email": "my_email", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "name": "my_name", + * // "siteFilter": {}, + * // "subaccountId": "my_subaccountId", + * // "traffickerType": "my_traffickerType", + * // "userAccessType": "my_userAccessType", + * // "userRoleFilter": {}, + * // "userRoleId": "my_userRoleId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accountUserProfiles.patch * @memberOf! () * @@ -7682,6 +8462,84 @@ export namespace dfareporting_v3_3 { /** * dfareporting.accountUserProfiles.update * @desc Updates an existing account user profile. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accountUserProfiles.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserFilter": {}, + * // "campaignFilter": {}, + * // "comments": "my_comments", + * // "email": "my_email", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "name": "my_name", + * // "siteFilter": {}, + * // "subaccountId": "my_subaccountId", + * // "traffickerType": "my_traffickerType", + * // "userAccessType": "my_userAccessType", + * // "userRoleFilter": {}, + * // "userRoleId": "my_userRoleId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserFilter": {}, + * // "campaignFilter": {}, + * // "comments": "my_comments", + * // "email": "my_email", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "name": "my_name", + * // "siteFilter": {}, + * // "subaccountId": "my_subaccountId", + * // "traffickerType": "my_traffickerType", + * // "userAccessType": "my_userAccessType", + * // "userRoleFilter": {}, + * // "userRoleId": "my_userRoleId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accountUserProfiles.update * @memberOf! () * @@ -7884,6 +8742,86 @@ export namespace dfareporting_v3_3 { /** * dfareporting.ads.get * @desc Gets one ad by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.ads.get({ + * // Ad ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentId": "my_audienceSegmentId", + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "clickThroughUrl": {}, + * // "clickThroughUrlSuffixProperties": {}, + * // "comments": "my_comments", + * // "compatibility": "my_compatibility", + * // "createInfo": {}, + * // "creativeGroupAssignments": [], + * // "creativeRotation": {}, + * // "dayPartTargeting": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "deliverySchedule": {}, + * // "dynamicClickTracker": false, + * // "endTime": "my_endTime", + * // "eventTagOverrides": [], + * // "geoTargeting": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementAssignments": [], + * // "remarketingListExpression": {}, + * // "size": {}, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "startTime": "my_startTime", + * // "subaccountId": "my_subaccountId", + * // "targetingTemplateId": "my_targetingTemplateId", + * // "technologyTargeting": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.ads.get * @memberOf! () * @@ -7955,6 +8893,130 @@ export namespace dfareporting_v3_3 { /** * dfareporting.ads.insert * @desc Inserts a new ad. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.ads.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentId": "my_audienceSegmentId", + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "clickThroughUrl": {}, + * // "clickThroughUrlSuffixProperties": {}, + * // "comments": "my_comments", + * // "compatibility": "my_compatibility", + * // "createInfo": {}, + * // "creativeGroupAssignments": [], + * // "creativeRotation": {}, + * // "dayPartTargeting": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "deliverySchedule": {}, + * // "dynamicClickTracker": false, + * // "endTime": "my_endTime", + * // "eventTagOverrides": [], + * // "geoTargeting": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementAssignments": [], + * // "remarketingListExpression": {}, + * // "size": {}, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "startTime": "my_startTime", + * // "subaccountId": "my_subaccountId", + * // "targetingTemplateId": "my_targetingTemplateId", + * // "technologyTargeting": {}, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentId": "my_audienceSegmentId", + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "clickThroughUrl": {}, + * // "clickThroughUrlSuffixProperties": {}, + * // "comments": "my_comments", + * // "compatibility": "my_compatibility", + * // "createInfo": {}, + * // "creativeGroupAssignments": [], + * // "creativeRotation": {}, + * // "dayPartTargeting": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "deliverySchedule": {}, + * // "dynamicClickTracker": false, + * // "endTime": "my_endTime", + * // "eventTagOverrides": [], + * // "geoTargeting": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementAssignments": [], + * // "remarketingListExpression": {}, + * // "size": {}, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "startTime": "my_startTime", + * // "subaccountId": "my_subaccountId", + * // "targetingTemplateId": "my_targetingTemplateId", + * // "technologyTargeting": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.ads.insert * @memberOf! () * @@ -8026,6 +9088,94 @@ export namespace dfareporting_v3_3 { /** * dfareporting.ads.list * @desc Retrieves a list of ads, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.ads.list({ + * // Select only active ads. + * active: 'placeholder-value', + * // Select only ads with this advertiser ID. + * advertiserId: 'placeholder-value', + * // Select only archived ads. + * archived: 'placeholder-value', + * // Select only ads with these audience segment IDs. + * audienceSegmentIds: 'placeholder-value', + * // Select only ads with these campaign IDs. + * campaignIds: 'placeholder-value', + * // Select default ads with the specified compatibility. Applicable when type is AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video ads developed with the VAST standard. + * compatibility: 'placeholder-value', + * // Select only ads with these creative IDs assigned. + * creativeIds: 'placeholder-value', + * // Select only ads with these creative optimization configuration IDs. + * creativeOptimizationConfigurationIds: 'placeholder-value', + * // Select only dynamic click trackers. Applicable when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click trackers. If false, select static click trackers. Leave unset to select both. + * dynamicClickTracker: 'placeholder-value', + * // Select only ads with these IDs. + * ids: 'placeholder-value', + * // Select only ads with these landing page IDs. + * landingPageIds: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Select only ads with this event tag override ID. + * overriddenEventTagId: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // Select only ads with these placement IDs assigned. + * placementIds: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Select only ads whose list targeting expression use these remarketing list IDs. + * remarketingListIds: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "ad*2015" will return objects with names like "ad June 2015", "ad April 2015", or simply "ad 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "ad" will match objects with name "my ad", "ad 2015", or simply "ad". + * searchString: 'placeholder-value', + * // Select only ads with these size IDs. + * sizeIds: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only ads that are SSL-compliant. + * sslCompliant: 'placeholder-value', + * // Select only ads that require SSL. + * sslRequired: 'placeholder-value', + * // Select only ads with these types. + * type: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ads": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.ads.list * @memberOf! () * @@ -8121,6 +9271,132 @@ export namespace dfareporting_v3_3 { /** * dfareporting.ads.patch * @desc Updates an existing ad. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.ads.patch({ + * // Ad ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentId": "my_audienceSegmentId", + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "clickThroughUrl": {}, + * // "clickThroughUrlSuffixProperties": {}, + * // "comments": "my_comments", + * // "compatibility": "my_compatibility", + * // "createInfo": {}, + * // "creativeGroupAssignments": [], + * // "creativeRotation": {}, + * // "dayPartTargeting": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "deliverySchedule": {}, + * // "dynamicClickTracker": false, + * // "endTime": "my_endTime", + * // "eventTagOverrides": [], + * // "geoTargeting": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementAssignments": [], + * // "remarketingListExpression": {}, + * // "size": {}, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "startTime": "my_startTime", + * // "subaccountId": "my_subaccountId", + * // "targetingTemplateId": "my_targetingTemplateId", + * // "technologyTargeting": {}, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentId": "my_audienceSegmentId", + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "clickThroughUrl": {}, + * // "clickThroughUrlSuffixProperties": {}, + * // "comments": "my_comments", + * // "compatibility": "my_compatibility", + * // "createInfo": {}, + * // "creativeGroupAssignments": [], + * // "creativeRotation": {}, + * // "dayPartTargeting": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "deliverySchedule": {}, + * // "dynamicClickTracker": false, + * // "endTime": "my_endTime", + * // "eventTagOverrides": [], + * // "geoTargeting": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementAssignments": [], + * // "remarketingListExpression": {}, + * // "size": {}, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "startTime": "my_startTime", + * // "subaccountId": "my_subaccountId", + * // "targetingTemplateId": "my_targetingTemplateId", + * // "technologyTargeting": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.ads.patch * @memberOf! () * @@ -8193,6 +9469,130 @@ export namespace dfareporting_v3_3 { /** * dfareporting.ads.update * @desc Updates an existing ad. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.ads.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentId": "my_audienceSegmentId", + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "clickThroughUrl": {}, + * // "clickThroughUrlSuffixProperties": {}, + * // "comments": "my_comments", + * // "compatibility": "my_compatibility", + * // "createInfo": {}, + * // "creativeGroupAssignments": [], + * // "creativeRotation": {}, + * // "dayPartTargeting": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "deliverySchedule": {}, + * // "dynamicClickTracker": false, + * // "endTime": "my_endTime", + * // "eventTagOverrides": [], + * // "geoTargeting": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementAssignments": [], + * // "remarketingListExpression": {}, + * // "size": {}, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "startTime": "my_startTime", + * // "subaccountId": "my_subaccountId", + * // "targetingTemplateId": "my_targetingTemplateId", + * // "technologyTargeting": {}, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentId": "my_audienceSegmentId", + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "clickThroughUrl": {}, + * // "clickThroughUrlSuffixProperties": {}, + * // "comments": "my_comments", + * // "compatibility": "my_compatibility", + * // "createInfo": {}, + * // "creativeGroupAssignments": [], + * // "creativeRotation": {}, + * // "dayPartTargeting": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "deliverySchedule": {}, + * // "dynamicClickTracker": false, + * // "endTime": "my_endTime", + * // "eventTagOverrides": [], + * // "geoTargeting": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementAssignments": [], + * // "remarketingListExpression": {}, + * // "size": {}, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "startTime": "my_startTime", + * // "subaccountId": "my_subaccountId", + * // "targetingTemplateId": "my_targetingTemplateId", + * // "technologyTargeting": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.ads.update * @memberOf! () * @@ -8442,6 +9842,43 @@ export namespace dfareporting_v3_3 { /** * dfareporting.advertiserGroups.delete * @desc Deletes an existing advertiser group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserGroups.delete({ + * // Advertiser group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserGroups.delete * @memberOf! () * @@ -8515,6 +9952,51 @@ export namespace dfareporting_v3_3 { /** * dfareporting.advertiserGroups.get * @desc Gets one advertiser group by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserGroups.get({ + * // Advertiser group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserGroups.get * @memberOf! () * @@ -8590,6 +10072,60 @@ export namespace dfareporting_v3_3 { /** * dfareporting.advertiserGroups.insert * @desc Inserts a new advertiser group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserGroups.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserGroups.insert * @memberOf! () * @@ -8665,6 +10201,60 @@ export namespace dfareporting_v3_3 { /** * dfareporting.advertiserGroups.list * @desc Retrieves a list of advertiser groups, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserGroups.list({ + * // Select only advertiser groups with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "advertiser*2015" will return objects with names like "advertiser group June 2015", "advertiser group April 2015", or simply "advertiser group 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "advertisergroup" will match objects with name "my advertisergroup", "advertisergroup 2015", or simply "advertisergroup". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserGroups": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserGroups.list * @memberOf! () * @@ -8754,6 +10344,62 @@ export namespace dfareporting_v3_3 { /** * dfareporting.advertiserGroups.patch * @desc Updates an existing advertiser group. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserGroups.patch({ + * // Advertiser group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserGroups.patch * @memberOf! () * @@ -8830,6 +10476,60 @@ export namespace dfareporting_v3_3 { /** * dfareporting.advertiserGroups.update * @desc Updates an existing advertiser group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserGroups.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserGroups.update * @memberOf! () * @@ -9036,6 +10736,54 @@ export namespace dfareporting_v3_3 { /** * dfareporting.advertiserLandingPages.get * @desc Gets one landing page by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserLandingPages.get({ + * // Landing page ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "archived": false, + * // "deepLinks": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserLandingPages.get * @memberOf! () * @@ -9111,6 +10859,66 @@ export namespace dfareporting_v3_3 { /** * dfareporting.advertiserLandingPages.insert * @desc Inserts a new landing page. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserLandingPages.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "advertiserId": "my_advertiserId", + * // "archived": false, + * // "deepLinks": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "url": "my_url" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "archived": false, + * // "deepLinks": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserLandingPages.insert * @memberOf! () * @@ -9186,6 +10994,68 @@ export namespace dfareporting_v3_3 { /** * dfareporting.advertiserLandingPages.list * @desc Retrieves a list of landing pages. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserLandingPages.list({ + * // Select only landing pages that belong to these advertisers. + * advertiserIds: 'placeholder-value', + * // Select only archived landing pages. Don't set this field to select both archived and non-archived landing pages. + * archived: 'placeholder-value', + * // Select only landing pages that are associated with these campaigns. + * campaignIds: 'placeholder-value', + * // Select only landing pages with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for landing pages by name or ID. Wildcards (*) are allowed. For example, "landingpage*2017" will return landing pages with names like "landingpage July 2017", "landingpage March 2017", or simply "landingpage 2017". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "landingpage" will match campaigns with name "my landingpage", "landingpage 2015", or simply "landingpage". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only landing pages that belong to this subaccount. + * subaccountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "landingPages": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserLandingPages.list * @memberOf! () * @@ -9279,6 +11149,68 @@ export namespace dfareporting_v3_3 { /** * dfareporting.advertiserLandingPages.patch * @desc Updates an existing landing page. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserLandingPages.patch({ + * // Landing page ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "advertiserId": "my_advertiserId", + * // "archived": false, + * // "deepLinks": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "url": "my_url" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "archived": false, + * // "deepLinks": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserLandingPages.patch * @memberOf! () * @@ -9355,6 +11287,66 @@ export namespace dfareporting_v3_3 { /** * dfareporting.advertiserLandingPages.update * @desc Updates an existing landing page. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserLandingPages.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "advertiserId": "my_advertiserId", + * // "archived": false, + * // "deepLinks": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "url": "my_url" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "archived": false, + * // "deepLinks": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserLandingPages.update * @memberOf! () * @@ -9561,6 +11553,62 @@ export namespace dfareporting_v3_3 { /** * dfareporting.advertisers.get * @desc Gets one advertiser by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertisers.get({ + * // Advertiser ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserGroupId": "my_advertiserGroupId", + * // "clickThroughUrlSuffix": "my_clickThroughUrlSuffix", + * // "defaultClickThroughEventTagId": "my_defaultClickThroughEventTagId", + * // "defaultEmail": "my_defaultEmail", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "originalFloodlightConfigurationId": "my_originalFloodlightConfigurationId", + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "suspended": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertisers.get * @memberOf! () * @@ -9635,6 +11683,82 @@ export namespace dfareporting_v3_3 { /** * dfareporting.advertisers.insert * @desc Inserts a new advertiser. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertisers.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserGroupId": "my_advertiserGroupId", + * // "clickThroughUrlSuffix": "my_clickThroughUrlSuffix", + * // "defaultClickThroughEventTagId": "my_defaultClickThroughEventTagId", + * // "defaultEmail": "my_defaultEmail", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "originalFloodlightConfigurationId": "my_originalFloodlightConfigurationId", + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "suspended": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserGroupId": "my_advertiserGroupId", + * // "clickThroughUrlSuffix": "my_clickThroughUrlSuffix", + * // "defaultClickThroughEventTagId": "my_defaultClickThroughEventTagId", + * // "defaultEmail": "my_defaultEmail", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "originalFloodlightConfigurationId": "my_originalFloodlightConfigurationId", + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "suspended": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertisers.insert * @memberOf! () * @@ -9710,6 +11834,72 @@ export namespace dfareporting_v3_3 { /** * dfareporting.advertisers.list * @desc Retrieves a list of advertisers, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertisers.list({ + * // Select only advertisers with these advertiser group IDs. + * advertiserGroupIds: 'placeholder-value', + * // Select only advertisers with these floodlight configuration IDs. + * floodlightConfigurationIds: 'placeholder-value', + * // Select only advertisers with these IDs. + * ids: 'placeholder-value', + * // Select only advertisers which do not belong to any advertiser group. + * includeAdvertisersWithoutGroupsOnly: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Select only advertisers which use another advertiser's floodlight configuration. + * onlyParent: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "advertiser*2015" will return objects with names like "advertiser June 2015", "advertiser April 2015", or simply "advertiser 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "advertiser" will match objects with name "my advertiser", "advertiser 2015", or simply "advertiser". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only advertisers with the specified status. + * status: 'placeholder-value', + * // Select only advertisers with these subaccount IDs. + * subaccountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertisers": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertisers.list * @memberOf! () * @@ -9797,6 +11987,84 @@ export namespace dfareporting_v3_3 { /** * dfareporting.advertisers.patch * @desc Updates an existing advertiser. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertisers.patch({ + * // Advertiser ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserGroupId": "my_advertiserGroupId", + * // "clickThroughUrlSuffix": "my_clickThroughUrlSuffix", + * // "defaultClickThroughEventTagId": "my_defaultClickThroughEventTagId", + * // "defaultEmail": "my_defaultEmail", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "originalFloodlightConfigurationId": "my_originalFloodlightConfigurationId", + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "suspended": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserGroupId": "my_advertiserGroupId", + * // "clickThroughUrlSuffix": "my_clickThroughUrlSuffix", + * // "defaultClickThroughEventTagId": "my_defaultClickThroughEventTagId", + * // "defaultEmail": "my_defaultEmail", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "originalFloodlightConfigurationId": "my_originalFloodlightConfigurationId", + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "suspended": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertisers.patch * @memberOf! () * @@ -9873,6 +12141,82 @@ export namespace dfareporting_v3_3 { /** * dfareporting.advertisers.update * @desc Updates an existing advertiser. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertisers.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserGroupId": "my_advertiserGroupId", + * // "clickThroughUrlSuffix": "my_clickThroughUrlSuffix", + * // "defaultClickThroughEventTagId": "my_defaultClickThroughEventTagId", + * // "defaultEmail": "my_defaultEmail", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "originalFloodlightConfigurationId": "my_originalFloodlightConfigurationId", + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "suspended": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserGroupId": "my_advertiserGroupId", + * // "clickThroughUrlSuffix": "my_clickThroughUrlSuffix", + * // "defaultClickThroughEventTagId": "my_defaultClickThroughEventTagId", + * // "defaultEmail": "my_defaultEmail", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "originalFloodlightConfigurationId": "my_originalFloodlightConfigurationId", + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "suspended": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertisers.update * @memberOf! () * @@ -10085,6 +12429,47 @@ export namespace dfareporting_v3_3 { /** * dfareporting.browsers.list * @desc Retrieves a list of browsers. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.browsers.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "browsers": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.browsers.list * @memberOf! () * @@ -10178,6 +12563,58 @@ export namespace dfareporting_v3_3 { /** * dfareporting.campaignCreativeAssociations.insert * @desc Associates a creative with the specified campaign. This method creates a default ad with dimensions matching the creative in the campaign if such a default ad does not exist already. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.campaignCreativeAssociations.insert({ + * // Campaign ID in this association. + * campaignId: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creativeId": "my_creativeId", + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creativeId": "my_creativeId", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.campaignCreativeAssociations.insert * @memberOf! () * @@ -10261,6 +12698,56 @@ export namespace dfareporting_v3_3 { /** * dfareporting.campaignCreativeAssociations.list * @desc Retrieves the list of creative IDs associated with the specified campaign. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.campaignCreativeAssociations.list({ + * // Campaign ID in this association. + * campaignId: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "campaignCreativeAssociations": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.campaignCreativeAssociations.list * @memberOf! () * @@ -10413,6 +12900,75 @@ export namespace dfareporting_v3_3 { /** * dfareporting.campaigns.get * @desc Gets one campaign by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.campaigns.get({ + * // Campaign ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adBlockingConfiguration": {}, + * // "additionalCreativeOptimizationConfigurations": [], + * // "advertiserGroupId": "my_advertiserGroupId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentGroups": [], + * // "billingInvoiceCode": "my_billingInvoiceCode", + * // "clickThroughUrlSuffixProperties": {}, + * // "comment": "my_comment", + * // "createInfo": {}, + * // "creativeGroupIds": [], + * // "creativeOptimizationConfiguration": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "defaultLandingPageId": "my_defaultLandingPageId", + * // "endDate": "my_endDate", + * // "eventTagOverrides": [], + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "startDate": "my_startDate", + * // "subaccountId": "my_subaccountId", + * // "traffickerEmails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.campaigns.get * @memberOf! () * @@ -10485,6 +13041,108 @@ export namespace dfareporting_v3_3 { /** * dfareporting.campaigns.insert * @desc Inserts a new campaign. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.campaigns.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "adBlockingConfiguration": {}, + * // "additionalCreativeOptimizationConfigurations": [], + * // "advertiserGroupId": "my_advertiserGroupId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentGroups": [], + * // "billingInvoiceCode": "my_billingInvoiceCode", + * // "clickThroughUrlSuffixProperties": {}, + * // "comment": "my_comment", + * // "createInfo": {}, + * // "creativeGroupIds": [], + * // "creativeOptimizationConfiguration": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "defaultLandingPageId": "my_defaultLandingPageId", + * // "endDate": "my_endDate", + * // "eventTagOverrides": [], + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "startDate": "my_startDate", + * // "subaccountId": "my_subaccountId", + * // "traffickerEmails": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adBlockingConfiguration": {}, + * // "additionalCreativeOptimizationConfigurations": [], + * // "advertiserGroupId": "my_advertiserGroupId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentGroups": [], + * // "billingInvoiceCode": "my_billingInvoiceCode", + * // "clickThroughUrlSuffixProperties": {}, + * // "comment": "my_comment", + * // "createInfo": {}, + * // "creativeGroupIds": [], + * // "creativeOptimizationConfiguration": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "defaultLandingPageId": "my_defaultLandingPageId", + * // "endDate": "my_endDate", + * // "eventTagOverrides": [], + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "startDate": "my_startDate", + * // "subaccountId": "my_subaccountId", + * // "traffickerEmails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.campaigns.insert * @memberOf! () * @@ -10556,6 +13214,74 @@ export namespace dfareporting_v3_3 { /** * dfareporting.campaigns.list * @desc Retrieves a list of campaigns, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.campaigns.list({ + * // Select only campaigns whose advertisers belong to these advertiser groups. + * advertiserGroupIds: 'placeholder-value', + * // Select only campaigns that belong to these advertisers. + * advertiserIds: 'placeholder-value', + * // Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns. + * archived: 'placeholder-value', + * // Select only campaigns that have at least one optimization activity. + * atLeastOneOptimizationActivity: 'placeholder-value', + * // Exclude campaigns with these IDs. + * excludedIds: 'placeholder-value', + * // Select only campaigns with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Select only campaigns that have overridden this event tag ID. + * overriddenEventTagId: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for campaigns by name or ID. Wildcards (*) are allowed. For example, "campaign*2015" will return campaigns with names like "campaign June 2015", "campaign April 2015", or simply "campaign 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "campaign" will match campaigns with name "my campaign", "campaign 2015", or simply "campaign". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only campaigns that belong to this subaccount. + * subaccountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "campaigns": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.campaigns.list * @memberOf! () * @@ -10643,6 +13369,110 @@ export namespace dfareporting_v3_3 { /** * dfareporting.campaigns.patch * @desc Updates an existing campaign. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.campaigns.patch({ + * // Campaign ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "adBlockingConfiguration": {}, + * // "additionalCreativeOptimizationConfigurations": [], + * // "advertiserGroupId": "my_advertiserGroupId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentGroups": [], + * // "billingInvoiceCode": "my_billingInvoiceCode", + * // "clickThroughUrlSuffixProperties": {}, + * // "comment": "my_comment", + * // "createInfo": {}, + * // "creativeGroupIds": [], + * // "creativeOptimizationConfiguration": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "defaultLandingPageId": "my_defaultLandingPageId", + * // "endDate": "my_endDate", + * // "eventTagOverrides": [], + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "startDate": "my_startDate", + * // "subaccountId": "my_subaccountId", + * // "traffickerEmails": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adBlockingConfiguration": {}, + * // "additionalCreativeOptimizationConfigurations": [], + * // "advertiserGroupId": "my_advertiserGroupId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentGroups": [], + * // "billingInvoiceCode": "my_billingInvoiceCode", + * // "clickThroughUrlSuffixProperties": {}, + * // "comment": "my_comment", + * // "createInfo": {}, + * // "creativeGroupIds": [], + * // "creativeOptimizationConfiguration": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "defaultLandingPageId": "my_defaultLandingPageId", + * // "endDate": "my_endDate", + * // "eventTagOverrides": [], + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "startDate": "my_startDate", + * // "subaccountId": "my_subaccountId", + * // "traffickerEmails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.campaigns.patch * @memberOf! () * @@ -10715,6 +13545,108 @@ export namespace dfareporting_v3_3 { /** * dfareporting.campaigns.update * @desc Updates an existing campaign. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.campaigns.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "adBlockingConfiguration": {}, + * // "additionalCreativeOptimizationConfigurations": [], + * // "advertiserGroupId": "my_advertiserGroupId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentGroups": [], + * // "billingInvoiceCode": "my_billingInvoiceCode", + * // "clickThroughUrlSuffixProperties": {}, + * // "comment": "my_comment", + * // "createInfo": {}, + * // "creativeGroupIds": [], + * // "creativeOptimizationConfiguration": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "defaultLandingPageId": "my_defaultLandingPageId", + * // "endDate": "my_endDate", + * // "eventTagOverrides": [], + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "startDate": "my_startDate", + * // "subaccountId": "my_subaccountId", + * // "traffickerEmails": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adBlockingConfiguration": {}, + * // "additionalCreativeOptimizationConfigurations": [], + * // "advertiserGroupId": "my_advertiserGroupId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentGroups": [], + * // "billingInvoiceCode": "my_billingInvoiceCode", + * // "clickThroughUrlSuffixProperties": {}, + * // "comment": "my_comment", + * // "createInfo": {}, + * // "creativeGroupIds": [], + * // "creativeOptimizationConfiguration": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "defaultLandingPageId": "my_defaultLandingPageId", + * // "endDate": "my_endDate", + * // "eventTagOverrides": [], + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "startDate": "my_startDate", + * // "subaccountId": "my_subaccountId", + * // "traffickerEmails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.campaigns.update * @memberOf! () * @@ -10924,6 +13856,61 @@ export namespace dfareporting_v3_3 { /** * dfareporting.changeLogs.get * @desc Gets one change log by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.changeLogs.get({ + * // Change log ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "action": "my_action", + * // "changeTime": "my_changeTime", + * // "fieldName": "my_fieldName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "newValue": "my_newValue", + * // "objectId": "my_objectId", + * // "objectType": "my_objectType", + * // "oldValue": "my_oldValue", + * // "subaccountId": "my_subaccountId", + * // "transactionId": "my_transactionId", + * // "userProfileId": "my_userProfileId", + * // "userProfileName": "my_userProfileName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.changeLogs.get * @memberOf! () * @@ -10998,6 +13985,68 @@ export namespace dfareporting_v3_3 { /** * dfareporting.changeLogs.list * @desc Retrieves a list of change logs. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.changeLogs.list({ + * // Select only change logs with the specified action. + * action: 'placeholder-value', + * // Select only change logs with these IDs. + * ids: 'placeholder-value', + * // Select only change logs whose change time is before the specified maxChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is "2015-07-18T22:54:00-04:00". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset. + * maxChangeTime: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Select only change logs whose change time is after the specified minChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is "2015-07-18T22:54:00-04:00". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset. + * minChangeTime: 'placeholder-value', + * // Select only change logs with these object IDs. + * objectIds: 'placeholder-value', + * // Select only change logs with the specified object type. + * objectType: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Select only change logs whose object ID, user name, old or new values match the search string. + * searchString: 'placeholder-value', + * // Select only change logs with these user profile IDs. + * userProfileIds: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "changeLogs": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.changeLogs.list * @memberOf! () * @@ -11156,6 +14205,55 @@ export namespace dfareporting_v3_3 { /** * dfareporting.cities.list * @desc Retrieves a list of cities, possibly filtered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.cities.list({ + * // Select only cities from these countries. + * countryDartIds: 'placeholder-value', + * // Select only cities with these DART IDs. + * dartIds: 'placeholder-value', + * // Select only cities with names starting with this prefix. + * namePrefix: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Select only cities from these regions. + * regionDartIds: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cities": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.cities.list * @memberOf! () * @@ -11267,6 +14365,50 @@ export namespace dfareporting_v3_3 { /** * dfareporting.connectionTypes.get * @desc Gets one connection type by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.connectionTypes.get({ + * // Connection type ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.connectionTypes.get * @memberOf! () * @@ -11342,6 +14484,47 @@ export namespace dfareporting_v3_3 { /** * dfareporting.connectionTypes.list * @desc Retrieves a list of connection types. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.connectionTypes.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "connectionTypes": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.connectionTypes.list * @memberOf! () * @@ -11459,6 +14642,43 @@ export namespace dfareporting_v3_3 { /** * dfareporting.contentCategories.delete * @desc Deletes an existing content category. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.contentCategories.delete({ + * // Content category ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.contentCategories.delete * @memberOf! () * @@ -11532,6 +14752,51 @@ export namespace dfareporting_v3_3 { /** * dfareporting.contentCategories.get * @desc Gets one content category by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.contentCategories.get({ + * // Content category ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.contentCategories.get * @memberOf! () * @@ -11607,6 +14872,60 @@ export namespace dfareporting_v3_3 { /** * dfareporting.contentCategories.insert * @desc Inserts a new content category. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.contentCategories.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.contentCategories.insert * @memberOf! () * @@ -11682,6 +15001,60 @@ export namespace dfareporting_v3_3 { /** * dfareporting.contentCategories.list * @desc Retrieves a list of content categories, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.contentCategories.list({ + * // Select only content categories with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "contentcategory*2015" will return objects with names like "contentcategory June 2015", "contentcategory April 2015", or simply "contentcategory 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "contentcategory" will match objects with name "my contentcategory", "contentcategory 2015", or simply "contentcategory". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentCategories": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.contentCategories.list * @memberOf! () * @@ -11771,6 +15144,62 @@ export namespace dfareporting_v3_3 { /** * dfareporting.contentCategories.patch * @desc Updates an existing content category. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.contentCategories.patch({ + * // Content category ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.contentCategories.patch * @memberOf! () * @@ -11847,6 +15276,60 @@ export namespace dfareporting_v3_3 { /** * dfareporting.contentCategories.update * @desc Updates an existing content category. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.contentCategories.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.contentCategories.update * @memberOf! () * @@ -12053,6 +15536,58 @@ export namespace dfareporting_v3_3 { /** * dfareporting.conversions.batchinsert * @desc Inserts conversions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/ddmconversions'], + * }); + * + * // 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 dfareporting.conversions.batchinsert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "conversions": [], + * // "encryptionInfo": {}, + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "hasFailures": false, + * // "kind": "my_kind", + * // "status": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.conversions.batchinsert * @memberOf! () * @@ -12137,6 +15672,58 @@ export namespace dfareporting_v3_3 { /** * dfareporting.conversions.batchupdate * @desc Updates existing conversions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/ddmconversions'], + * }); + * + * // 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 dfareporting.conversions.batchupdate({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "conversions": [], + * // "encryptionInfo": {}, + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "hasFailures": false, + * // "kind": "my_kind", + * // "status": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.conversions.batchupdate * @memberOf! () * @@ -12263,6 +15850,52 @@ export namespace dfareporting_v3_3 { /** * dfareporting.countries.get * @desc Gets one country by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.countries.get({ + * // Country DART ID. + * dartId: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "countryCode": "my_countryCode", + * // "dartId": "my_dartId", + * // "kind": "my_kind", + * // "name": "my_name", + * // "sslEnabled": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.countries.get * @memberOf! () * @@ -12335,6 +15968,47 @@ export namespace dfareporting_v3_3 { /** * dfareporting.countries.list * @desc Retrieves a list of countries. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.countries.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "countries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.countries.list * @memberOf! () * @@ -12443,6 +16117,72 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creativeAssets.insert * @desc Inserts a new creative asset. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeAssets.insert({ + * // Advertiser ID of this creative. This is a required field. + * advertiserId: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "assetIdentifier": {}, + * // "clickTags": [], + * // "detectedFeatures": [], + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "warnedValidationRules": [] + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assetIdentifier": {}, + * // "clickTags": [], + * // "detectedFeatures": [], + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "warnedValidationRules": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeAssets.insert * @memberOf! () * @@ -12572,6 +16312,43 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creativeFields.delete * @desc Deletes an existing creative field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFields.delete({ + * // Creative Field ID + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFields.delete * @memberOf! () * @@ -12645,6 +16422,54 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creativeFields.get * @desc Gets one creative field by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFields.get({ + * // Creative Field ID + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFields.get * @memberOf! () * @@ -12720,6 +16545,66 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creativeFields.insert * @desc Inserts a new creative field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFields.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFields.insert * @memberOf! () * @@ -12795,6 +16680,62 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creativeFields.list * @desc Retrieves a list of creative fields, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFields.list({ + * // Select only creative fields that belong to these advertisers. + * advertiserIds: 'placeholder-value', + * // Select only creative fields with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for creative fields by name or ID. Wildcards (*) are allowed. For example, "creativefield*2015" will return creative fields with names like "creativefield June 2015", "creativefield April 2015", or simply "creativefield 2015". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of "creativefield" will match creative fields with the name "my creativefield", "creativefield 2015", or simply "creativefield". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creativeFields": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFields.list * @memberOf! () * @@ -12883,6 +16824,68 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creativeFields.patch * @desc Updates an existing creative field. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFields.patch({ + * // Creative Field ID + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFields.patch * @memberOf! () * @@ -12959,6 +16962,66 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creativeFields.update * @desc Updates an existing creative field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFields.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFields.update * @memberOf! () * @@ -13169,6 +17232,45 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creativeFieldValues.delete * @desc Deletes an existing creative field value. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFieldValues.delete({ + * // Creative field ID for this creative field value. + * creativeFieldId: 'placeholder-value', + * // Creative Field Value ID + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFieldValues.delete * @memberOf! () * @@ -13243,6 +17345,52 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creativeFieldValues.get * @desc Gets one creative field value by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFieldValues.get({ + * // Creative field ID for this creative field value. + * creativeFieldId: 'placeholder-value', + * // Creative Field Value ID + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "value": "my_value" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFieldValues.get * @memberOf! () * @@ -13319,6 +17467,60 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creativeFieldValues.insert * @desc Inserts a new creative field value. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFieldValues.insert({ + * // Creative field ID for this creative field value. + * creativeFieldId: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "value": "my_value" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "value": "my_value" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFieldValues.insert * @memberOf! () * @@ -13395,6 +17597,62 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creativeFieldValues.list * @desc Retrieves a list of creative field values, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFieldValues.list({ + * // Creative field ID for this creative field value. + * creativeFieldId: 'placeholder-value', + * // Select only creative field values with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed. + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creativeFieldValues": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFieldValues.list * @memberOf! () * @@ -13485,6 +17743,62 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creativeFieldValues.patch * @desc Updates an existing creative field value. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFieldValues.patch({ + * // Creative field ID for this creative field value. + * creativeFieldId: 'placeholder-value', + * // Creative Field Value ID + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "value": "my_value" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "value": "my_value" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFieldValues.patch * @memberOf! () * @@ -13562,6 +17876,60 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creativeFieldValues.update * @desc Updates an existing creative field value. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFieldValues.update({ + * // Creative field ID for this creative field value. + * creativeFieldId: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "value": "my_value" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "value": "my_value" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFieldValues.update * @memberOf! () * @@ -13793,6 +18161,55 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creativeGroups.get * @desc Gets one creative group by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeGroups.get({ + * // Creative group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "groupNumber": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeGroups.get * @memberOf! () * @@ -13868,6 +18285,68 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creativeGroups.insert * @desc Inserts a new creative group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeGroups.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "groupNumber": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "groupNumber": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeGroups.insert * @memberOf! () * @@ -13943,6 +18422,64 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creativeGroups.list * @desc Retrieves a list of creative groups, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeGroups.list({ + * // Select only creative groups that belong to these advertisers. + * advertiserIds: 'placeholder-value', + * // Select only creative groups that belong to this subgroup. + * groupNumber: 'placeholder-value', + * // Select only creative groups with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for creative groups by name or ID. Wildcards (*) are allowed. For example, "creativegroup*2015" will return creative groups with names like "creativegroup June 2015", "creativegroup April 2015", or simply "creativegroup 2015". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of "creativegroup" will match creative groups with the name "my creativegroup", "creativegroup 2015", or simply "creativegroup". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creativeGroups": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeGroups.list * @memberOf! () * @@ -14032,6 +18569,70 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creativeGroups.patch * @desc Updates an existing creative group. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeGroups.patch({ + * // Creative group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "groupNumber": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "groupNumber": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeGroups.patch * @memberOf! () * @@ -14108,6 +18709,68 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creativeGroups.update * @desc Updates an existing creative group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeGroups.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "groupNumber": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "groupNumber": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeGroups.update * @memberOf! () * @@ -14306,6 +18969,111 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creatives.get * @desc Gets one creative by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creatives.get({ + * // Creative ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "adParameters": "my_adParameters", + * // "adTagKeys": [], + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "allowScriptAccess": false, + * // "archived": false, + * // "artworkType": "my_artworkType", + * // "authoringSource": "my_authoringSource", + * // "authoringTool": "my_authoringTool", + * // "autoAdvanceImages": false, + * // "backgroundColor": "my_backgroundColor", + * // "backupImageClickThroughUrl": {}, + * // "backupImageFeatures": [], + * // "backupImageReportingLabel": "my_backupImageReportingLabel", + * // "backupImageTargetWindow": {}, + * // "clickTags": [], + * // "commercialId": "my_commercialId", + * // "companionCreatives": [], + * // "compatibility": [], + * // "convertFlashToHtml5": false, + * // "counterCustomEvents": [], + * // "creativeAssetSelection": {}, + * // "creativeAssets": [], + * // "creativeFieldAssignments": [], + * // "customKeyValues": [], + * // "dynamicAssetSelection": false, + * // "exitCustomEvents": [], + * // "fsCommand": {}, + * // "htmlCode": "my_htmlCode", + * // "htmlCodeLocked": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "latestTraffickedCreativeId": "my_latestTraffickedCreativeId", + * // "mediaDescription": "my_mediaDescription", + * // "mediaDuration": {}, + * // "name": "my_name", + * // "overrideCss": "my_overrideCss", + * // "progressOffset": {}, + * // "redirectUrl": "my_redirectUrl", + * // "renderingId": "my_renderingId", + * // "renderingIdDimensionValue": {}, + * // "requiredFlashPluginVersion": "my_requiredFlashPluginVersion", + * // "requiredFlashVersion": 0, + * // "size": {}, + * // "skipOffset": {}, + * // "skippable": false, + * // "sslCompliant": false, + * // "sslOverride": false, + * // "studioAdvertiserId": "my_studioAdvertiserId", + * // "studioCreativeId": "my_studioCreativeId", + * // "studioTraffickedCreativeId": "my_studioTraffickedCreativeId", + * // "subaccountId": "my_subaccountId", + * // "thirdPartyBackupImageImpressionsUrl": "my_thirdPartyBackupImageImpressionsUrl", + * // "thirdPartyRichMediaImpressionsUrl": "my_thirdPartyRichMediaImpressionsUrl", + * // "thirdPartyUrls": [], + * // "timerCustomEvents": [], + * // "totalFileSize": "my_totalFileSize", + * // "type": "my_type", + * // "universalAdId": {}, + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creatives.get * @memberOf! () * @@ -14378,6 +19146,180 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creatives.insert * @desc Inserts a new creative. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creatives.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "adParameters": "my_adParameters", + * // "adTagKeys": [], + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "allowScriptAccess": false, + * // "archived": false, + * // "artworkType": "my_artworkType", + * // "authoringSource": "my_authoringSource", + * // "authoringTool": "my_authoringTool", + * // "autoAdvanceImages": false, + * // "backgroundColor": "my_backgroundColor", + * // "backupImageClickThroughUrl": {}, + * // "backupImageFeatures": [], + * // "backupImageReportingLabel": "my_backupImageReportingLabel", + * // "backupImageTargetWindow": {}, + * // "clickTags": [], + * // "commercialId": "my_commercialId", + * // "companionCreatives": [], + * // "compatibility": [], + * // "convertFlashToHtml5": false, + * // "counterCustomEvents": [], + * // "creativeAssetSelection": {}, + * // "creativeAssets": [], + * // "creativeFieldAssignments": [], + * // "customKeyValues": [], + * // "dynamicAssetSelection": false, + * // "exitCustomEvents": [], + * // "fsCommand": {}, + * // "htmlCode": "my_htmlCode", + * // "htmlCodeLocked": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "latestTraffickedCreativeId": "my_latestTraffickedCreativeId", + * // "mediaDescription": "my_mediaDescription", + * // "mediaDuration": {}, + * // "name": "my_name", + * // "overrideCss": "my_overrideCss", + * // "progressOffset": {}, + * // "redirectUrl": "my_redirectUrl", + * // "renderingId": "my_renderingId", + * // "renderingIdDimensionValue": {}, + * // "requiredFlashPluginVersion": "my_requiredFlashPluginVersion", + * // "requiredFlashVersion": 0, + * // "size": {}, + * // "skipOffset": {}, + * // "skippable": false, + * // "sslCompliant": false, + * // "sslOverride": false, + * // "studioAdvertiserId": "my_studioAdvertiserId", + * // "studioCreativeId": "my_studioCreativeId", + * // "studioTraffickedCreativeId": "my_studioTraffickedCreativeId", + * // "subaccountId": "my_subaccountId", + * // "thirdPartyBackupImageImpressionsUrl": "my_thirdPartyBackupImageImpressionsUrl", + * // "thirdPartyRichMediaImpressionsUrl": "my_thirdPartyRichMediaImpressionsUrl", + * // "thirdPartyUrls": [], + * // "timerCustomEvents": [], + * // "totalFileSize": "my_totalFileSize", + * // "type": "my_type", + * // "universalAdId": {}, + * // "version": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "adParameters": "my_adParameters", + * // "adTagKeys": [], + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "allowScriptAccess": false, + * // "archived": false, + * // "artworkType": "my_artworkType", + * // "authoringSource": "my_authoringSource", + * // "authoringTool": "my_authoringTool", + * // "autoAdvanceImages": false, + * // "backgroundColor": "my_backgroundColor", + * // "backupImageClickThroughUrl": {}, + * // "backupImageFeatures": [], + * // "backupImageReportingLabel": "my_backupImageReportingLabel", + * // "backupImageTargetWindow": {}, + * // "clickTags": [], + * // "commercialId": "my_commercialId", + * // "companionCreatives": [], + * // "compatibility": [], + * // "convertFlashToHtml5": false, + * // "counterCustomEvents": [], + * // "creativeAssetSelection": {}, + * // "creativeAssets": [], + * // "creativeFieldAssignments": [], + * // "customKeyValues": [], + * // "dynamicAssetSelection": false, + * // "exitCustomEvents": [], + * // "fsCommand": {}, + * // "htmlCode": "my_htmlCode", + * // "htmlCodeLocked": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "latestTraffickedCreativeId": "my_latestTraffickedCreativeId", + * // "mediaDescription": "my_mediaDescription", + * // "mediaDuration": {}, + * // "name": "my_name", + * // "overrideCss": "my_overrideCss", + * // "progressOffset": {}, + * // "redirectUrl": "my_redirectUrl", + * // "renderingId": "my_renderingId", + * // "renderingIdDimensionValue": {}, + * // "requiredFlashPluginVersion": "my_requiredFlashPluginVersion", + * // "requiredFlashVersion": 0, + * // "size": {}, + * // "skipOffset": {}, + * // "skippable": false, + * // "sslCompliant": false, + * // "sslOverride": false, + * // "studioAdvertiserId": "my_studioAdvertiserId", + * // "studioCreativeId": "my_studioCreativeId", + * // "studioTraffickedCreativeId": "my_studioTraffickedCreativeId", + * // "subaccountId": "my_subaccountId", + * // "thirdPartyBackupImageImpressionsUrl": "my_thirdPartyBackupImageImpressionsUrl", + * // "thirdPartyRichMediaImpressionsUrl": "my_thirdPartyRichMediaImpressionsUrl", + * // "thirdPartyUrls": [], + * // "timerCustomEvents": [], + * // "totalFileSize": "my_totalFileSize", + * // "type": "my_type", + * // "universalAdId": {}, + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creatives.insert * @memberOf! () * @@ -14449,6 +19391,80 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creatives.list * @desc Retrieves a list of creatives, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creatives.list({ + * // Select only active creatives. Leave blank to select active and inactive creatives. + * active: 'placeholder-value', + * // Select only creatives with this advertiser ID. + * advertiserId: 'placeholder-value', + * // Select only archived creatives. Leave blank to select archived and unarchived creatives. + * archived: 'placeholder-value', + * // Select only creatives with this campaign ID. + * campaignId: 'placeholder-value', + * // Select only in-stream video creatives with these companion IDs. + * companionCreativeIds: 'placeholder-value', + * // Select only creatives with these creative field IDs. + * creativeFieldIds: 'placeholder-value', + * // Select only creatives with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Select only creatives with these rendering IDs. + * renderingIds: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "creative*2015" will return objects with names like "creative June 2015", "creative April 2015", or simply "creative 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "creative" will match objects with name "my creative", "creative 2015", or simply "creative". + * searchString: 'placeholder-value', + * // Select only creatives with these size IDs. + * sizeIds: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only creatives corresponding to this Studio creative ID. + * studioCreativeId: 'placeholder-value', + * // Select only creatives with these creative types. + * types: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creatives": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creatives.list * @memberOf! () * @@ -14539,6 +19555,182 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creatives.patch * @desc Updates an existing creative. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creatives.patch({ + * // Creative ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "adParameters": "my_adParameters", + * // "adTagKeys": [], + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "allowScriptAccess": false, + * // "archived": false, + * // "artworkType": "my_artworkType", + * // "authoringSource": "my_authoringSource", + * // "authoringTool": "my_authoringTool", + * // "autoAdvanceImages": false, + * // "backgroundColor": "my_backgroundColor", + * // "backupImageClickThroughUrl": {}, + * // "backupImageFeatures": [], + * // "backupImageReportingLabel": "my_backupImageReportingLabel", + * // "backupImageTargetWindow": {}, + * // "clickTags": [], + * // "commercialId": "my_commercialId", + * // "companionCreatives": [], + * // "compatibility": [], + * // "convertFlashToHtml5": false, + * // "counterCustomEvents": [], + * // "creativeAssetSelection": {}, + * // "creativeAssets": [], + * // "creativeFieldAssignments": [], + * // "customKeyValues": [], + * // "dynamicAssetSelection": false, + * // "exitCustomEvents": [], + * // "fsCommand": {}, + * // "htmlCode": "my_htmlCode", + * // "htmlCodeLocked": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "latestTraffickedCreativeId": "my_latestTraffickedCreativeId", + * // "mediaDescription": "my_mediaDescription", + * // "mediaDuration": {}, + * // "name": "my_name", + * // "overrideCss": "my_overrideCss", + * // "progressOffset": {}, + * // "redirectUrl": "my_redirectUrl", + * // "renderingId": "my_renderingId", + * // "renderingIdDimensionValue": {}, + * // "requiredFlashPluginVersion": "my_requiredFlashPluginVersion", + * // "requiredFlashVersion": 0, + * // "size": {}, + * // "skipOffset": {}, + * // "skippable": false, + * // "sslCompliant": false, + * // "sslOverride": false, + * // "studioAdvertiserId": "my_studioAdvertiserId", + * // "studioCreativeId": "my_studioCreativeId", + * // "studioTraffickedCreativeId": "my_studioTraffickedCreativeId", + * // "subaccountId": "my_subaccountId", + * // "thirdPartyBackupImageImpressionsUrl": "my_thirdPartyBackupImageImpressionsUrl", + * // "thirdPartyRichMediaImpressionsUrl": "my_thirdPartyRichMediaImpressionsUrl", + * // "thirdPartyUrls": [], + * // "timerCustomEvents": [], + * // "totalFileSize": "my_totalFileSize", + * // "type": "my_type", + * // "universalAdId": {}, + * // "version": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "adParameters": "my_adParameters", + * // "adTagKeys": [], + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "allowScriptAccess": false, + * // "archived": false, + * // "artworkType": "my_artworkType", + * // "authoringSource": "my_authoringSource", + * // "authoringTool": "my_authoringTool", + * // "autoAdvanceImages": false, + * // "backgroundColor": "my_backgroundColor", + * // "backupImageClickThroughUrl": {}, + * // "backupImageFeatures": [], + * // "backupImageReportingLabel": "my_backupImageReportingLabel", + * // "backupImageTargetWindow": {}, + * // "clickTags": [], + * // "commercialId": "my_commercialId", + * // "companionCreatives": [], + * // "compatibility": [], + * // "convertFlashToHtml5": false, + * // "counterCustomEvents": [], + * // "creativeAssetSelection": {}, + * // "creativeAssets": [], + * // "creativeFieldAssignments": [], + * // "customKeyValues": [], + * // "dynamicAssetSelection": false, + * // "exitCustomEvents": [], + * // "fsCommand": {}, + * // "htmlCode": "my_htmlCode", + * // "htmlCodeLocked": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "latestTraffickedCreativeId": "my_latestTraffickedCreativeId", + * // "mediaDescription": "my_mediaDescription", + * // "mediaDuration": {}, + * // "name": "my_name", + * // "overrideCss": "my_overrideCss", + * // "progressOffset": {}, + * // "redirectUrl": "my_redirectUrl", + * // "renderingId": "my_renderingId", + * // "renderingIdDimensionValue": {}, + * // "requiredFlashPluginVersion": "my_requiredFlashPluginVersion", + * // "requiredFlashVersion": 0, + * // "size": {}, + * // "skipOffset": {}, + * // "skippable": false, + * // "sslCompliant": false, + * // "sslOverride": false, + * // "studioAdvertiserId": "my_studioAdvertiserId", + * // "studioCreativeId": "my_studioCreativeId", + * // "studioTraffickedCreativeId": "my_studioTraffickedCreativeId", + * // "subaccountId": "my_subaccountId", + * // "thirdPartyBackupImageImpressionsUrl": "my_thirdPartyBackupImageImpressionsUrl", + * // "thirdPartyRichMediaImpressionsUrl": "my_thirdPartyRichMediaImpressionsUrl", + * // "thirdPartyUrls": [], + * // "timerCustomEvents": [], + * // "totalFileSize": "my_totalFileSize", + * // "type": "my_type", + * // "universalAdId": {}, + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creatives.patch * @memberOf! () * @@ -14611,6 +19803,180 @@ export namespace dfareporting_v3_3 { /** * dfareporting.creatives.update * @desc Updates an existing creative. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creatives.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "adParameters": "my_adParameters", + * // "adTagKeys": [], + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "allowScriptAccess": false, + * // "archived": false, + * // "artworkType": "my_artworkType", + * // "authoringSource": "my_authoringSource", + * // "authoringTool": "my_authoringTool", + * // "autoAdvanceImages": false, + * // "backgroundColor": "my_backgroundColor", + * // "backupImageClickThroughUrl": {}, + * // "backupImageFeatures": [], + * // "backupImageReportingLabel": "my_backupImageReportingLabel", + * // "backupImageTargetWindow": {}, + * // "clickTags": [], + * // "commercialId": "my_commercialId", + * // "companionCreatives": [], + * // "compatibility": [], + * // "convertFlashToHtml5": false, + * // "counterCustomEvents": [], + * // "creativeAssetSelection": {}, + * // "creativeAssets": [], + * // "creativeFieldAssignments": [], + * // "customKeyValues": [], + * // "dynamicAssetSelection": false, + * // "exitCustomEvents": [], + * // "fsCommand": {}, + * // "htmlCode": "my_htmlCode", + * // "htmlCodeLocked": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "latestTraffickedCreativeId": "my_latestTraffickedCreativeId", + * // "mediaDescription": "my_mediaDescription", + * // "mediaDuration": {}, + * // "name": "my_name", + * // "overrideCss": "my_overrideCss", + * // "progressOffset": {}, + * // "redirectUrl": "my_redirectUrl", + * // "renderingId": "my_renderingId", + * // "renderingIdDimensionValue": {}, + * // "requiredFlashPluginVersion": "my_requiredFlashPluginVersion", + * // "requiredFlashVersion": 0, + * // "size": {}, + * // "skipOffset": {}, + * // "skippable": false, + * // "sslCompliant": false, + * // "sslOverride": false, + * // "studioAdvertiserId": "my_studioAdvertiserId", + * // "studioCreativeId": "my_studioCreativeId", + * // "studioTraffickedCreativeId": "my_studioTraffickedCreativeId", + * // "subaccountId": "my_subaccountId", + * // "thirdPartyBackupImageImpressionsUrl": "my_thirdPartyBackupImageImpressionsUrl", + * // "thirdPartyRichMediaImpressionsUrl": "my_thirdPartyRichMediaImpressionsUrl", + * // "thirdPartyUrls": [], + * // "timerCustomEvents": [], + * // "totalFileSize": "my_totalFileSize", + * // "type": "my_type", + * // "universalAdId": {}, + * // "version": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "adParameters": "my_adParameters", + * // "adTagKeys": [], + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "allowScriptAccess": false, + * // "archived": false, + * // "artworkType": "my_artworkType", + * // "authoringSource": "my_authoringSource", + * // "authoringTool": "my_authoringTool", + * // "autoAdvanceImages": false, + * // "backgroundColor": "my_backgroundColor", + * // "backupImageClickThroughUrl": {}, + * // "backupImageFeatures": [], + * // "backupImageReportingLabel": "my_backupImageReportingLabel", + * // "backupImageTargetWindow": {}, + * // "clickTags": [], + * // "commercialId": "my_commercialId", + * // "companionCreatives": [], + * // "compatibility": [], + * // "convertFlashToHtml5": false, + * // "counterCustomEvents": [], + * // "creativeAssetSelection": {}, + * // "creativeAssets": [], + * // "creativeFieldAssignments": [], + * // "customKeyValues": [], + * // "dynamicAssetSelection": false, + * // "exitCustomEvents": [], + * // "fsCommand": {}, + * // "htmlCode": "my_htmlCode", + * // "htmlCodeLocked": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "latestTraffickedCreativeId": "my_latestTraffickedCreativeId", + * // "mediaDescription": "my_mediaDescription", + * // "mediaDuration": {}, + * // "name": "my_name", + * // "overrideCss": "my_overrideCss", + * // "progressOffset": {}, + * // "redirectUrl": "my_redirectUrl", + * // "renderingId": "my_renderingId", + * // "renderingIdDimensionValue": {}, + * // "requiredFlashPluginVersion": "my_requiredFlashPluginVersion", + * // "requiredFlashVersion": 0, + * // "size": {}, + * // "skipOffset": {}, + * // "skippable": false, + * // "sslCompliant": false, + * // "sslOverride": false, + * // "studioAdvertiserId": "my_studioAdvertiserId", + * // "studioCreativeId": "my_studioCreativeId", + * // "studioTraffickedCreativeId": "my_studioTraffickedCreativeId", + * // "subaccountId": "my_subaccountId", + * // "thirdPartyBackupImageImpressionsUrl": "my_thirdPartyBackupImageImpressionsUrl", + * // "thirdPartyRichMediaImpressionsUrl": "my_thirdPartyRichMediaImpressionsUrl", + * // "thirdPartyUrls": [], + * // "timerCustomEvents": [], + * // "totalFileSize": "my_totalFileSize", + * // "type": "my_type", + * // "universalAdId": {}, + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creatives.update * @memberOf! () * @@ -14832,6 +20198,65 @@ export namespace dfareporting_v3_3 { /** * dfareporting.dimensionValues.query * @desc Retrieves list of report dimension values for a list of filters. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.dimensionValues.query({ + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // The value of the nextToken from the previous result page. + * pageToken: 'placeholder-value', + * // The DFA user profile ID. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dimensionName": "my_dimensionName", + * // "endDate": "my_endDate", + * // "filters": [], + * // "kind": "my_kind", + * // "startDate": "my_startDate" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.dimensionValues.query * @memberOf! () * @@ -14942,6 +20367,56 @@ export namespace dfareporting_v3_3 { /** * dfareporting.directorySites.get * @desc Gets one directory site by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.directorySites.get({ + * // Directory site ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "active": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "inpageTagFormats": [], + * // "interstitialTagFormats": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "settings": {}, + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.directorySites.get * @memberOf! () * @@ -15017,6 +20492,70 @@ export namespace dfareporting_v3_3 { /** * dfareporting.directorySites.insert * @desc Inserts a new directory site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.directorySites.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "active": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "inpageTagFormats": [], + * // "interstitialTagFormats": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "settings": {}, + * // "url": "my_url" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "active": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "inpageTagFormats": [], + * // "interstitialTagFormats": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "settings": {}, + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.directorySites.insert * @memberOf! () * @@ -15092,6 +20631,70 @@ export namespace dfareporting_v3_3 { /** * dfareporting.directorySites.list * @desc Retrieves a list of directory sites, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.directorySites.list({ + * // This search filter is no longer supported and will have no effect on the results returned. + * acceptsInStreamVideoPlacements: 'placeholder-value', + * // This search filter is no longer supported and will have no effect on the results returned. + * acceptsInterstitialPlacements: 'placeholder-value', + * // Select only directory sites that accept publisher paid placements. This field can be left blank. + * acceptsPublisherPaidPlacements: 'placeholder-value', + * // Select only active directory sites. Leave blank to retrieve both active and inactive directory sites. + * active: 'placeholder-value', + * // Select only directory sites with this Ad Manager network code. + * dfpNetworkCode: 'placeholder-value', + * // Select only directory sites with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name, ID or URL. Wildcards (*) are allowed. For example, "directory site*2015" will return objects with names like "directory site June 2015", "directory site April 2015", or simply "directory site 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "directory site" will match objects with name "my directory site", "directory site 2015" or simply, "directory site". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "directorySites": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.directorySites.list * @memberOf! () * @@ -15281,6 +20884,47 @@ export namespace dfareporting_v3_3 { /** * dfareporting.dynamicTargetingKeys.delete * @desc Deletes an existing dynamic targeting key. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.dynamicTargetingKeys.delete({ + * // Name of this dynamic targeting key. This is a required field. Must be less than 256 characters long and cannot contain commas. All characters are converted to lowercase. + * name: 'placeholder-value', + * // ID of the object of this dynamic targeting key. This is a required field. + * objectId: 'placeholder-value', + * // Type of the object of this dynamic targeting key. This is a required field. + * objectType: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.dynamicTargetingKeys.delete * @memberOf! () * @@ -15356,6 +21000,60 @@ export namespace dfareporting_v3_3 { /** * dfareporting.dynamicTargetingKeys.insert * @desc Inserts a new dynamic targeting key. Keys must be created at the advertiser level before being assigned to the advertiser's ads, creatives, or placements. There is a maximum of 1000 keys per advertiser, out of which a maximum of 20 keys can be assigned per ad, creative, or placement. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.dynamicTargetingKeys.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "name": "my_name", + * // "objectId": "my_objectId", + * // "objectType": "my_objectType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "name": "my_name", + * // "objectId": "my_objectId", + * // "objectType": "my_objectType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.dynamicTargetingKeys.insert * @memberOf! () * @@ -15431,6 +21129,55 @@ export namespace dfareporting_v3_3 { /** * dfareporting.dynamicTargetingKeys.list * @desc Retrieves a list of dynamic targeting keys. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.dynamicTargetingKeys.list({ + * // Select only dynamic targeting keys whose object has this advertiser ID. + * advertiserId: 'placeholder-value', + * // Select only dynamic targeting keys exactly matching these names. + * names: 'placeholder-value', + * // Select only dynamic targeting keys with this object ID. + * objectId: 'placeholder-value', + * // Select only dynamic targeting keys with this object type. + * objectType: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dynamicTargetingKeys": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.dynamicTargetingKeys.list * @memberOf! () * @@ -15595,6 +21342,43 @@ export namespace dfareporting_v3_3 { /** * dfareporting.eventTags.delete * @desc Deletes an existing event tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.eventTags.delete({ + * // Event tag ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.eventTags.delete * @memberOf! () * @@ -15667,6 +21451,65 @@ export namespace dfareporting_v3_3 { /** * dfareporting.eventTags.get * @desc Gets one event tag by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.eventTags.get({ + * // Event tag ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "enabledByDefault": false, + * // "excludeFromAdxRequests": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteFilterType": "my_siteFilterType", + * // "siteIds": [], + * // "sslCompliant": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "type": "my_type", + * // "url": "my_url", + * // "urlEscapeLevels": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.eventTags.get * @memberOf! () * @@ -15739,6 +21582,88 @@ export namespace dfareporting_v3_3 { /** * dfareporting.eventTags.insert * @desc Inserts a new event tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.eventTags.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "enabledByDefault": false, + * // "excludeFromAdxRequests": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteFilterType": "my_siteFilterType", + * // "siteIds": [], + * // "sslCompliant": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "type": "my_type", + * // "url": "my_url", + * // "urlEscapeLevels": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "enabledByDefault": false, + * // "excludeFromAdxRequests": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteFilterType": "my_siteFilterType", + * // "siteIds": [], + * // "sslCompliant": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "type": "my_type", + * // "url": "my_url", + * // "urlEscapeLevels": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.eventTags.insert * @memberOf! () * @@ -15810,6 +21735,67 @@ export namespace dfareporting_v3_3 { /** * dfareporting.eventTags.list * @desc Retrieves a list of event tags, possibly filtered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.eventTags.list({ + * // Select only event tags that belong to this ad. + * adId: 'placeholder-value', + * // Select only event tags that belong to this advertiser. + * advertiserId: 'placeholder-value', + * // Select only event tags that belong to this campaign. + * campaignId: 'placeholder-value', + * // Examine only the specified campaign or advertiser's event tags for matching selector criteria. When set to false, the parent advertiser and parent campaign of the specified ad or campaign is examined as well. In addition, when set to false, the status field is examined as well, along with the enabledByDefault field. This parameter can not be set to true when adId is specified as ads do not define their own even tags. + * definitionsOnly: 'placeholder-value', + * // Select only enabled event tags. What is considered enabled or disabled depends on the definitionsOnly parameter. When definitionsOnly is set to true, only the specified advertiser or campaign's event tags' enabledByDefault field is examined. When definitionsOnly is set to false, the specified ad or specified campaign's parent advertiser's or parent campaign's event tags' enabledByDefault and status fields are examined as well. + * enabled: 'placeholder-value', + * // Select only event tags with the specified event tag types. Event tag types can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking. + * eventTagTypes: 'placeholder-value', + * // Select only event tags with these IDs. + * ids: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "eventtag*2015" will return objects with names like "eventtag June 2015", "eventtag April 2015", or simply "eventtag 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "eventtag" will match objects with name "my eventtag", "eventtag 2015", or simply "eventtag". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "eventTags": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.eventTags.list * @memberOf! () * @@ -15894,6 +21880,90 @@ export namespace dfareporting_v3_3 { /** * dfareporting.eventTags.patch * @desc Updates an existing event tag. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.eventTags.patch({ + * // Event tag ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "enabledByDefault": false, + * // "excludeFromAdxRequests": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteFilterType": "my_siteFilterType", + * // "siteIds": [], + * // "sslCompliant": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "type": "my_type", + * // "url": "my_url", + * // "urlEscapeLevels": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "enabledByDefault": false, + * // "excludeFromAdxRequests": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteFilterType": "my_siteFilterType", + * // "siteIds": [], + * // "sslCompliant": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "type": "my_type", + * // "url": "my_url", + * // "urlEscapeLevels": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.eventTags.patch * @memberOf! () * @@ -15966,6 +22036,88 @@ export namespace dfareporting_v3_3 { /** * dfareporting.eventTags.update * @desc Updates an existing event tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.eventTags.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "enabledByDefault": false, + * // "excludeFromAdxRequests": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteFilterType": "my_siteFilterType", + * // "siteIds": [], + * // "sslCompliant": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "type": "my_type", + * // "url": "my_url", + * // "urlEscapeLevels": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "enabledByDefault": false, + * // "excludeFromAdxRequests": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteFilterType": "my_siteFilterType", + * // "siteIds": [], + * // "sslCompliant": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "type": "my_type", + * // "url": "my_url", + * // "urlEscapeLevels": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.eventTags.update * @memberOf! () * @@ -16178,6 +22330,57 @@ export namespace dfareporting_v3_3 { /** * dfareporting.files.get * @desc Retrieves a report file by its report ID and file ID. This method supports media download. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.files.get({ + * // The ID of the report file. + * fileId: 'placeholder-value', + * // The ID of the report. + * reportId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dateRange": {}, + * // "etag": "my_etag", + * // "fileName": "my_fileName", + * // "format": "my_format", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "reportId": "my_reportId", + * // "status": "my_status", + * // "urls": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.files.get * @memberOf! () * @@ -16249,6 +22452,59 @@ export namespace dfareporting_v3_3 { /** * dfareporting.files.list * @desc Lists files for a user profile. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.files.list({ + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // The value of the nextToken from the previous result page. + * pageToken: 'placeholder-value', + * // The DFA profile ID. + * profileId: 'placeholder-value', + * // The scope that defines which results are returned. + * scope: 'placeholder-value', + * // The field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.files.list * @memberOf! () * @@ -16378,6 +22634,43 @@ export namespace dfareporting_v3_3 { /** * dfareporting.floodlightActivities.delete * @desc Deletes an existing floodlight activity. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivities.delete({ + * // Floodlight activity ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivities.delete * @memberOf! () * @@ -16451,6 +22744,50 @@ export namespace dfareporting_v3_3 { /** * dfareporting.floodlightActivities.generatetag * @desc Generates a tag for a floodlight activity. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivities.generatetag({ + * // Floodlight activity ID for which we want to generate a tag. + * floodlightActivityId: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "floodlightActivityTag": "my_floodlightActivityTag", + * // "globalSiteTagGlobalSnippet": "my_globalSiteTagGlobalSnippet", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivities.generatetag * @memberOf! () * @@ -16543,6 +22880,75 @@ export namespace dfareporting_v3_3 { /** * dfareporting.floodlightActivities.get * @desc Gets one floodlight activity by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivities.get({ + * // Floodlight activity ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "cacheBustingType": "my_cacheBustingType", + * // "countingMethod": "my_countingMethod", + * // "defaultTags": [], + * // "expectedUrl": "my_expectedUrl", + * // "floodlightActivityGroupId": "my_floodlightActivityGroupId", + * // "floodlightActivityGroupName": "my_floodlightActivityGroupName", + * // "floodlightActivityGroupTagString": "my_floodlightActivityGroupTagString", + * // "floodlightActivityGroupType": "my_floodlightActivityGroupType", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "floodlightTagType": "my_floodlightTagType", + * // "hidden": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "notes": "my_notes", + * // "publisherTags": [], + * // "secure": false, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "subaccountId": "my_subaccountId", + * // "tagFormat": "my_tagFormat", + * // "tagString": "my_tagString", + * // "userDefinedVariableTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivities.get * @memberOf! () * @@ -16618,6 +23024,108 @@ export namespace dfareporting_v3_3 { /** * dfareporting.floodlightActivities.insert * @desc Inserts a new floodlight activity. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivities.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "cacheBustingType": "my_cacheBustingType", + * // "countingMethod": "my_countingMethod", + * // "defaultTags": [], + * // "expectedUrl": "my_expectedUrl", + * // "floodlightActivityGroupId": "my_floodlightActivityGroupId", + * // "floodlightActivityGroupName": "my_floodlightActivityGroupName", + * // "floodlightActivityGroupTagString": "my_floodlightActivityGroupTagString", + * // "floodlightActivityGroupType": "my_floodlightActivityGroupType", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "floodlightTagType": "my_floodlightTagType", + * // "hidden": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "notes": "my_notes", + * // "publisherTags": [], + * // "secure": false, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "subaccountId": "my_subaccountId", + * // "tagFormat": "my_tagFormat", + * // "tagString": "my_tagString", + * // "userDefinedVariableTypes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "cacheBustingType": "my_cacheBustingType", + * // "countingMethod": "my_countingMethod", + * // "defaultTags": [], + * // "expectedUrl": "my_expectedUrl", + * // "floodlightActivityGroupId": "my_floodlightActivityGroupId", + * // "floodlightActivityGroupName": "my_floodlightActivityGroupName", + * // "floodlightActivityGroupTagString": "my_floodlightActivityGroupTagString", + * // "floodlightActivityGroupType": "my_floodlightActivityGroupType", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "floodlightTagType": "my_floodlightTagType", + * // "hidden": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "notes": "my_notes", + * // "publisherTags": [], + * // "secure": false, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "subaccountId": "my_subaccountId", + * // "tagFormat": "my_tagFormat", + * // "tagString": "my_tagString", + * // "userDefinedVariableTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivities.insert * @memberOf! () * @@ -16693,6 +23201,74 @@ export namespace dfareporting_v3_3 { /** * dfareporting.floodlightActivities.list * @desc Retrieves a list of floodlight activities, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivities.list({ + * // Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. + * advertiserId: 'placeholder-value', + * // Select only floodlight activities with the specified floodlight activity group IDs. + * floodlightActivityGroupIds: 'placeholder-value', + * // Select only floodlight activities with the specified floodlight activity group name. + * floodlightActivityGroupName: 'placeholder-value', + * // Select only floodlight activities with the specified floodlight activity group tag string. + * floodlightActivityGroupTagString: 'placeholder-value', + * // Select only floodlight activities with the specified floodlight activity group type. + * floodlightActivityGroupType: 'placeholder-value', + * // Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. + * floodlightConfigurationId: 'placeholder-value', + * // Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "floodlightactivity*2015" will return objects with names like "floodlightactivity June 2015", "floodlightactivity April 2015", or simply "floodlightactivity 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "floodlightactivity" will match objects with name "my floodlightactivity activity", "floodlightactivity 2015", or simply "floodlightactivity". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only floodlight activities with the specified tag string. + * tagString: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "floodlightActivities": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivities.list * @memberOf! () * @@ -16789,6 +23365,110 @@ export namespace dfareporting_v3_3 { /** * dfareporting.floodlightActivities.patch * @desc Updates an existing floodlight activity. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivities.patch({ + * // Floodlight activity ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "cacheBustingType": "my_cacheBustingType", + * // "countingMethod": "my_countingMethod", + * // "defaultTags": [], + * // "expectedUrl": "my_expectedUrl", + * // "floodlightActivityGroupId": "my_floodlightActivityGroupId", + * // "floodlightActivityGroupName": "my_floodlightActivityGroupName", + * // "floodlightActivityGroupTagString": "my_floodlightActivityGroupTagString", + * // "floodlightActivityGroupType": "my_floodlightActivityGroupType", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "floodlightTagType": "my_floodlightTagType", + * // "hidden": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "notes": "my_notes", + * // "publisherTags": [], + * // "secure": false, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "subaccountId": "my_subaccountId", + * // "tagFormat": "my_tagFormat", + * // "tagString": "my_tagString", + * // "userDefinedVariableTypes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "cacheBustingType": "my_cacheBustingType", + * // "countingMethod": "my_countingMethod", + * // "defaultTags": [], + * // "expectedUrl": "my_expectedUrl", + * // "floodlightActivityGroupId": "my_floodlightActivityGroupId", + * // "floodlightActivityGroupName": "my_floodlightActivityGroupName", + * // "floodlightActivityGroupTagString": "my_floodlightActivityGroupTagString", + * // "floodlightActivityGroupType": "my_floodlightActivityGroupType", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "floodlightTagType": "my_floodlightTagType", + * // "hidden": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "notes": "my_notes", + * // "publisherTags": [], + * // "secure": false, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "subaccountId": "my_subaccountId", + * // "tagFormat": "my_tagFormat", + * // "tagString": "my_tagString", + * // "userDefinedVariableTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivities.patch * @memberOf! () * @@ -16865,6 +23545,108 @@ export namespace dfareporting_v3_3 { /** * dfareporting.floodlightActivities.update * @desc Updates an existing floodlight activity. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivities.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "cacheBustingType": "my_cacheBustingType", + * // "countingMethod": "my_countingMethod", + * // "defaultTags": [], + * // "expectedUrl": "my_expectedUrl", + * // "floodlightActivityGroupId": "my_floodlightActivityGroupId", + * // "floodlightActivityGroupName": "my_floodlightActivityGroupName", + * // "floodlightActivityGroupTagString": "my_floodlightActivityGroupTagString", + * // "floodlightActivityGroupType": "my_floodlightActivityGroupType", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "floodlightTagType": "my_floodlightTagType", + * // "hidden": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "notes": "my_notes", + * // "publisherTags": [], + * // "secure": false, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "subaccountId": "my_subaccountId", + * // "tagFormat": "my_tagFormat", + * // "tagString": "my_tagString", + * // "userDefinedVariableTypes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "cacheBustingType": "my_cacheBustingType", + * // "countingMethod": "my_countingMethod", + * // "defaultTags": [], + * // "expectedUrl": "my_expectedUrl", + * // "floodlightActivityGroupId": "my_floodlightActivityGroupId", + * // "floodlightActivityGroupName": "my_floodlightActivityGroupName", + * // "floodlightActivityGroupTagString": "my_floodlightActivityGroupTagString", + * // "floodlightActivityGroupType": "my_floodlightActivityGroupType", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "floodlightTagType": "my_floodlightTagType", + * // "hidden": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "notes": "my_notes", + * // "publisherTags": [], + * // "secure": false, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "subaccountId": "my_subaccountId", + * // "tagFormat": "my_tagFormat", + * // "tagString": "my_tagString", + * // "userDefinedVariableTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivities.update * @memberOf! () * @@ -17115,6 +23897,59 @@ export namespace dfareporting_v3_3 { /** * dfareporting.floodlightActivityGroups.get * @desc Gets one floodlight activity group by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivityGroups.get({ + * // Floodlight activity Group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "tagString": "my_tagString", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivityGroups.get * @memberOf! () * @@ -17192,6 +24027,76 @@ export namespace dfareporting_v3_3 { /** * dfareporting.floodlightActivityGroups.insert * @desc Inserts a new floodlight activity group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivityGroups.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "tagString": "my_tagString", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "tagString": "my_tagString", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivityGroups.insert * @memberOf! () * @@ -17271,6 +24176,66 @@ export namespace dfareporting_v3_3 { /** * dfareporting.floodlightActivityGroups.list * @desc Retrieves a list of floodlight activity groups, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivityGroups.list({ + * // Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result. + * advertiserId: 'placeholder-value', + * // Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result. + * floodlightConfigurationId: 'placeholder-value', + * // Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "floodlightactivitygroup*2015" will return objects with names like "floodlightactivitygroup June 2015", "floodlightactivitygroup April 2015", or simply "floodlightactivitygroup 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "floodlightactivitygroup" will match objects with name "my floodlightactivitygroup activity", "floodlightactivitygroup 2015", or simply "floodlightactivitygroup". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only floodlight activity groups with the specified floodlight activity group type. + * type: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "floodlightActivityGroups": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivityGroups.list * @memberOf! () * @@ -17371,6 +24336,78 @@ export namespace dfareporting_v3_3 { /** * dfareporting.floodlightActivityGroups.patch * @desc Updates an existing floodlight activity group. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivityGroups.patch({ + * // Floodlight activity Group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "tagString": "my_tagString", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "tagString": "my_tagString", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivityGroups.patch * @memberOf! () * @@ -17449,6 +24486,76 @@ export namespace dfareporting_v3_3 { /** * dfareporting.floodlightActivityGroups.update * @desc Updates an existing floodlight activity group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivityGroups.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "tagString": "my_tagString", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "tagString": "my_tagString", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivityGroups.update * @memberOf! () * @@ -17655,6 +24762,65 @@ export namespace dfareporting_v3_3 { /** * dfareporting.floodlightConfigurations.get * @desc Gets one floodlight configuration by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightConfigurations.get({ + * // Floodlight configuration ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "analyticsDataSharingEnabled": false, + * // "customViewabilityMetric": {}, + * // "exposureToConversionEnabled": false, + * // "firstDayOfWeek": "my_firstDayOfWeek", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "inAppAttributionTrackingEnabled": false, + * // "kind": "my_kind", + * // "lookbackConfiguration": {}, + * // "naturalSearchConversionAttributionOption": "my_naturalSearchConversionAttributionOption", + * // "omnitureSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "tagSettings": {}, + * // "thirdPartyAuthenticationTokens": [], + * // "userDefinedVariableConfigurations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightConfigurations.get * @memberOf! () * @@ -17732,6 +24898,49 @@ export namespace dfareporting_v3_3 { /** * dfareporting.floodlightConfigurations.list * @desc Retrieves a list of floodlight configurations, possibly filtered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightConfigurations.list({ + * // Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned. + * ids: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "floodlightConfigurations": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightConfigurations.list * @memberOf! () * @@ -17824,6 +25033,90 @@ export namespace dfareporting_v3_3 { /** * dfareporting.floodlightConfigurations.patch * @desc Updates an existing floodlight configuration. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightConfigurations.patch({ + * // Floodlight configuration ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "analyticsDataSharingEnabled": false, + * // "customViewabilityMetric": {}, + * // "exposureToConversionEnabled": false, + * // "firstDayOfWeek": "my_firstDayOfWeek", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "inAppAttributionTrackingEnabled": false, + * // "kind": "my_kind", + * // "lookbackConfiguration": {}, + * // "naturalSearchConversionAttributionOption": "my_naturalSearchConversionAttributionOption", + * // "omnitureSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "tagSettings": {}, + * // "thirdPartyAuthenticationTokens": [], + * // "userDefinedVariableConfigurations": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "analyticsDataSharingEnabled": false, + * // "customViewabilityMetric": {}, + * // "exposureToConversionEnabled": false, + * // "firstDayOfWeek": "my_firstDayOfWeek", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "inAppAttributionTrackingEnabled": false, + * // "kind": "my_kind", + * // "lookbackConfiguration": {}, + * // "naturalSearchConversionAttributionOption": "my_naturalSearchConversionAttributionOption", + * // "omnitureSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "tagSettings": {}, + * // "thirdPartyAuthenticationTokens": [], + * // "userDefinedVariableConfigurations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightConfigurations.patch * @memberOf! () * @@ -17902,6 +25195,88 @@ export namespace dfareporting_v3_3 { /** * dfareporting.floodlightConfigurations.update * @desc Updates an existing floodlight configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightConfigurations.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "analyticsDataSharingEnabled": false, + * // "customViewabilityMetric": {}, + * // "exposureToConversionEnabled": false, + * // "firstDayOfWeek": "my_firstDayOfWeek", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "inAppAttributionTrackingEnabled": false, + * // "kind": "my_kind", + * // "lookbackConfiguration": {}, + * // "naturalSearchConversionAttributionOption": "my_naturalSearchConversionAttributionOption", + * // "omnitureSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "tagSettings": {}, + * // "thirdPartyAuthenticationTokens": [], + * // "userDefinedVariableConfigurations": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "analyticsDataSharingEnabled": false, + * // "customViewabilityMetric": {}, + * // "exposureToConversionEnabled": false, + * // "firstDayOfWeek": "my_firstDayOfWeek", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "inAppAttributionTrackingEnabled": false, + * // "kind": "my_kind", + * // "lookbackConfiguration": {}, + * // "naturalSearchConversionAttributionOption": "my_naturalSearchConversionAttributionOption", + * // "omnitureSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "tagSettings": {}, + * // "thirdPartyAuthenticationTokens": [], + * // "userDefinedVariableConfigurations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightConfigurations.update * @memberOf! () * @@ -18059,6 +25434,69 @@ export namespace dfareporting_v3_3 { /** * dfareporting.inventoryItems.get * @desc Gets one inventory item by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.inventoryItems.get({ + * // Inventory item ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Project ID for order documents. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adSlots": [], + * // "advertiserId": "my_advertiserId", + * // "contentCategoryId": "my_contentCategoryId", + * // "estimatedClickThroughRate": "my_estimatedClickThroughRate", + * // "estimatedConversionRate": "my_estimatedConversionRate", + * // "id": "my_id", + * // "inPlan": false, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "negotiationChannelId": "my_negotiationChannelId", + * // "orderId": "my_orderId", + * // "placementStrategyId": "my_placementStrategyId", + * // "pricing": {}, + * // "projectId": "my_projectId", + * // "rfpId": "my_rfpId", + * // "siteId": "my_siteId", + * // "subaccountId": "my_subaccountId", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.inventoryItems.get * @memberOf! () * @@ -18135,6 +25573,68 @@ export namespace dfareporting_v3_3 { /** * dfareporting.inventoryItems.list * @desc Retrieves a list of inventory items, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.inventoryItems.list({ + * // Select only inventory items with these IDs. + * ids: 'placeholder-value', + * // Select only inventory items that are in plan. + * inPlan: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Select only inventory items that belong to specified orders. + * orderId: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Project ID for order documents. + * projectId: 'placeholder-value', + * // Select only inventory items that are associated with these sites. + * siteId: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only inventory items with this type. + * type: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "inventoryItems": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.inventoryItems.list * @memberOf! () * @@ -18306,6 +25806,47 @@ export namespace dfareporting_v3_3 { /** * dfareporting.languages.list * @desc Retrieves a list of languages. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.languages.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "languages": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.languages.list * @memberOf! () * @@ -18399,6 +25940,47 @@ export namespace dfareporting_v3_3 { /** * dfareporting.metros.list * @desc Retrieves a list of metros. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.metros.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "metros": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.metros.list * @memberOf! () * @@ -18490,6 +26072,52 @@ export namespace dfareporting_v3_3 { /** * dfareporting.mobileApps.get * @desc Gets one mobile app by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.mobileApps.get({ + * // Mobile app ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "directory": "my_directory", + * // "id": "my_id", + * // "kind": "my_kind", + * // "publisherName": "my_publisherName", + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.mobileApps.get * @memberOf! () * @@ -18564,6 +26192,58 @@ export namespace dfareporting_v3_3 { /** * dfareporting.mobileApps.list * @desc Retrieves list of available mobile apps. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.mobileApps.list({ + * // Select only apps from these directories. + * directories: 'placeholder-value', + * // Select only apps with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "app*2015" will return objects with names like "app Jan 2018", "app Jan 2018", or simply "app 2018". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "app" will match objects with name "my app", "app 2018", or simply "app". + * searchString: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "mobileApps": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.mobileApps.list * @memberOf! () * @@ -18697,6 +26377,52 @@ export namespace dfareporting_v3_3 { /** * dfareporting.mobileCarriers.get * @desc Gets one mobile carrier by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.mobileCarriers.get({ + * // Mobile carrier ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "countryCode": "my_countryCode", + * // "countryDartId": "my_countryDartId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.mobileCarriers.get * @memberOf! () * @@ -18772,6 +26498,47 @@ export namespace dfareporting_v3_3 { /** * dfareporting.mobileCarriers.list * @desc Retrieves a list of mobile carriers. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.mobileCarriers.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "mobileCarriers": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.mobileCarriers.list * @memberOf! () * @@ -18889,6 +26656,52 @@ export namespace dfareporting_v3_3 { /** * dfareporting.operatingSystems.get * @desc Gets one operating system by DART ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.operatingSystems.get({ + * // Operating system DART ID. + * dartId: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dartId": "my_dartId", + * // "desktop": false, + * // "kind": "my_kind", + * // "mobile": false, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.operatingSystems.get * @memberOf! () * @@ -18964,6 +26777,47 @@ export namespace dfareporting_v3_3 { /** * dfareporting.operatingSystems.list * @desc Retrieves a list of operating systems. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.operatingSystems.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "operatingSystems": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.operatingSystems.list * @memberOf! () * @@ -19083,6 +26937,53 @@ export namespace dfareporting_v3_3 { /** * dfareporting.operatingSystemVersions.get * @desc Gets one operating system version by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.operatingSystemVersions.get({ + * // Operating system version ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "majorVersion": "my_majorVersion", + * // "minorVersion": "my_minorVersion", + * // "name": "my_name", + * // "operatingSystem": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.operatingSystemVersions.get * @memberOf! () * @@ -19160,6 +27061,47 @@ export namespace dfareporting_v3_3 { /** * dfareporting.operatingSystemVersions.list * @desc Retrieves a list of operating system versions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.operatingSystemVersions.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "operatingSystemVersions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.operatingSystemVersions.list * @memberOf! () * @@ -19281,6 +27223,66 @@ export namespace dfareporting_v3_3 { /** * dfareporting.orderDocuments.get * @desc Gets one order document by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.orderDocuments.get({ + * // Order document ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Project ID for order documents. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "amendedOrderDocumentId": "my_amendedOrderDocumentId", + * // "approvedByUserProfileIds": [], + * // "cancelled": false, + * // "createdInfo": {}, + * // "effectiveDate": "my_effectiveDate", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastSentRecipients": [], + * // "lastSentTime": "my_lastSentTime", + * // "orderId": "my_orderId", + * // "projectId": "my_projectId", + * // "signed": false, + * // "subaccountId": "my_subaccountId", + * // "title": "my_title", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.orderDocuments.get * @memberOf! () * @@ -19357,6 +27359,68 @@ export namespace dfareporting_v3_3 { /** * dfareporting.orderDocuments.list * @desc Retrieves a list of order documents, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.orderDocuments.list({ + * // Select only order documents that have been approved by at least one user. + * approved: 'placeholder-value', + * // Select only order documents with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Select only order documents for specified orders. + * orderId: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Project ID for order documents. + * projectId: 'placeholder-value', + * // Allows searching for order documents by name or ID. Wildcards (*) are allowed. For example, "orderdocument*2015" will return order documents with names like "orderdocument June 2015", "orderdocument April 2015", or simply "orderdocument 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "orderdocument" will match order documents with name "my orderdocument", "orderdocument 2015", or simply "orderdocument". + * searchString: 'placeholder-value', + * // Select only order documents that are associated with these sites. + * siteId: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "orderDocuments": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.orderDocuments.list * @memberOf! () * @@ -19528,6 +27592,69 @@ export namespace dfareporting_v3_3 { /** * dfareporting.orders.get * @desc Gets one order by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.orders.get({ + * // Order ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Project ID for orders. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "approverUserProfileIds": [], + * // "buyerInvoiceId": "my_buyerInvoiceId", + * // "buyerOrganizationName": "my_buyerOrganizationName", + * // "comments": "my_comments", + * // "contacts": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "notes": "my_notes", + * // "planningTermId": "my_planningTermId", + * // "projectId": "my_projectId", + * // "sellerOrderId": "my_sellerOrderId", + * // "sellerOrganizationName": "my_sellerOrganizationName", + * // "siteId": [], + * // "siteNames": [], + * // "subaccountId": "my_subaccountId", + * // "termsAndConditions": "my_termsAndConditions" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.orders.get * @memberOf! () * @@ -19601,6 +27728,64 @@ export namespace dfareporting_v3_3 { /** * dfareporting.orders.list * @desc Retrieves a list of orders, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.orders.list({ + * // Select only orders with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Project ID for orders. + * projectId: 'placeholder-value', + * // Allows searching for orders by name or ID. Wildcards (*) are allowed. For example, "order*2015" will return orders with names like "order June 2015", "order April 2015", or simply "order 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "order" will match orders with name "my order", "order 2015", or simply "order". + * searchString: 'placeholder-value', + * // Select only orders that are associated with these site IDs. + * siteId: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "orders": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.orders.list * @memberOf! () * @@ -19752,6 +27937,73 @@ export namespace dfareporting_v3_3 { /** * dfareporting.placementGroups.get * @desc Gets one placement group by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementGroups.get({ + * // Placement group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "childPlacementIds": [], + * // "comment": "my_comment", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementGroupType": "my_placementGroupType", + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primaryPlacementId": "my_primaryPlacementId", + * // "primaryPlacementIdDimensionValue": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementGroups.get * @memberOf! () * @@ -19827,6 +28079,104 @@ export namespace dfareporting_v3_3 { /** * dfareporting.placementGroups.insert * @desc Inserts a new placement group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementGroups.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "childPlacementIds": [], + * // "comment": "my_comment", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementGroupType": "my_placementGroupType", + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primaryPlacementId": "my_primaryPlacementId", + * // "primaryPlacementIdDimensionValue": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "childPlacementIds": [], + * // "comment": "my_comment", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementGroupType": "my_placementGroupType", + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primaryPlacementId": "my_primaryPlacementId", + * // "primaryPlacementIdDimensionValue": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementGroups.insert * @memberOf! () * @@ -19902,6 +28252,86 @@ export namespace dfareporting_v3_3 { /** * dfareporting.placementGroups.list * @desc Retrieves a list of placement groups, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementGroups.list({ + * // Select only placement groups that belong to these advertisers. + * advertiserIds: 'placeholder-value', + * // Select only archived placements. Don't set this field to select both archived and non-archived placements. + * archived: 'placeholder-value', + * // Select only placement groups that belong to these campaigns. + * campaignIds: 'placeholder-value', + * // Select only placement groups that are associated with these content categories. + * contentCategoryIds: 'placeholder-value', + * // Select only placement groups that are associated with these directory sites. + * directorySiteIds: 'placeholder-value', + * // Select only placement groups with these IDs. + * ids: 'placeholder-value', + * // Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as "yyyy-MM-dd". + * maxEndDate: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as "yyyy-MM-dd". + * maxStartDate: 'placeholder-value', + * // Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as "yyyy-MM-dd". + * minEndDate: 'placeholder-value', + * // Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as "yyyy-MM-dd". + * minStartDate: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // Select only placement groups belonging with this group type. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group of placements that not only acts as a single pricing point but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting. + * placementGroupType: 'placeholder-value', + * // Select only placement groups that are associated with these placement strategies. + * placementStrategyIds: 'placeholder-value', + * // Select only placement groups with these pricing types. + * pricingTypes: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for placement groups by name or ID. Wildcards (*) are allowed. For example, "placement*2015" will return placement groups with names like "placement group June 2015", "placement group May 2015", or simply "placements 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placementgroup" will match placement groups with name "my placementgroup", "placementgroup 2015", or simply "placementgroup". + * searchString: 'placeholder-value', + * // Select only placement groups that are associated with these sites. + * siteIds: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "placementGroups": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementGroups.list * @memberOf! () * @@ -20002,6 +28432,106 @@ export namespace dfareporting_v3_3 { /** * dfareporting.placementGroups.patch * @desc Updates an existing placement group. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementGroups.patch({ + * // Placement group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "childPlacementIds": [], + * // "comment": "my_comment", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementGroupType": "my_placementGroupType", + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primaryPlacementId": "my_primaryPlacementId", + * // "primaryPlacementIdDimensionValue": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "childPlacementIds": [], + * // "comment": "my_comment", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementGroupType": "my_placementGroupType", + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primaryPlacementId": "my_primaryPlacementId", + * // "primaryPlacementIdDimensionValue": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementGroups.patch * @memberOf! () * @@ -20078,6 +28608,104 @@ export namespace dfareporting_v3_3 { /** * dfareporting.placementGroups.update * @desc Updates an existing placement group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementGroups.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "childPlacementIds": [], + * // "comment": "my_comment", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementGroupType": "my_placementGroupType", + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primaryPlacementId": "my_primaryPlacementId", + * // "primaryPlacementIdDimensionValue": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "childPlacementIds": [], + * // "comment": "my_comment", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementGroupType": "my_placementGroupType", + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primaryPlacementId": "my_primaryPlacementId", + * // "primaryPlacementIdDimensionValue": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementGroups.update * @memberOf! () * @@ -20320,6 +28948,55 @@ export namespace dfareporting_v3_3 { /** * dfareporting.placements.generatetags * @desc Generates tags for a placement. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placements.generatetags({ + * // Generate placements belonging to this campaign. This is a required field. + * campaignId: 'placeholder-value', + * // Generate tags for these placements. + * placementIds: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Tag formats to generate for these placements. + * // + * // Note: PLACEMENT_TAG_STANDARD can only be generated for 1x1 placements. + * tagFormats: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "placementTags": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placements.generatetags * @memberOf! () * @@ -20406,6 +29083,88 @@ export namespace dfareporting_v3_3 { /** * dfareporting.placements.get * @desc Gets one placement by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placements.get({ + * // Placement ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adBlockingOptOut": false, + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "comment": "my_comment", + * // "compatibility": "my_compatibility", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "lookbackConfiguration": {}, + * // "name": "my_name", + * // "paymentApproved": false, + * // "paymentSource": "my_paymentSource", + * // "placementGroupId": "my_placementGroupId", + * // "placementGroupIdDimensionValue": {}, + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primary": false, + * // "publisherUpdateInfo": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "size": {}, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormats": [], + * // "tagSetting": {}, + * // "videoActiveViewOptOut": false, + * // "videoSettings": {}, + * // "vpaidAdapterChoice": "my_vpaidAdapterChoice" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placements.get * @memberOf! () * @@ -20480,6 +29239,134 @@ export namespace dfareporting_v3_3 { /** * dfareporting.placements.insert * @desc Inserts a new placement. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placements.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "adBlockingOptOut": false, + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "comment": "my_comment", + * // "compatibility": "my_compatibility", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "lookbackConfiguration": {}, + * // "name": "my_name", + * // "paymentApproved": false, + * // "paymentSource": "my_paymentSource", + * // "placementGroupId": "my_placementGroupId", + * // "placementGroupIdDimensionValue": {}, + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primary": false, + * // "publisherUpdateInfo": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "size": {}, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormats": [], + * // "tagSetting": {}, + * // "videoActiveViewOptOut": false, + * // "videoSettings": {}, + * // "vpaidAdapterChoice": "my_vpaidAdapterChoice" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adBlockingOptOut": false, + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "comment": "my_comment", + * // "compatibility": "my_compatibility", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "lookbackConfiguration": {}, + * // "name": "my_name", + * // "paymentApproved": false, + * // "paymentSource": "my_paymentSource", + * // "placementGroupId": "my_placementGroupId", + * // "placementGroupIdDimensionValue": {}, + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primary": false, + * // "publisherUpdateInfo": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "size": {}, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormats": [], + * // "tagSetting": {}, + * // "videoActiveViewOptOut": false, + * // "videoSettings": {}, + * // "vpaidAdapterChoice": "my_vpaidAdapterChoice" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placements.insert * @memberOf! () * @@ -20554,6 +29441,92 @@ export namespace dfareporting_v3_3 { /** * dfareporting.placements.list * @desc Retrieves a list of placements, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placements.list({ + * // Select only placements that belong to these advertisers. + * advertiserIds: 'placeholder-value', + * // Select only archived placements. Don't set this field to select both archived and non-archived placements. + * archived: 'placeholder-value', + * // Select only placements that belong to these campaigns. + * campaignIds: 'placeholder-value', + * // Select only placements that are associated with these compatibilities. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. + * compatibilities: 'placeholder-value', + * // Select only placements that are associated with these content categories. + * contentCategoryIds: 'placeholder-value', + * // Select only placements that are associated with these directory sites. + * directorySiteIds: 'placeholder-value', + * // Select only placements that belong to these placement groups. + * groupIds: 'placeholder-value', + * // Select only placements with these IDs. + * ids: 'placeholder-value', + * // Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as "yyyy-MM-dd". + * maxEndDate: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as "yyyy-MM-dd". + * maxStartDate: 'placeholder-value', + * // Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as "yyyy-MM-dd". + * minEndDate: 'placeholder-value', + * // Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as "yyyy-MM-dd". + * minStartDate: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // Select only placements with this payment source. + * paymentSource: 'placeholder-value', + * // Select only placements that are associated with these placement strategies. + * placementStrategyIds: 'placeholder-value', + * // Select only placements with these pricing types. + * pricingTypes: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for placements by name or ID. Wildcards (*) are allowed. For example, "placement*2015" will return placements with names like "placement June 2015", "placement May 2015", or simply "placements 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placement" will match placements with name "my placement", "placement 2015", or simply "placement". + * searchString: 'placeholder-value', + * // Select only placements that are associated with these sites. + * siteIds: 'placeholder-value', + * // Select only placements that are associated with these sizes. + * sizeIds: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "placements": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placements.list * @memberOf! () * @@ -20650,6 +29623,136 @@ export namespace dfareporting_v3_3 { /** * dfareporting.placements.patch * @desc Updates an existing placement. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placements.patch({ + * // Placement ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "adBlockingOptOut": false, + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "comment": "my_comment", + * // "compatibility": "my_compatibility", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "lookbackConfiguration": {}, + * // "name": "my_name", + * // "paymentApproved": false, + * // "paymentSource": "my_paymentSource", + * // "placementGroupId": "my_placementGroupId", + * // "placementGroupIdDimensionValue": {}, + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primary": false, + * // "publisherUpdateInfo": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "size": {}, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormats": [], + * // "tagSetting": {}, + * // "videoActiveViewOptOut": false, + * // "videoSettings": {}, + * // "vpaidAdapterChoice": "my_vpaidAdapterChoice" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adBlockingOptOut": false, + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "comment": "my_comment", + * // "compatibility": "my_compatibility", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "lookbackConfiguration": {}, + * // "name": "my_name", + * // "paymentApproved": false, + * // "paymentSource": "my_paymentSource", + * // "placementGroupId": "my_placementGroupId", + * // "placementGroupIdDimensionValue": {}, + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primary": false, + * // "publisherUpdateInfo": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "size": {}, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormats": [], + * // "tagSetting": {}, + * // "videoActiveViewOptOut": false, + * // "videoSettings": {}, + * // "vpaidAdapterChoice": "my_vpaidAdapterChoice" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placements.patch * @memberOf! () * @@ -20724,6 +29827,134 @@ export namespace dfareporting_v3_3 { /** * dfareporting.placements.update * @desc Updates an existing placement. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placements.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "adBlockingOptOut": false, + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "comment": "my_comment", + * // "compatibility": "my_compatibility", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "lookbackConfiguration": {}, + * // "name": "my_name", + * // "paymentApproved": false, + * // "paymentSource": "my_paymentSource", + * // "placementGroupId": "my_placementGroupId", + * // "placementGroupIdDimensionValue": {}, + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primary": false, + * // "publisherUpdateInfo": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "size": {}, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormats": [], + * // "tagSetting": {}, + * // "videoActiveViewOptOut": false, + * // "videoSettings": {}, + * // "vpaidAdapterChoice": "my_vpaidAdapterChoice" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adBlockingOptOut": false, + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "comment": "my_comment", + * // "compatibility": "my_compatibility", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "lookbackConfiguration": {}, + * // "name": "my_name", + * // "paymentApproved": false, + * // "paymentSource": "my_paymentSource", + * // "placementGroupId": "my_placementGroupId", + * // "placementGroupIdDimensionValue": {}, + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primary": false, + * // "publisherUpdateInfo": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "size": {}, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormats": [], + * // "tagSetting": {}, + * // "videoActiveViewOptOut": false, + * // "videoSettings": {}, + * // "vpaidAdapterChoice": "my_vpaidAdapterChoice" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placements.update * @memberOf! () * @@ -20998,6 +30229,43 @@ export namespace dfareporting_v3_3 { /** * dfareporting.placementStrategies.delete * @desc Deletes an existing placement strategy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementStrategies.delete({ + * // Placement strategy ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementStrategies.delete * @memberOf! () * @@ -21071,6 +30339,51 @@ export namespace dfareporting_v3_3 { /** * dfareporting.placementStrategies.get * @desc Gets one placement strategy by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementStrategies.get({ + * // Placement strategy ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementStrategies.get * @memberOf! () * @@ -21146,6 +30459,60 @@ export namespace dfareporting_v3_3 { /** * dfareporting.placementStrategies.insert * @desc Inserts a new placement strategy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementStrategies.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementStrategies.insert * @memberOf! () * @@ -21221,6 +30588,60 @@ export namespace dfareporting_v3_3 { /** * dfareporting.placementStrategies.list * @desc Retrieves a list of placement strategies, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementStrategies.list({ + * // Select only placement strategies with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "placementstrategy*2015" will return objects with names like "placementstrategy June 2015", "placementstrategy April 2015", or simply "placementstrategy 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placementstrategy" will match objects with name "my placementstrategy", "placementstrategy 2015", or simply "placementstrategy". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "placementStrategies": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementStrategies.list * @memberOf! () * @@ -21310,6 +30731,62 @@ export namespace dfareporting_v3_3 { /** * dfareporting.placementStrategies.patch * @desc Updates an existing placement strategy. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementStrategies.patch({ + * // Placement strategy ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementStrategies.patch * @memberOf! () * @@ -21386,6 +30863,60 @@ export namespace dfareporting_v3_3 { /** * dfareporting.placementStrategies.update * @desc Updates an existing placement strategy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementStrategies.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementStrategies.update * @memberOf! () * @@ -21592,6 +31123,50 @@ export namespace dfareporting_v3_3 { /** * dfareporting.platformTypes.get * @desc Gets one platform type by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.platformTypes.get({ + * // Platform type ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.platformTypes.get * @memberOf! () * @@ -21667,6 +31242,47 @@ export namespace dfareporting_v3_3 { /** * dfareporting.platformTypes.list * @desc Retrieves a list of platform types. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.platformTypes.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "platformTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.platformTypes.list * @memberOf! () * @@ -21784,6 +31400,52 @@ export namespace dfareporting_v3_3 { /** * dfareporting.postalCodes.get * @desc Gets one postal code by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.postalCodes.get({ + * // Postal code ID. + * code: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": "my_code", + * // "countryCode": "my_countryCode", + * // "countryDartId": "my_countryDartId", + * // "id": "my_id", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.postalCodes.get * @memberOf! () * @@ -21858,6 +31520,47 @@ export namespace dfareporting_v3_3 { /** * dfareporting.postalCodes.list * @desc Retrieves a list of postal codes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.postalCodes.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "postalCodes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.postalCodes.list * @memberOf! () * @@ -21967,6 +31670,69 @@ export namespace dfareporting_v3_3 { /** * dfareporting.projects.get * @desc Gets one project by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.projects.get({ + * // Project ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "audienceAgeGroup": "my_audienceAgeGroup", + * // "audienceGender": "my_audienceGender", + * // "budget": "my_budget", + * // "clientBillingCode": "my_clientBillingCode", + * // "clientName": "my_clientName", + * // "endDate": "my_endDate", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "overview": "my_overview", + * // "startDate": "my_startDate", + * // "subaccountId": "my_subaccountId", + * // "targetClicks": "my_targetClicks", + * // "targetConversions": "my_targetConversions", + * // "targetCpaNanos": "my_targetCpaNanos", + * // "targetCpcNanos": "my_targetCpcNanos", + * // "targetCpmActiveViewNanos": "my_targetCpmActiveViewNanos", + * // "targetCpmNanos": "my_targetCpmNanos", + * // "targetImpressions": "my_targetImpressions" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.projects.get * @memberOf! () * @@ -22039,6 +31805,62 @@ export namespace dfareporting_v3_3 { /** * dfareporting.projects.list * @desc Retrieves a list of projects, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.projects.list({ + * // Select only projects with these advertiser IDs. + * advertiserIds: 'placeholder-value', + * // Select only projects with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for projects by name or ID. Wildcards (*) are allowed. For example, "project*2015" will return projects with names like "project June 2015", "project April 2015", or simply "project 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "project" will match projects with name "my project", "project 2015", or simply "project". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "projects": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.projects.list * @memberOf! () * @@ -22182,6 +32004,47 @@ export namespace dfareporting_v3_3 { /** * dfareporting.regions.list * @desc Retrieves a list of regions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.regions.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "regions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.regions.list * @memberOf! () * @@ -22273,6 +32136,60 @@ export namespace dfareporting_v3_3 { /** * dfareporting.remarketingLists.get * @desc Gets one remarketing list by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.remarketingLists.get({ + * // Remarketing list ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifeSpan": "my_lifeSpan", + * // "listPopulationRule": {}, + * // "listSize": "my_listSize", + * // "listSource": "my_listSource", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.remarketingLists.get * @memberOf! () * @@ -22348,6 +32265,78 @@ export namespace dfareporting_v3_3 { /** * dfareporting.remarketingLists.insert * @desc Inserts a new remarketing list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.remarketingLists.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifeSpan": "my_lifeSpan", + * // "listPopulationRule": {}, + * // "listSize": "my_listSize", + * // "listSource": "my_listSource", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifeSpan": "my_lifeSpan", + * // "listPopulationRule": {}, + * // "listSize": "my_listSize", + * // "listSource": "my_listSource", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.remarketingLists.insert * @memberOf! () * @@ -22423,6 +32412,64 @@ export namespace dfareporting_v3_3 { /** * dfareporting.remarketingLists.list * @desc Retrieves a list of remarketing lists, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.remarketingLists.list({ + * // Select only active or only inactive remarketing lists. + * active: 'placeholder-value', + * // Select only remarketing lists owned by this advertiser. + * advertiserId: 'placeholder-value', + * // Select only remarketing lists that have this floodlight activity ID. + * floodlightActivityId: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "remarketing list*2015" will return objects with names like "remarketing list June 2015", "remarketing list April 2015", or simply "remarketing list 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "remarketing list" will match objects with name "my remarketing list", "remarketing list 2015", or simply "remarketing list". + * name: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "remarketingLists": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.remarketingLists.list * @memberOf! () * @@ -22514,6 +32561,80 @@ export namespace dfareporting_v3_3 { /** * dfareporting.remarketingLists.patch * @desc Updates an existing remarketing list. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.remarketingLists.patch({ + * // Remarketing list ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifeSpan": "my_lifeSpan", + * // "listPopulationRule": {}, + * // "listSize": "my_listSize", + * // "listSource": "my_listSource", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifeSpan": "my_lifeSpan", + * // "listPopulationRule": {}, + * // "listSize": "my_listSize", + * // "listSource": "my_listSource", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.remarketingLists.patch * @memberOf! () * @@ -22590,6 +32711,78 @@ export namespace dfareporting_v3_3 { /** * dfareporting.remarketingLists.update * @desc Updates an existing remarketing list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.remarketingLists.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifeSpan": "my_lifeSpan", + * // "listPopulationRule": {}, + * // "listSize": "my_listSize", + * // "listSource": "my_listSource", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifeSpan": "my_lifeSpan", + * // "listPopulationRule": {}, + * // "listSize": "my_listSize", + * // "listSource": "my_listSource", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.remarketingLists.update * @memberOf! () * @@ -22788,6 +32981,51 @@ export namespace dfareporting_v3_3 { /** * dfareporting.remarketingListShares.get * @desc Gets one remarketing list share by remarketing list ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.remarketingListShares.get({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Remarketing list ID. + * remarketingListId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "remarketingListId": "my_remarketingListId", + * // "sharedAccountIds": [], + * // "sharedAdvertiserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.remarketingListShares.get * @memberOf! () * @@ -22865,6 +33103,62 @@ export namespace dfareporting_v3_3 { /** * dfareporting.remarketingListShares.patch * @desc Updates an existing remarketing list share. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.remarketingListShares.patch({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Remarketing list ID. + * remarketingListId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "remarketingListId": "my_remarketingListId", + * // "sharedAccountIds": [], + * // "sharedAdvertiserIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "remarketingListId": "my_remarketingListId", + * // "sharedAccountIds": [], + * // "sharedAdvertiserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.remarketingListShares.patch * @memberOf! () * @@ -22943,6 +33237,60 @@ export namespace dfareporting_v3_3 { /** * dfareporting.remarketingListShares.update * @desc Updates an existing remarketing list share. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.remarketingListShares.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "remarketingListId": "my_remarketingListId", + * // "sharedAccountIds": [], + * // "sharedAdvertiserIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "remarketingListId": "my_remarketingListId", + * // "sharedAccountIds": [], + * // "sharedAdvertiserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.remarketingListShares.update * @memberOf! () * @@ -23088,6 +33436,43 @@ export namespace dfareporting_v3_3 { /** * dfareporting.reports.delete * @desc Deletes a report by its ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.reports.delete({ + * // The DFA user profile ID. + * profileId: 'placeholder-value', + * // The ID of the report. + * reportId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.reports.delete * @memberOf! () * @@ -23160,6 +33545,65 @@ export namespace dfareporting_v3_3 { /** * dfareporting.reports.get * @desc Retrieves a report by its ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.reports.get({ + * // The DFA user profile ID. + * profileId: 'placeholder-value', + * // The ID of the report. + * reportId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "criteria": {}, + * // "crossDimensionReachCriteria": {}, + * // "delivery": {}, + * // "etag": "my_etag", + * // "fileName": "my_fileName", + * // "floodlightCriteria": {}, + * // "format": "my_format", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "name": "my_name", + * // "ownerProfileId": "my_ownerProfileId", + * // "pathToConversionCriteria": {}, + * // "reachCriteria": {}, + * // "schedule": {}, + * // "subAccountId": "my_subAccountId", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.reports.get * @memberOf! () * @@ -23232,6 +33676,88 @@ export namespace dfareporting_v3_3 { /** * dfareporting.reports.insert * @desc Creates a report. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.reports.insert({ + * // The DFA user profile ID. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "criteria": {}, + * // "crossDimensionReachCriteria": {}, + * // "delivery": {}, + * // "etag": "my_etag", + * // "fileName": "my_fileName", + * // "floodlightCriteria": {}, + * // "format": "my_format", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "name": "my_name", + * // "ownerProfileId": "my_ownerProfileId", + * // "pathToConversionCriteria": {}, + * // "reachCriteria": {}, + * // "schedule": {}, + * // "subAccountId": "my_subAccountId", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "criteria": {}, + * // "crossDimensionReachCriteria": {}, + * // "delivery": {}, + * // "etag": "my_etag", + * // "fileName": "my_fileName", + * // "floodlightCriteria": {}, + * // "format": "my_format", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "name": "my_name", + * // "ownerProfileId": "my_ownerProfileId", + * // "pathToConversionCriteria": {}, + * // "reachCriteria": {}, + * // "schedule": {}, + * // "subAccountId": "my_subAccountId", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.reports.insert * @memberOf! () * @@ -23303,6 +33829,59 @@ export namespace dfareporting_v3_3 { /** * dfareporting.reports.list * @desc Retrieves list of reports. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.reports.list({ + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // The value of the nextToken from the previous result page. + * pageToken: 'placeholder-value', + * // The DFA user profile ID. + * profileId: 'placeholder-value', + * // The scope that defines which results are returned. + * scope: 'placeholder-value', + * // The field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.reports.list * @memberOf! () * @@ -23380,6 +33959,90 @@ export namespace dfareporting_v3_3 { /** * dfareporting.reports.patch * @desc Updates a report. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.reports.patch({ + * // The DFA user profile ID. + * profileId: 'placeholder-value', + * // The ID of the report. + * reportId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "criteria": {}, + * // "crossDimensionReachCriteria": {}, + * // "delivery": {}, + * // "etag": "my_etag", + * // "fileName": "my_fileName", + * // "floodlightCriteria": {}, + * // "format": "my_format", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "name": "my_name", + * // "ownerProfileId": "my_ownerProfileId", + * // "pathToConversionCriteria": {}, + * // "reachCriteria": {}, + * // "schedule": {}, + * // "subAccountId": "my_subAccountId", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "criteria": {}, + * // "crossDimensionReachCriteria": {}, + * // "delivery": {}, + * // "etag": "my_etag", + * // "fileName": "my_fileName", + * // "floodlightCriteria": {}, + * // "format": "my_format", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "name": "my_name", + * // "ownerProfileId": "my_ownerProfileId", + * // "pathToConversionCriteria": {}, + * // "reachCriteria": {}, + * // "schedule": {}, + * // "subAccountId": "my_subAccountId", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.reports.patch * @memberOf! () * @@ -23453,6 +34116,59 @@ export namespace dfareporting_v3_3 { /** * dfareporting.reports.run * @desc Runs a report. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.reports.run({ + * // The DFA profile ID. + * profileId: 'placeholder-value', + * // The ID of the report. + * reportId: 'placeholder-value', + * // If set and true, tries to run the report synchronously. + * synchronous: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dateRange": {}, + * // "etag": "my_etag", + * // "fileName": "my_fileName", + * // "format": "my_format", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "reportId": "my_reportId", + * // "status": "my_status", + * // "urls": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.reports.run * @memberOf! () * @@ -23526,6 +34242,90 @@ export namespace dfareporting_v3_3 { /** * dfareporting.reports.update * @desc Updates a report. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.reports.update({ + * // The DFA user profile ID. + * profileId: 'placeholder-value', + * // The ID of the report. + * reportId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "criteria": {}, + * // "crossDimensionReachCriteria": {}, + * // "delivery": {}, + * // "etag": "my_etag", + * // "fileName": "my_fileName", + * // "floodlightCriteria": {}, + * // "format": "my_format", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "name": "my_name", + * // "ownerProfileId": "my_ownerProfileId", + * // "pathToConversionCriteria": {}, + * // "reachCriteria": {}, + * // "schedule": {}, + * // "subAccountId": "my_subAccountId", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "criteria": {}, + * // "crossDimensionReachCriteria": {}, + * // "delivery": {}, + * // "etag": "my_etag", + * // "fileName": "my_fileName", + * // "floodlightCriteria": {}, + * // "format": "my_format", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "name": "my_name", + * // "ownerProfileId": "my_ownerProfileId", + * // "pathToConversionCriteria": {}, + * // "reachCriteria": {}, + * // "schedule": {}, + * // "subAccountId": "my_subAccountId", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.reports.update * @memberOf! () * @@ -23743,6 +34543,76 @@ export namespace dfareporting_v3_3 { /** * dfareporting.reports.compatibleFields.query * @desc Returns the fields that are compatible to be selected in the respective sections of a report criteria, given the fields already selected in the input report and user permissions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.reports.compatibleFields.query({ + * // The DFA user profile ID. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "criteria": {}, + * // "crossDimensionReachCriteria": {}, + * // "delivery": {}, + * // "etag": "my_etag", + * // "fileName": "my_fileName", + * // "floodlightCriteria": {}, + * // "format": "my_format", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "name": "my_name", + * // "ownerProfileId": "my_ownerProfileId", + * // "pathToConversionCriteria": {}, + * // "reachCriteria": {}, + * // "schedule": {}, + * // "subAccountId": "my_subAccountId", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "crossDimensionReachReportCompatibleFields": {}, + * // "floodlightReportCompatibleFields": {}, + * // "kind": "my_kind", + * // "pathToConversionReportCompatibleFields": {}, + * // "reachReportCompatibleFields": {}, + * // "reportCompatibleFields": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.reports.compatibleFields.query * @memberOf! () * @@ -23843,6 +34713,59 @@ export namespace dfareporting_v3_3 { /** * dfareporting.reports.files.get * @desc Retrieves a report file by its report ID and file ID. This method supports media download. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.reports.files.get({ + * // The ID of the report file. + * fileId: 'placeholder-value', + * // The DFA user profile ID. + * profileId: 'placeholder-value', + * // The ID of the report. + * reportId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dateRange": {}, + * // "etag": "my_etag", + * // "fileName": "my_fileName", + * // "format": "my_format", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "reportId": "my_reportId", + * // "status": "my_status", + * // "urls": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.reports.files.get * @memberOf! () * @@ -23917,6 +34840,59 @@ export namespace dfareporting_v3_3 { /** * dfareporting.reports.files.list * @desc Lists files for a report. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.reports.files.list({ + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // The value of the nextToken from the previous result page. + * pageToken: 'placeholder-value', + * // The DFA user profile ID. + * profileId: 'placeholder-value', + * // The ID of the report. + * reportId: 'placeholder-value', + * // The field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.reports.files.list * @memberOf! () * @@ -24054,6 +35030,60 @@ export namespace dfareporting_v3_3 { /** * dfareporting.sites.get * @desc Gets one site by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.sites.get({ + * // Site ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "approved": false, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteContacts": [], + * // "siteSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "videoSettings": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.sites.get * @memberOf! () * @@ -24125,6 +35155,78 @@ export namespace dfareporting_v3_3 { /** * dfareporting.sites.insert * @desc Inserts a new site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.sites.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "approved": false, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteContacts": [], + * // "siteSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "videoSettings": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "approved": false, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteContacts": [], + * // "siteSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "videoSettings": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.sites.insert * @memberOf! () * @@ -24196,6 +35298,78 @@ export namespace dfareporting_v3_3 { /** * dfareporting.sites.list * @desc Retrieves a list of sites, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.sites.list({ + * // This search filter is no longer supported and will have no effect on the results returned. + * acceptsInStreamVideoPlacements: 'placeholder-value', + * // This search filter is no longer supported and will have no effect on the results returned. + * acceptsInterstitialPlacements: 'placeholder-value', + * // Select only sites that accept publisher paid placements. + * acceptsPublisherPaidPlacements: 'placeholder-value', + * // Select only AdWords sites. + * adWordsSite: 'placeholder-value', + * // Select only approved sites. + * approved: 'placeholder-value', + * // Select only sites with these campaign IDs. + * campaignIds: 'placeholder-value', + * // Select only sites with these directory site IDs. + * directorySiteIds: 'placeholder-value', + * // Select only sites with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name, ID or keyName. Wildcards (*) are allowed. For example, "site*2015" will return objects with names like "site June 2015", "site April 2015", or simply "site 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "site" will match objects with name "my site", "site 2015", or simply "site". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only sites with this subaccount ID. + * subaccountId: 'placeholder-value', + * // Select only sites that have not been mapped to a directory site. + * unmappedSite: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "sites": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.sites.list * @memberOf! () * @@ -24283,6 +35457,80 @@ export namespace dfareporting_v3_3 { /** * dfareporting.sites.patch * @desc Updates an existing site. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.sites.patch({ + * // Site ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "approved": false, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteContacts": [], + * // "siteSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "videoSettings": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "approved": false, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteContacts": [], + * // "siteSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "videoSettings": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.sites.patch * @memberOf! () * @@ -24355,6 +35603,78 @@ export namespace dfareporting_v3_3 { /** * dfareporting.sites.update * @desc Updates an existing site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.sites.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "approved": false, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteContacts": [], + * // "siteSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "videoSettings": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "approved": false, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteContacts": [], + * // "siteSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "videoSettings": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.sites.update * @memberOf! () * @@ -24572,6 +35892,52 @@ export namespace dfareporting_v3_3 { /** * dfareporting.sizes.get * @desc Gets one size by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.sizes.get({ + * // Size ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "height": 0, + * // "iab": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "width": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.sizes.get * @memberOf! () * @@ -24643,6 +36009,62 @@ export namespace dfareporting_v3_3 { /** * dfareporting.sizes.insert * @desc Inserts a new size. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.sizes.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "height": 0, + * // "iab": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "width": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "height": 0, + * // "iab": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "width": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.sizes.insert * @memberOf! () * @@ -24714,6 +36136,55 @@ export namespace dfareporting_v3_3 { /** * dfareporting.sizes.list * @desc Retrieves a list of sizes, possibly filtered. Retrieved sizes are globally unique and may include values not currently in use by your account. Due to this, the list of sizes returned by this method may differ from the list seen in the Trafficking UI. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.sizes.list({ + * // Select only sizes with this height. + * height: 'placeholder-value', + * // Select only IAB standard sizes. + * iabStandard: 'placeholder-value', + * // Select only sizes with these IDs. + * ids: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Select only sizes with this width. + * width: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "sizes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.sizes.list * @memberOf! () * @@ -24856,6 +36327,52 @@ export namespace dfareporting_v3_3 { /** * dfareporting.subaccounts.get * @desc Gets one subaccount by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.subaccounts.get({ + * // Subaccount ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "availablePermissionIds": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.subaccounts.get * @memberOf! () * @@ -24930,6 +36447,62 @@ export namespace dfareporting_v3_3 { /** * dfareporting.subaccounts.insert * @desc Inserts a new subaccount. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.subaccounts.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "availablePermissionIds": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "availablePermissionIds": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.subaccounts.insert * @memberOf! () * @@ -25005,6 +36578,60 @@ export namespace dfareporting_v3_3 { /** * dfareporting.subaccounts.list * @desc Gets a list of subaccounts, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.subaccounts.list({ + * // Select only subaccounts with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "subaccount*2015" will return objects with names like "subaccount June 2015", "subaccount April 2015", or simply "subaccount 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "subaccount" will match objects with name "my subaccount", "subaccount 2015", or simply "subaccount". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "subaccounts": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.subaccounts.list * @memberOf! () * @@ -25086,6 +36713,64 @@ export namespace dfareporting_v3_3 { /** * dfareporting.subaccounts.patch * @desc Updates an existing subaccount. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.subaccounts.patch({ + * // Subaccount ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "availablePermissionIds": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "availablePermissionIds": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.subaccounts.patch * @memberOf! () * @@ -25162,6 +36847,62 @@ export namespace dfareporting_v3_3 { /** * dfareporting.subaccounts.update * @desc Updates an existing subaccount. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.subaccounts.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "availablePermissionIds": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "availablePermissionIds": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.subaccounts.update * @memberOf! () * @@ -25350,6 +37091,59 @@ export namespace dfareporting_v3_3 { /** * dfareporting.targetableRemarketingLists.get * @desc Gets one remarketing list by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.targetableRemarketingLists.get({ + * // Remarketing list ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifeSpan": "my_lifeSpan", + * // "listSize": "my_listSize", + * // "listSource": "my_listSource", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.targetableRemarketingLists.get * @memberOf! () * @@ -25430,6 +37224,62 @@ export namespace dfareporting_v3_3 { /** * dfareporting.targetableRemarketingLists.list * @desc Retrieves a list of targetable remarketing lists, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.targetableRemarketingLists.list({ + * // Select only active or only inactive targetable remarketing lists. + * active: 'placeholder-value', + * // Select only targetable remarketing lists targetable by these advertisers. + * advertiserId: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "remarketing list*2015" will return objects with names like "remarketing list June 2015", "remarketing list April 2015", or simply "remarketing list 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "remarketing list" will match objects with name "my remarketing list", "remarketing list 2015", or simply "remarketing list". + * name: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "targetableRemarketingLists": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.targetableRemarketingLists.list * @memberOf! () * @@ -25592,6 +37442,60 @@ export namespace dfareporting_v3_3 { /** * dfareporting.targetingTemplates.get * @desc Gets one targeting template by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.targetingTemplates.get({ + * // Targeting template ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "dayPartTargeting": {}, + * // "geoTargeting": {}, + * // "id": "my_id", + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "listTargetingExpression": {}, + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "technologyTargeting": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.targetingTemplates.get * @memberOf! () * @@ -25667,6 +37571,78 @@ export namespace dfareporting_v3_3 { /** * dfareporting.targetingTemplates.insert * @desc Inserts a new targeting template. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.targetingTemplates.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "dayPartTargeting": {}, + * // "geoTargeting": {}, + * // "id": "my_id", + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "listTargetingExpression": {}, + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "technologyTargeting": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "dayPartTargeting": {}, + * // "geoTargeting": {}, + * // "id": "my_id", + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "listTargetingExpression": {}, + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "technologyTargeting": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.targetingTemplates.insert * @memberOf! () * @@ -25742,6 +37718,62 @@ export namespace dfareporting_v3_3 { /** * dfareporting.targetingTemplates.list * @desc Retrieves a list of targeting templates, optionally filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.targetingTemplates.list({ + * // Select only targeting templates with this advertiser ID. + * advertiserId: 'placeholder-value', + * // Select only targeting templates with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "template*2015" will return objects with names like "template June 2015", "template April 2015", or simply "template 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "template" will match objects with name "my template", "template 2015", or simply "template". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "targetingTemplates": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.targetingTemplates.list * @memberOf! () * @@ -25832,6 +37864,80 @@ export namespace dfareporting_v3_3 { /** * dfareporting.targetingTemplates.patch * @desc Updates an existing targeting template. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.targetingTemplates.patch({ + * // Targeting template ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "dayPartTargeting": {}, + * // "geoTargeting": {}, + * // "id": "my_id", + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "listTargetingExpression": {}, + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "technologyTargeting": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "dayPartTargeting": {}, + * // "geoTargeting": {}, + * // "id": "my_id", + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "listTargetingExpression": {}, + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "technologyTargeting": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.targetingTemplates.patch * @memberOf! () * @@ -25908,6 +38014,78 @@ export namespace dfareporting_v3_3 { /** * dfareporting.targetingTemplates.update * @desc Updates an existing targeting template. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.targetingTemplates.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "dayPartTargeting": {}, + * // "geoTargeting": {}, + * // "id": "my_id", + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "listTargetingExpression": {}, + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "technologyTargeting": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "dayPartTargeting": {}, + * // "geoTargeting": {}, + * // "id": "my_id", + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "listTargetingExpression": {}, + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "technologyTargeting": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.targetingTemplates.update * @memberOf! () * @@ -26102,6 +38280,56 @@ export namespace dfareporting_v3_3 { /** * dfareporting.userProfiles.get * @desc Gets one user profile by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfareporting', + * 'https://www.googleapis.com/auth/dfatrafficking', + * ], + * }); + * + * // 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 dfareporting.userProfiles.get({ + * // The user profile ID. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "accountName": "my_accountName", + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "profileId": "my_profileId", + * // "subAccountId": "my_subAccountId", + * // "subAccountName": "my_subAccountName", + * // "userName": "my_userName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userProfiles.get * @memberOf! () * @@ -26174,6 +38402,48 @@ export namespace dfareporting_v3_3 { /** * dfareporting.userProfiles.list * @desc Retrieves list of user profiles for a user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfareporting', + * 'https://www.googleapis.com/auth/dfatrafficking', + * ], + * }); + * + * // 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 dfareporting.userProfiles.list({}); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userProfiles.list * @memberOf! () * @@ -26273,6 +38543,50 @@ export namespace dfareporting_v3_3 { /** * dfareporting.userRolePermissionGroups.get * @desc Gets one user role permission group by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.userRolePermissionGroups.get({ + * // User role permission group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userRolePermissionGroups.get * @memberOf! () * @@ -26350,6 +38664,47 @@ export namespace dfareporting_v3_3 { /** * dfareporting.userRolePermissionGroups.list * @desc Gets a list of all supported user role permission groups. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.userRolePermissionGroups.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "userRolePermissionGroups": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userRolePermissionGroups.list * @memberOf! () * @@ -26477,6 +38832,52 @@ export namespace dfareporting_v3_3 { /** * dfareporting.userRolePermissions.get * @desc Gets one user role permission by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.userRolePermissions.get({ + * // User role permission ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "availability": "my_availability", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "permissionGroupId": "my_permissionGroupId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userRolePermissions.get * @memberOf! () * @@ -26552,6 +38953,49 @@ export namespace dfareporting_v3_3 { /** * dfareporting.userRolePermissions.list * @desc Gets a list of user role permissions, possibly filtered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.userRolePermissions.list({ + * // Select only user role permissions with these IDs. + * ids: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "userRolePermissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userRolePermissions.list * @memberOf! () * @@ -26676,6 +39120,43 @@ export namespace dfareporting_v3_3 { /** * dfareporting.userRoles.delete * @desc Deletes an existing user role. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.userRoles.delete({ + * // User role ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userRoles.delete * @memberOf! () * @@ -26748,6 +39229,55 @@ export namespace dfareporting_v3_3 { /** * dfareporting.userRoles.get * @desc Gets one user role by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.userRoles.get({ + * // User role ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "defaultUserRole": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentUserRoleId": "my_parentUserRoleId", + * // "permissions": [], + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userRoles.get * @memberOf! () * @@ -26820,6 +39350,68 @@ export namespace dfareporting_v3_3 { /** * dfareporting.userRoles.insert * @desc Inserts a new user role. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.userRoles.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "defaultUserRole": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentUserRoleId": "my_parentUserRoleId", + * // "permissions": [], + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "defaultUserRole": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentUserRoleId": "my_parentUserRoleId", + * // "permissions": [], + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userRoles.insert * @memberOf! () * @@ -26891,6 +39483,64 @@ export namespace dfareporting_v3_3 { /** * dfareporting.userRoles.list * @desc Retrieves a list of user roles, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.userRoles.list({ + * // Select only account level user roles not associated with any specific subaccount. + * accountUserRoleOnly: 'placeholder-value', + * // Select only user roles with the specified IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "userrole*2015" will return objects with names like "userrole June 2015", "userrole April 2015", or simply "userrole 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "userrole" will match objects with name "my userrole", "userrole 2015", or simply "userrole". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only user roles that belong to this subaccount. + * subaccountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "userRoles": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userRoles.list * @memberOf! () * @@ -26973,6 +39623,70 @@ export namespace dfareporting_v3_3 { /** * dfareporting.userRoles.patch * @desc Updates an existing user role. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.userRoles.patch({ + * // User role ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "defaultUserRole": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentUserRoleId": "my_parentUserRoleId", + * // "permissions": [], + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "defaultUserRole": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentUserRoleId": "my_parentUserRoleId", + * // "permissions": [], + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userRoles.patch * @memberOf! () * @@ -27045,6 +39759,68 @@ export namespace dfareporting_v3_3 { /** * dfareporting.userRoles.update * @desc Updates an existing user role. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.userRoles.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "defaultUserRole": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentUserRoleId": "my_parentUserRoleId", + * // "permissions": [], + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "defaultUserRole": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentUserRoleId": "my_parentUserRoleId", + * // "permissions": [], + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userRoles.update * @memberOf! () * @@ -27249,6 +40025,52 @@ export namespace dfareporting_v3_3 { /** * dfareporting.videoFormats.get * @desc Gets one video format by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.videoFormats.get({ + * // Video format ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "fileType": "my_fileType", + * // "id": 0, + * // "kind": "my_kind", + * // "resolution": {}, + * // "targetBitRate": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.videoFormats.get * @memberOf! () * @@ -27323,6 +40145,47 @@ export namespace dfareporting_v3_3 { /** * dfareporting.videoFormats.list * @desc Lists available video formats. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.3'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.videoFormats.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "videoFormats": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.videoFormats.list * @memberOf! () * diff --git a/src/apis/dfareporting/v3.4.ts b/src/apis/dfareporting/v3.4.ts index 008eb9ff0c1..b7b25a67e4b 100644 --- a/src/apis/dfareporting/v3.4.ts +++ b/src/apis/dfareporting/v3.4.ts @@ -6763,6 +6763,52 @@ export namespace dfareporting_v3_4 { /** * dfareporting.accountActiveAdSummaries.get * @desc Gets the account's active ad summary by account ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accountActiveAdSummaries.get({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Account ID. + * summaryAccountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "activeAds": "my_activeAds", + * // "activeAdsLimitTier": "my_activeAdsLimitTier", + * // "availableAds": "my_availableAds", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accountActiveAdSummaries.get * @memberOf! () * @@ -6864,6 +6910,50 @@ export namespace dfareporting_v3_4 { /** * dfareporting.accountPermissionGroups.get * @desc Gets one account permission group by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accountPermissionGroups.get({ + * // Account permission group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accountPermissionGroups.get * @memberOf! () * @@ -6941,6 +7031,47 @@ export namespace dfareporting_v3_4 { /** * dfareporting.accountPermissionGroups.list * @desc Retrieves the list of account permission groups. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accountPermissionGroups.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountPermissionGroups": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accountPermissionGroups.list * @memberOf! () * @@ -7062,6 +7193,53 @@ export namespace dfareporting_v3_4 { /** * dfareporting.accountPermissions.get * @desc Gets one account permission by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accountPermissions.get({ + * // Account permission ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountProfiles": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "level": "my_level", + * // "name": "my_name", + * // "permissionGroupId": "my_permissionGroupId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accountPermissions.get * @memberOf! () * @@ -7137,6 +7315,47 @@ export namespace dfareporting_v3_4 { /** * dfareporting.accountPermissions.list * @desc Retrieves the list of account permissions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accountPermissions.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountPermissions": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accountPermissions.list * @memberOf! () * @@ -7256,6 +7475,66 @@ export namespace dfareporting_v3_4 { /** * dfareporting.accounts.get * @desc Gets one account by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accounts.get({ + * // Account ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountPermissionIds": [], + * // "accountProfile": "my_accountProfile", + * // "active": false, + * // "activeAdsLimitTier": "my_activeAdsLimitTier", + * // "activeViewOptOut": false, + * // "availablePermissionIds": [], + * // "countryId": "my_countryId", + * // "currencyId": "my_currencyId", + * // "defaultCreativeSizeId": "my_defaultCreativeSizeId", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "maximumImageSize": "my_maximumImageSize", + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "reportsConfiguration": {}, + * // "shareReportsWithTwitter": false, + * // "teaserSizeLimit": "my_teaserSizeLimit" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accounts.get * @memberOf! () * @@ -7328,6 +7607,62 @@ export namespace dfareporting_v3_4 { /** * dfareporting.accounts.list * @desc Retrieves the list of accounts, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accounts.list({ + * // Select only active accounts. Don't set this field to select both active and non-active accounts. + * active: 'placeholder-value', + * // Select only accounts with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "account*2015" will return objects with names like "account June 2015", "account April 2015", or simply "account 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "account" will match objects with name "my account", "account 2015", or simply "account". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accounts": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accounts.list * @memberOf! () * @@ -7409,6 +7744,92 @@ export namespace dfareporting_v3_4 { /** * dfareporting.accounts.patch * @desc Updates an existing account. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accounts.patch({ + * // Account ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountPermissionIds": [], + * // "accountProfile": "my_accountProfile", + * // "active": false, + * // "activeAdsLimitTier": "my_activeAdsLimitTier", + * // "activeViewOptOut": false, + * // "availablePermissionIds": [], + * // "countryId": "my_countryId", + * // "currencyId": "my_currencyId", + * // "defaultCreativeSizeId": "my_defaultCreativeSizeId", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "maximumImageSize": "my_maximumImageSize", + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "reportsConfiguration": {}, + * // "shareReportsWithTwitter": false, + * // "teaserSizeLimit": "my_teaserSizeLimit" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountPermissionIds": [], + * // "accountProfile": "my_accountProfile", + * // "active": false, + * // "activeAdsLimitTier": "my_activeAdsLimitTier", + * // "activeViewOptOut": false, + * // "availablePermissionIds": [], + * // "countryId": "my_countryId", + * // "currencyId": "my_currencyId", + * // "defaultCreativeSizeId": "my_defaultCreativeSizeId", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "maximumImageSize": "my_maximumImageSize", + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "reportsConfiguration": {}, + * // "shareReportsWithTwitter": false, + * // "teaserSizeLimit": "my_teaserSizeLimit" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accounts.patch * @memberOf! () * @@ -7481,6 +7902,90 @@ export namespace dfareporting_v3_4 { /** * dfareporting.accounts.update * @desc Updates an existing account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accounts.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountPermissionIds": [], + * // "accountProfile": "my_accountProfile", + * // "active": false, + * // "activeAdsLimitTier": "my_activeAdsLimitTier", + * // "activeViewOptOut": false, + * // "availablePermissionIds": [], + * // "countryId": "my_countryId", + * // "currencyId": "my_currencyId", + * // "defaultCreativeSizeId": "my_defaultCreativeSizeId", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "maximumImageSize": "my_maximumImageSize", + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "reportsConfiguration": {}, + * // "shareReportsWithTwitter": false, + * // "teaserSizeLimit": "my_teaserSizeLimit" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountPermissionIds": [], + * // "accountProfile": "my_accountProfile", + * // "active": false, + * // "activeAdsLimitTier": "my_activeAdsLimitTier", + * // "activeViewOptOut": false, + * // "availablePermissionIds": [], + * // "countryId": "my_countryId", + * // "currencyId": "my_currencyId", + * // "defaultCreativeSizeId": "my_defaultCreativeSizeId", + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "maximumImageSize": "my_maximumImageSize", + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "reportsConfiguration": {}, + * // "shareReportsWithTwitter": false, + * // "teaserSizeLimit": "my_teaserSizeLimit" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accounts.update * @memberOf! () * @@ -7650,6 +8155,63 @@ export namespace dfareporting_v3_4 { /** * dfareporting.accountUserProfiles.get * @desc Gets one account user profile by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accountUserProfiles.get({ + * // User profile ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserFilter": {}, + * // "campaignFilter": {}, + * // "comments": "my_comments", + * // "email": "my_email", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "name": "my_name", + * // "siteFilter": {}, + * // "subaccountId": "my_subaccountId", + * // "traffickerType": "my_traffickerType", + * // "userAccessType": "my_userAccessType", + * // "userRoleFilter": {}, + * // "userRoleId": "my_userRoleId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accountUserProfiles.get * @memberOf! () * @@ -7725,6 +8287,84 @@ export namespace dfareporting_v3_4 { /** * dfareporting.accountUserProfiles.insert * @desc Inserts a new account user profile. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accountUserProfiles.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserFilter": {}, + * // "campaignFilter": {}, + * // "comments": "my_comments", + * // "email": "my_email", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "name": "my_name", + * // "siteFilter": {}, + * // "subaccountId": "my_subaccountId", + * // "traffickerType": "my_traffickerType", + * // "userAccessType": "my_userAccessType", + * // "userRoleFilter": {}, + * // "userRoleId": "my_userRoleId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserFilter": {}, + * // "campaignFilter": {}, + * // "comments": "my_comments", + * // "email": "my_email", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "name": "my_name", + * // "siteFilter": {}, + * // "subaccountId": "my_subaccountId", + * // "traffickerType": "my_traffickerType", + * // "userAccessType": "my_userAccessType", + * // "userRoleFilter": {}, + * // "userRoleId": "my_userRoleId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accountUserProfiles.insert * @memberOf! () * @@ -7800,6 +8440,66 @@ export namespace dfareporting_v3_4 { /** * dfareporting.accountUserProfiles.list * @desc Retrieves a list of account user profiles, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accountUserProfiles.list({ + * // Select only active user profiles. + * active: 'placeholder-value', + * // Select only user profiles with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, "user profile*2015" will return objects with names like "user profile June 2015", "user profile April 2015", or simply "user profile 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "user profile" will match objects with name "my user profile", "user profile 2015", or simply "user profile". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only user profiles with the specified subaccount ID. + * subaccountId: 'placeholder-value', + * // Select only user profiles with the specified user role ID. + * userRoleId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountUserProfiles": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accountUserProfiles.list * @memberOf! () * @@ -7892,6 +8592,86 @@ export namespace dfareporting_v3_4 { /** * dfareporting.accountUserProfiles.patch * @desc Updates an existing account user profile. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accountUserProfiles.patch({ + * // User profile ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserFilter": {}, + * // "campaignFilter": {}, + * // "comments": "my_comments", + * // "email": "my_email", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "name": "my_name", + * // "siteFilter": {}, + * // "subaccountId": "my_subaccountId", + * // "traffickerType": "my_traffickerType", + * // "userAccessType": "my_userAccessType", + * // "userRoleFilter": {}, + * // "userRoleId": "my_userRoleId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserFilter": {}, + * // "campaignFilter": {}, + * // "comments": "my_comments", + * // "email": "my_email", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "name": "my_name", + * // "siteFilter": {}, + * // "subaccountId": "my_subaccountId", + * // "traffickerType": "my_traffickerType", + * // "userAccessType": "my_userAccessType", + * // "userRoleFilter": {}, + * // "userRoleId": "my_userRoleId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accountUserProfiles.patch * @memberOf! () * @@ -7968,6 +8748,84 @@ export namespace dfareporting_v3_4 { /** * dfareporting.accountUserProfiles.update * @desc Updates an existing account user profile. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.accountUserProfiles.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserFilter": {}, + * // "campaignFilter": {}, + * // "comments": "my_comments", + * // "email": "my_email", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "name": "my_name", + * // "siteFilter": {}, + * // "subaccountId": "my_subaccountId", + * // "traffickerType": "my_traffickerType", + * // "userAccessType": "my_userAccessType", + * // "userRoleFilter": {}, + * // "userRoleId": "my_userRoleId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserFilter": {}, + * // "campaignFilter": {}, + * // "comments": "my_comments", + * // "email": "my_email", + * // "id": "my_id", + * // "kind": "my_kind", + * // "locale": "my_locale", + * // "name": "my_name", + * // "siteFilter": {}, + * // "subaccountId": "my_subaccountId", + * // "traffickerType": "my_traffickerType", + * // "userAccessType": "my_userAccessType", + * // "userRoleFilter": {}, + * // "userRoleId": "my_userRoleId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.accountUserProfiles.update * @memberOf! () * @@ -8170,6 +9028,86 @@ export namespace dfareporting_v3_4 { /** * dfareporting.ads.get * @desc Gets one ad by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.ads.get({ + * // Ad ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentId": "my_audienceSegmentId", + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "clickThroughUrl": {}, + * // "clickThroughUrlSuffixProperties": {}, + * // "comments": "my_comments", + * // "compatibility": "my_compatibility", + * // "createInfo": {}, + * // "creativeGroupAssignments": [], + * // "creativeRotation": {}, + * // "dayPartTargeting": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "deliverySchedule": {}, + * // "dynamicClickTracker": false, + * // "endTime": "my_endTime", + * // "eventTagOverrides": [], + * // "geoTargeting": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementAssignments": [], + * // "remarketingListExpression": {}, + * // "size": {}, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "startTime": "my_startTime", + * // "subaccountId": "my_subaccountId", + * // "targetingTemplateId": "my_targetingTemplateId", + * // "technologyTargeting": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.ads.get * @memberOf! () * @@ -8241,6 +9179,130 @@ export namespace dfareporting_v3_4 { /** * dfareporting.ads.insert * @desc Inserts a new ad. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.ads.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentId": "my_audienceSegmentId", + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "clickThroughUrl": {}, + * // "clickThroughUrlSuffixProperties": {}, + * // "comments": "my_comments", + * // "compatibility": "my_compatibility", + * // "createInfo": {}, + * // "creativeGroupAssignments": [], + * // "creativeRotation": {}, + * // "dayPartTargeting": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "deliverySchedule": {}, + * // "dynamicClickTracker": false, + * // "endTime": "my_endTime", + * // "eventTagOverrides": [], + * // "geoTargeting": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementAssignments": [], + * // "remarketingListExpression": {}, + * // "size": {}, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "startTime": "my_startTime", + * // "subaccountId": "my_subaccountId", + * // "targetingTemplateId": "my_targetingTemplateId", + * // "technologyTargeting": {}, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentId": "my_audienceSegmentId", + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "clickThroughUrl": {}, + * // "clickThroughUrlSuffixProperties": {}, + * // "comments": "my_comments", + * // "compatibility": "my_compatibility", + * // "createInfo": {}, + * // "creativeGroupAssignments": [], + * // "creativeRotation": {}, + * // "dayPartTargeting": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "deliverySchedule": {}, + * // "dynamicClickTracker": false, + * // "endTime": "my_endTime", + * // "eventTagOverrides": [], + * // "geoTargeting": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementAssignments": [], + * // "remarketingListExpression": {}, + * // "size": {}, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "startTime": "my_startTime", + * // "subaccountId": "my_subaccountId", + * // "targetingTemplateId": "my_targetingTemplateId", + * // "technologyTargeting": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.ads.insert * @memberOf! () * @@ -8312,6 +9374,94 @@ export namespace dfareporting_v3_4 { /** * dfareporting.ads.list * @desc Retrieves a list of ads, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.ads.list({ + * // Select only active ads. + * active: 'placeholder-value', + * // Select only ads with this advertiser ID. + * advertiserId: 'placeholder-value', + * // Select only archived ads. + * archived: 'placeholder-value', + * // Select only ads with these audience segment IDs. + * audienceSegmentIds: 'placeholder-value', + * // Select only ads with these campaign IDs. + * campaignIds: 'placeholder-value', + * // Select default ads with the specified compatibility. Applicable when type is AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video ads developed with the VAST standard. + * compatibility: 'placeholder-value', + * // Select only ads with these creative IDs assigned. + * creativeIds: 'placeholder-value', + * // Select only ads with these creative optimization configuration IDs. + * creativeOptimizationConfigurationIds: 'placeholder-value', + * // Select only dynamic click trackers. Applicable when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click trackers. If false, select static click trackers. Leave unset to select both. + * dynamicClickTracker: 'placeholder-value', + * // Select only ads with these IDs. + * ids: 'placeholder-value', + * // Select only ads with these landing page IDs. + * landingPageIds: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Select only ads with this event tag override ID. + * overriddenEventTagId: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // Select only ads with these placement IDs assigned. + * placementIds: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Select only ads whose list targeting expression use these remarketing list IDs. + * remarketingListIds: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "ad*2015" will return objects with names like "ad June 2015", "ad April 2015", or simply "ad 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "ad" will match objects with name "my ad", "ad 2015", or simply "ad". + * searchString: 'placeholder-value', + * // Select only ads with these size IDs. + * sizeIds: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only ads that are SSL-compliant. + * sslCompliant: 'placeholder-value', + * // Select only ads that require SSL. + * sslRequired: 'placeholder-value', + * // Select only ads with these types. + * type: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ads": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.ads.list * @memberOf! () * @@ -8407,6 +9557,132 @@ export namespace dfareporting_v3_4 { /** * dfareporting.ads.patch * @desc Updates an existing ad. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.ads.patch({ + * // Ad ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentId": "my_audienceSegmentId", + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "clickThroughUrl": {}, + * // "clickThroughUrlSuffixProperties": {}, + * // "comments": "my_comments", + * // "compatibility": "my_compatibility", + * // "createInfo": {}, + * // "creativeGroupAssignments": [], + * // "creativeRotation": {}, + * // "dayPartTargeting": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "deliverySchedule": {}, + * // "dynamicClickTracker": false, + * // "endTime": "my_endTime", + * // "eventTagOverrides": [], + * // "geoTargeting": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementAssignments": [], + * // "remarketingListExpression": {}, + * // "size": {}, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "startTime": "my_startTime", + * // "subaccountId": "my_subaccountId", + * // "targetingTemplateId": "my_targetingTemplateId", + * // "technologyTargeting": {}, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentId": "my_audienceSegmentId", + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "clickThroughUrl": {}, + * // "clickThroughUrlSuffixProperties": {}, + * // "comments": "my_comments", + * // "compatibility": "my_compatibility", + * // "createInfo": {}, + * // "creativeGroupAssignments": [], + * // "creativeRotation": {}, + * // "dayPartTargeting": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "deliverySchedule": {}, + * // "dynamicClickTracker": false, + * // "endTime": "my_endTime", + * // "eventTagOverrides": [], + * // "geoTargeting": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementAssignments": [], + * // "remarketingListExpression": {}, + * // "size": {}, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "startTime": "my_startTime", + * // "subaccountId": "my_subaccountId", + * // "targetingTemplateId": "my_targetingTemplateId", + * // "technologyTargeting": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.ads.patch * @memberOf! () * @@ -8479,6 +9755,130 @@ export namespace dfareporting_v3_4 { /** * dfareporting.ads.update * @desc Updates an existing ad. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.ads.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentId": "my_audienceSegmentId", + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "clickThroughUrl": {}, + * // "clickThroughUrlSuffixProperties": {}, + * // "comments": "my_comments", + * // "compatibility": "my_compatibility", + * // "createInfo": {}, + * // "creativeGroupAssignments": [], + * // "creativeRotation": {}, + * // "dayPartTargeting": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "deliverySchedule": {}, + * // "dynamicClickTracker": false, + * // "endTime": "my_endTime", + * // "eventTagOverrides": [], + * // "geoTargeting": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementAssignments": [], + * // "remarketingListExpression": {}, + * // "size": {}, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "startTime": "my_startTime", + * // "subaccountId": "my_subaccountId", + * // "targetingTemplateId": "my_targetingTemplateId", + * // "technologyTargeting": {}, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentId": "my_audienceSegmentId", + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "clickThroughUrl": {}, + * // "clickThroughUrlSuffixProperties": {}, + * // "comments": "my_comments", + * // "compatibility": "my_compatibility", + * // "createInfo": {}, + * // "creativeGroupAssignments": [], + * // "creativeRotation": {}, + * // "dayPartTargeting": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "deliverySchedule": {}, + * // "dynamicClickTracker": false, + * // "endTime": "my_endTime", + * // "eventTagOverrides": [], + * // "geoTargeting": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementAssignments": [], + * // "remarketingListExpression": {}, + * // "size": {}, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "startTime": "my_startTime", + * // "subaccountId": "my_subaccountId", + * // "targetingTemplateId": "my_targetingTemplateId", + * // "technologyTargeting": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.ads.update * @memberOf! () * @@ -8728,6 +10128,43 @@ export namespace dfareporting_v3_4 { /** * dfareporting.advertiserGroups.delete * @desc Deletes an existing advertiser group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserGroups.delete({ + * // Advertiser group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserGroups.delete * @memberOf! () * @@ -8801,6 +10238,51 @@ export namespace dfareporting_v3_4 { /** * dfareporting.advertiserGroups.get * @desc Gets one advertiser group by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserGroups.get({ + * // Advertiser group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserGroups.get * @memberOf! () * @@ -8876,6 +10358,60 @@ export namespace dfareporting_v3_4 { /** * dfareporting.advertiserGroups.insert * @desc Inserts a new advertiser group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserGroups.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserGroups.insert * @memberOf! () * @@ -8951,6 +10487,60 @@ export namespace dfareporting_v3_4 { /** * dfareporting.advertiserGroups.list * @desc Retrieves a list of advertiser groups, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserGroups.list({ + * // Select only advertiser groups with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "advertiser*2015" will return objects with names like "advertiser group June 2015", "advertiser group April 2015", or simply "advertiser group 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "advertisergroup" will match objects with name "my advertisergroup", "advertisergroup 2015", or simply "advertisergroup". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserGroups": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserGroups.list * @memberOf! () * @@ -9040,6 +10630,62 @@ export namespace dfareporting_v3_4 { /** * dfareporting.advertiserGroups.patch * @desc Updates an existing advertiser group. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserGroups.patch({ + * // Advertiser group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserGroups.patch * @memberOf! () * @@ -9116,6 +10762,60 @@ export namespace dfareporting_v3_4 { /** * dfareporting.advertiserGroups.update * @desc Updates an existing advertiser group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserGroups.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserGroups.update * @memberOf! () * @@ -9322,6 +11022,54 @@ export namespace dfareporting_v3_4 { /** * dfareporting.advertiserLandingPages.get * @desc Gets one landing page by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserLandingPages.get({ + * // Landing page ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "archived": false, + * // "deepLinks": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserLandingPages.get * @memberOf! () * @@ -9397,6 +11145,66 @@ export namespace dfareporting_v3_4 { /** * dfareporting.advertiserLandingPages.insert * @desc Inserts a new landing page. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserLandingPages.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "advertiserId": "my_advertiserId", + * // "archived": false, + * // "deepLinks": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "url": "my_url" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "archived": false, + * // "deepLinks": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserLandingPages.insert * @memberOf! () * @@ -9472,6 +11280,68 @@ export namespace dfareporting_v3_4 { /** * dfareporting.advertiserLandingPages.list * @desc Retrieves a list of landing pages. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserLandingPages.list({ + * // Select only landing pages that belong to these advertisers. + * advertiserIds: 'placeholder-value', + * // Select only archived landing pages. Don't set this field to select both archived and non-archived landing pages. + * archived: 'placeholder-value', + * // Select only landing pages that are associated with these campaigns. + * campaignIds: 'placeholder-value', + * // Select only landing pages with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for landing pages by name or ID. Wildcards (*) are allowed. For example, "landingpage*2017" will return landing pages with names like "landingpage July 2017", "landingpage March 2017", or simply "landingpage 2017". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "landingpage" will match campaigns with name "my landingpage", "landingpage 2015", or simply "landingpage". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only landing pages that belong to this subaccount. + * subaccountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "landingPages": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserLandingPages.list * @memberOf! () * @@ -9565,6 +11435,68 @@ export namespace dfareporting_v3_4 { /** * dfareporting.advertiserLandingPages.patch * @desc Updates an existing landing page. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserLandingPages.patch({ + * // Landing page ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "advertiserId": "my_advertiserId", + * // "archived": false, + * // "deepLinks": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "url": "my_url" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "archived": false, + * // "deepLinks": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserLandingPages.patch * @memberOf! () * @@ -9641,6 +11573,66 @@ export namespace dfareporting_v3_4 { /** * dfareporting.advertiserLandingPages.update * @desc Updates an existing landing page. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertiserLandingPages.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "advertiserId": "my_advertiserId", + * // "archived": false, + * // "deepLinks": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "url": "my_url" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "archived": false, + * // "deepLinks": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertiserLandingPages.update * @memberOf! () * @@ -9847,6 +11839,62 @@ export namespace dfareporting_v3_4 { /** * dfareporting.advertisers.get * @desc Gets one advertiser by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertisers.get({ + * // Advertiser ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserGroupId": "my_advertiserGroupId", + * // "clickThroughUrlSuffix": "my_clickThroughUrlSuffix", + * // "defaultClickThroughEventTagId": "my_defaultClickThroughEventTagId", + * // "defaultEmail": "my_defaultEmail", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "originalFloodlightConfigurationId": "my_originalFloodlightConfigurationId", + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "suspended": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertisers.get * @memberOf! () * @@ -9921,6 +11969,82 @@ export namespace dfareporting_v3_4 { /** * dfareporting.advertisers.insert * @desc Inserts a new advertiser. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertisers.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserGroupId": "my_advertiserGroupId", + * // "clickThroughUrlSuffix": "my_clickThroughUrlSuffix", + * // "defaultClickThroughEventTagId": "my_defaultClickThroughEventTagId", + * // "defaultEmail": "my_defaultEmail", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "originalFloodlightConfigurationId": "my_originalFloodlightConfigurationId", + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "suspended": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserGroupId": "my_advertiserGroupId", + * // "clickThroughUrlSuffix": "my_clickThroughUrlSuffix", + * // "defaultClickThroughEventTagId": "my_defaultClickThroughEventTagId", + * // "defaultEmail": "my_defaultEmail", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "originalFloodlightConfigurationId": "my_originalFloodlightConfigurationId", + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "suspended": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertisers.insert * @memberOf! () * @@ -9996,6 +12120,72 @@ export namespace dfareporting_v3_4 { /** * dfareporting.advertisers.list * @desc Retrieves a list of advertisers, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertisers.list({ + * // Select only advertisers with these advertiser group IDs. + * advertiserGroupIds: 'placeholder-value', + * // Select only advertisers with these floodlight configuration IDs. + * floodlightConfigurationIds: 'placeholder-value', + * // Select only advertisers with these IDs. + * ids: 'placeholder-value', + * // Select only advertisers which do not belong to any advertiser group. + * includeAdvertisersWithoutGroupsOnly: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Select only advertisers which use another advertiser's floodlight configuration. + * onlyParent: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "advertiser*2015" will return objects with names like "advertiser June 2015", "advertiser April 2015", or simply "advertiser 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "advertiser" will match objects with name "my advertiser", "advertiser 2015", or simply "advertiser". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only advertisers with the specified status. + * status: 'placeholder-value', + * // Select only advertisers with these subaccount IDs. + * subaccountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertisers": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertisers.list * @memberOf! () * @@ -10083,6 +12273,84 @@ export namespace dfareporting_v3_4 { /** * dfareporting.advertisers.patch * @desc Updates an existing advertiser. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertisers.patch({ + * // Advertiser ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserGroupId": "my_advertiserGroupId", + * // "clickThroughUrlSuffix": "my_clickThroughUrlSuffix", + * // "defaultClickThroughEventTagId": "my_defaultClickThroughEventTagId", + * // "defaultEmail": "my_defaultEmail", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "originalFloodlightConfigurationId": "my_originalFloodlightConfigurationId", + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "suspended": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserGroupId": "my_advertiserGroupId", + * // "clickThroughUrlSuffix": "my_clickThroughUrlSuffix", + * // "defaultClickThroughEventTagId": "my_defaultClickThroughEventTagId", + * // "defaultEmail": "my_defaultEmail", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "originalFloodlightConfigurationId": "my_originalFloodlightConfigurationId", + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "suspended": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertisers.patch * @memberOf! () * @@ -10159,6 +12427,82 @@ export namespace dfareporting_v3_4 { /** * dfareporting.advertisers.update * @desc Updates an existing advertiser. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.advertisers.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserGroupId": "my_advertiserGroupId", + * // "clickThroughUrlSuffix": "my_clickThroughUrlSuffix", + * // "defaultClickThroughEventTagId": "my_defaultClickThroughEventTagId", + * // "defaultEmail": "my_defaultEmail", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "originalFloodlightConfigurationId": "my_originalFloodlightConfigurationId", + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "suspended": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserGroupId": "my_advertiserGroupId", + * // "clickThroughUrlSuffix": "my_clickThroughUrlSuffix", + * // "defaultClickThroughEventTagId": "my_defaultClickThroughEventTagId", + * // "defaultEmail": "my_defaultEmail", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "originalFloodlightConfigurationId": "my_originalFloodlightConfigurationId", + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "suspended": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.advertisers.update * @memberOf! () * @@ -10371,6 +12715,47 @@ export namespace dfareporting_v3_4 { /** * dfareporting.browsers.list * @desc Retrieves a list of browsers. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.browsers.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "browsers": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.browsers.list * @memberOf! () * @@ -10464,6 +12849,58 @@ export namespace dfareporting_v3_4 { /** * dfareporting.campaignCreativeAssociations.insert * @desc Associates a creative with the specified campaign. This method creates a default ad with dimensions matching the creative in the campaign if such a default ad does not exist already. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.campaignCreativeAssociations.insert({ + * // Campaign ID in this association. + * campaignId: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creativeId": "my_creativeId", + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creativeId": "my_creativeId", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.campaignCreativeAssociations.insert * @memberOf! () * @@ -10547,6 +12984,56 @@ export namespace dfareporting_v3_4 { /** * dfareporting.campaignCreativeAssociations.list * @desc Retrieves the list of creative IDs associated with the specified campaign. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.campaignCreativeAssociations.list({ + * // Campaign ID in this association. + * campaignId: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "campaignCreativeAssociations": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.campaignCreativeAssociations.list * @memberOf! () * @@ -10699,6 +13186,75 @@ export namespace dfareporting_v3_4 { /** * dfareporting.campaigns.get * @desc Gets one campaign by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.campaigns.get({ + * // Campaign ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adBlockingConfiguration": {}, + * // "additionalCreativeOptimizationConfigurations": [], + * // "advertiserGroupId": "my_advertiserGroupId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentGroups": [], + * // "billingInvoiceCode": "my_billingInvoiceCode", + * // "clickThroughUrlSuffixProperties": {}, + * // "comment": "my_comment", + * // "createInfo": {}, + * // "creativeGroupIds": [], + * // "creativeOptimizationConfiguration": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "defaultLandingPageId": "my_defaultLandingPageId", + * // "endDate": "my_endDate", + * // "eventTagOverrides": [], + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "startDate": "my_startDate", + * // "subaccountId": "my_subaccountId", + * // "traffickerEmails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.campaigns.get * @memberOf! () * @@ -10771,6 +13327,108 @@ export namespace dfareporting_v3_4 { /** * dfareporting.campaigns.insert * @desc Inserts a new campaign. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.campaigns.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "adBlockingConfiguration": {}, + * // "additionalCreativeOptimizationConfigurations": [], + * // "advertiserGroupId": "my_advertiserGroupId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentGroups": [], + * // "billingInvoiceCode": "my_billingInvoiceCode", + * // "clickThroughUrlSuffixProperties": {}, + * // "comment": "my_comment", + * // "createInfo": {}, + * // "creativeGroupIds": [], + * // "creativeOptimizationConfiguration": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "defaultLandingPageId": "my_defaultLandingPageId", + * // "endDate": "my_endDate", + * // "eventTagOverrides": [], + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "startDate": "my_startDate", + * // "subaccountId": "my_subaccountId", + * // "traffickerEmails": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adBlockingConfiguration": {}, + * // "additionalCreativeOptimizationConfigurations": [], + * // "advertiserGroupId": "my_advertiserGroupId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentGroups": [], + * // "billingInvoiceCode": "my_billingInvoiceCode", + * // "clickThroughUrlSuffixProperties": {}, + * // "comment": "my_comment", + * // "createInfo": {}, + * // "creativeGroupIds": [], + * // "creativeOptimizationConfiguration": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "defaultLandingPageId": "my_defaultLandingPageId", + * // "endDate": "my_endDate", + * // "eventTagOverrides": [], + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "startDate": "my_startDate", + * // "subaccountId": "my_subaccountId", + * // "traffickerEmails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.campaigns.insert * @memberOf! () * @@ -10842,6 +13500,74 @@ export namespace dfareporting_v3_4 { /** * dfareporting.campaigns.list * @desc Retrieves a list of campaigns, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.campaigns.list({ + * // Select only campaigns whose advertisers belong to these advertiser groups. + * advertiserGroupIds: 'placeholder-value', + * // Select only campaigns that belong to these advertisers. + * advertiserIds: 'placeholder-value', + * // Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns. + * archived: 'placeholder-value', + * // Select only campaigns that have at least one optimization activity. + * atLeastOneOptimizationActivity: 'placeholder-value', + * // Exclude campaigns with these IDs. + * excludedIds: 'placeholder-value', + * // Select only campaigns with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Select only campaigns that have overridden this event tag ID. + * overriddenEventTagId: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for campaigns by name or ID. Wildcards (*) are allowed. For example, "campaign*2015" will return campaigns with names like "campaign June 2015", "campaign April 2015", or simply "campaign 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "campaign" will match campaigns with name "my campaign", "campaign 2015", or simply "campaign". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only campaigns that belong to this subaccount. + * subaccountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "campaigns": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.campaigns.list * @memberOf! () * @@ -10929,6 +13655,110 @@ export namespace dfareporting_v3_4 { /** * dfareporting.campaigns.patch * @desc Updates an existing campaign. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.campaigns.patch({ + * // Campaign ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "adBlockingConfiguration": {}, + * // "additionalCreativeOptimizationConfigurations": [], + * // "advertiserGroupId": "my_advertiserGroupId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentGroups": [], + * // "billingInvoiceCode": "my_billingInvoiceCode", + * // "clickThroughUrlSuffixProperties": {}, + * // "comment": "my_comment", + * // "createInfo": {}, + * // "creativeGroupIds": [], + * // "creativeOptimizationConfiguration": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "defaultLandingPageId": "my_defaultLandingPageId", + * // "endDate": "my_endDate", + * // "eventTagOverrides": [], + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "startDate": "my_startDate", + * // "subaccountId": "my_subaccountId", + * // "traffickerEmails": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adBlockingConfiguration": {}, + * // "additionalCreativeOptimizationConfigurations": [], + * // "advertiserGroupId": "my_advertiserGroupId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentGroups": [], + * // "billingInvoiceCode": "my_billingInvoiceCode", + * // "clickThroughUrlSuffixProperties": {}, + * // "comment": "my_comment", + * // "createInfo": {}, + * // "creativeGroupIds": [], + * // "creativeOptimizationConfiguration": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "defaultLandingPageId": "my_defaultLandingPageId", + * // "endDate": "my_endDate", + * // "eventTagOverrides": [], + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "startDate": "my_startDate", + * // "subaccountId": "my_subaccountId", + * // "traffickerEmails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.campaigns.patch * @memberOf! () * @@ -11001,6 +13831,108 @@ export namespace dfareporting_v3_4 { /** * dfareporting.campaigns.update * @desc Updates an existing campaign. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.campaigns.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "adBlockingConfiguration": {}, + * // "additionalCreativeOptimizationConfigurations": [], + * // "advertiserGroupId": "my_advertiserGroupId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentGroups": [], + * // "billingInvoiceCode": "my_billingInvoiceCode", + * // "clickThroughUrlSuffixProperties": {}, + * // "comment": "my_comment", + * // "createInfo": {}, + * // "creativeGroupIds": [], + * // "creativeOptimizationConfiguration": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "defaultLandingPageId": "my_defaultLandingPageId", + * // "endDate": "my_endDate", + * // "eventTagOverrides": [], + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "startDate": "my_startDate", + * // "subaccountId": "my_subaccountId", + * // "traffickerEmails": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adBlockingConfiguration": {}, + * // "additionalCreativeOptimizationConfigurations": [], + * // "advertiserGroupId": "my_advertiserGroupId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "audienceSegmentGroups": [], + * // "billingInvoiceCode": "my_billingInvoiceCode", + * // "clickThroughUrlSuffixProperties": {}, + * // "comment": "my_comment", + * // "createInfo": {}, + * // "creativeGroupIds": [], + * // "creativeOptimizationConfiguration": {}, + * // "defaultClickThroughEventTagProperties": {}, + * // "defaultLandingPageId": "my_defaultLandingPageId", + * // "endDate": "my_endDate", + * // "eventTagOverrides": [], + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "nielsenOcrEnabled": false, + * // "startDate": "my_startDate", + * // "subaccountId": "my_subaccountId", + * // "traffickerEmails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.campaigns.update * @memberOf! () * @@ -11210,6 +14142,61 @@ export namespace dfareporting_v3_4 { /** * dfareporting.changeLogs.get * @desc Gets one change log by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.changeLogs.get({ + * // Change log ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "action": "my_action", + * // "changeTime": "my_changeTime", + * // "fieldName": "my_fieldName", + * // "id": "my_id", + * // "kind": "my_kind", + * // "newValue": "my_newValue", + * // "objectId": "my_objectId", + * // "objectType": "my_objectType", + * // "oldValue": "my_oldValue", + * // "subaccountId": "my_subaccountId", + * // "transactionId": "my_transactionId", + * // "userProfileId": "my_userProfileId", + * // "userProfileName": "my_userProfileName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.changeLogs.get * @memberOf! () * @@ -11284,6 +14271,68 @@ export namespace dfareporting_v3_4 { /** * dfareporting.changeLogs.list * @desc Retrieves a list of change logs. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.changeLogs.list({ + * // Select only change logs with the specified action. + * action: 'placeholder-value', + * // Select only change logs with these IDs. + * ids: 'placeholder-value', + * // Select only change logs whose change time is before the specified maxChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is "2015-07-18T22:54:00-04:00". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset. + * maxChangeTime: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Select only change logs whose change time is after the specified minChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is "2015-07-18T22:54:00-04:00". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset. + * minChangeTime: 'placeholder-value', + * // Select only change logs with these object IDs. + * objectIds: 'placeholder-value', + * // Select only change logs with the specified object type. + * objectType: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Select only change logs whose object ID, user name, old or new values match the search string. + * searchString: 'placeholder-value', + * // Select only change logs with these user profile IDs. + * userProfileIds: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "changeLogs": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.changeLogs.list * @memberOf! () * @@ -11442,6 +14491,55 @@ export namespace dfareporting_v3_4 { /** * dfareporting.cities.list * @desc Retrieves a list of cities, possibly filtered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.cities.list({ + * // Select only cities from these countries. + * countryDartIds: 'placeholder-value', + * // Select only cities with these DART IDs. + * dartIds: 'placeholder-value', + * // Select only cities with names starting with this prefix. + * namePrefix: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Select only cities from these regions. + * regionDartIds: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cities": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.cities.list * @memberOf! () * @@ -11553,6 +14651,50 @@ export namespace dfareporting_v3_4 { /** * dfareporting.connectionTypes.get * @desc Gets one connection type by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.connectionTypes.get({ + * // Connection type ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.connectionTypes.get * @memberOf! () * @@ -11628,6 +14770,47 @@ export namespace dfareporting_v3_4 { /** * dfareporting.connectionTypes.list * @desc Retrieves a list of connection types. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.connectionTypes.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "connectionTypes": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.connectionTypes.list * @memberOf! () * @@ -11745,6 +14928,43 @@ export namespace dfareporting_v3_4 { /** * dfareporting.contentCategories.delete * @desc Deletes an existing content category. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.contentCategories.delete({ + * // Content category ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.contentCategories.delete * @memberOf! () * @@ -11818,6 +15038,51 @@ export namespace dfareporting_v3_4 { /** * dfareporting.contentCategories.get * @desc Gets one content category by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.contentCategories.get({ + * // Content category ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.contentCategories.get * @memberOf! () * @@ -11893,6 +15158,60 @@ export namespace dfareporting_v3_4 { /** * dfareporting.contentCategories.insert * @desc Inserts a new content category. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.contentCategories.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.contentCategories.insert * @memberOf! () * @@ -11968,6 +15287,60 @@ export namespace dfareporting_v3_4 { /** * dfareporting.contentCategories.list * @desc Retrieves a list of content categories, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.contentCategories.list({ + * // Select only content categories with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "contentcategory*2015" will return objects with names like "contentcategory June 2015", "contentcategory April 2015", or simply "contentcategory 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "contentcategory" will match objects with name "my contentcategory", "contentcategory 2015", or simply "contentcategory". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentCategories": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.contentCategories.list * @memberOf! () * @@ -12057,6 +15430,62 @@ export namespace dfareporting_v3_4 { /** * dfareporting.contentCategories.patch * @desc Updates an existing content category. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.contentCategories.patch({ + * // Content category ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.contentCategories.patch * @memberOf! () * @@ -12133,6 +15562,60 @@ export namespace dfareporting_v3_4 { /** * dfareporting.contentCategories.update * @desc Updates an existing content category. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.contentCategories.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.contentCategories.update * @memberOf! () * @@ -12339,6 +15822,58 @@ export namespace dfareporting_v3_4 { /** * dfareporting.conversions.batchinsert * @desc Inserts conversions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/ddmconversions'], + * }); + * + * // 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 dfareporting.conversions.batchinsert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "conversions": [], + * // "encryptionInfo": {}, + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "hasFailures": false, + * // "kind": "my_kind", + * // "status": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.conversions.batchinsert * @memberOf! () * @@ -12423,6 +15958,58 @@ export namespace dfareporting_v3_4 { /** * dfareporting.conversions.batchupdate * @desc Updates existing conversions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/ddmconversions'], + * }); + * + * // 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 dfareporting.conversions.batchupdate({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "conversions": [], + * // "encryptionInfo": {}, + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "hasFailures": false, + * // "kind": "my_kind", + * // "status": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.conversions.batchupdate * @memberOf! () * @@ -12549,6 +16136,52 @@ export namespace dfareporting_v3_4 { /** * dfareporting.countries.get * @desc Gets one country by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.countries.get({ + * // Country DART ID. + * dartId: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "countryCode": "my_countryCode", + * // "dartId": "my_dartId", + * // "kind": "my_kind", + * // "name": "my_name", + * // "sslEnabled": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.countries.get * @memberOf! () * @@ -12621,6 +16254,47 @@ export namespace dfareporting_v3_4 { /** * dfareporting.countries.list * @desc Retrieves a list of countries. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.countries.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "countries": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.countries.list * @memberOf! () * @@ -12729,6 +16403,80 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creativeAssets.insert * @desc Inserts a new creative asset. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeAssets.insert({ + * // Advertiser ID of this creative. This is a required field. + * advertiserId: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "assetIdentifier": {}, + * // "clickTags": [], + * // "counterCustomEvents": [], + * // "detectedFeatures": [], + * // "exitCustomEvents": [], + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "richMedia": false, + * // "timerCustomEvents": [], + * // "warnedValidationRules": [] + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assetIdentifier": {}, + * // "clickTags": [], + * // "counterCustomEvents": [], + * // "detectedFeatures": [], + * // "exitCustomEvents": [], + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "richMedia": false, + * // "timerCustomEvents": [], + * // "warnedValidationRules": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeAssets.insert * @memberOf! () * @@ -12858,6 +16606,43 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creativeFields.delete * @desc Deletes an existing creative field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFields.delete({ + * // Creative Field ID + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFields.delete * @memberOf! () * @@ -12931,6 +16716,54 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creativeFields.get * @desc Gets one creative field by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFields.get({ + * // Creative Field ID + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFields.get * @memberOf! () * @@ -13006,6 +16839,66 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creativeFields.insert * @desc Inserts a new creative field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFields.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFields.insert * @memberOf! () * @@ -13081,6 +16974,62 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creativeFields.list * @desc Retrieves a list of creative fields, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFields.list({ + * // Select only creative fields that belong to these advertisers. + * advertiserIds: 'placeholder-value', + * // Select only creative fields with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for creative fields by name or ID. Wildcards (*) are allowed. For example, "creativefield*2015" will return creative fields with names like "creativefield June 2015", "creativefield April 2015", or simply "creativefield 2015". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of "creativefield" will match creative fields with the name "my creativefield", "creativefield 2015", or simply "creativefield". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creativeFields": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFields.list * @memberOf! () * @@ -13169,6 +17118,68 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creativeFields.patch * @desc Updates an existing creative field. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFields.patch({ + * // Creative Field ID + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFields.patch * @memberOf! () * @@ -13245,6 +17256,66 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creativeFields.update * @desc Updates an existing creative field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFields.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFields.update * @memberOf! () * @@ -13455,6 +17526,45 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creativeFieldValues.delete * @desc Deletes an existing creative field value. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFieldValues.delete({ + * // Creative field ID for this creative field value. + * creativeFieldId: 'placeholder-value', + * // Creative Field Value ID + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFieldValues.delete * @memberOf! () * @@ -13529,6 +17639,52 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creativeFieldValues.get * @desc Gets one creative field value by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFieldValues.get({ + * // Creative field ID for this creative field value. + * creativeFieldId: 'placeholder-value', + * // Creative Field Value ID + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "value": "my_value" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFieldValues.get * @memberOf! () * @@ -13605,6 +17761,60 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creativeFieldValues.insert * @desc Inserts a new creative field value. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFieldValues.insert({ + * // Creative field ID for this creative field value. + * creativeFieldId: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "value": "my_value" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "value": "my_value" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFieldValues.insert * @memberOf! () * @@ -13681,6 +17891,62 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creativeFieldValues.list * @desc Retrieves a list of creative field values, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFieldValues.list({ + * // Creative field ID for this creative field value. + * creativeFieldId: 'placeholder-value', + * // Select only creative field values with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed. + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creativeFieldValues": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFieldValues.list * @memberOf! () * @@ -13771,6 +18037,62 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creativeFieldValues.patch * @desc Updates an existing creative field value. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFieldValues.patch({ + * // Creative field ID for this creative field value. + * creativeFieldId: 'placeholder-value', + * // Creative Field Value ID + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "value": "my_value" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "value": "my_value" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFieldValues.patch * @memberOf! () * @@ -13848,6 +18170,60 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creativeFieldValues.update * @desc Updates an existing creative field value. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeFieldValues.update({ + * // Creative field ID for this creative field value. + * creativeFieldId: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "value": "my_value" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "value": "my_value" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeFieldValues.update * @memberOf! () * @@ -14079,6 +18455,55 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creativeGroups.get * @desc Gets one creative group by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeGroups.get({ + * // Creative group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "groupNumber": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeGroups.get * @memberOf! () * @@ -14154,6 +18579,68 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creativeGroups.insert * @desc Inserts a new creative group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeGroups.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "groupNumber": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "groupNumber": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeGroups.insert * @memberOf! () * @@ -14229,6 +18716,64 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creativeGroups.list * @desc Retrieves a list of creative groups, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeGroups.list({ + * // Select only creative groups that belong to these advertisers. + * advertiserIds: 'placeholder-value', + * // Select only creative groups that belong to this subgroup. + * groupNumber: 'placeholder-value', + * // Select only creative groups with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for creative groups by name or ID. Wildcards (*) are allowed. For example, "creativegroup*2015" will return creative groups with names like "creativegroup June 2015", "creativegroup April 2015", or simply "creativegroup 2015". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of "creativegroup" will match creative groups with the name "my creativegroup", "creativegroup 2015", or simply "creativegroup". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creativeGroups": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeGroups.list * @memberOf! () * @@ -14318,6 +18863,70 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creativeGroups.patch * @desc Updates an existing creative group. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeGroups.patch({ + * // Creative group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "groupNumber": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "groupNumber": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeGroups.patch * @memberOf! () * @@ -14394,6 +19003,68 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creativeGroups.update * @desc Updates an existing creative group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creativeGroups.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "groupNumber": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "groupNumber": 0, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creativeGroups.update * @memberOf! () * @@ -14592,6 +19263,112 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creatives.get * @desc Gets one creative by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creatives.get({ + * // Creative ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "adParameters": "my_adParameters", + * // "adTagKeys": [], + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "allowScriptAccess": false, + * // "archived": false, + * // "artworkType": "my_artworkType", + * // "authoringSource": "my_authoringSource", + * // "authoringTool": "my_authoringTool", + * // "autoAdvanceImages": false, + * // "backgroundColor": "my_backgroundColor", + * // "backupImageClickThroughUrl": {}, + * // "backupImageFeatures": [], + * // "backupImageReportingLabel": "my_backupImageReportingLabel", + * // "backupImageTargetWindow": {}, + * // "clickTags": [], + * // "commercialId": "my_commercialId", + * // "companionCreatives": [], + * // "compatibility": [], + * // "convertFlashToHtml5": false, + * // "counterCustomEvents": [], + * // "creativeAssetSelection": {}, + * // "creativeAssets": [], + * // "creativeFieldAssignments": [], + * // "customKeyValues": [], + * // "dynamicAssetSelection": false, + * // "exitCustomEvents": [], + * // "fsCommand": {}, + * // "htmlCode": "my_htmlCode", + * // "htmlCodeLocked": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "latestTraffickedCreativeId": "my_latestTraffickedCreativeId", + * // "mediaDescription": "my_mediaDescription", + * // "mediaDuration": {}, + * // "name": "my_name", + * // "obaIcon": {}, + * // "overrideCss": "my_overrideCss", + * // "progressOffset": {}, + * // "redirectUrl": "my_redirectUrl", + * // "renderingId": "my_renderingId", + * // "renderingIdDimensionValue": {}, + * // "requiredFlashPluginVersion": "my_requiredFlashPluginVersion", + * // "requiredFlashVersion": 0, + * // "size": {}, + * // "skipOffset": {}, + * // "skippable": false, + * // "sslCompliant": false, + * // "sslOverride": false, + * // "studioAdvertiserId": "my_studioAdvertiserId", + * // "studioCreativeId": "my_studioCreativeId", + * // "studioTraffickedCreativeId": "my_studioTraffickedCreativeId", + * // "subaccountId": "my_subaccountId", + * // "thirdPartyBackupImageImpressionsUrl": "my_thirdPartyBackupImageImpressionsUrl", + * // "thirdPartyRichMediaImpressionsUrl": "my_thirdPartyRichMediaImpressionsUrl", + * // "thirdPartyUrls": [], + * // "timerCustomEvents": [], + * // "totalFileSize": "my_totalFileSize", + * // "type": "my_type", + * // "universalAdId": {}, + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creatives.get * @memberOf! () * @@ -14664,6 +19441,182 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creatives.insert * @desc Inserts a new creative. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creatives.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "adParameters": "my_adParameters", + * // "adTagKeys": [], + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "allowScriptAccess": false, + * // "archived": false, + * // "artworkType": "my_artworkType", + * // "authoringSource": "my_authoringSource", + * // "authoringTool": "my_authoringTool", + * // "autoAdvanceImages": false, + * // "backgroundColor": "my_backgroundColor", + * // "backupImageClickThroughUrl": {}, + * // "backupImageFeatures": [], + * // "backupImageReportingLabel": "my_backupImageReportingLabel", + * // "backupImageTargetWindow": {}, + * // "clickTags": [], + * // "commercialId": "my_commercialId", + * // "companionCreatives": [], + * // "compatibility": [], + * // "convertFlashToHtml5": false, + * // "counterCustomEvents": [], + * // "creativeAssetSelection": {}, + * // "creativeAssets": [], + * // "creativeFieldAssignments": [], + * // "customKeyValues": [], + * // "dynamicAssetSelection": false, + * // "exitCustomEvents": [], + * // "fsCommand": {}, + * // "htmlCode": "my_htmlCode", + * // "htmlCodeLocked": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "latestTraffickedCreativeId": "my_latestTraffickedCreativeId", + * // "mediaDescription": "my_mediaDescription", + * // "mediaDuration": {}, + * // "name": "my_name", + * // "obaIcon": {}, + * // "overrideCss": "my_overrideCss", + * // "progressOffset": {}, + * // "redirectUrl": "my_redirectUrl", + * // "renderingId": "my_renderingId", + * // "renderingIdDimensionValue": {}, + * // "requiredFlashPluginVersion": "my_requiredFlashPluginVersion", + * // "requiredFlashVersion": 0, + * // "size": {}, + * // "skipOffset": {}, + * // "skippable": false, + * // "sslCompliant": false, + * // "sslOverride": false, + * // "studioAdvertiserId": "my_studioAdvertiserId", + * // "studioCreativeId": "my_studioCreativeId", + * // "studioTraffickedCreativeId": "my_studioTraffickedCreativeId", + * // "subaccountId": "my_subaccountId", + * // "thirdPartyBackupImageImpressionsUrl": "my_thirdPartyBackupImageImpressionsUrl", + * // "thirdPartyRichMediaImpressionsUrl": "my_thirdPartyRichMediaImpressionsUrl", + * // "thirdPartyUrls": [], + * // "timerCustomEvents": [], + * // "totalFileSize": "my_totalFileSize", + * // "type": "my_type", + * // "universalAdId": {}, + * // "version": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "adParameters": "my_adParameters", + * // "adTagKeys": [], + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "allowScriptAccess": false, + * // "archived": false, + * // "artworkType": "my_artworkType", + * // "authoringSource": "my_authoringSource", + * // "authoringTool": "my_authoringTool", + * // "autoAdvanceImages": false, + * // "backgroundColor": "my_backgroundColor", + * // "backupImageClickThroughUrl": {}, + * // "backupImageFeatures": [], + * // "backupImageReportingLabel": "my_backupImageReportingLabel", + * // "backupImageTargetWindow": {}, + * // "clickTags": [], + * // "commercialId": "my_commercialId", + * // "companionCreatives": [], + * // "compatibility": [], + * // "convertFlashToHtml5": false, + * // "counterCustomEvents": [], + * // "creativeAssetSelection": {}, + * // "creativeAssets": [], + * // "creativeFieldAssignments": [], + * // "customKeyValues": [], + * // "dynamicAssetSelection": false, + * // "exitCustomEvents": [], + * // "fsCommand": {}, + * // "htmlCode": "my_htmlCode", + * // "htmlCodeLocked": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "latestTraffickedCreativeId": "my_latestTraffickedCreativeId", + * // "mediaDescription": "my_mediaDescription", + * // "mediaDuration": {}, + * // "name": "my_name", + * // "obaIcon": {}, + * // "overrideCss": "my_overrideCss", + * // "progressOffset": {}, + * // "redirectUrl": "my_redirectUrl", + * // "renderingId": "my_renderingId", + * // "renderingIdDimensionValue": {}, + * // "requiredFlashPluginVersion": "my_requiredFlashPluginVersion", + * // "requiredFlashVersion": 0, + * // "size": {}, + * // "skipOffset": {}, + * // "skippable": false, + * // "sslCompliant": false, + * // "sslOverride": false, + * // "studioAdvertiserId": "my_studioAdvertiserId", + * // "studioCreativeId": "my_studioCreativeId", + * // "studioTraffickedCreativeId": "my_studioTraffickedCreativeId", + * // "subaccountId": "my_subaccountId", + * // "thirdPartyBackupImageImpressionsUrl": "my_thirdPartyBackupImageImpressionsUrl", + * // "thirdPartyRichMediaImpressionsUrl": "my_thirdPartyRichMediaImpressionsUrl", + * // "thirdPartyUrls": [], + * // "timerCustomEvents": [], + * // "totalFileSize": "my_totalFileSize", + * // "type": "my_type", + * // "universalAdId": {}, + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creatives.insert * @memberOf! () * @@ -14735,6 +19688,80 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creatives.list * @desc Retrieves a list of creatives, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creatives.list({ + * // Select only active creatives. Leave blank to select active and inactive creatives. + * active: 'placeholder-value', + * // Select only creatives with this advertiser ID. + * advertiserId: 'placeholder-value', + * // Select only archived creatives. Leave blank to select archived and unarchived creatives. + * archived: 'placeholder-value', + * // Select only creatives with this campaign ID. + * campaignId: 'placeholder-value', + * // Select only in-stream video creatives with these companion IDs. + * companionCreativeIds: 'placeholder-value', + * // Select only creatives with these creative field IDs. + * creativeFieldIds: 'placeholder-value', + * // Select only creatives with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Select only creatives with these rendering IDs. + * renderingIds: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "creative*2015" will return objects with names like "creative June 2015", "creative April 2015", or simply "creative 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "creative" will match objects with name "my creative", "creative 2015", or simply "creative". + * searchString: 'placeholder-value', + * // Select only creatives with these size IDs. + * sizeIds: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only creatives corresponding to this Studio creative ID. + * studioCreativeId: 'placeholder-value', + * // Select only creatives with these creative types. + * types: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creatives": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creatives.list * @memberOf! () * @@ -14825,6 +19852,184 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creatives.patch * @desc Updates an existing creative. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creatives.patch({ + * // Creative ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "adParameters": "my_adParameters", + * // "adTagKeys": [], + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "allowScriptAccess": false, + * // "archived": false, + * // "artworkType": "my_artworkType", + * // "authoringSource": "my_authoringSource", + * // "authoringTool": "my_authoringTool", + * // "autoAdvanceImages": false, + * // "backgroundColor": "my_backgroundColor", + * // "backupImageClickThroughUrl": {}, + * // "backupImageFeatures": [], + * // "backupImageReportingLabel": "my_backupImageReportingLabel", + * // "backupImageTargetWindow": {}, + * // "clickTags": [], + * // "commercialId": "my_commercialId", + * // "companionCreatives": [], + * // "compatibility": [], + * // "convertFlashToHtml5": false, + * // "counterCustomEvents": [], + * // "creativeAssetSelection": {}, + * // "creativeAssets": [], + * // "creativeFieldAssignments": [], + * // "customKeyValues": [], + * // "dynamicAssetSelection": false, + * // "exitCustomEvents": [], + * // "fsCommand": {}, + * // "htmlCode": "my_htmlCode", + * // "htmlCodeLocked": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "latestTraffickedCreativeId": "my_latestTraffickedCreativeId", + * // "mediaDescription": "my_mediaDescription", + * // "mediaDuration": {}, + * // "name": "my_name", + * // "obaIcon": {}, + * // "overrideCss": "my_overrideCss", + * // "progressOffset": {}, + * // "redirectUrl": "my_redirectUrl", + * // "renderingId": "my_renderingId", + * // "renderingIdDimensionValue": {}, + * // "requiredFlashPluginVersion": "my_requiredFlashPluginVersion", + * // "requiredFlashVersion": 0, + * // "size": {}, + * // "skipOffset": {}, + * // "skippable": false, + * // "sslCompliant": false, + * // "sslOverride": false, + * // "studioAdvertiserId": "my_studioAdvertiserId", + * // "studioCreativeId": "my_studioCreativeId", + * // "studioTraffickedCreativeId": "my_studioTraffickedCreativeId", + * // "subaccountId": "my_subaccountId", + * // "thirdPartyBackupImageImpressionsUrl": "my_thirdPartyBackupImageImpressionsUrl", + * // "thirdPartyRichMediaImpressionsUrl": "my_thirdPartyRichMediaImpressionsUrl", + * // "thirdPartyUrls": [], + * // "timerCustomEvents": [], + * // "totalFileSize": "my_totalFileSize", + * // "type": "my_type", + * // "universalAdId": {}, + * // "version": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "adParameters": "my_adParameters", + * // "adTagKeys": [], + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "allowScriptAccess": false, + * // "archived": false, + * // "artworkType": "my_artworkType", + * // "authoringSource": "my_authoringSource", + * // "authoringTool": "my_authoringTool", + * // "autoAdvanceImages": false, + * // "backgroundColor": "my_backgroundColor", + * // "backupImageClickThroughUrl": {}, + * // "backupImageFeatures": [], + * // "backupImageReportingLabel": "my_backupImageReportingLabel", + * // "backupImageTargetWindow": {}, + * // "clickTags": [], + * // "commercialId": "my_commercialId", + * // "companionCreatives": [], + * // "compatibility": [], + * // "convertFlashToHtml5": false, + * // "counterCustomEvents": [], + * // "creativeAssetSelection": {}, + * // "creativeAssets": [], + * // "creativeFieldAssignments": [], + * // "customKeyValues": [], + * // "dynamicAssetSelection": false, + * // "exitCustomEvents": [], + * // "fsCommand": {}, + * // "htmlCode": "my_htmlCode", + * // "htmlCodeLocked": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "latestTraffickedCreativeId": "my_latestTraffickedCreativeId", + * // "mediaDescription": "my_mediaDescription", + * // "mediaDuration": {}, + * // "name": "my_name", + * // "obaIcon": {}, + * // "overrideCss": "my_overrideCss", + * // "progressOffset": {}, + * // "redirectUrl": "my_redirectUrl", + * // "renderingId": "my_renderingId", + * // "renderingIdDimensionValue": {}, + * // "requiredFlashPluginVersion": "my_requiredFlashPluginVersion", + * // "requiredFlashVersion": 0, + * // "size": {}, + * // "skipOffset": {}, + * // "skippable": false, + * // "sslCompliant": false, + * // "sslOverride": false, + * // "studioAdvertiserId": "my_studioAdvertiserId", + * // "studioCreativeId": "my_studioCreativeId", + * // "studioTraffickedCreativeId": "my_studioTraffickedCreativeId", + * // "subaccountId": "my_subaccountId", + * // "thirdPartyBackupImageImpressionsUrl": "my_thirdPartyBackupImageImpressionsUrl", + * // "thirdPartyRichMediaImpressionsUrl": "my_thirdPartyRichMediaImpressionsUrl", + * // "thirdPartyUrls": [], + * // "timerCustomEvents": [], + * // "totalFileSize": "my_totalFileSize", + * // "type": "my_type", + * // "universalAdId": {}, + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creatives.patch * @memberOf! () * @@ -14897,6 +20102,182 @@ export namespace dfareporting_v3_4 { /** * dfareporting.creatives.update * @desc Updates an existing creative. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.creatives.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "adParameters": "my_adParameters", + * // "adTagKeys": [], + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "allowScriptAccess": false, + * // "archived": false, + * // "artworkType": "my_artworkType", + * // "authoringSource": "my_authoringSource", + * // "authoringTool": "my_authoringTool", + * // "autoAdvanceImages": false, + * // "backgroundColor": "my_backgroundColor", + * // "backupImageClickThroughUrl": {}, + * // "backupImageFeatures": [], + * // "backupImageReportingLabel": "my_backupImageReportingLabel", + * // "backupImageTargetWindow": {}, + * // "clickTags": [], + * // "commercialId": "my_commercialId", + * // "companionCreatives": [], + * // "compatibility": [], + * // "convertFlashToHtml5": false, + * // "counterCustomEvents": [], + * // "creativeAssetSelection": {}, + * // "creativeAssets": [], + * // "creativeFieldAssignments": [], + * // "customKeyValues": [], + * // "dynamicAssetSelection": false, + * // "exitCustomEvents": [], + * // "fsCommand": {}, + * // "htmlCode": "my_htmlCode", + * // "htmlCodeLocked": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "latestTraffickedCreativeId": "my_latestTraffickedCreativeId", + * // "mediaDescription": "my_mediaDescription", + * // "mediaDuration": {}, + * // "name": "my_name", + * // "obaIcon": {}, + * // "overrideCss": "my_overrideCss", + * // "progressOffset": {}, + * // "redirectUrl": "my_redirectUrl", + * // "renderingId": "my_renderingId", + * // "renderingIdDimensionValue": {}, + * // "requiredFlashPluginVersion": "my_requiredFlashPluginVersion", + * // "requiredFlashVersion": 0, + * // "size": {}, + * // "skipOffset": {}, + * // "skippable": false, + * // "sslCompliant": false, + * // "sslOverride": false, + * // "studioAdvertiserId": "my_studioAdvertiserId", + * // "studioCreativeId": "my_studioCreativeId", + * // "studioTraffickedCreativeId": "my_studioTraffickedCreativeId", + * // "subaccountId": "my_subaccountId", + * // "thirdPartyBackupImageImpressionsUrl": "my_thirdPartyBackupImageImpressionsUrl", + * // "thirdPartyRichMediaImpressionsUrl": "my_thirdPartyRichMediaImpressionsUrl", + * // "thirdPartyUrls": [], + * // "timerCustomEvents": [], + * // "totalFileSize": "my_totalFileSize", + * // "type": "my_type", + * // "universalAdId": {}, + * // "version": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "adParameters": "my_adParameters", + * // "adTagKeys": [], + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "allowScriptAccess": false, + * // "archived": false, + * // "artworkType": "my_artworkType", + * // "authoringSource": "my_authoringSource", + * // "authoringTool": "my_authoringTool", + * // "autoAdvanceImages": false, + * // "backgroundColor": "my_backgroundColor", + * // "backupImageClickThroughUrl": {}, + * // "backupImageFeatures": [], + * // "backupImageReportingLabel": "my_backupImageReportingLabel", + * // "backupImageTargetWindow": {}, + * // "clickTags": [], + * // "commercialId": "my_commercialId", + * // "companionCreatives": [], + * // "compatibility": [], + * // "convertFlashToHtml5": false, + * // "counterCustomEvents": [], + * // "creativeAssetSelection": {}, + * // "creativeAssets": [], + * // "creativeFieldAssignments": [], + * // "customKeyValues": [], + * // "dynamicAssetSelection": false, + * // "exitCustomEvents": [], + * // "fsCommand": {}, + * // "htmlCode": "my_htmlCode", + * // "htmlCodeLocked": false, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "latestTraffickedCreativeId": "my_latestTraffickedCreativeId", + * // "mediaDescription": "my_mediaDescription", + * // "mediaDuration": {}, + * // "name": "my_name", + * // "obaIcon": {}, + * // "overrideCss": "my_overrideCss", + * // "progressOffset": {}, + * // "redirectUrl": "my_redirectUrl", + * // "renderingId": "my_renderingId", + * // "renderingIdDimensionValue": {}, + * // "requiredFlashPluginVersion": "my_requiredFlashPluginVersion", + * // "requiredFlashVersion": 0, + * // "size": {}, + * // "skipOffset": {}, + * // "skippable": false, + * // "sslCompliant": false, + * // "sslOverride": false, + * // "studioAdvertiserId": "my_studioAdvertiserId", + * // "studioCreativeId": "my_studioCreativeId", + * // "studioTraffickedCreativeId": "my_studioTraffickedCreativeId", + * // "subaccountId": "my_subaccountId", + * // "thirdPartyBackupImageImpressionsUrl": "my_thirdPartyBackupImageImpressionsUrl", + * // "thirdPartyRichMediaImpressionsUrl": "my_thirdPartyRichMediaImpressionsUrl", + * // "thirdPartyUrls": [], + * // "timerCustomEvents": [], + * // "totalFileSize": "my_totalFileSize", + * // "type": "my_type", + * // "universalAdId": {}, + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.creatives.update * @memberOf! () * @@ -15118,6 +20499,57 @@ export namespace dfareporting_v3_4 { /** * dfareporting.customEvents.batchinsert * @desc Inserts custom events. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/ddmconversions'], + * }); + * + * // 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 dfareporting.customEvents.batchinsert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "customEvents": [], + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "hasFailures": false, + * // "kind": "my_kind", + * // "status": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.customEvents.batchinsert * @memberOf! () * @@ -15227,6 +20659,65 @@ export namespace dfareporting_v3_4 { /** * dfareporting.dimensionValues.query * @desc Retrieves list of report dimension values for a list of filters. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.dimensionValues.query({ + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // The value of the nextToken from the previous result page. + * pageToken: 'placeholder-value', + * // The DFA user profile ID. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dimensionName": "my_dimensionName", + * // "endDate": "my_endDate", + * // "filters": [], + * // "kind": "my_kind", + * // "startDate": "my_startDate" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.dimensionValues.query * @memberOf! () * @@ -15337,6 +20828,55 @@ export namespace dfareporting_v3_4 { /** * dfareporting.directorySites.get * @desc Gets one directory site by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.directorySites.get({ + * // Directory site ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "inpageTagFormats": [], + * // "interstitialTagFormats": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "settings": {}, + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.directorySites.get * @memberOf! () * @@ -15412,6 +20952,68 @@ export namespace dfareporting_v3_4 { /** * dfareporting.directorySites.insert * @desc Inserts a new directory site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.directorySites.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "inpageTagFormats": [], + * // "interstitialTagFormats": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "settings": {}, + * // "url": "my_url" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "inpageTagFormats": [], + * // "interstitialTagFormats": [], + * // "kind": "my_kind", + * // "name": "my_name", + * // "settings": {}, + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.directorySites.insert * @memberOf! () * @@ -15487,6 +21089,70 @@ export namespace dfareporting_v3_4 { /** * dfareporting.directorySites.list * @desc Retrieves a list of directory sites, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.directorySites.list({ + * // This search filter is no longer supported and will have no effect on the results returned. + * acceptsInStreamVideoPlacements: 'placeholder-value', + * // This search filter is no longer supported and will have no effect on the results returned. + * acceptsInterstitialPlacements: 'placeholder-value', + * // Select only directory sites that accept publisher paid placements. This field can be left blank. + * acceptsPublisherPaidPlacements: 'placeholder-value', + * // Select only active directory sites. Leave blank to retrieve both active and inactive directory sites. + * active: 'placeholder-value', + * // Select only directory sites with this Ad Manager network code. + * dfpNetworkCode: 'placeholder-value', + * // Select only directory sites with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name, ID or URL. Wildcards (*) are allowed. For example, "directory site*2015" will return objects with names like "directory site June 2015", "directory site April 2015", or simply "directory site 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "directory site" will match objects with name "my directory site", "directory site 2015" or simply, "directory site". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "directorySites": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.directorySites.list * @memberOf! () * @@ -15676,6 +21342,47 @@ export namespace dfareporting_v3_4 { /** * dfareporting.dynamicTargetingKeys.delete * @desc Deletes an existing dynamic targeting key. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.dynamicTargetingKeys.delete({ + * // Name of this dynamic targeting key. This is a required field. Must be less than 256 characters long and cannot contain commas. All characters are converted to lowercase. + * name: 'placeholder-value', + * // ID of the object of this dynamic targeting key. This is a required field. + * objectId: 'placeholder-value', + * // Type of the object of this dynamic targeting key. This is a required field. + * objectType: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.dynamicTargetingKeys.delete * @memberOf! () * @@ -15751,6 +21458,60 @@ export namespace dfareporting_v3_4 { /** * dfareporting.dynamicTargetingKeys.insert * @desc Inserts a new dynamic targeting key. Keys must be created at the advertiser level before being assigned to the advertiser's ads, creatives, or placements. There is a maximum of 1000 keys per advertiser, out of which a maximum of 20 keys can be assigned per ad, creative, or placement. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.dynamicTargetingKeys.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "name": "my_name", + * // "objectId": "my_objectId", + * // "objectType": "my_objectType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "name": "my_name", + * // "objectId": "my_objectId", + * // "objectType": "my_objectType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.dynamicTargetingKeys.insert * @memberOf! () * @@ -15826,6 +21587,55 @@ export namespace dfareporting_v3_4 { /** * dfareporting.dynamicTargetingKeys.list * @desc Retrieves a list of dynamic targeting keys. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.dynamicTargetingKeys.list({ + * // Select only dynamic targeting keys whose object has this advertiser ID. + * advertiserId: 'placeholder-value', + * // Select only dynamic targeting keys exactly matching these names. + * names: 'placeholder-value', + * // Select only dynamic targeting keys with this object ID. + * objectId: 'placeholder-value', + * // Select only dynamic targeting keys with this object type. + * objectType: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dynamicTargetingKeys": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.dynamicTargetingKeys.list * @memberOf! () * @@ -15990,6 +21800,43 @@ export namespace dfareporting_v3_4 { /** * dfareporting.eventTags.delete * @desc Deletes an existing event tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.eventTags.delete({ + * // Event tag ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.eventTags.delete * @memberOf! () * @@ -16062,6 +21909,65 @@ export namespace dfareporting_v3_4 { /** * dfareporting.eventTags.get * @desc Gets one event tag by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.eventTags.get({ + * // Event tag ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "enabledByDefault": false, + * // "excludeFromAdxRequests": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteFilterType": "my_siteFilterType", + * // "siteIds": [], + * // "sslCompliant": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "type": "my_type", + * // "url": "my_url", + * // "urlEscapeLevels": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.eventTags.get * @memberOf! () * @@ -16134,6 +22040,88 @@ export namespace dfareporting_v3_4 { /** * dfareporting.eventTags.insert * @desc Inserts a new event tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.eventTags.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "enabledByDefault": false, + * // "excludeFromAdxRequests": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteFilterType": "my_siteFilterType", + * // "siteIds": [], + * // "sslCompliant": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "type": "my_type", + * // "url": "my_url", + * // "urlEscapeLevels": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "enabledByDefault": false, + * // "excludeFromAdxRequests": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteFilterType": "my_siteFilterType", + * // "siteIds": [], + * // "sslCompliant": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "type": "my_type", + * // "url": "my_url", + * // "urlEscapeLevels": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.eventTags.insert * @memberOf! () * @@ -16205,6 +22193,67 @@ export namespace dfareporting_v3_4 { /** * dfareporting.eventTags.list * @desc Retrieves a list of event tags, possibly filtered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.eventTags.list({ + * // Select only event tags that belong to this ad. + * adId: 'placeholder-value', + * // Select only event tags that belong to this advertiser. + * advertiserId: 'placeholder-value', + * // Select only event tags that belong to this campaign. + * campaignId: 'placeholder-value', + * // Examine only the specified campaign or advertiser's event tags for matching selector criteria. When set to false, the parent advertiser and parent campaign of the specified ad or campaign is examined as well. In addition, when set to false, the status field is examined as well, along with the enabledByDefault field. This parameter can not be set to true when adId is specified as ads do not define their own even tags. + * definitionsOnly: 'placeholder-value', + * // Select only enabled event tags. What is considered enabled or disabled depends on the definitionsOnly parameter. When definitionsOnly is set to true, only the specified advertiser or campaign's event tags' enabledByDefault field is examined. When definitionsOnly is set to false, the specified ad or specified campaign's parent advertiser's or parent campaign's event tags' enabledByDefault and status fields are examined as well. + * enabled: 'placeholder-value', + * // Select only event tags with the specified event tag types. Event tag types can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking. + * eventTagTypes: 'placeholder-value', + * // Select only event tags with these IDs. + * ids: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "eventtag*2015" will return objects with names like "eventtag June 2015", "eventtag April 2015", or simply "eventtag 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "eventtag" will match objects with name "my eventtag", "eventtag 2015", or simply "eventtag". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "eventTags": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.eventTags.list * @memberOf! () * @@ -16289,6 +22338,90 @@ export namespace dfareporting_v3_4 { /** * dfareporting.eventTags.patch * @desc Updates an existing event tag. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.eventTags.patch({ + * // Event tag ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "enabledByDefault": false, + * // "excludeFromAdxRequests": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteFilterType": "my_siteFilterType", + * // "siteIds": [], + * // "sslCompliant": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "type": "my_type", + * // "url": "my_url", + * // "urlEscapeLevels": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "enabledByDefault": false, + * // "excludeFromAdxRequests": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteFilterType": "my_siteFilterType", + * // "siteIds": [], + * // "sslCompliant": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "type": "my_type", + * // "url": "my_url", + * // "urlEscapeLevels": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.eventTags.patch * @memberOf! () * @@ -16361,6 +22494,88 @@ export namespace dfareporting_v3_4 { /** * dfareporting.eventTags.update * @desc Updates an existing event tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.eventTags.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "enabledByDefault": false, + * // "excludeFromAdxRequests": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteFilterType": "my_siteFilterType", + * // "siteIds": [], + * // "sslCompliant": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "type": "my_type", + * // "url": "my_url", + * // "urlEscapeLevels": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "enabledByDefault": false, + * // "excludeFromAdxRequests": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteFilterType": "my_siteFilterType", + * // "siteIds": [], + * // "sslCompliant": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "type": "my_type", + * // "url": "my_url", + * // "urlEscapeLevels": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.eventTags.update * @memberOf! () * @@ -16573,6 +22788,57 @@ export namespace dfareporting_v3_4 { /** * dfareporting.files.get * @desc Retrieves a report file by its report ID and file ID. This method supports media download. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.files.get({ + * // The ID of the report file. + * fileId: 'placeholder-value', + * // The ID of the report. + * reportId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dateRange": {}, + * // "etag": "my_etag", + * // "fileName": "my_fileName", + * // "format": "my_format", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "reportId": "my_reportId", + * // "status": "my_status", + * // "urls": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.files.get * @memberOf! () * @@ -16644,6 +22910,59 @@ export namespace dfareporting_v3_4 { /** * dfareporting.files.list * @desc Lists files for a user profile. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.files.list({ + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // The value of the nextToken from the previous result page. + * pageToken: 'placeholder-value', + * // The DFA profile ID. + * profileId: 'placeholder-value', + * // The scope that defines which results are returned. + * scope: 'placeholder-value', + * // The field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.files.list * @memberOf! () * @@ -16773,6 +23092,43 @@ export namespace dfareporting_v3_4 { /** * dfareporting.floodlightActivities.delete * @desc Deletes an existing floodlight activity. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivities.delete({ + * // Floodlight activity ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivities.delete * @memberOf! () * @@ -16846,6 +23202,50 @@ export namespace dfareporting_v3_4 { /** * dfareporting.floodlightActivities.generatetag * @desc Generates a tag for a floodlight activity. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivities.generatetag({ + * // Floodlight activity ID for which we want to generate a tag. + * floodlightActivityId: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "floodlightActivityTag": "my_floodlightActivityTag", + * // "globalSiteTagGlobalSnippet": "my_globalSiteTagGlobalSnippet", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivities.generatetag * @memberOf! () * @@ -16938,6 +23338,75 @@ export namespace dfareporting_v3_4 { /** * dfareporting.floodlightActivities.get * @desc Gets one floodlight activity by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivities.get({ + * // Floodlight activity ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "cacheBustingType": "my_cacheBustingType", + * // "countingMethod": "my_countingMethod", + * // "defaultTags": [], + * // "expectedUrl": "my_expectedUrl", + * // "floodlightActivityGroupId": "my_floodlightActivityGroupId", + * // "floodlightActivityGroupName": "my_floodlightActivityGroupName", + * // "floodlightActivityGroupTagString": "my_floodlightActivityGroupTagString", + * // "floodlightActivityGroupType": "my_floodlightActivityGroupType", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "floodlightTagType": "my_floodlightTagType", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "notes": "my_notes", + * // "publisherTags": [], + * // "secure": false, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormat": "my_tagFormat", + * // "tagString": "my_tagString", + * // "userDefinedVariableTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivities.get * @memberOf! () * @@ -17013,6 +23482,108 @@ export namespace dfareporting_v3_4 { /** * dfareporting.floodlightActivities.insert * @desc Inserts a new floodlight activity. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivities.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "cacheBustingType": "my_cacheBustingType", + * // "countingMethod": "my_countingMethod", + * // "defaultTags": [], + * // "expectedUrl": "my_expectedUrl", + * // "floodlightActivityGroupId": "my_floodlightActivityGroupId", + * // "floodlightActivityGroupName": "my_floodlightActivityGroupName", + * // "floodlightActivityGroupTagString": "my_floodlightActivityGroupTagString", + * // "floodlightActivityGroupType": "my_floodlightActivityGroupType", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "floodlightTagType": "my_floodlightTagType", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "notes": "my_notes", + * // "publisherTags": [], + * // "secure": false, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormat": "my_tagFormat", + * // "tagString": "my_tagString", + * // "userDefinedVariableTypes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "cacheBustingType": "my_cacheBustingType", + * // "countingMethod": "my_countingMethod", + * // "defaultTags": [], + * // "expectedUrl": "my_expectedUrl", + * // "floodlightActivityGroupId": "my_floodlightActivityGroupId", + * // "floodlightActivityGroupName": "my_floodlightActivityGroupName", + * // "floodlightActivityGroupTagString": "my_floodlightActivityGroupTagString", + * // "floodlightActivityGroupType": "my_floodlightActivityGroupType", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "floodlightTagType": "my_floodlightTagType", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "notes": "my_notes", + * // "publisherTags": [], + * // "secure": false, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormat": "my_tagFormat", + * // "tagString": "my_tagString", + * // "userDefinedVariableTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivities.insert * @memberOf! () * @@ -17088,6 +23659,74 @@ export namespace dfareporting_v3_4 { /** * dfareporting.floodlightActivities.list * @desc Retrieves a list of floodlight activities, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivities.list({ + * // Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. + * advertiserId: 'placeholder-value', + * // Select only floodlight activities with the specified floodlight activity group IDs. + * floodlightActivityGroupIds: 'placeholder-value', + * // Select only floodlight activities with the specified floodlight activity group name. + * floodlightActivityGroupName: 'placeholder-value', + * // Select only floodlight activities with the specified floodlight activity group tag string. + * floodlightActivityGroupTagString: 'placeholder-value', + * // Select only floodlight activities with the specified floodlight activity group type. + * floodlightActivityGroupType: 'placeholder-value', + * // Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. + * floodlightConfigurationId: 'placeholder-value', + * // Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "floodlightactivity*2015" will return objects with names like "floodlightactivity June 2015", "floodlightactivity April 2015", or simply "floodlightactivity 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "floodlightactivity" will match objects with name "my floodlightactivity activity", "floodlightactivity 2015", or simply "floodlightactivity". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only floodlight activities with the specified tag string. + * tagString: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "floodlightActivities": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivities.list * @memberOf! () * @@ -17184,6 +23823,110 @@ export namespace dfareporting_v3_4 { /** * dfareporting.floodlightActivities.patch * @desc Updates an existing floodlight activity. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivities.patch({ + * // Floodlight activity ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "cacheBustingType": "my_cacheBustingType", + * // "countingMethod": "my_countingMethod", + * // "defaultTags": [], + * // "expectedUrl": "my_expectedUrl", + * // "floodlightActivityGroupId": "my_floodlightActivityGroupId", + * // "floodlightActivityGroupName": "my_floodlightActivityGroupName", + * // "floodlightActivityGroupTagString": "my_floodlightActivityGroupTagString", + * // "floodlightActivityGroupType": "my_floodlightActivityGroupType", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "floodlightTagType": "my_floodlightTagType", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "notes": "my_notes", + * // "publisherTags": [], + * // "secure": false, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormat": "my_tagFormat", + * // "tagString": "my_tagString", + * // "userDefinedVariableTypes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "cacheBustingType": "my_cacheBustingType", + * // "countingMethod": "my_countingMethod", + * // "defaultTags": [], + * // "expectedUrl": "my_expectedUrl", + * // "floodlightActivityGroupId": "my_floodlightActivityGroupId", + * // "floodlightActivityGroupName": "my_floodlightActivityGroupName", + * // "floodlightActivityGroupTagString": "my_floodlightActivityGroupTagString", + * // "floodlightActivityGroupType": "my_floodlightActivityGroupType", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "floodlightTagType": "my_floodlightTagType", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "notes": "my_notes", + * // "publisherTags": [], + * // "secure": false, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormat": "my_tagFormat", + * // "tagString": "my_tagString", + * // "userDefinedVariableTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivities.patch * @memberOf! () * @@ -17260,6 +24003,108 @@ export namespace dfareporting_v3_4 { /** * dfareporting.floodlightActivities.update * @desc Updates an existing floodlight activity. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivities.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "cacheBustingType": "my_cacheBustingType", + * // "countingMethod": "my_countingMethod", + * // "defaultTags": [], + * // "expectedUrl": "my_expectedUrl", + * // "floodlightActivityGroupId": "my_floodlightActivityGroupId", + * // "floodlightActivityGroupName": "my_floodlightActivityGroupName", + * // "floodlightActivityGroupTagString": "my_floodlightActivityGroupTagString", + * // "floodlightActivityGroupType": "my_floodlightActivityGroupType", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "floodlightTagType": "my_floodlightTagType", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "notes": "my_notes", + * // "publisherTags": [], + * // "secure": false, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormat": "my_tagFormat", + * // "tagString": "my_tagString", + * // "userDefinedVariableTypes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "cacheBustingType": "my_cacheBustingType", + * // "countingMethod": "my_countingMethod", + * // "defaultTags": [], + * // "expectedUrl": "my_expectedUrl", + * // "floodlightActivityGroupId": "my_floodlightActivityGroupId", + * // "floodlightActivityGroupName": "my_floodlightActivityGroupName", + * // "floodlightActivityGroupTagString": "my_floodlightActivityGroupTagString", + * // "floodlightActivityGroupType": "my_floodlightActivityGroupType", + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "floodlightTagType": "my_floodlightTagType", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "notes": "my_notes", + * // "publisherTags": [], + * // "secure": false, + * // "sslCompliant": false, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormat": "my_tagFormat", + * // "tagString": "my_tagString", + * // "userDefinedVariableTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivities.update * @memberOf! () * @@ -17510,6 +24355,59 @@ export namespace dfareporting_v3_4 { /** * dfareporting.floodlightActivityGroups.get * @desc Gets one floodlight activity group by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivityGroups.get({ + * // Floodlight activity Group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "tagString": "my_tagString", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivityGroups.get * @memberOf! () * @@ -17587,6 +24485,76 @@ export namespace dfareporting_v3_4 { /** * dfareporting.floodlightActivityGroups.insert * @desc Inserts a new floodlight activity group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivityGroups.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "tagString": "my_tagString", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "tagString": "my_tagString", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivityGroups.insert * @memberOf! () * @@ -17666,6 +24634,66 @@ export namespace dfareporting_v3_4 { /** * dfareporting.floodlightActivityGroups.list * @desc Retrieves a list of floodlight activity groups, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivityGroups.list({ + * // Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result. + * advertiserId: 'placeholder-value', + * // Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result. + * floodlightConfigurationId: 'placeholder-value', + * // Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "floodlightactivitygroup*2015" will return objects with names like "floodlightactivitygroup June 2015", "floodlightactivitygroup April 2015", or simply "floodlightactivitygroup 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "floodlightactivitygroup" will match objects with name "my floodlightactivitygroup activity", "floodlightactivitygroup 2015", or simply "floodlightactivitygroup". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only floodlight activity groups with the specified floodlight activity group type. + * type: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "floodlightActivityGroups": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivityGroups.list * @memberOf! () * @@ -17766,6 +24794,78 @@ export namespace dfareporting_v3_4 { /** * dfareporting.floodlightActivityGroups.patch * @desc Updates an existing floodlight activity group. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivityGroups.patch({ + * // Floodlight activity Group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "tagString": "my_tagString", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "tagString": "my_tagString", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivityGroups.patch * @memberOf! () * @@ -17844,6 +24944,76 @@ export namespace dfareporting_v3_4 { /** * dfareporting.floodlightActivityGroups.update * @desc Updates an existing floodlight activity group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightActivityGroups.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "tagString": "my_tagString", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "floodlightConfigurationId": "my_floodlightConfigurationId", + * // "floodlightConfigurationIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "tagString": "my_tagString", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightActivityGroups.update * @memberOf! () * @@ -18050,6 +25220,65 @@ export namespace dfareporting_v3_4 { /** * dfareporting.floodlightConfigurations.get * @desc Gets one floodlight configuration by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightConfigurations.get({ + * // Floodlight configuration ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "analyticsDataSharingEnabled": false, + * // "customViewabilityMetric": {}, + * // "exposureToConversionEnabled": false, + * // "firstDayOfWeek": "my_firstDayOfWeek", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "inAppAttributionTrackingEnabled": false, + * // "kind": "my_kind", + * // "lookbackConfiguration": {}, + * // "naturalSearchConversionAttributionOption": "my_naturalSearchConversionAttributionOption", + * // "omnitureSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "tagSettings": {}, + * // "thirdPartyAuthenticationTokens": [], + * // "userDefinedVariableConfigurations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightConfigurations.get * @memberOf! () * @@ -18127,6 +25356,49 @@ export namespace dfareporting_v3_4 { /** * dfareporting.floodlightConfigurations.list * @desc Retrieves a list of floodlight configurations, possibly filtered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightConfigurations.list({ + * // Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned. + * ids: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "floodlightConfigurations": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightConfigurations.list * @memberOf! () * @@ -18219,6 +25491,90 @@ export namespace dfareporting_v3_4 { /** * dfareporting.floodlightConfigurations.patch * @desc Updates an existing floodlight configuration. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightConfigurations.patch({ + * // Floodlight configuration ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "analyticsDataSharingEnabled": false, + * // "customViewabilityMetric": {}, + * // "exposureToConversionEnabled": false, + * // "firstDayOfWeek": "my_firstDayOfWeek", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "inAppAttributionTrackingEnabled": false, + * // "kind": "my_kind", + * // "lookbackConfiguration": {}, + * // "naturalSearchConversionAttributionOption": "my_naturalSearchConversionAttributionOption", + * // "omnitureSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "tagSettings": {}, + * // "thirdPartyAuthenticationTokens": [], + * // "userDefinedVariableConfigurations": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "analyticsDataSharingEnabled": false, + * // "customViewabilityMetric": {}, + * // "exposureToConversionEnabled": false, + * // "firstDayOfWeek": "my_firstDayOfWeek", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "inAppAttributionTrackingEnabled": false, + * // "kind": "my_kind", + * // "lookbackConfiguration": {}, + * // "naturalSearchConversionAttributionOption": "my_naturalSearchConversionAttributionOption", + * // "omnitureSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "tagSettings": {}, + * // "thirdPartyAuthenticationTokens": [], + * // "userDefinedVariableConfigurations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightConfigurations.patch * @memberOf! () * @@ -18297,6 +25653,88 @@ export namespace dfareporting_v3_4 { /** * dfareporting.floodlightConfigurations.update * @desc Updates an existing floodlight configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.floodlightConfigurations.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "analyticsDataSharingEnabled": false, + * // "customViewabilityMetric": {}, + * // "exposureToConversionEnabled": false, + * // "firstDayOfWeek": "my_firstDayOfWeek", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "inAppAttributionTrackingEnabled": false, + * // "kind": "my_kind", + * // "lookbackConfiguration": {}, + * // "naturalSearchConversionAttributionOption": "my_naturalSearchConversionAttributionOption", + * // "omnitureSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "tagSettings": {}, + * // "thirdPartyAuthenticationTokens": [], + * // "userDefinedVariableConfigurations": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "analyticsDataSharingEnabled": false, + * // "customViewabilityMetric": {}, + * // "exposureToConversionEnabled": false, + * // "firstDayOfWeek": "my_firstDayOfWeek", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "inAppAttributionTrackingEnabled": false, + * // "kind": "my_kind", + * // "lookbackConfiguration": {}, + * // "naturalSearchConversionAttributionOption": "my_naturalSearchConversionAttributionOption", + * // "omnitureSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "tagSettings": {}, + * // "thirdPartyAuthenticationTokens": [], + * // "userDefinedVariableConfigurations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.floodlightConfigurations.update * @memberOf! () * @@ -18454,6 +25892,69 @@ export namespace dfareporting_v3_4 { /** * dfareporting.inventoryItems.get * @desc Gets one inventory item by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.inventoryItems.get({ + * // Inventory item ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Project ID for order documents. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adSlots": [], + * // "advertiserId": "my_advertiserId", + * // "contentCategoryId": "my_contentCategoryId", + * // "estimatedClickThroughRate": "my_estimatedClickThroughRate", + * // "estimatedConversionRate": "my_estimatedConversionRate", + * // "id": "my_id", + * // "inPlan": false, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "negotiationChannelId": "my_negotiationChannelId", + * // "orderId": "my_orderId", + * // "placementStrategyId": "my_placementStrategyId", + * // "pricing": {}, + * // "projectId": "my_projectId", + * // "rfpId": "my_rfpId", + * // "siteId": "my_siteId", + * // "subaccountId": "my_subaccountId", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.inventoryItems.get * @memberOf! () * @@ -18530,6 +26031,68 @@ export namespace dfareporting_v3_4 { /** * dfareporting.inventoryItems.list * @desc Retrieves a list of inventory items, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.inventoryItems.list({ + * // Select only inventory items with these IDs. + * ids: 'placeholder-value', + * // Select only inventory items that are in plan. + * inPlan: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Select only inventory items that belong to specified orders. + * orderId: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Project ID for order documents. + * projectId: 'placeholder-value', + * // Select only inventory items that are associated with these sites. + * siteId: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only inventory items with this type. + * type: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "inventoryItems": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.inventoryItems.list * @memberOf! () * @@ -18701,6 +26264,47 @@ export namespace dfareporting_v3_4 { /** * dfareporting.languages.list * @desc Retrieves a list of languages. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.languages.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "languages": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.languages.list * @memberOf! () * @@ -18794,6 +26398,47 @@ export namespace dfareporting_v3_4 { /** * dfareporting.metros.list * @desc Retrieves a list of metros. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.metros.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "metros": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.metros.list * @memberOf! () * @@ -18885,6 +26530,52 @@ export namespace dfareporting_v3_4 { /** * dfareporting.mobileApps.get * @desc Gets one mobile app by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.mobileApps.get({ + * // Mobile app ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "directory": "my_directory", + * // "id": "my_id", + * // "kind": "my_kind", + * // "publisherName": "my_publisherName", + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.mobileApps.get * @memberOf! () * @@ -18959,6 +26650,58 @@ export namespace dfareporting_v3_4 { /** * dfareporting.mobileApps.list * @desc Retrieves list of available mobile apps. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.mobileApps.list({ + * // Select only apps from these directories. + * directories: 'placeholder-value', + * // Select only apps with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "app*2015" will return objects with names like "app Jan 2018", "app Jan 2018", or simply "app 2018". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "app" will match objects with name "my app", "app 2018", or simply "app". + * searchString: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "mobileApps": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.mobileApps.list * @memberOf! () * @@ -19092,6 +26835,52 @@ export namespace dfareporting_v3_4 { /** * dfareporting.mobileCarriers.get * @desc Gets one mobile carrier by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.mobileCarriers.get({ + * // Mobile carrier ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "countryCode": "my_countryCode", + * // "countryDartId": "my_countryDartId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.mobileCarriers.get * @memberOf! () * @@ -19167,6 +26956,47 @@ export namespace dfareporting_v3_4 { /** * dfareporting.mobileCarriers.list * @desc Retrieves a list of mobile carriers. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.mobileCarriers.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "mobileCarriers": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.mobileCarriers.list * @memberOf! () * @@ -19284,6 +27114,52 @@ export namespace dfareporting_v3_4 { /** * dfareporting.operatingSystems.get * @desc Gets one operating system by DART ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.operatingSystems.get({ + * // Operating system DART ID. + * dartId: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dartId": "my_dartId", + * // "desktop": false, + * // "kind": "my_kind", + * // "mobile": false, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.operatingSystems.get * @memberOf! () * @@ -19359,6 +27235,47 @@ export namespace dfareporting_v3_4 { /** * dfareporting.operatingSystems.list * @desc Retrieves a list of operating systems. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.operatingSystems.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "operatingSystems": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.operatingSystems.list * @memberOf! () * @@ -19478,6 +27395,53 @@ export namespace dfareporting_v3_4 { /** * dfareporting.operatingSystemVersions.get * @desc Gets one operating system version by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.operatingSystemVersions.get({ + * // Operating system version ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "majorVersion": "my_majorVersion", + * // "minorVersion": "my_minorVersion", + * // "name": "my_name", + * // "operatingSystem": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.operatingSystemVersions.get * @memberOf! () * @@ -19555,6 +27519,47 @@ export namespace dfareporting_v3_4 { /** * dfareporting.operatingSystemVersions.list * @desc Retrieves a list of operating system versions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.operatingSystemVersions.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "operatingSystemVersions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.operatingSystemVersions.list * @memberOf! () * @@ -19676,6 +27681,66 @@ export namespace dfareporting_v3_4 { /** * dfareporting.orderDocuments.get * @desc Gets one order document by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.orderDocuments.get({ + * // Order document ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Project ID for order documents. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "amendedOrderDocumentId": "my_amendedOrderDocumentId", + * // "approvedByUserProfileIds": [], + * // "cancelled": false, + * // "createdInfo": {}, + * // "effectiveDate": "my_effectiveDate", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastSentRecipients": [], + * // "lastSentTime": "my_lastSentTime", + * // "orderId": "my_orderId", + * // "projectId": "my_projectId", + * // "signed": false, + * // "subaccountId": "my_subaccountId", + * // "title": "my_title", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.orderDocuments.get * @memberOf! () * @@ -19752,6 +27817,68 @@ export namespace dfareporting_v3_4 { /** * dfareporting.orderDocuments.list * @desc Retrieves a list of order documents, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.orderDocuments.list({ + * // Select only order documents that have been approved by at least one user. + * approved: 'placeholder-value', + * // Select only order documents with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Select only order documents for specified orders. + * orderId: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Project ID for order documents. + * projectId: 'placeholder-value', + * // Allows searching for order documents by name or ID. Wildcards (*) are allowed. For example, "orderdocument*2015" will return order documents with names like "orderdocument June 2015", "orderdocument April 2015", or simply "orderdocument 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "orderdocument" will match order documents with name "my orderdocument", "orderdocument 2015", or simply "orderdocument". + * searchString: 'placeholder-value', + * // Select only order documents that are associated with these sites. + * siteId: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "orderDocuments": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.orderDocuments.list * @memberOf! () * @@ -19923,6 +28050,69 @@ export namespace dfareporting_v3_4 { /** * dfareporting.orders.get * @desc Gets one order by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.orders.get({ + * // Order ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Project ID for orders. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "approverUserProfileIds": [], + * // "buyerInvoiceId": "my_buyerInvoiceId", + * // "buyerOrganizationName": "my_buyerOrganizationName", + * // "comments": "my_comments", + * // "contacts": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "notes": "my_notes", + * // "planningTermId": "my_planningTermId", + * // "projectId": "my_projectId", + * // "sellerOrderId": "my_sellerOrderId", + * // "sellerOrganizationName": "my_sellerOrganizationName", + * // "siteId": [], + * // "siteNames": [], + * // "subaccountId": "my_subaccountId", + * // "termsAndConditions": "my_termsAndConditions" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.orders.get * @memberOf! () * @@ -19996,6 +28186,64 @@ export namespace dfareporting_v3_4 { /** * dfareporting.orders.list * @desc Retrieves a list of orders, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.orders.list({ + * // Select only orders with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Project ID for orders. + * projectId: 'placeholder-value', + * // Allows searching for orders by name or ID. Wildcards (*) are allowed. For example, "order*2015" will return orders with names like "order June 2015", "order April 2015", or simply "order 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "order" will match orders with name "my order", "order 2015", or simply "order". + * searchString: 'placeholder-value', + * // Select only orders that are associated with these site IDs. + * siteId: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "orders": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.orders.list * @memberOf! () * @@ -20147,6 +28395,73 @@ export namespace dfareporting_v3_4 { /** * dfareporting.placementGroups.get * @desc Gets one placement group by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementGroups.get({ + * // Placement group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "childPlacementIds": [], + * // "comment": "my_comment", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementGroupType": "my_placementGroupType", + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primaryPlacementId": "my_primaryPlacementId", + * // "primaryPlacementIdDimensionValue": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementGroups.get * @memberOf! () * @@ -20222,6 +28537,104 @@ export namespace dfareporting_v3_4 { /** * dfareporting.placementGroups.insert * @desc Inserts a new placement group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementGroups.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "childPlacementIds": [], + * // "comment": "my_comment", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementGroupType": "my_placementGroupType", + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primaryPlacementId": "my_primaryPlacementId", + * // "primaryPlacementIdDimensionValue": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "childPlacementIds": [], + * // "comment": "my_comment", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementGroupType": "my_placementGroupType", + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primaryPlacementId": "my_primaryPlacementId", + * // "primaryPlacementIdDimensionValue": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementGroups.insert * @memberOf! () * @@ -20297,6 +28710,86 @@ export namespace dfareporting_v3_4 { /** * dfareporting.placementGroups.list * @desc Retrieves a list of placement groups, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementGroups.list({ + * // Select only placement groups that belong to these advertisers. + * advertiserIds: 'placeholder-value', + * // Select only archived placements. Don't set this field to select both archived and non-archived placements. + * archived: 'placeholder-value', + * // Select only placement groups that belong to these campaigns. + * campaignIds: 'placeholder-value', + * // Select only placement groups that are associated with these content categories. + * contentCategoryIds: 'placeholder-value', + * // Select only placement groups that are associated with these directory sites. + * directorySiteIds: 'placeholder-value', + * // Select only placement groups with these IDs. + * ids: 'placeholder-value', + * // Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as "yyyy-MM-dd". + * maxEndDate: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as "yyyy-MM-dd". + * maxStartDate: 'placeholder-value', + * // Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as "yyyy-MM-dd". + * minEndDate: 'placeholder-value', + * // Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as "yyyy-MM-dd". + * minStartDate: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // Select only placement groups belonging with this group type. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group of placements that not only acts as a single pricing point but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting. + * placementGroupType: 'placeholder-value', + * // Select only placement groups that are associated with these placement strategies. + * placementStrategyIds: 'placeholder-value', + * // Select only placement groups with these pricing types. + * pricingTypes: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for placement groups by name or ID. Wildcards (*) are allowed. For example, "placement*2015" will return placement groups with names like "placement group June 2015", "placement group May 2015", or simply "placements 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placementgroup" will match placement groups with name "my placementgroup", "placementgroup 2015", or simply "placementgroup". + * searchString: 'placeholder-value', + * // Select only placement groups that are associated with these sites. + * siteIds: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "placementGroups": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementGroups.list * @memberOf! () * @@ -20397,6 +28890,106 @@ export namespace dfareporting_v3_4 { /** * dfareporting.placementGroups.patch * @desc Updates an existing placement group. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementGroups.patch({ + * // Placement group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "childPlacementIds": [], + * // "comment": "my_comment", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementGroupType": "my_placementGroupType", + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primaryPlacementId": "my_primaryPlacementId", + * // "primaryPlacementIdDimensionValue": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "childPlacementIds": [], + * // "comment": "my_comment", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementGroupType": "my_placementGroupType", + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primaryPlacementId": "my_primaryPlacementId", + * // "primaryPlacementIdDimensionValue": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementGroups.patch * @memberOf! () * @@ -20473,6 +29066,104 @@ export namespace dfareporting_v3_4 { /** * dfareporting.placementGroups.update * @desc Updates an existing placement group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementGroups.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "childPlacementIds": [], + * // "comment": "my_comment", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementGroupType": "my_placementGroupType", + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primaryPlacementId": "my_primaryPlacementId", + * // "primaryPlacementIdDimensionValue": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "childPlacementIds": [], + * // "comment": "my_comment", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "placementGroupType": "my_placementGroupType", + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primaryPlacementId": "my_primaryPlacementId", + * // "primaryPlacementIdDimensionValue": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementGroups.update * @memberOf! () * @@ -20715,6 +29406,55 @@ export namespace dfareporting_v3_4 { /** * dfareporting.placements.generatetags * @desc Generates tags for a placement. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placements.generatetags({ + * // Generate placements belonging to this campaign. This is a required field. + * campaignId: 'placeholder-value', + * // Generate tags for these placements. + * placementIds: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Tag formats to generate for these placements. + * // + * // Note: PLACEMENT_TAG_STANDARD can only be generated for 1x1 placements. + * tagFormats: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "placementTags": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placements.generatetags * @memberOf! () * @@ -20801,6 +29541,88 @@ export namespace dfareporting_v3_4 { /** * dfareporting.placements.get * @desc Gets one placement by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placements.get({ + * // Placement ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adBlockingOptOut": false, + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "comment": "my_comment", + * // "compatibility": "my_compatibility", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "lookbackConfiguration": {}, + * // "name": "my_name", + * // "paymentApproved": false, + * // "paymentSource": "my_paymentSource", + * // "placementGroupId": "my_placementGroupId", + * // "placementGroupIdDimensionValue": {}, + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primary": false, + * // "publisherUpdateInfo": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "size": {}, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormats": [], + * // "tagSetting": {}, + * // "videoActiveViewOptOut": false, + * // "videoSettings": {}, + * // "vpaidAdapterChoice": "my_vpaidAdapterChoice" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placements.get * @memberOf! () * @@ -20875,6 +29697,134 @@ export namespace dfareporting_v3_4 { /** * dfareporting.placements.insert * @desc Inserts a new placement. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placements.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "adBlockingOptOut": false, + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "comment": "my_comment", + * // "compatibility": "my_compatibility", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "lookbackConfiguration": {}, + * // "name": "my_name", + * // "paymentApproved": false, + * // "paymentSource": "my_paymentSource", + * // "placementGroupId": "my_placementGroupId", + * // "placementGroupIdDimensionValue": {}, + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primary": false, + * // "publisherUpdateInfo": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "size": {}, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormats": [], + * // "tagSetting": {}, + * // "videoActiveViewOptOut": false, + * // "videoSettings": {}, + * // "vpaidAdapterChoice": "my_vpaidAdapterChoice" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adBlockingOptOut": false, + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "comment": "my_comment", + * // "compatibility": "my_compatibility", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "lookbackConfiguration": {}, + * // "name": "my_name", + * // "paymentApproved": false, + * // "paymentSource": "my_paymentSource", + * // "placementGroupId": "my_placementGroupId", + * // "placementGroupIdDimensionValue": {}, + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primary": false, + * // "publisherUpdateInfo": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "size": {}, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormats": [], + * // "tagSetting": {}, + * // "videoActiveViewOptOut": false, + * // "videoSettings": {}, + * // "vpaidAdapterChoice": "my_vpaidAdapterChoice" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placements.insert * @memberOf! () * @@ -20949,6 +29899,92 @@ export namespace dfareporting_v3_4 { /** * dfareporting.placements.list * @desc Retrieves a list of placements, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placements.list({ + * // Select only placements that belong to these advertisers. + * advertiserIds: 'placeholder-value', + * // Select only archived placements. Don't set this field to select both archived and non-archived placements. + * archived: 'placeholder-value', + * // Select only placements that belong to these campaigns. + * campaignIds: 'placeholder-value', + * // Select only placements that are associated with these compatibilities. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. + * compatibilities: 'placeholder-value', + * // Select only placements that are associated with these content categories. + * contentCategoryIds: 'placeholder-value', + * // Select only placements that are associated with these directory sites. + * directorySiteIds: 'placeholder-value', + * // Select only placements that belong to these placement groups. + * groupIds: 'placeholder-value', + * // Select only placements with these IDs. + * ids: 'placeholder-value', + * // Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as "yyyy-MM-dd". + * maxEndDate: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as "yyyy-MM-dd". + * maxStartDate: 'placeholder-value', + * // Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as "yyyy-MM-dd". + * minEndDate: 'placeholder-value', + * // Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as "yyyy-MM-dd". + * minStartDate: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // Select only placements with this payment source. + * paymentSource: 'placeholder-value', + * // Select only placements that are associated with these placement strategies. + * placementStrategyIds: 'placeholder-value', + * // Select only placements with these pricing types. + * pricingTypes: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for placements by name or ID. Wildcards (*) are allowed. For example, "placement*2015" will return placements with names like "placement June 2015", "placement May 2015", or simply "placements 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placement" will match placements with name "my placement", "placement 2015", or simply "placement". + * searchString: 'placeholder-value', + * // Select only placements that are associated with these sites. + * siteIds: 'placeholder-value', + * // Select only placements that are associated with these sizes. + * sizeIds: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "placements": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placements.list * @memberOf! () * @@ -21045,6 +30081,136 @@ export namespace dfareporting_v3_4 { /** * dfareporting.placements.patch * @desc Updates an existing placement. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placements.patch({ + * // Placement ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "adBlockingOptOut": false, + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "comment": "my_comment", + * // "compatibility": "my_compatibility", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "lookbackConfiguration": {}, + * // "name": "my_name", + * // "paymentApproved": false, + * // "paymentSource": "my_paymentSource", + * // "placementGroupId": "my_placementGroupId", + * // "placementGroupIdDimensionValue": {}, + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primary": false, + * // "publisherUpdateInfo": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "size": {}, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormats": [], + * // "tagSetting": {}, + * // "videoActiveViewOptOut": false, + * // "videoSettings": {}, + * // "vpaidAdapterChoice": "my_vpaidAdapterChoice" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adBlockingOptOut": false, + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "comment": "my_comment", + * // "compatibility": "my_compatibility", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "lookbackConfiguration": {}, + * // "name": "my_name", + * // "paymentApproved": false, + * // "paymentSource": "my_paymentSource", + * // "placementGroupId": "my_placementGroupId", + * // "placementGroupIdDimensionValue": {}, + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primary": false, + * // "publisherUpdateInfo": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "size": {}, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormats": [], + * // "tagSetting": {}, + * // "videoActiveViewOptOut": false, + * // "videoSettings": {}, + * // "vpaidAdapterChoice": "my_vpaidAdapterChoice" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placements.patch * @memberOf! () * @@ -21119,6 +30285,134 @@ export namespace dfareporting_v3_4 { /** * dfareporting.placements.update * @desc Updates an existing placement. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placements.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "adBlockingOptOut": false, + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "comment": "my_comment", + * // "compatibility": "my_compatibility", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "lookbackConfiguration": {}, + * // "name": "my_name", + * // "paymentApproved": false, + * // "paymentSource": "my_paymentSource", + * // "placementGroupId": "my_placementGroupId", + * // "placementGroupIdDimensionValue": {}, + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primary": false, + * // "publisherUpdateInfo": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "size": {}, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormats": [], + * // "tagSetting": {}, + * // "videoActiveViewOptOut": false, + * // "videoSettings": {}, + * // "vpaidAdapterChoice": "my_vpaidAdapterChoice" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "adBlockingOptOut": false, + * // "additionalSizes": [], + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "archived": false, + * // "campaignId": "my_campaignId", + * // "campaignIdDimensionValue": {}, + * // "comment": "my_comment", + * // "compatibility": "my_compatibility", + * // "contentCategoryId": "my_contentCategoryId", + * // "createInfo": {}, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "externalId": "my_externalId", + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "lookbackConfiguration": {}, + * // "name": "my_name", + * // "paymentApproved": false, + * // "paymentSource": "my_paymentSource", + * // "placementGroupId": "my_placementGroupId", + * // "placementGroupIdDimensionValue": {}, + * // "placementStrategyId": "my_placementStrategyId", + * // "pricingSchedule": {}, + * // "primary": false, + * // "publisherUpdateInfo": {}, + * // "siteId": "my_siteId", + * // "siteIdDimensionValue": {}, + * // "size": {}, + * // "sslRequired": false, + * // "status": "my_status", + * // "subaccountId": "my_subaccountId", + * // "tagFormats": [], + * // "tagSetting": {}, + * // "videoActiveViewOptOut": false, + * // "videoSettings": {}, + * // "vpaidAdapterChoice": "my_vpaidAdapterChoice" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placements.update * @memberOf! () * @@ -21393,6 +30687,43 @@ export namespace dfareporting_v3_4 { /** * dfareporting.placementStrategies.delete * @desc Deletes an existing placement strategy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementStrategies.delete({ + * // Placement strategy ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementStrategies.delete * @memberOf! () * @@ -21466,6 +30797,51 @@ export namespace dfareporting_v3_4 { /** * dfareporting.placementStrategies.get * @desc Gets one placement strategy by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementStrategies.get({ + * // Placement strategy ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementStrategies.get * @memberOf! () * @@ -21541,6 +30917,60 @@ export namespace dfareporting_v3_4 { /** * dfareporting.placementStrategies.insert * @desc Inserts a new placement strategy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementStrategies.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementStrategies.insert * @memberOf! () * @@ -21616,6 +31046,60 @@ export namespace dfareporting_v3_4 { /** * dfareporting.placementStrategies.list * @desc Retrieves a list of placement strategies, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementStrategies.list({ + * // Select only placement strategies with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "placementstrategy*2015" will return objects with names like "placementstrategy June 2015", "placementstrategy April 2015", or simply "placementstrategy 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placementstrategy" will match objects with name "my placementstrategy", "placementstrategy 2015", or simply "placementstrategy". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "placementStrategies": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementStrategies.list * @memberOf! () * @@ -21705,6 +31189,62 @@ export namespace dfareporting_v3_4 { /** * dfareporting.placementStrategies.patch * @desc Updates an existing placement strategy. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementStrategies.patch({ + * // Placement strategy ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementStrategies.patch * @memberOf! () * @@ -21781,6 +31321,60 @@ export namespace dfareporting_v3_4 { /** * dfareporting.placementStrategies.update * @desc Updates an existing placement strategy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.placementStrategies.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.placementStrategies.update * @memberOf! () * @@ -21987,6 +31581,50 @@ export namespace dfareporting_v3_4 { /** * dfareporting.platformTypes.get * @desc Gets one platform type by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.platformTypes.get({ + * // Platform type ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.platformTypes.get * @memberOf! () * @@ -22062,6 +31700,47 @@ export namespace dfareporting_v3_4 { /** * dfareporting.platformTypes.list * @desc Retrieves a list of platform types. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.platformTypes.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "platformTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.platformTypes.list * @memberOf! () * @@ -22179,6 +31858,52 @@ export namespace dfareporting_v3_4 { /** * dfareporting.postalCodes.get * @desc Gets one postal code by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.postalCodes.get({ + * // Postal code ID. + * code: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": "my_code", + * // "countryCode": "my_countryCode", + * // "countryDartId": "my_countryDartId", + * // "id": "my_id", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.postalCodes.get * @memberOf! () * @@ -22253,6 +31978,47 @@ export namespace dfareporting_v3_4 { /** * dfareporting.postalCodes.list * @desc Retrieves a list of postal codes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.postalCodes.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "postalCodes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.postalCodes.list * @memberOf! () * @@ -22362,6 +32128,69 @@ export namespace dfareporting_v3_4 { /** * dfareporting.projects.get * @desc Gets one project by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.projects.get({ + * // Project ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "audienceAgeGroup": "my_audienceAgeGroup", + * // "audienceGender": "my_audienceGender", + * // "budget": "my_budget", + * // "clientBillingCode": "my_clientBillingCode", + * // "clientName": "my_clientName", + * // "endDate": "my_endDate", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedInfo": {}, + * // "name": "my_name", + * // "overview": "my_overview", + * // "startDate": "my_startDate", + * // "subaccountId": "my_subaccountId", + * // "targetClicks": "my_targetClicks", + * // "targetConversions": "my_targetConversions", + * // "targetCpaNanos": "my_targetCpaNanos", + * // "targetCpcNanos": "my_targetCpcNanos", + * // "targetCpmActiveViewNanos": "my_targetCpmActiveViewNanos", + * // "targetCpmNanos": "my_targetCpmNanos", + * // "targetImpressions": "my_targetImpressions" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.projects.get * @memberOf! () * @@ -22434,6 +32263,62 @@ export namespace dfareporting_v3_4 { /** * dfareporting.projects.list * @desc Retrieves a list of projects, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.projects.list({ + * // Select only projects with these advertiser IDs. + * advertiserIds: 'placeholder-value', + * // Select only projects with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for projects by name or ID. Wildcards (*) are allowed. For example, "project*2015" will return projects with names like "project June 2015", "project April 2015", or simply "project 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "project" will match projects with name "my project", "project 2015", or simply "project". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "projects": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.projects.list * @memberOf! () * @@ -22577,6 +32462,47 @@ export namespace dfareporting_v3_4 { /** * dfareporting.regions.list * @desc Retrieves a list of regions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.regions.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "regions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.regions.list * @memberOf! () * @@ -22668,6 +32594,60 @@ export namespace dfareporting_v3_4 { /** * dfareporting.remarketingLists.get * @desc Gets one remarketing list by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.remarketingLists.get({ + * // Remarketing list ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifeSpan": "my_lifeSpan", + * // "listPopulationRule": {}, + * // "listSize": "my_listSize", + * // "listSource": "my_listSource", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.remarketingLists.get * @memberOf! () * @@ -22743,6 +32723,78 @@ export namespace dfareporting_v3_4 { /** * dfareporting.remarketingLists.insert * @desc Inserts a new remarketing list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.remarketingLists.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifeSpan": "my_lifeSpan", + * // "listPopulationRule": {}, + * // "listSize": "my_listSize", + * // "listSource": "my_listSource", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifeSpan": "my_lifeSpan", + * // "listPopulationRule": {}, + * // "listSize": "my_listSize", + * // "listSource": "my_listSource", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.remarketingLists.insert * @memberOf! () * @@ -22818,6 +32870,64 @@ export namespace dfareporting_v3_4 { /** * dfareporting.remarketingLists.list * @desc Retrieves a list of remarketing lists, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.remarketingLists.list({ + * // Select only active or only inactive remarketing lists. + * active: 'placeholder-value', + * // Select only remarketing lists owned by this advertiser. + * advertiserId: 'placeholder-value', + * // Select only remarketing lists that have this floodlight activity ID. + * floodlightActivityId: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "remarketing list*2015" will return objects with names like "remarketing list June 2015", "remarketing list April 2015", or simply "remarketing list 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "remarketing list" will match objects with name "my remarketing list", "remarketing list 2015", or simply "remarketing list". + * name: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "remarketingLists": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.remarketingLists.list * @memberOf! () * @@ -22909,6 +33019,80 @@ export namespace dfareporting_v3_4 { /** * dfareporting.remarketingLists.patch * @desc Updates an existing remarketing list. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.remarketingLists.patch({ + * // Remarketing list ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifeSpan": "my_lifeSpan", + * // "listPopulationRule": {}, + * // "listSize": "my_listSize", + * // "listSource": "my_listSource", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifeSpan": "my_lifeSpan", + * // "listPopulationRule": {}, + * // "listSize": "my_listSize", + * // "listSource": "my_listSource", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.remarketingLists.patch * @memberOf! () * @@ -22985,6 +33169,78 @@ export namespace dfareporting_v3_4 { /** * dfareporting.remarketingLists.update * @desc Updates an existing remarketing list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.remarketingLists.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifeSpan": "my_lifeSpan", + * // "listPopulationRule": {}, + * // "listSize": "my_listSize", + * // "listSource": "my_listSource", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifeSpan": "my_lifeSpan", + * // "listPopulationRule": {}, + * // "listSize": "my_listSize", + * // "listSource": "my_listSource", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.remarketingLists.update * @memberOf! () * @@ -23183,6 +33439,51 @@ export namespace dfareporting_v3_4 { /** * dfareporting.remarketingListShares.get * @desc Gets one remarketing list share by remarketing list ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.remarketingListShares.get({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Remarketing list ID. + * remarketingListId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "remarketingListId": "my_remarketingListId", + * // "sharedAccountIds": [], + * // "sharedAdvertiserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.remarketingListShares.get * @memberOf! () * @@ -23260,6 +33561,62 @@ export namespace dfareporting_v3_4 { /** * dfareporting.remarketingListShares.patch * @desc Updates an existing remarketing list share. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.remarketingListShares.patch({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Remarketing list ID. + * remarketingListId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "remarketingListId": "my_remarketingListId", + * // "sharedAccountIds": [], + * // "sharedAdvertiserIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "remarketingListId": "my_remarketingListId", + * // "sharedAccountIds": [], + * // "sharedAdvertiserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.remarketingListShares.patch * @memberOf! () * @@ -23338,6 +33695,60 @@ export namespace dfareporting_v3_4 { /** * dfareporting.remarketingListShares.update * @desc Updates an existing remarketing list share. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.remarketingListShares.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "remarketingListId": "my_remarketingListId", + * // "sharedAccountIds": [], + * // "sharedAdvertiserIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "remarketingListId": "my_remarketingListId", + * // "sharedAccountIds": [], + * // "sharedAdvertiserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.remarketingListShares.update * @memberOf! () * @@ -23483,6 +33894,43 @@ export namespace dfareporting_v3_4 { /** * dfareporting.reports.delete * @desc Deletes a report by its ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.reports.delete({ + * // The DFA user profile ID. + * profileId: 'placeholder-value', + * // The ID of the report. + * reportId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.reports.delete * @memberOf! () * @@ -23555,6 +34003,65 @@ export namespace dfareporting_v3_4 { /** * dfareporting.reports.get * @desc Retrieves a report by its ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.reports.get({ + * // The DFA user profile ID. + * profileId: 'placeholder-value', + * // The ID of the report. + * reportId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "criteria": {}, + * // "crossDimensionReachCriteria": {}, + * // "delivery": {}, + * // "etag": "my_etag", + * // "fileName": "my_fileName", + * // "floodlightCriteria": {}, + * // "format": "my_format", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "name": "my_name", + * // "ownerProfileId": "my_ownerProfileId", + * // "pathToConversionCriteria": {}, + * // "reachCriteria": {}, + * // "schedule": {}, + * // "subAccountId": "my_subAccountId", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.reports.get * @memberOf! () * @@ -23627,6 +34134,88 @@ export namespace dfareporting_v3_4 { /** * dfareporting.reports.insert * @desc Creates a report. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.reports.insert({ + * // The DFA user profile ID. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "criteria": {}, + * // "crossDimensionReachCriteria": {}, + * // "delivery": {}, + * // "etag": "my_etag", + * // "fileName": "my_fileName", + * // "floodlightCriteria": {}, + * // "format": "my_format", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "name": "my_name", + * // "ownerProfileId": "my_ownerProfileId", + * // "pathToConversionCriteria": {}, + * // "reachCriteria": {}, + * // "schedule": {}, + * // "subAccountId": "my_subAccountId", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "criteria": {}, + * // "crossDimensionReachCriteria": {}, + * // "delivery": {}, + * // "etag": "my_etag", + * // "fileName": "my_fileName", + * // "floodlightCriteria": {}, + * // "format": "my_format", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "name": "my_name", + * // "ownerProfileId": "my_ownerProfileId", + * // "pathToConversionCriteria": {}, + * // "reachCriteria": {}, + * // "schedule": {}, + * // "subAccountId": "my_subAccountId", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.reports.insert * @memberOf! () * @@ -23698,6 +34287,59 @@ export namespace dfareporting_v3_4 { /** * dfareporting.reports.list * @desc Retrieves list of reports. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.reports.list({ + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // The value of the nextToken from the previous result page. + * pageToken: 'placeholder-value', + * // The DFA user profile ID. + * profileId: 'placeholder-value', + * // The scope that defines which results are returned. + * scope: 'placeholder-value', + * // The field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.reports.list * @memberOf! () * @@ -23775,6 +34417,59 @@ export namespace dfareporting_v3_4 { /** * dfareporting.reports.run * @desc Runs a report. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.reports.run({ + * // The DFA profile ID. + * profileId: 'placeholder-value', + * // The ID of the report. + * reportId: 'placeholder-value', + * // If set and true, tries to run the report synchronously. + * synchronous: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dateRange": {}, + * // "etag": "my_etag", + * // "fileName": "my_fileName", + * // "format": "my_format", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "reportId": "my_reportId", + * // "status": "my_status", + * // "urls": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.reports.run * @memberOf! () * @@ -23848,6 +34543,90 @@ export namespace dfareporting_v3_4 { /** * dfareporting.reports.update * @desc Updates a report. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.reports.update({ + * // The DFA user profile ID. + * profileId: 'placeholder-value', + * // The ID of the report. + * reportId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "criteria": {}, + * // "crossDimensionReachCriteria": {}, + * // "delivery": {}, + * // "etag": "my_etag", + * // "fileName": "my_fileName", + * // "floodlightCriteria": {}, + * // "format": "my_format", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "name": "my_name", + * // "ownerProfileId": "my_ownerProfileId", + * // "pathToConversionCriteria": {}, + * // "reachCriteria": {}, + * // "schedule": {}, + * // "subAccountId": "my_subAccountId", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "criteria": {}, + * // "crossDimensionReachCriteria": {}, + * // "delivery": {}, + * // "etag": "my_etag", + * // "fileName": "my_fileName", + * // "floodlightCriteria": {}, + * // "format": "my_format", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "name": "my_name", + * // "ownerProfileId": "my_ownerProfileId", + * // "pathToConversionCriteria": {}, + * // "reachCriteria": {}, + * // "schedule": {}, + * // "subAccountId": "my_subAccountId", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.reports.update * @memberOf! () * @@ -24045,6 +34824,76 @@ export namespace dfareporting_v3_4 { /** * dfareporting.reports.compatibleFields.query * @desc Returns the fields that are compatible to be selected in the respective sections of a report criteria, given the fields already selected in the input report and user permissions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.reports.compatibleFields.query({ + * // The DFA user profile ID. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "criteria": {}, + * // "crossDimensionReachCriteria": {}, + * // "delivery": {}, + * // "etag": "my_etag", + * // "fileName": "my_fileName", + * // "floodlightCriteria": {}, + * // "format": "my_format", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "name": "my_name", + * // "ownerProfileId": "my_ownerProfileId", + * // "pathToConversionCriteria": {}, + * // "reachCriteria": {}, + * // "schedule": {}, + * // "subAccountId": "my_subAccountId", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "crossDimensionReachReportCompatibleFields": {}, + * // "floodlightReportCompatibleFields": {}, + * // "kind": "my_kind", + * // "pathToConversionReportCompatibleFields": {}, + * // "reachReportCompatibleFields": {}, + * // "reportCompatibleFields": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.reports.compatibleFields.query * @memberOf! () * @@ -24145,6 +34994,59 @@ export namespace dfareporting_v3_4 { /** * dfareporting.reports.files.get * @desc Retrieves a report file by its report ID and file ID. This method supports media download. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.reports.files.get({ + * // The ID of the report file. + * fileId: 'placeholder-value', + * // The DFA user profile ID. + * profileId: 'placeholder-value', + * // The ID of the report. + * reportId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dateRange": {}, + * // "etag": "my_etag", + * // "fileName": "my_fileName", + * // "format": "my_format", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedTime": "my_lastModifiedTime", + * // "reportId": "my_reportId", + * // "status": "my_status", + * // "urls": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.reports.files.get * @memberOf! () * @@ -24219,6 +35121,59 @@ export namespace dfareporting_v3_4 { /** * dfareporting.reports.files.list * @desc Lists files for a report. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfareporting'], + * }); + * + * // 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 dfareporting.reports.files.list({ + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // The value of the nextToken from the previous result page. + * pageToken: 'placeholder-value', + * // The DFA user profile ID. + * profileId: 'placeholder-value', + * // The ID of the report. + * reportId: 'placeholder-value', + * // The field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.reports.files.list * @memberOf! () * @@ -24356,6 +35311,60 @@ export namespace dfareporting_v3_4 { /** * dfareporting.sites.get * @desc Gets one site by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.sites.get({ + * // Site ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "approved": false, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteContacts": [], + * // "siteSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "videoSettings": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.sites.get * @memberOf! () * @@ -24427,6 +35436,78 @@ export namespace dfareporting_v3_4 { /** * dfareporting.sites.insert * @desc Inserts a new site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.sites.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "approved": false, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteContacts": [], + * // "siteSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "videoSettings": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "approved": false, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteContacts": [], + * // "siteSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "videoSettings": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.sites.insert * @memberOf! () * @@ -24498,6 +35579,78 @@ export namespace dfareporting_v3_4 { /** * dfareporting.sites.list * @desc Retrieves a list of sites, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.sites.list({ + * // This search filter is no longer supported and will have no effect on the results returned. + * acceptsInStreamVideoPlacements: 'placeholder-value', + * // This search filter is no longer supported and will have no effect on the results returned. + * acceptsInterstitialPlacements: 'placeholder-value', + * // Select only sites that accept publisher paid placements. + * acceptsPublisherPaidPlacements: 'placeholder-value', + * // Select only AdWords sites. + * adWordsSite: 'placeholder-value', + * // Select only approved sites. + * approved: 'placeholder-value', + * // Select only sites with these campaign IDs. + * campaignIds: 'placeholder-value', + * // Select only sites with these directory site IDs. + * directorySiteIds: 'placeholder-value', + * // Select only sites with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name, ID or keyName. Wildcards (*) are allowed. For example, "site*2015" will return objects with names like "site June 2015", "site April 2015", or simply "site 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "site" will match objects with name "my site", "site 2015", or simply "site". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only sites with this subaccount ID. + * subaccountId: 'placeholder-value', + * // Select only sites that have not been mapped to a directory site. + * unmappedSite: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "sites": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.sites.list * @memberOf! () * @@ -24585,6 +35738,80 @@ export namespace dfareporting_v3_4 { /** * dfareporting.sites.patch * @desc Updates an existing site. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.sites.patch({ + * // Site ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "approved": false, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteContacts": [], + * // "siteSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "videoSettings": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "approved": false, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteContacts": [], + * // "siteSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "videoSettings": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.sites.patch * @memberOf! () * @@ -24657,6 +35884,78 @@ export namespace dfareporting_v3_4 { /** * dfareporting.sites.update * @desc Updates an existing site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.sites.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "approved": false, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteContacts": [], + * // "siteSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "videoSettings": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "approved": false, + * // "directorySiteId": "my_directorySiteId", + * // "directorySiteIdDimensionValue": {}, + * // "id": "my_id", + * // "idDimensionValue": {}, + * // "keyName": "my_keyName", + * // "kind": "my_kind", + * // "name": "my_name", + * // "siteContacts": [], + * // "siteSettings": {}, + * // "subaccountId": "my_subaccountId", + * // "videoSettings": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.sites.update * @memberOf! () * @@ -24874,6 +36173,52 @@ export namespace dfareporting_v3_4 { /** * dfareporting.sizes.get * @desc Gets one size by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.sizes.get({ + * // Size ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "height": 0, + * // "iab": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "width": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.sizes.get * @memberOf! () * @@ -24945,6 +36290,62 @@ export namespace dfareporting_v3_4 { /** * dfareporting.sizes.insert * @desc Inserts a new size. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.sizes.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "height": 0, + * // "iab": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "width": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "height": 0, + * // "iab": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "width": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.sizes.insert * @memberOf! () * @@ -25016,6 +36417,55 @@ export namespace dfareporting_v3_4 { /** * dfareporting.sizes.list * @desc Retrieves a list of sizes, possibly filtered. Retrieved sizes are globally unique and may include values not currently in use by your account. Due to this, the list of sizes returned by this method may differ from the list seen in the Trafficking UI. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.sizes.list({ + * // Select only sizes with this height. + * height: 'placeholder-value', + * // Select only IAB standard sizes. + * iabStandard: 'placeholder-value', + * // Select only sizes with these IDs. + * ids: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Select only sizes with this width. + * width: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "sizes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.sizes.list * @memberOf! () * @@ -25158,6 +36608,52 @@ export namespace dfareporting_v3_4 { /** * dfareporting.subaccounts.get * @desc Gets one subaccount by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.subaccounts.get({ + * // Subaccount ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "availablePermissionIds": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.subaccounts.get * @memberOf! () * @@ -25232,6 +36728,62 @@ export namespace dfareporting_v3_4 { /** * dfareporting.subaccounts.insert * @desc Inserts a new subaccount. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.subaccounts.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "availablePermissionIds": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "availablePermissionIds": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.subaccounts.insert * @memberOf! () * @@ -25307,6 +36859,60 @@ export namespace dfareporting_v3_4 { /** * dfareporting.subaccounts.list * @desc Gets a list of subaccounts, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.subaccounts.list({ + * // Select only subaccounts with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "subaccount*2015" will return objects with names like "subaccount June 2015", "subaccount April 2015", or simply "subaccount 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "subaccount" will match objects with name "my subaccount", "subaccount 2015", or simply "subaccount". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "subaccounts": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.subaccounts.list * @memberOf! () * @@ -25388,6 +36994,64 @@ export namespace dfareporting_v3_4 { /** * dfareporting.subaccounts.patch * @desc Updates an existing subaccount. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.subaccounts.patch({ + * // Subaccount ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "availablePermissionIds": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "availablePermissionIds": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.subaccounts.patch * @memberOf! () * @@ -25464,6 +37128,62 @@ export namespace dfareporting_v3_4 { /** * dfareporting.subaccounts.update * @desc Updates an existing subaccount. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.subaccounts.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "availablePermissionIds": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "availablePermissionIds": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.subaccounts.update * @memberOf! () * @@ -25652,6 +37372,59 @@ export namespace dfareporting_v3_4 { /** * dfareporting.targetableRemarketingLists.get * @desc Gets one remarketing list by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.targetableRemarketingLists.get({ + * // Remarketing list ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "active": false, + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "description": "my_description", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifeSpan": "my_lifeSpan", + * // "listSize": "my_listSize", + * // "listSource": "my_listSource", + * // "name": "my_name", + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.targetableRemarketingLists.get * @memberOf! () * @@ -25732,6 +37505,62 @@ export namespace dfareporting_v3_4 { /** * dfareporting.targetableRemarketingLists.list * @desc Retrieves a list of targetable remarketing lists, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.targetableRemarketingLists.list({ + * // Select only active or only inactive targetable remarketing lists. + * active: 'placeholder-value', + * // Select only targetable remarketing lists targetable by these advertisers. + * advertiserId: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "remarketing list*2015" will return objects with names like "remarketing list June 2015", "remarketing list April 2015", or simply "remarketing list 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "remarketing list" will match objects with name "my remarketing list", "remarketing list 2015", or simply "remarketing list". + * name: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "targetableRemarketingLists": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.targetableRemarketingLists.list * @memberOf! () * @@ -25894,6 +37723,60 @@ export namespace dfareporting_v3_4 { /** * dfareporting.targetingTemplates.get * @desc Gets one targeting template by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.targetingTemplates.get({ + * // Targeting template ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "dayPartTargeting": {}, + * // "geoTargeting": {}, + * // "id": "my_id", + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "listTargetingExpression": {}, + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "technologyTargeting": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.targetingTemplates.get * @memberOf! () * @@ -25969,6 +37852,78 @@ export namespace dfareporting_v3_4 { /** * dfareporting.targetingTemplates.insert * @desc Inserts a new targeting template. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.targetingTemplates.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "dayPartTargeting": {}, + * // "geoTargeting": {}, + * // "id": "my_id", + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "listTargetingExpression": {}, + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "technologyTargeting": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "dayPartTargeting": {}, + * // "geoTargeting": {}, + * // "id": "my_id", + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "listTargetingExpression": {}, + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "technologyTargeting": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.targetingTemplates.insert * @memberOf! () * @@ -26044,6 +37999,62 @@ export namespace dfareporting_v3_4 { /** * dfareporting.targetingTemplates.list * @desc Retrieves a list of targeting templates, optionally filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.targetingTemplates.list({ + * // Select only targeting templates with this advertiser ID. + * advertiserId: 'placeholder-value', + * // Select only targeting templates with these IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "template*2015" will return objects with names like "template June 2015", "template April 2015", or simply "template 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "template" will match objects with name "my template", "template 2015", or simply "template". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "targetingTemplates": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.targetingTemplates.list * @memberOf! () * @@ -26134,6 +38145,80 @@ export namespace dfareporting_v3_4 { /** * dfareporting.targetingTemplates.patch * @desc Updates an existing targeting template. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.targetingTemplates.patch({ + * // Targeting template ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "dayPartTargeting": {}, + * // "geoTargeting": {}, + * // "id": "my_id", + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "listTargetingExpression": {}, + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "technologyTargeting": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "dayPartTargeting": {}, + * // "geoTargeting": {}, + * // "id": "my_id", + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "listTargetingExpression": {}, + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "technologyTargeting": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.targetingTemplates.patch * @memberOf! () * @@ -26210,6 +38295,78 @@ export namespace dfareporting_v3_4 { /** * dfareporting.targetingTemplates.update * @desc Updates an existing targeting template. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.targetingTemplates.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "dayPartTargeting": {}, + * // "geoTargeting": {}, + * // "id": "my_id", + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "listTargetingExpression": {}, + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "technologyTargeting": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "advertiserId": "my_advertiserId", + * // "advertiserIdDimensionValue": {}, + * // "dayPartTargeting": {}, + * // "geoTargeting": {}, + * // "id": "my_id", + * // "keyValueTargetingExpression": {}, + * // "kind": "my_kind", + * // "languageTargeting": {}, + * // "listTargetingExpression": {}, + * // "name": "my_name", + * // "subaccountId": "my_subaccountId", + * // "technologyTargeting": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.targetingTemplates.update * @memberOf! () * @@ -26404,6 +38561,56 @@ export namespace dfareporting_v3_4 { /** * dfareporting.userProfiles.get * @desc Gets one user profile by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfareporting', + * 'https://www.googleapis.com/auth/dfatrafficking', + * ], + * }); + * + * // 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 dfareporting.userProfiles.get({ + * // The user profile ID. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "accountName": "my_accountName", + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "profileId": "my_profileId", + * // "subAccountId": "my_subAccountId", + * // "subAccountName": "my_subAccountName", + * // "userName": "my_userName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userProfiles.get * @memberOf! () * @@ -26476,6 +38683,48 @@ export namespace dfareporting_v3_4 { /** * dfareporting.userProfiles.list * @desc Retrieves list of user profiles for a user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfareporting', + * 'https://www.googleapis.com/auth/dfatrafficking', + * ], + * }); + * + * // 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 dfareporting.userProfiles.list({}); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userProfiles.list * @memberOf! () * @@ -26575,6 +38824,50 @@ export namespace dfareporting_v3_4 { /** * dfareporting.userRolePermissionGroups.get * @desc Gets one user role permission group by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.userRolePermissionGroups.get({ + * // User role permission group ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userRolePermissionGroups.get * @memberOf! () * @@ -26652,6 +38945,47 @@ export namespace dfareporting_v3_4 { /** * dfareporting.userRolePermissionGroups.list * @desc Gets a list of all supported user role permission groups. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.userRolePermissionGroups.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "userRolePermissionGroups": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userRolePermissionGroups.list * @memberOf! () * @@ -26779,6 +39113,52 @@ export namespace dfareporting_v3_4 { /** * dfareporting.userRolePermissions.get * @desc Gets one user role permission by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.userRolePermissions.get({ + * // User role permission ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "availability": "my_availability", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "permissionGroupId": "my_permissionGroupId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userRolePermissions.get * @memberOf! () * @@ -26854,6 +39234,49 @@ export namespace dfareporting_v3_4 { /** * dfareporting.userRolePermissions.list * @desc Gets a list of user role permissions, possibly filtered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.userRolePermissions.list({ + * // Select only user role permissions with these IDs. + * ids: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "userRolePermissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userRolePermissions.list * @memberOf! () * @@ -26978,6 +39401,43 @@ export namespace dfareporting_v3_4 { /** * dfareporting.userRoles.delete * @desc Deletes an existing user role. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.userRoles.delete({ + * // User role ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userRoles.delete * @memberOf! () * @@ -27050,6 +39510,55 @@ export namespace dfareporting_v3_4 { /** * dfareporting.userRoles.get * @desc Gets one user role by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.userRoles.get({ + * // User role ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "defaultUserRole": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentUserRoleId": "my_parentUserRoleId", + * // "permissions": [], + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userRoles.get * @memberOf! () * @@ -27122,6 +39631,68 @@ export namespace dfareporting_v3_4 { /** * dfareporting.userRoles.insert * @desc Inserts a new user role. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.userRoles.insert({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "defaultUserRole": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentUserRoleId": "my_parentUserRoleId", + * // "permissions": [], + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "defaultUserRole": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentUserRoleId": "my_parentUserRoleId", + * // "permissions": [], + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userRoles.insert * @memberOf! () * @@ -27193,6 +39764,64 @@ export namespace dfareporting_v3_4 { /** * dfareporting.userRoles.list * @desc Retrieves a list of user roles, possibly filtered. This method supports paging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.userRoles.list({ + * // Select only account level user roles not associated with any specific subaccount. + * accountUserRoleOnly: 'placeholder-value', + * // Select only user roles with the specified IDs. + * ids: 'placeholder-value', + * // Maximum number of results to return. + * maxResults: 'placeholder-value', + * // Value of the nextPageToken from the previous result page. + * pageToken: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * // Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "userrole*2015" will return objects with names like "userrole June 2015", "userrole April 2015", or simply "userrole 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "userrole" will match objects with name "my userrole", "userrole 2015", or simply "userrole". + * searchString: 'placeholder-value', + * // Field by which to sort the list. + * sortField: 'placeholder-value', + * // Order of sorted results. + * sortOrder: 'placeholder-value', + * // Select only user roles that belong to this subaccount. + * subaccountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "userRoles": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userRoles.list * @memberOf! () * @@ -27275,6 +39904,70 @@ export namespace dfareporting_v3_4 { /** * dfareporting.userRoles.patch * @desc Updates an existing user role. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.userRoles.patch({ + * // User role ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "defaultUserRole": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentUserRoleId": "my_parentUserRoleId", + * // "permissions": [], + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "defaultUserRole": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentUserRoleId": "my_parentUserRoleId", + * // "permissions": [], + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userRoles.patch * @memberOf! () * @@ -27347,6 +40040,68 @@ export namespace dfareporting_v3_4 { /** * dfareporting.userRoles.update * @desc Updates an existing user role. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.userRoles.update({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "defaultUserRole": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentUserRoleId": "my_parentUserRoleId", + * // "permissions": [], + * // "subaccountId": "my_subaccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "defaultUserRole": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "parentUserRoleId": "my_parentUserRoleId", + * // "permissions": [], + * // "subaccountId": "my_subaccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.userRoles.update * @memberOf! () * @@ -27551,6 +40306,52 @@ export namespace dfareporting_v3_4 { /** * dfareporting.videoFormats.get * @desc Gets one video format by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.videoFormats.get({ + * // Video format ID. + * id: 'placeholder-value', + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "fileType": "my_fileType", + * // "id": 0, + * // "kind": "my_kind", + * // "resolution": {}, + * // "targetBitRate": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.videoFormats.get * @memberOf! () * @@ -27625,6 +40426,47 @@ export namespace dfareporting_v3_4 { /** * dfareporting.videoFormats.list * @desc Lists available video formats. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dfareporting.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 dfareporting = google.dfareporting('v3.4'); + * + * 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/dfatrafficking'], + * }); + * + * // 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 dfareporting.videoFormats.list({ + * // User profile ID associated with this request. + * profileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "videoFormats": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dfareporting.videoFormats.list * @memberOf! () * diff --git a/src/apis/dialogflow/v2.ts b/src/apis/dialogflow/v2.ts index 9613b3ea50b..70dac5af6b4 100644 --- a/src/apis/dialogflow/v2.ts +++ b/src/apis/dialogflow/v2.ts @@ -3078,6 +3078,48 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.deleteAgent * @desc Deletes the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.deleteAgent({ + * // Required. The project that the agent to delete is associated with. + * // Format: `projects/`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.deleteAgent * @memberOf! () * @@ -3154,6 +3196,61 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.getAgent * @desc Retrieves the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.getAgent({ + * // Required. The project that the agent to fetch is associated with. + * // Format: `projects/`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "avatarUri": "my_avatarUri", + * // "classificationThreshold": {}, + * // "defaultLanguageCode": "my_defaultLanguageCode", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "enableLogging": false, + * // "matchMode": "my_matchMode", + * // "parent": "my_parent", + * // "supportedLanguageCodes": [], + * // "tier": "my_tier", + * // "timeZone": "my_timeZone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.getAgent * @memberOf! () * @@ -3237,6 +3334,82 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.setAgent * @desc Creates/updates the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.setAgent({ + * // Required. The project of this agent. + * // Format: `projects/`. + * parent: 'projects/my-project', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "avatarUri": "my_avatarUri", + * // "classificationThreshold": {}, + * // "defaultLanguageCode": "my_defaultLanguageCode", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "enableLogging": false, + * // "matchMode": "my_matchMode", + * // "parent": "my_parent", + * // "supportedLanguageCodes": [], + * // "tier": "my_tier", + * // "timeZone": "my_timeZone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "avatarUri": "my_avatarUri", + * // "classificationThreshold": {}, + * // "defaultLanguageCode": "my_defaultLanguageCode", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "enableLogging": false, + * // "matchMode": "my_matchMode", + * // "parent": "my_parent", + * // "supportedLanguageCodes": [], + * // "tier": "my_tier", + * // "timeZone": "my_timeZone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.setAgent * @memberOf! () * @@ -3385,6 +3558,62 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.export * @desc Exports the specified agent to a ZIP file. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.export({ + * // Required. The project that the agent to export is associated with. + * // Format: `projects/`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "agentUri": "my_agentUri" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.export * @memberOf! () * @@ -3467,6 +3696,54 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.getFulfillment * @desc Retrieves the fulfillment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.getFulfillment({ + * // Required. The name of the fulfillment. + * // Format: `projects//agent/fulfillment`. + * name: 'projects/my-project/agent/fulfillment', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "enabled": false, + * // "features": [], + * // "genericWebService": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.getFulfillment * @memberOf! () * @@ -3547,6 +3824,56 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.getValidationResult * @desc Gets agent validation result. Agent validation is performed during training time and is updated automatically when training is completed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.getValidationResult({ + * // Optional. The language for which you want a validation result. If not + * // specified, the agent's default language is used. [Many + * // languages](https://cloud.google.com/dialogflow/docs/reference/language) + * // are supported. Note: languages must be enabled in the agent before they can + * // be used. + * languageCode: 'placeholder-value', + * // Required. The project that the agent is associated with. + * // Format: `projects/`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "validationErrors": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.getValidationResult * @memberOf! () * @@ -3639,6 +3966,63 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.import * @desc Imports the specified agent from a ZIP file. Uploads new intents and entity types without deleting the existing ones. Intents and entity types with the same name are replaced with the new versions from ImportAgentRequest. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.import({ + * // Required. The project that the agent to import is associated with. + * // Format: `projects/`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "agentContent": "my_agentContent", + * // "agentUri": "my_agentUri" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.import * @memberOf! () * @@ -3721,6 +4105,63 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.restore * @desc Restores the specified agent from a ZIP file. Replaces the current agent version with a new one. All the intents and entity types in the older version are deleted. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.restore({ + * // Required. The project that the agent to restore is associated with. + * // Format: `projects/`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "agentContent": "my_agentContent", + * // "agentUri": "my_agentUri" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.restore * @memberOf! () * @@ -3803,6 +4244,56 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.search * @desc Returns the list of agents. Since there is at most one conversational agent per project, this method is useful primarily for listing all agents across projects the caller has access to. One can achieve that with a wildcard project collection id "-". Refer to [List Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.search({ + * // Optional. The maximum number of items to return in a single page. By + * // default 100 and at most 1000. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The project to list agents from. + * // Format: `projects/`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "agents": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.search * @memberOf! () * @@ -3904,6 +4395,60 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.train * @desc Trains the specified agent. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.train({ + * // Required. The project that the agent to train is associated with. + * // Format: `projects/`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.train * @memberOf! () * @@ -3986,6 +4531,69 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.updateFulfillment * @desc Updates the fulfillment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.updateFulfillment({ + * // Required. The unique identifier of the fulfillment. + * // Format: `projects//agent/fulfillment`. + * name: 'projects/my-project/agent/fulfillment', + * // Required. The mask to control which fields get updated. If the mask is not + * // present, all fields will be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "enabled": false, + * // "features": [], + * // "genericWebService": {}, + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "enabled": false, + * // "features": [], + * // "genericWebService": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.updateFulfillment * @memberOf! () * @@ -4217,6 +4825,62 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.entityTypes.batchDelete * @desc Deletes entity types in the specified agent. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.entityTypes.batchDelete({ + * // Required. The name of the agent to delete all entities types for. Format: + * // `projects//agent`. + * parent: 'projects/my-project/agent', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entityTypeNames": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.entityTypes.batchDelete * @memberOf! () * @@ -4299,6 +4963,65 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.entityTypes.batchUpdate * @desc Updates/Creates multiple entity types in the specified agent. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.entityTypes.batchUpdate({ + * // Required. The name of the agent to update or create entity types in. + * // Format: `projects//agent`. + * parent: 'projects/my-project/agent', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entityTypeBatchInline": {}, + * // "entityTypeBatchUri": "my_entityTypeBatchUri", + * // "languageCode": "my_languageCode", + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.entityTypes.batchUpdate * @memberOf! () * @@ -4381,6 +5104,74 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.entityTypes.create * @desc Creates an entity type in the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.entityTypes.create({ + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // Required. The agent to create a entity type for. + * // Format: `projects//agent`. + * parent: 'projects/my-project/agent', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoExpansionMode": "my_autoExpansionMode", + * // "displayName": "my_displayName", + * // "enableFuzzyExtraction": false, + * // "entities": [], + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoExpansionMode": "my_autoExpansionMode", + * // "displayName": "my_displayName", + * // "enableFuzzyExtraction": false, + * // "entities": [], + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.entityTypes.create * @memberOf! () * @@ -4466,6 +5257,48 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.entityTypes.delete * @desc Deletes the specified entity type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.entityTypes.delete({ + * // Required. The name of the entity type to delete. + * // Format: `projects//agent/entityTypes/`. + * name: 'projects/my-project/agent/entityTypes/my-entityType', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.entityTypes.delete * @memberOf! () * @@ -4537,6 +5370,61 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.entityTypes.get * @desc Retrieves the specified entity type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.entityTypes.get({ + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // Required. The name of the entity type. + * // Format: `projects//agent/entityTypes/`. + * name: 'projects/my-project/agent/entityTypes/my-entityType', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoExpansionMode": "my_autoExpansionMode", + * // "displayName": "my_displayName", + * // "enableFuzzyExtraction": false, + * // "entities": [], + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.entityTypes.get * @memberOf! () * @@ -4618,6 +5506,62 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.entityTypes.list * @desc Returns the list of all entity types in the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.entityTypes.list({ + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // Optional. The maximum number of items to return in a single page. By + * // default 100 and at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The agent to list all entity types from. + * // Format: `projects//agent`. + * parent: 'projects/my-project/agent', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entityTypes": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.entityTypes.list * @memberOf! () * @@ -4720,6 +5664,78 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.entityTypes.patch * @desc Updates the specified entity type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.entityTypes.patch({ + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // The unique identifier of the entity type. + * // Required for EntityTypes.UpdateEntityType and + * // EntityTypes.BatchUpdateEntityTypes methods. + * // Format: `projects//agent/entityTypes/`. + * name: 'projects/my-project/agent/entityTypes/my-entityType', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoExpansionMode": "my_autoExpansionMode", + * // "displayName": "my_displayName", + * // "enableFuzzyExtraction": false, + * // "entities": [], + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoExpansionMode": "my_autoExpansionMode", + * // "displayName": "my_displayName", + * // "enableFuzzyExtraction": false, + * // "entities": [], + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.entityTypes.patch * @memberOf! () * @@ -4943,6 +5959,63 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.entityTypes.entities.batchCreate * @desc Creates multiple new entities in the specified entity type. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.entityTypes.entities.batchCreate({ + * // Required. The name of the entity type to create entities in. Format: + * // `projects//agent/entityTypes/`. + * parent: 'projects/my-project/agent/entityTypes/my-entityType', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entities": [], + * // "languageCode": "my_languageCode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.entityTypes.entities.batchCreate * @memberOf! () * @@ -5025,6 +6098,63 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.entityTypes.entities.batchDelete * @desc Deletes entities in the specified entity type. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.entityTypes.entities.batchDelete({ + * // Required. The name of the entity type to delete entries for. Format: + * // `projects//agent/entityTypes/`. + * parent: 'projects/my-project/agent/entityTypes/my-entityType', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entityValues": [], + * // "languageCode": "my_languageCode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.entityTypes.entities.batchDelete * @memberOf! () * @@ -5107,6 +6237,64 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.entityTypes.entities.batchUpdate * @desc Updates or creates multiple entities in the specified entity type. This method does not affect entities in the entity type that aren't explicitly specified in the request. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.entityTypes.entities.batchUpdate({ + * // Required. The name of the entity type to update or create entities in. + * // Format: `projects//agent/entityTypes/`. + * parent: 'projects/my-project/agent/entityTypes/my-entityType', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entities": [], + * // "languageCode": "my_languageCode", + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.entityTypes.entities.batchUpdate * @memberOf! () * @@ -5250,6 +6438,56 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.environments.list * @desc Returns the list of all non-draft environments of the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.list({ + * // Optional. The maximum number of items to return in a single page. By default 100 and + * // at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The agent to list all environments from. + * // Format: `projects//agent`. + * parent: 'projects/my-project/agent', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "environments": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.list * @memberOf! () * @@ -5397,6 +6635,55 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.environments.users.sessions.deleteContexts * @desc Deletes all active contexts in the specified session. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.deleteContexts( + * { + * // Required. The name of the session to delete all contexts from. Format: + * // `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + * // If `Environment ID` is not specified we assume default 'draft' environment. + * // If `User ID` is not specified, we assume default '-' user. + * parent: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.deleteContexts * @memberOf! () * @@ -5473,6 +6760,76 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.environments.users.sessions.detectIntent * @desc Processes a natural language query and returns structured, actionable data as a result. This method is not idempotent, because it may cause contexts and session entity types to be updated, which in turn might affect results of future queries. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.detectIntent( + * { + * // Required. The name of the session this query is sent to. Format: + * // `projects//agent/sessions/`, or + * // `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * // default 'draft' environment. If `User ID` is not specified, we are using + * // "-". It's up to the API caller to choose an appropriate `Session ID` and + * // `User Id`. They can be a random number or some type of user and session + * // identifiers (preferably hashed). The length of the `Session ID` and + * // `User ID` must not exceed 36 characters. + * session: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inputAudio": "my_inputAudio", + * // "outputAudioConfig": {}, + * // "outputAudioConfigMask": "my_outputAudioConfigMask", + * // "queryInput": {}, + * // "queryParams": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "outputAudio": "my_outputAudio", + * // "outputAudioConfig": {}, + * // "queryResult": {}, + * // "responseId": "my_responseId", + * // "webhookStatus": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.detectIntent * @memberOf! () * @@ -5610,6 +6967,69 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.environments.users.sessions.contexts.create * @desc Creates a context. If the specified context already exists, overrides the context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.contexts.create( + * { + * // Required. The session to create a context for. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users//sessions/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * parent: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.contexts.create * @memberOf! () * @@ -5694,6 +7114,55 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.environments.users.sessions.contexts.delete * @desc Deletes the specified context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.contexts.delete( + * { + * // Required. The name of the context to delete. Format: + * // `projects//agent/sessions//contexts/` + * // or `projects//agent/environments//users//sessions//contexts/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * name: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session/contexts/my-context', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.contexts.delete * @memberOf! () * @@ -5765,6 +7234,59 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.environments.users.sessions.contexts.get * @desc Retrieves the specified context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.contexts.get( + * { + * // Required. The name of the context. Format: + * // `projects//agent/sessions//contexts/` + * // or `projects//agent/environments//users//sessions//contexts/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * name: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session/contexts/my-context', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.contexts.get * @memberOf! () * @@ -5845,6 +7367,63 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.environments.users.sessions.contexts.list * @desc Returns the list of all contexts in the specified session. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.contexts.list( + * { + * // Optional. The maximum number of items to return in a single page. By + * // default 100 and at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The session to list all contexts from. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users//sessions/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * parent: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contexts": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.contexts.list * @memberOf! () * @@ -5946,6 +7525,82 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.environments.users.sessions.contexts.patch * @desc Updates the specified context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.contexts.patch( + * { + * // Required. The unique identifier of the context. Format: + * // `projects//agent/sessions//contexts/`, + * // or `projects//agent/environments//users//sessions//contexts/`. + * // + * // The `Context ID` is always converted to lowercase, may only contain + * // characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + * // + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * // + * // The following context names are reserved for internal use by Dialogflow. + * // You should not use these contexts or create contexts with these names: + * // + * // * `__system_counters__` + * // * `*_id_dialog_context` + * // * `*_dialog_params_size` + * name: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session/contexts/my-context', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.contexts.patch * @memberOf! () * @@ -6118,6 +7773,69 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.environments.users.sessions.entityTypes.create * @desc Creates a session entity type. If the specified session entity type already exists, overrides the session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.entityTypes.create( + * { + * // Required. The session to create a session entity type for. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users// + * // sessions/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * parent: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.entityTypes.create * @memberOf! () * @@ -6210,6 +7928,56 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.environments.users.sessions.entityTypes.delete * @desc Deletes the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.entityTypes.delete( + * { + * // Required. The name of the entity type to delete. Format: + * // `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * name: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session/entityTypes/my-entityType', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.entityTypes.delete * @memberOf! () * @@ -6281,6 +8049,60 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.environments.users.sessions.entityTypes.get * @desc Retrieves the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.entityTypes.get( + * { + * // Required. The name of the session entity type. Format: + * // `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * name: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session/entityTypes/my-entityType', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.entityTypes.get * @memberOf! () * @@ -6369,6 +8191,63 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.environments.users.sessions.entityTypes.list * @desc Returns the list of all session entity types in the specified session. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.entityTypes.list( + * { + * // Optional. The maximum number of items to return in a single page. By + * // default 100 and at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The session to list all session entity types from. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users// + * // sessions/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * parent: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "sessionEntityTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.entityTypes.list * @memberOf! () * @@ -6471,6 +8350,75 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.environments.users.sessions.entityTypes.patch * @desc Updates the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.entityTypes.patch( + * { + * // Required. The unique identifier of this session entity type. Format: + * // `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions//entityTypes/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * // + * // `` must be the display name of an existing entity + * // type in the same agent that will be overridden or supplemented. + * name: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session/entityTypes/my-entityType', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.entityTypes.patch * @memberOf! () * @@ -6651,6 +8599,62 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.intents.batchDelete * @desc Deletes intents in the specified agent. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.intents.batchDelete({ + * // Required. The name of the agent to delete all entities types for. Format: + * // `projects//agent`. + * parent: 'projects/my-project/agent', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "intents": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.intents.batchDelete * @memberOf! () * @@ -6733,6 +8737,66 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.intents.batchUpdate * @desc Updates/Creates multiple intents in the specified agent. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.intents.batchUpdate({ + * // Required. The name of the agent to update or create intents in. + * // Format: `projects//agent`. + * parent: 'projects/my-project/agent', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "intentBatchInline": {}, + * // "intentBatchUri": "my_intentBatchUri", + * // "intentView": "my_intentView", + * // "languageCode": "my_languageCode", + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.intents.batchUpdate * @memberOf! () * @@ -6815,6 +8879,100 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.intents.create * @desc Creates an intent in the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.intents.create({ + * // Optional. The resource view to apply to the returned intent. + * intentView: 'placeholder-value', + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // Required. The agent to create a intent for. + * // Format: `projects//agent`. + * parent: 'projects/my-project/agent', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "defaultResponsePlatforms": [], + * // "displayName": "my_displayName", + * // "events": [], + * // "followupIntentInfo": [], + * // "inputContextNames": [], + * // "isFallback": false, + * // "messages": [], + * // "mlDisabled": false, + * // "name": "my_name", + * // "outputContexts": [], + * // "parameters": [], + * // "parentFollowupIntentName": "my_parentFollowupIntentName", + * // "priority": 0, + * // "resetContexts": false, + * // "rootFollowupIntentName": "my_rootFollowupIntentName", + * // "trainingPhrases": [], + * // "webhookState": "my_webhookState" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "defaultResponsePlatforms": [], + * // "displayName": "my_displayName", + * // "events": [], + * // "followupIntentInfo": [], + * // "inputContextNames": [], + * // "isFallback": false, + * // "messages": [], + * // "mlDisabled": false, + * // "name": "my_name", + * // "outputContexts": [], + * // "parameters": [], + * // "parentFollowupIntentName": "my_parentFollowupIntentName", + * // "priority": 0, + * // "resetContexts": false, + * // "rootFollowupIntentName": "my_rootFollowupIntentName", + * // "trainingPhrases": [], + * // "webhookState": "my_webhookState" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.intents.create * @memberOf! () * @@ -6901,6 +9059,49 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.intents.delete * @desc Deletes the specified intent and its direct or indirect followup intents. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.intents.delete({ + * // Required. The name of the intent to delete. If this intent has direct or + * // indirect followup intents, we also delete them. + * // Format: `projects//agent/intents/`. + * name: 'projects/my-project/agent/intents/my-intent', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.intents.delete * @memberOf! () * @@ -6972,6 +9173,75 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.intents.get * @desc Retrieves the specified intent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.intents.get({ + * // Optional. The resource view to apply to the returned intent. + * intentView: 'placeholder-value', + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // Required. The name of the intent. + * // Format: `projects//agent/intents/`. + * name: 'projects/my-project/agent/intents/my-intent', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "defaultResponsePlatforms": [], + * // "displayName": "my_displayName", + * // "events": [], + * // "followupIntentInfo": [], + * // "inputContextNames": [], + * // "isFallback": false, + * // "messages": [], + * // "mlDisabled": false, + * // "name": "my_name", + * // "outputContexts": [], + * // "parameters": [], + * // "parentFollowupIntentName": "my_parentFollowupIntentName", + * // "priority": 0, + * // "resetContexts": false, + * // "rootFollowupIntentName": "my_rootFollowupIntentName", + * // "trainingPhrases": [], + * // "webhookState": "my_webhookState" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.intents.get * @memberOf! () * @@ -7054,6 +9324,64 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.intents.list * @desc Returns the list of all intents in the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.intents.list({ + * // Optional. The resource view to apply to the returned intent. + * intentView: 'placeholder-value', + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // Optional. The maximum number of items to return in a single page. By + * // default 100 and at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The agent to list all intents from. + * // Format: `projects//agent`. + * parent: 'projects/my-project/agent', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "intents": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.intents.list * @memberOf! () * @@ -7155,6 +9483,104 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.intents.patch * @desc Updates the specified intent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.intents.patch({ + * // Optional. The resource view to apply to the returned intent. + * intentView: 'placeholder-value', + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // Optional. The unique identifier of this intent. + * // Required for Intents.UpdateIntent and Intents.BatchUpdateIntents + * // methods. + * // Format: `projects//agent/intents/`. + * name: 'projects/my-project/agent/intents/my-intent', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "defaultResponsePlatforms": [], + * // "displayName": "my_displayName", + * // "events": [], + * // "followupIntentInfo": [], + * // "inputContextNames": [], + * // "isFallback": false, + * // "messages": [], + * // "mlDisabled": false, + * // "name": "my_name", + * // "outputContexts": [], + * // "parameters": [], + * // "parentFollowupIntentName": "my_parentFollowupIntentName", + * // "priority": 0, + * // "resetContexts": false, + * // "rootFollowupIntentName": "my_rootFollowupIntentName", + * // "trainingPhrases": [], + * // "webhookState": "my_webhookState" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "defaultResponsePlatforms": [], + * // "displayName": "my_displayName", + * // "events": [], + * // "followupIntentInfo": [], + * // "inputContextNames": [], + * // "isFallback": false, + * // "messages": [], + * // "mlDisabled": false, + * // "name": "my_name", + * // "outputContexts": [], + * // "parameters": [], + * // "parentFollowupIntentName": "my_parentFollowupIntentName", + * // "priority": 0, + * // "resetContexts": false, + * // "rootFollowupIntentName": "my_rootFollowupIntentName", + * // "trainingPhrases": [], + * // "webhookState": "my_webhookState" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.intents.patch * @memberOf! () * @@ -7403,6 +9829,52 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.sessions.deleteContexts * @desc Deletes all active contexts in the specified session. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.deleteContexts({ + * // Required. The name of the session to delete all contexts from. Format: + * // `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + * // If `Environment ID` is not specified we assume default 'draft' environment. + * // If `User ID` is not specified, we assume default '-' user. + * parent: 'projects/my-project/agent/sessions/my-session', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.deleteContexts * @memberOf! () * @@ -7479,6 +9951,73 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.sessions.detectIntent * @desc Processes a natural language query and returns structured, actionable data as a result. This method is not idempotent, because it may cause contexts and session entity types to be updated, which in turn might affect results of future queries. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.detectIntent({ + * // Required. The name of the session this query is sent to. Format: + * // `projects//agent/sessions/`, or + * // `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * // default 'draft' environment. If `User ID` is not specified, we are using + * // "-". It's up to the API caller to choose an appropriate `Session ID` and + * // `User Id`. They can be a random number or some type of user and session + * // identifiers (preferably hashed). The length of the `Session ID` and + * // `User ID` must not exceed 36 characters. + * session: 'projects/my-project/agent/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inputAudio": "my_inputAudio", + * // "outputAudioConfig": {}, + * // "outputAudioConfigMask": "my_outputAudioConfigMask", + * // "queryInput": {}, + * // "queryParams": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "outputAudio": "my_outputAudio", + * // "outputAudioConfig": {}, + * // "queryResult": {}, + * // "responseId": "my_responseId", + * // "webhookStatus": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.detectIntent * @memberOf! () * @@ -7616,6 +10155,66 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.sessions.contexts.create * @desc Creates a context. If the specified context already exists, overrides the context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.contexts.create({ + * // Required. The session to create a context for. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users//sessions/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * parent: 'projects/my-project/agent/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.contexts.create * @memberOf! () * @@ -7700,6 +10299,52 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.sessions.contexts.delete * @desc Deletes the specified context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.contexts.delete({ + * // Required. The name of the context to delete. Format: + * // `projects//agent/sessions//contexts/` + * // or `projects//agent/environments//users//sessions//contexts/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * name: 'projects/my-project/agent/sessions/my-session/contexts/my-context', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.contexts.delete * @memberOf! () * @@ -7771,6 +10416,56 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.sessions.contexts.get * @desc Retrieves the specified context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.contexts.get({ + * // Required. The name of the context. Format: + * // `projects//agent/sessions//contexts/` + * // or `projects//agent/environments//users//sessions//contexts/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * name: 'projects/my-project/agent/sessions/my-session/contexts/my-context', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.contexts.get * @memberOf! () * @@ -7851,6 +10546,60 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.sessions.contexts.list * @desc Returns the list of all contexts in the specified session. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.contexts.list({ + * // Optional. The maximum number of items to return in a single page. By + * // default 100 and at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The session to list all contexts from. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users//sessions/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * parent: 'projects/my-project/agent/sessions/my-session', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contexts": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.contexts.list * @memberOf! () * @@ -7952,6 +10701,79 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.sessions.contexts.patch * @desc Updates the specified context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.contexts.patch({ + * // Required. The unique identifier of the context. Format: + * // `projects//agent/sessions//contexts/`, + * // or `projects//agent/environments//users//sessions//contexts/`. + * // + * // The `Context ID` is always converted to lowercase, may only contain + * // characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + * // + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * // + * // The following context names are reserved for internal use by Dialogflow. + * // You should not use these contexts or create contexts with these names: + * // + * // * `__system_counters__` + * // * `*_id_dialog_context` + * // * `*_dialog_params_size` + * name: 'projects/my-project/agent/sessions/my-session/contexts/my-context', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.contexts.patch * @memberOf! () * @@ -8124,6 +10946,66 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.sessions.entityTypes.create * @desc Creates a session entity type. If the specified session entity type already exists, overrides the session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.entityTypes.create({ + * // Required. The session to create a session entity type for. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users// + * // sessions/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * parent: 'projects/my-project/agent/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.entityTypes.create * @memberOf! () * @@ -8216,6 +11098,54 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.sessions.entityTypes.delete * @desc Deletes the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.entityTypes.delete({ + * // Required. The name of the entity type to delete. Format: + * // `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * name: + * 'projects/my-project/agent/sessions/my-session/entityTypes/my-entityType', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.entityTypes.delete * @memberOf! () * @@ -8287,6 +11217,58 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.sessions.entityTypes.get * @desc Retrieves the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.entityTypes.get({ + * // Required. The name of the session entity type. Format: + * // `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * name: + * 'projects/my-project/agent/sessions/my-session/entityTypes/my-entityType', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.entityTypes.get * @memberOf! () * @@ -8375,6 +11357,60 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.sessions.entityTypes.list * @desc Returns the list of all session entity types in the specified session. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.entityTypes.list({ + * // Optional. The maximum number of items to return in a single page. By + * // default 100 and at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The session to list all session entity types from. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users// + * // sessions/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * parent: 'projects/my-project/agent/sessions/my-session', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "sessionEntityTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.entityTypes.list * @memberOf! () * @@ -8477,6 +11513,73 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.agent.sessions.entityTypes.patch * @desc Updates the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.entityTypes.patch({ + * // Required. The unique identifier of this session entity type. Format: + * // `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions//entityTypes/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * // + * // `` must be the display name of an existing entity + * // type in the same agent that will be overridden or supplemented. + * name: + * 'projects/my-project/agent/sessions/my-session/entityTypes/my-entityType', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.entityTypes.patch * @memberOf! () * @@ -8668,6 +11771,47 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.locations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.operations.cancel * @memberOf! () * @@ -8739,6 +11883,53 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.operations.get * @memberOf! () * @@ -8817,6 +12008,56 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.locations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.operations.list * @memberOf! () * @@ -8967,6 +12208,47 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.operations.cancel * @memberOf! () * @@ -9038,6 +12320,53 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.operations.get * @memberOf! () * @@ -9116,6 +12445,56 @@ export namespace dialogflow_v2 { /** * dialogflow.projects.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.operations.list * @memberOf! () * diff --git a/src/apis/dialogflow/v2beta1.ts b/src/apis/dialogflow/v2beta1.ts index a5626c6196e..93f6cb9a9f3 100644 --- a/src/apis/dialogflow/v2beta1.ts +++ b/src/apis/dialogflow/v2beta1.ts @@ -3227,6 +3227,48 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.deleteAgent * @desc Deletes the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.deleteAgent({ + * // Required. The project that the agent to delete is associated with. + * // Format: `projects/`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.deleteAgent * @memberOf! () * @@ -3303,6 +3345,61 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.getAgent * @desc Retrieves the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.getAgent({ + * // Required. The project that the agent to fetch is associated with. + * // Format: `projects/`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "avatarUri": "my_avatarUri", + * // "classificationThreshold": {}, + * // "defaultLanguageCode": "my_defaultLanguageCode", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "enableLogging": false, + * // "matchMode": "my_matchMode", + * // "parent": "my_parent", + * // "supportedLanguageCodes": [], + * // "tier": "my_tier", + * // "timeZone": "my_timeZone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.getAgent * @memberOf! () * @@ -3386,6 +3483,82 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.setAgent * @desc Creates/updates the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.setAgent({ + * // Required. The project of this agent. + * // Format: `projects/`. + * parent: 'projects/my-project', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "avatarUri": "my_avatarUri", + * // "classificationThreshold": {}, + * // "defaultLanguageCode": "my_defaultLanguageCode", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "enableLogging": false, + * // "matchMode": "my_matchMode", + * // "parent": "my_parent", + * // "supportedLanguageCodes": [], + * // "tier": "my_tier", + * // "timeZone": "my_timeZone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "avatarUri": "my_avatarUri", + * // "classificationThreshold": {}, + * // "defaultLanguageCode": "my_defaultLanguageCode", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "enableLogging": false, + * // "matchMode": "my_matchMode", + * // "parent": "my_parent", + * // "supportedLanguageCodes": [], + * // "tier": "my_tier", + * // "timeZone": "my_timeZone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.setAgent * @memberOf! () * @@ -3538,6 +3711,62 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.export * @desc Exports the specified agent to a ZIP file. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.export({ + * // Required. The project that the agent to export is associated with. + * // Format: `projects/`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "agentUri": "my_agentUri" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.export * @memberOf! () * @@ -3620,6 +3849,54 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.getFulfillment * @desc Retrieves the fulfillment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.getFulfillment({ + * // Required. The name of the fulfillment. + * // Format: `projects//agent/fulfillment`. + * name: 'projects/my-project/agent/fulfillment', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "enabled": false, + * // "features": [], + * // "genericWebService": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.getFulfillment * @memberOf! () * @@ -3708,6 +3985,56 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.getValidationResult * @desc Gets agent validation result. Agent validation is performed during training time and is updated automatically when training is completed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.getValidationResult({ + * // Optional. The language for which you want a validation result. If not + * // specified, the agent's default language is used. [Many + * // languages](https://cloud.google.com/dialogflow/docs/reference/language) + * // are supported. Note: languages must be enabled in the agent before they can + * // be used. + * languageCode: 'placeholder-value', + * // Required. The project that the agent is associated with. + * // Format: `projects/`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "validationErrors": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.getValidationResult * @memberOf! () * @@ -3807,6 +4134,63 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.import * @desc Imports the specified agent from a ZIP file. Uploads new intents and entity types without deleting the existing ones. Intents and entity types with the same name are replaced with the new versions from ImportAgentRequest. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.import({ + * // Required. The project that the agent to import is associated with. + * // Format: `projects/`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "agentContent": "my_agentContent", + * // "agentUri": "my_agentUri" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.import * @memberOf! () * @@ -3889,6 +4273,63 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.restore * @desc Restores the specified agent from a ZIP file. Replaces the current agent version with a new one. All the intents and entity types in the older version are deleted. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.restore({ + * // Required. The project that the agent to restore is associated with. + * // Format: `projects/`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "agentContent": "my_agentContent", + * // "agentUri": "my_agentUri" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.restore * @memberOf! () * @@ -3971,6 +4412,56 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.search * @desc Returns the list of agents. Since there is at most one conversational agent per project, this method is useful primarily for listing all agents across projects the caller has access to. One can achieve that with a wildcard project collection id "-". Refer to [List Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.search({ + * // Optional. The maximum number of items to return in a single page. By + * // default 100 and at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The project to list agents from. + * // Format: `projects/`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "agents": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.search * @memberOf! () * @@ -4071,6 +4562,60 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.train * @desc Trains the specified agent. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.train({ + * // Required. The project that the agent to train is associated with. + * // Format: `projects/`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.train * @memberOf! () * @@ -4153,6 +4698,69 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.updateFulfillment * @desc Updates the fulfillment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.updateFulfillment({ + * // Required. The unique identifier of the fulfillment. + * // Format: `projects//agent/fulfillment`. + * name: 'projects/my-project/agent/fulfillment', + * // Required. The mask to control which fields get updated. If the mask is not + * // present, all fields will be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "enabled": false, + * // "features": [], + * // "genericWebService": {}, + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "enabled": false, + * // "features": [], + * // "genericWebService": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.updateFulfillment * @memberOf! () * @@ -4392,6 +5000,62 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.entityTypes.batchDelete * @desc Deletes entity types in the specified agent. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.entityTypes.batchDelete({ + * // Required. The name of the agent to delete all entities types for. Format: + * // `projects//agent`. + * parent: 'projects/my-project/agent', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entityTypeNames": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.entityTypes.batchDelete * @memberOf! () * @@ -4473,6 +5137,65 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.entityTypes.batchUpdate * @desc Updates/Creates multiple entity types in the specified agent. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.entityTypes.batchUpdate({ + * // Required. The name of the agent to update or create entity types in. + * // Format: `projects//agent`. + * parent: 'projects/my-project/agent', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entityTypeBatchInline": {}, + * // "entityTypeBatchUri": "my_entityTypeBatchUri", + * // "languageCode": "my_languageCode", + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.entityTypes.batchUpdate * @memberOf! () * @@ -4554,6 +5277,74 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.entityTypes.create * @desc Creates an entity type in the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.entityTypes.create({ + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // Required. The agent to create a entity type for. + * // Format: `projects//agent`. + * parent: 'projects/my-project/agent', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoExpansionMode": "my_autoExpansionMode", + * // "displayName": "my_displayName", + * // "enableFuzzyExtraction": false, + * // "entities": [], + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoExpansionMode": "my_autoExpansionMode", + * // "displayName": "my_displayName", + * // "enableFuzzyExtraction": false, + * // "entities": [], + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.entityTypes.create * @memberOf! () * @@ -4647,6 +5438,48 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.entityTypes.delete * @desc Deletes the specified entity type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.entityTypes.delete({ + * // Required. The name of the entity type to delete. + * // Format: `projects//agent/entityTypes/`. + * name: 'projects/my-project/agent/entityTypes/my-entityType', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.entityTypes.delete * @memberOf! () * @@ -4718,6 +5551,61 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.entityTypes.get * @desc Retrieves the specified entity type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.entityTypes.get({ + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // Required. The name of the entity type. + * // Format: `projects//agent/entityTypes/`. + * name: 'projects/my-project/agent/entityTypes/my-entityType', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoExpansionMode": "my_autoExpansionMode", + * // "displayName": "my_displayName", + * // "enableFuzzyExtraction": false, + * // "entities": [], + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.entityTypes.get * @memberOf! () * @@ -4807,6 +5695,62 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.entityTypes.list * @desc Returns the list of all entity types in the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.entityTypes.list({ + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // Optional. The maximum number of items to return in a single page. By + * // default 100 and at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The agent to list all entity types from. + * // Format: `projects//agent`. + * parent: 'projects/my-project/agent', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entityTypes": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.entityTypes.list * @memberOf! () * @@ -4910,6 +5854,78 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.entityTypes.patch * @desc Updates the specified entity type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.entityTypes.patch({ + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // The unique identifier of the entity type. + * // Required for EntityTypes.UpdateEntityType and + * // EntityTypes.BatchUpdateEntityTypes methods. + * // Format: `projects//agent/entityTypes/`. + * name: 'projects/my-project/agent/entityTypes/my-entityType', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoExpansionMode": "my_autoExpansionMode", + * // "displayName": "my_displayName", + * // "enableFuzzyExtraction": false, + * // "entities": [], + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoExpansionMode": "my_autoExpansionMode", + * // "displayName": "my_displayName", + * // "enableFuzzyExtraction": false, + * // "entities": [], + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.entityTypes.patch * @memberOf! () * @@ -5141,6 +6157,63 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.entityTypes.entities.batchCreate * @desc Creates multiple new entities in the specified entity type. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.entityTypes.entities.batchCreate({ + * // Required. The name of the entity type to create entities in. Format: + * // `projects//agent/entityTypes/`. + * parent: 'projects/my-project/agent/entityTypes/my-entityType', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entities": [], + * // "languageCode": "my_languageCode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.entityTypes.entities.batchCreate * @memberOf! () * @@ -5223,6 +6296,63 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.entityTypes.entities.batchDelete * @desc Deletes entities in the specified entity type. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.entityTypes.entities.batchDelete({ + * // Required. The name of the entity type to delete entries for. Format: + * // `projects//agent/entityTypes/`. + * parent: 'projects/my-project/agent/entityTypes/my-entityType', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entityValues": [], + * // "languageCode": "my_languageCode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.entityTypes.entities.batchDelete * @memberOf! () * @@ -5305,6 +6435,64 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.entityTypes.entities.batchUpdate * @desc Updates or creates multiple entities in the specified entity type. This method does not affect entities in the entity type that aren't explicitly specified in the request. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.entityTypes.entities.batchUpdate({ + * // Required. The name of the entity type to update or create entities in. + * // Format: `projects//agent/entityTypes/`. + * parent: 'projects/my-project/agent/entityTypes/my-entityType', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entities": [], + * // "languageCode": "my_languageCode", + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.entityTypes.entities.batchUpdate * @memberOf! () * @@ -5448,6 +6636,56 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.environments.list * @desc Returns the list of all non-draft environments of the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.list({ + * // Optional. The maximum number of items to return in a single page. By default 100 and + * // at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The agent to list all environments from. + * // Format: `projects//agent`. + * parent: 'projects/my-project/agent', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "environments": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.list * @memberOf! () * @@ -5597,6 +6835,54 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.environments.users.sessions.deleteContexts * @desc Deletes all active contexts in the specified session. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.deleteContexts( + * { + * // Required. The name of the session to delete all contexts from. Format: + * // `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * parent: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.deleteContexts * @memberOf! () * @@ -5673,6 +6959,77 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.environments.users.sessions.detectIntent * @desc Processes a natural language query and returns structured, actionable data as a result. This method is not idempotent, because it may cause contexts and session entity types to be updated, which in turn might affect results of future queries. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.detectIntent( + * { + * // Required. The name of the session this query is sent to. Format: + * // `projects//agent/sessions/`, or + * // `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * // default 'draft' environment. If `User ID` is not specified, we are using + * // "-". It's up to the API caller to choose an appropriate `Session ID` and + * // `User Id`. They can be a random number or some type of user and session + * // identifiers (preferably hashed). The length of the `Session ID` and + * // `User ID` must not exceed 36 characters. + * session: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inputAudio": "my_inputAudio", + * // "outputAudioConfig": {}, + * // "outputAudioConfigMask": "my_outputAudioConfigMask", + * // "queryInput": {}, + * // "queryParams": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "alternativeQueryResults": [], + * // "outputAudio": "my_outputAudio", + * // "outputAudioConfig": {}, + * // "queryResult": {}, + * // "responseId": "my_responseId", + * // "webhookStatus": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.detectIntent * @memberOf! () * @@ -5809,6 +7166,69 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.environments.users.sessions.contexts.create * @desc Creates a context. If the specified context already exists, overrides the context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.contexts.create( + * { + * // Required. The session to create a context for. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * // default 'draft' environment. If `User ID` is not specified, we assume + * // default '-' user. + * parent: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.contexts.create * @memberOf! () * @@ -5895,6 +7315,55 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.environments.users.sessions.contexts.delete * @desc Deletes the specified context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.contexts.delete( + * { + * // Required. The name of the context to delete. Format: + * // `projects//agent/sessions//contexts/` + * // or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + * // not specified, we assume default 'draft' environment. If `User ID` is not + * // specified, we assume default '-' user. + * name: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session/contexts/my-context', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.contexts.delete * @memberOf! () * @@ -5966,6 +7435,59 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.environments.users.sessions.contexts.get * @desc Retrieves the specified context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.contexts.get( + * { + * // Required. The name of the context. Format: + * // `projects//agent/sessions//contexts/` + * // or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + * // not specified, we assume default 'draft' environment. If `User ID` is not + * // specified, we assume default '-' user. + * name: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session/contexts/my-context', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.contexts.get * @memberOf! () * @@ -6048,6 +7570,63 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.environments.users.sessions.contexts.list * @desc Returns the list of all contexts in the specified session. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.contexts.list( + * { + * // Optional. The maximum number of items to return in a single page. By + * // default 100 and at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The session to list all contexts from. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * // default 'draft' environment. If `User ID` is not specified, we assume + * // default '-' user. + * parent: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contexts": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.contexts.list * @memberOf! () * @@ -6148,6 +7727,82 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.environments.users.sessions.contexts.patch * @desc Updates the specified context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.contexts.patch( + * { + * // Required. The unique identifier of the context. Format: + * // `projects//agent/sessions//contexts/`, + * // or `projects//agent/environments//users//sessions//contexts/`. + * // + * // The `Context ID` is always converted to lowercase, may only contain + * // characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + * // + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * // + * // The following context names are reserved for internal use by Dialogflow. + * // You should not use these contexts or create contexts with these names: + * // + * // * `__system_counters__` + * // * `*_id_dialog_context` + * // * `*_dialog_params_size` + * name: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session/contexts/my-context', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.contexts.patch * @memberOf! () * @@ -6322,6 +7977,69 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.environments.users.sessions.entityTypes.create * @desc Creates a session entity type. If the specified session entity type already exists, overrides the session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.entityTypes.create( + * { + * // Required. The session to create a session entity type for. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users// + * // sessions/`. If `Environment ID` is not specified, we assume + * // default 'draft' environment. If `User ID` is not specified, we assume + * // default '-' user. + * parent: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.entityTypes.create * @memberOf! () * @@ -6422,6 +8140,55 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.environments.users.sessions.entityTypes.delete * @desc Deletes the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.entityTypes.delete( + * { + * // Required. The name of the entity type to delete. Format: + * // `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * name: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session/entityTypes/my-entityType', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.entityTypes.delete * @memberOf! () * @@ -6493,6 +8260,59 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.environments.users.sessions.entityTypes.get * @desc Retrieves the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.entityTypes.get( + * { + * // Required. The name of the session entity type. Format: + * // `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * name: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session/entityTypes/my-entityType', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.entityTypes.get * @memberOf! () * @@ -6589,6 +8409,63 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.environments.users.sessions.entityTypes.list * @desc Returns the list of all session entity types in the specified session. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.entityTypes.list( + * { + * // Optional. The maximum number of items to return in a single page. By + * // default 100 and at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The session to list all session entity types from. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users// + * // sessions/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * parent: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "sessionEntityTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.entityTypes.list * @memberOf! () * @@ -6691,6 +8568,75 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.environments.users.sessions.entityTypes.patch * @desc Updates the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.environments.users.sessions.entityTypes.patch( + * { + * // Required. The unique identifier of this session entity type. Format: + * // `projects//agent/sessions//entityTypes/`, or + * // `projects//agent/environments//users//sessions//entityTypes/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * // + * // `` must be the display name of an existing entity + * // type in the same agent that will be overridden or supplemented. + * name: + * 'projects/my-project/agent/environments/my-environment/users/my-user/sessions/my-session/entityTypes/my-entityType', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.environments.users.sessions.entityTypes.patch * @memberOf! () * @@ -6879,6 +8825,62 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.intents.batchDelete * @desc Deletes intents in the specified agent. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.intents.batchDelete({ + * // Required. The name of the agent to delete all entities types for. Format: + * // `projects//agent`. + * parent: 'projects/my-project/agent', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "intents": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.intents.batchDelete * @memberOf! () * @@ -6961,6 +8963,66 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.intents.batchUpdate * @desc Updates/Creates multiple intents in the specified agent. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.intents.batchUpdate({ + * // Required. The name of the agent to update or create intents in. + * // Format: `projects//agent`. + * parent: 'projects/my-project/agent', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "intentBatchInline": {}, + * // "intentBatchUri": "my_intentBatchUri", + * // "intentView": "my_intentView", + * // "languageCode": "my_languageCode", + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.intents.batchUpdate * @memberOf! () * @@ -7043,6 +9105,104 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.intents.create * @desc Creates an intent in the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.intents.create({ + * // Optional. The resource view to apply to the returned intent. + * intentView: 'placeholder-value', + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // Required. The agent to create a intent for. + * // Format: `projects//agent`. + * parent: 'projects/my-project/agent', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "defaultResponsePlatforms": [], + * // "displayName": "my_displayName", + * // "endInteraction": false, + * // "events": [], + * // "followupIntentInfo": [], + * // "inputContextNames": [], + * // "isFallback": false, + * // "messages": [], + * // "mlDisabled": false, + * // "mlEnabled": false, + * // "name": "my_name", + * // "outputContexts": [], + * // "parameters": [], + * // "parentFollowupIntentName": "my_parentFollowupIntentName", + * // "priority": 0, + * // "resetContexts": false, + * // "rootFollowupIntentName": "my_rootFollowupIntentName", + * // "trainingPhrases": [], + * // "webhookState": "my_webhookState" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "defaultResponsePlatforms": [], + * // "displayName": "my_displayName", + * // "endInteraction": false, + * // "events": [], + * // "followupIntentInfo": [], + * // "inputContextNames": [], + * // "isFallback": false, + * // "messages": [], + * // "mlDisabled": false, + * // "mlEnabled": false, + * // "name": "my_name", + * // "outputContexts": [], + * // "parameters": [], + * // "parentFollowupIntentName": "my_parentFollowupIntentName", + * // "priority": 0, + * // "resetContexts": false, + * // "rootFollowupIntentName": "my_rootFollowupIntentName", + * // "trainingPhrases": [], + * // "webhookState": "my_webhookState" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.intents.create * @memberOf! () * @@ -7129,6 +9289,50 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.intents.delete * @desc Deletes the specified intent and its direct or indirect followup intents. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.intents.delete({ + * // Required. The name of the intent to delete. If this intent has direct or + * // indirect followup intents, we also delete them. + * // + * // Format: `projects//agent/intents/`. + * name: 'projects/my-project/agent/intents/my-intent', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.intents.delete * @memberOf! () * @@ -7200,6 +9404,77 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.intents.get * @desc Retrieves the specified intent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.intents.get({ + * // Optional. The resource view to apply to the returned intent. + * intentView: 'placeholder-value', + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // Required. The name of the intent. + * // Format: `projects//agent/intents/`. + * name: 'projects/my-project/agent/intents/my-intent', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "defaultResponsePlatforms": [], + * // "displayName": "my_displayName", + * // "endInteraction": false, + * // "events": [], + * // "followupIntentInfo": [], + * // "inputContextNames": [], + * // "isFallback": false, + * // "messages": [], + * // "mlDisabled": false, + * // "mlEnabled": false, + * // "name": "my_name", + * // "outputContexts": [], + * // "parameters": [], + * // "parentFollowupIntentName": "my_parentFollowupIntentName", + * // "priority": 0, + * // "resetContexts": false, + * // "rootFollowupIntentName": "my_rootFollowupIntentName", + * // "trainingPhrases": [], + * // "webhookState": "my_webhookState" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.intents.get * @memberOf! () * @@ -7282,6 +9557,64 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.intents.list * @desc Returns the list of all intents in the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.intents.list({ + * // Optional. The resource view to apply to the returned intent. + * intentView: 'placeholder-value', + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // Optional. The maximum number of items to return in a single page. By + * // default 100 and at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The agent to list all intents from. + * // Format: `projects//agent`. + * parent: 'projects/my-project/agent', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "intents": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.intents.list * @memberOf! () * @@ -7384,6 +9717,108 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.intents.patch * @desc Updates the specified intent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.intents.patch({ + * // Optional. The resource view to apply to the returned intent. + * intentView: 'placeholder-value', + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // The unique identifier of this intent. + * // Required for Intents.UpdateIntent and Intents.BatchUpdateIntents + * // methods. + * // Format: `projects//agent/intents/`. + * name: 'projects/my-project/agent/intents/my-intent', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "defaultResponsePlatforms": [], + * // "displayName": "my_displayName", + * // "endInteraction": false, + * // "events": [], + * // "followupIntentInfo": [], + * // "inputContextNames": [], + * // "isFallback": false, + * // "messages": [], + * // "mlDisabled": false, + * // "mlEnabled": false, + * // "name": "my_name", + * // "outputContexts": [], + * // "parameters": [], + * // "parentFollowupIntentName": "my_parentFollowupIntentName", + * // "priority": 0, + * // "resetContexts": false, + * // "rootFollowupIntentName": "my_rootFollowupIntentName", + * // "trainingPhrases": [], + * // "webhookState": "my_webhookState" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "defaultResponsePlatforms": [], + * // "displayName": "my_displayName", + * // "endInteraction": false, + * // "events": [], + * // "followupIntentInfo": [], + * // "inputContextNames": [], + * // "isFallback": false, + * // "messages": [], + * // "mlDisabled": false, + * // "mlEnabled": false, + * // "name": "my_name", + * // "outputContexts": [], + * // "parameters": [], + * // "parentFollowupIntentName": "my_parentFollowupIntentName", + * // "priority": 0, + * // "resetContexts": false, + * // "rootFollowupIntentName": "my_rootFollowupIntentName", + * // "trainingPhrases": [], + * // "webhookState": "my_webhookState" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.intents.patch * @memberOf! () * @@ -7628,6 +10063,62 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.knowledgeBases.create * @desc Creates a knowledge base. Note: The `projects.agent.knowledgeBases` resource is deprecated; only use `projects.knowledgeBases`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.knowledgeBases.create({ + * // Required. The project to create a knowledge base for. + * // Format: `projects/`. + * parent: 'projects/my-project/agent', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "languageCode": "my_languageCode", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "languageCode": "my_languageCode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.knowledgeBases.create * @memberOf! () * @@ -7726,6 +10217,51 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.knowledgeBases.delete * @desc Deletes the specified knowledge base. Note: The `projects.agent.knowledgeBases` resource is deprecated; only use `projects.knowledgeBases`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.knowledgeBases.delete({ + * // Optional. Force deletes the knowledge base. When set to true, any documents + * // in the knowledge base are also deleted. + * force: 'placeholder-value', + * // Required. The name of the knowledge base to delete. + * // Format: `projects//knowledgeBases/`. + * name: 'projects/my-project/agent/knowledgeBases/my-knowledgeBase', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.knowledgeBases.delete * @memberOf! () * @@ -7798,6 +10334,52 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.knowledgeBases.get * @desc Retrieves the specified knowledge base. Note: The `projects.agent.knowledgeBases` resource is deprecated; only use `projects.knowledgeBases`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.knowledgeBases.get({ + * // Required. The name of the knowledge base to retrieve. + * // Format `projects//knowledgeBases/`. + * name: 'projects/my-project/agent/knowledgeBases/my-knowledgeBase', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "languageCode": "my_languageCode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.knowledgeBases.get * @memberOf! () * @@ -7892,6 +10474,56 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.knowledgeBases.list * @desc Returns the list of all knowledge bases of the specified agent. Note: The `projects.agent.knowledgeBases` resource is deprecated; only use `projects.knowledgeBases`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.knowledgeBases.list({ + * // Optional. The maximum number of items to return in a single page. By + * // default 10 and at most 100. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The project to list of knowledge bases for. + * // Format: `projects/`. + * parent: 'projects/my-project/agent', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "knowledgeBases": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.knowledgeBases.list * @memberOf! () * @@ -7994,6 +10626,67 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.knowledgeBases.patch * @desc Updates the specified knowledge base. Note: The `projects.agent.knowledgeBases` resource is deprecated; only use `projects.knowledgeBases`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.knowledgeBases.patch({ + * // The knowledge base resource name. + * // The name must be empty when creating a knowledge base. + * // Format: `projects//knowledgeBases/`. + * name: 'projects/my-project/agent/knowledgeBases/my-knowledgeBase', + * // Optional. Not specified means `update all`. + * // Currently, only `display_name` can be updated, an InvalidArgument will be + * // returned for attempting to update other fields. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "languageCode": "my_languageCode", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "languageCode": "my_languageCode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.knowledgeBases.patch * @memberOf! () * @@ -8184,6 +10877,70 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.knowledgeBases.documents.create * @desc Creates a new document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.knowledgeBases.documents.create({ + * // Required. The knoweldge base to create a document for. + * // Format: `projects//knowledgeBases/`. + * parent: 'projects/my-project/agent/knowledgeBases/my-knowledgeBase', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "content": "my_content", + * // "contentUri": "my_contentUri", + * // "displayName": "my_displayName", + * // "enableAutoReload": false, + * // "knowledgeTypes": [], + * // "latestReloadStatus": {}, + * // "mimeType": "my_mimeType", + * // "name": "my_name", + * // "rawContent": "my_rawContent" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.knowledgeBases.documents.create * @memberOf! () * @@ -8266,6 +11023,56 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.knowledgeBases.documents.delete * @desc Deletes the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.knowledgeBases.documents.delete({ + * // The name of the document to delete. + * // Format: `projects//knowledgeBases//documents/`. + * name: + * 'projects/my-project/agent/knowledgeBases/my-knowledgeBase/documents/my-document', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.knowledgeBases.documents.delete * @memberOf! () * @@ -8344,6 +11151,60 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.knowledgeBases.documents.get * @desc Retrieves the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.knowledgeBases.documents.get({ + * // Required. The name of the document to retrieve. + * // Format `projects//knowledgeBases//documents/`. + * name: + * 'projects/my-project/agent/knowledgeBases/my-knowledgeBase/documents/my-document', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "content": "my_content", + * // "contentUri": "my_contentUri", + * // "displayName": "my_displayName", + * // "enableAutoReload": false, + * // "knowledgeTypes": [], + * // "latestReloadStatus": {}, + * // "mimeType": "my_mimeType", + * // "name": "my_name", + * // "rawContent": "my_rawContent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.knowledgeBases.documents.get * @memberOf! () * @@ -8432,6 +11293,56 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.knowledgeBases.documents.list * @desc Returns the list of all documents of the knowledge base. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.knowledgeBases.documents.list({ + * // Optional. The maximum number of items to return in a single page. By + * // default 10 and at most 100. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The knowledge base to list all documents for. + * // Format: `projects//knowledgeBases/`. + * parent: 'projects/my-project/agent/knowledgeBases/my-knowledgeBase', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "documents": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.knowledgeBases.documents.list * @memberOf! () * @@ -8532,6 +11443,77 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.knowledgeBases.documents.patch * @desc Updates the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.knowledgeBases.documents.patch({ + * // The document resource name. + * // The name must be empty when creating a document. + * // Format: `projects//knowledgeBases//documents/`. + * name: + * 'projects/my-project/agent/knowledgeBases/my-knowledgeBase/documents/my-document', + * // Optional. Not specified means `update all`. + * // Currently, only `display_name` can be updated, an InvalidArgument will be + * // returned for attempting to update other fields. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "content": "my_content", + * // "contentUri": "my_contentUri", + * // "displayName": "my_displayName", + * // "enableAutoReload": false, + * // "knowledgeTypes": [], + * // "latestReloadStatus": {}, + * // "mimeType": "my_mimeType", + * // "name": "my_name", + * // "rawContent": "my_rawContent" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.knowledgeBases.documents.patch * @memberOf! () * @@ -8612,6 +11594,64 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.knowledgeBases.documents.reload * @desc Reloads the specified document from its specified source, content_uri or content. The previously loaded content of the document will be deleted. Note: Even when the content of the document has not changed, there still may be side effects because of internal implementation changes. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.knowledgeBases.documents.reload({ + * // The name of the document to reload. + * // Format: `projects//knowledgeBases//documents/` + * name: + * 'projects/my-project/agent/knowledgeBases/my-knowledgeBase/documents/my-document', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "gcsSource": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.knowledgeBases.documents.reload * @memberOf! () * @@ -8809,6 +11849,51 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.sessions.deleteContexts * @desc Deletes all active contexts in the specified session. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.deleteContexts({ + * // Required. The name of the session to delete all contexts from. Format: + * // `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * parent: 'projects/my-project/agent/sessions/my-session', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.deleteContexts * @memberOf! () * @@ -8885,6 +11970,74 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.sessions.detectIntent * @desc Processes a natural language query and returns structured, actionable data as a result. This method is not idempotent, because it may cause contexts and session entity types to be updated, which in turn might affect results of future queries. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.detectIntent({ + * // Required. The name of the session this query is sent to. Format: + * // `projects//agent/sessions/`, or + * // `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * // default 'draft' environment. If `User ID` is not specified, we are using + * // "-". It's up to the API caller to choose an appropriate `Session ID` and + * // `User Id`. They can be a random number or some type of user and session + * // identifiers (preferably hashed). The length of the `Session ID` and + * // `User ID` must not exceed 36 characters. + * session: 'projects/my-project/agent/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inputAudio": "my_inputAudio", + * // "outputAudioConfig": {}, + * // "outputAudioConfigMask": "my_outputAudioConfigMask", + * // "queryInput": {}, + * // "queryParams": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternativeQueryResults": [], + * // "outputAudio": "my_outputAudio", + * // "outputAudioConfig": {}, + * // "queryResult": {}, + * // "responseId": "my_responseId", + * // "webhookStatus": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.detectIntent * @memberOf! () * @@ -9021,6 +12174,66 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.sessions.contexts.create * @desc Creates a context. If the specified context already exists, overrides the context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.contexts.create({ + * // Required. The session to create a context for. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * // default 'draft' environment. If `User ID` is not specified, we assume + * // default '-' user. + * parent: 'projects/my-project/agent/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.contexts.create * @memberOf! () * @@ -9107,6 +12320,52 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.sessions.contexts.delete * @desc Deletes the specified context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.contexts.delete({ + * // Required. The name of the context to delete. Format: + * // `projects//agent/sessions//contexts/` + * // or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + * // not specified, we assume default 'draft' environment. If `User ID` is not + * // specified, we assume default '-' user. + * name: 'projects/my-project/agent/sessions/my-session/contexts/my-context', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.contexts.delete * @memberOf! () * @@ -9178,6 +12437,56 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.sessions.contexts.get * @desc Retrieves the specified context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.contexts.get({ + * // Required. The name of the context. Format: + * // `projects//agent/sessions//contexts/` + * // or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + * // not specified, we assume default 'draft' environment. If `User ID` is not + * // specified, we assume default '-' user. + * name: 'projects/my-project/agent/sessions/my-session/contexts/my-context', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.contexts.get * @memberOf! () * @@ -9260,6 +12569,60 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.sessions.contexts.list * @desc Returns the list of all contexts in the specified session. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.contexts.list({ + * // Optional. The maximum number of items to return in a single page. By + * // default 100 and at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The session to list all contexts from. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * // default 'draft' environment. If `User ID` is not specified, we assume + * // default '-' user. + * parent: 'projects/my-project/agent/sessions/my-session', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contexts": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.contexts.list * @memberOf! () * @@ -9360,6 +12723,79 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.sessions.contexts.patch * @desc Updates the specified context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.contexts.patch({ + * // Required. The unique identifier of the context. Format: + * // `projects//agent/sessions//contexts/`, + * // or `projects//agent/environments//users//sessions//contexts/`. + * // + * // The `Context ID` is always converted to lowercase, may only contain + * // characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + * // + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * // + * // The following context names are reserved for internal use by Dialogflow. + * // You should not use these contexts or create contexts with these names: + * // + * // * `__system_counters__` + * // * `*_id_dialog_context` + * // * `*_dialog_params_size` + * name: 'projects/my-project/agent/sessions/my-session/contexts/my-context', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.contexts.patch * @memberOf! () * @@ -9534,6 +12970,66 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.sessions.entityTypes.create * @desc Creates a session entity type. If the specified session entity type already exists, overrides the session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.entityTypes.create({ + * // Required. The session to create a session entity type for. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users// + * // sessions/`. If `Environment ID` is not specified, we assume + * // default 'draft' environment. If `User ID` is not specified, we assume + * // default '-' user. + * parent: 'projects/my-project/agent/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.entityTypes.create * @memberOf! () * @@ -9634,6 +13130,53 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.sessions.entityTypes.delete * @desc Deletes the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.entityTypes.delete({ + * // Required. The name of the entity type to delete. Format: + * // `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * name: + * 'projects/my-project/agent/sessions/my-session/entityTypes/my-entityType', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.entityTypes.delete * @memberOf! () * @@ -9705,6 +13248,57 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.sessions.entityTypes.get * @desc Retrieves the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.entityTypes.get({ + * // Required. The name of the session entity type. Format: + * // `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * name: + * 'projects/my-project/agent/sessions/my-session/entityTypes/my-entityType', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.entityTypes.get * @memberOf! () * @@ -9801,6 +13395,60 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.sessions.entityTypes.list * @desc Returns the list of all session entity types in the specified session. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.entityTypes.list({ + * // Optional. The maximum number of items to return in a single page. By + * // default 100 and at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The session to list all session entity types from. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users// + * // sessions/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * parent: 'projects/my-project/agent/sessions/my-session', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "sessionEntityTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.entityTypes.list * @memberOf! () * @@ -9903,6 +13551,73 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.agent.sessions.entityTypes.patch * @desc Updates the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.agent.sessions.entityTypes.patch({ + * // Required. The unique identifier of this session entity type. Format: + * // `projects//agent/sessions//entityTypes/`, or + * // `projects//agent/environments//users//sessions//entityTypes/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * // + * // `` must be the display name of an existing entity + * // type in the same agent that will be overridden or supplemented. + * name: + * 'projects/my-project/agent/sessions/my-session/entityTypes/my-entityType', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.agent.sessions.entityTypes.patch * @memberOf! () * @@ -10095,6 +13810,62 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.knowledgeBases.create * @desc Creates a knowledge base. Note: The `projects.agent.knowledgeBases` resource is deprecated; only use `projects.knowledgeBases`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.knowledgeBases.create({ + * // Required. The project to create a knowledge base for. + * // Format: `projects/`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "languageCode": "my_languageCode", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "languageCode": "my_languageCode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.knowledgeBases.create * @memberOf! () * @@ -10193,6 +13964,51 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.knowledgeBases.delete * @desc Deletes the specified knowledge base. Note: The `projects.agent.knowledgeBases` resource is deprecated; only use `projects.knowledgeBases`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.knowledgeBases.delete({ + * // Optional. Force deletes the knowledge base. When set to true, any documents + * // in the knowledge base are also deleted. + * force: 'placeholder-value', + * // Required. The name of the knowledge base to delete. + * // Format: `projects//knowledgeBases/`. + * name: 'projects/my-project/knowledgeBases/my-knowledgeBase', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.knowledgeBases.delete * @memberOf! () * @@ -10265,6 +14081,52 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.knowledgeBases.get * @desc Retrieves the specified knowledge base. Note: The `projects.agent.knowledgeBases` resource is deprecated; only use `projects.knowledgeBases`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.knowledgeBases.get({ + * // Required. The name of the knowledge base to retrieve. + * // Format `projects//knowledgeBases/`. + * name: 'projects/my-project/knowledgeBases/my-knowledgeBase', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "languageCode": "my_languageCode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.knowledgeBases.get * @memberOf! () * @@ -10359,6 +14221,56 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.knowledgeBases.list * @desc Returns the list of all knowledge bases of the specified agent. Note: The `projects.agent.knowledgeBases` resource is deprecated; only use `projects.knowledgeBases`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.knowledgeBases.list({ + * // Optional. The maximum number of items to return in a single page. By + * // default 10 and at most 100. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The project to list of knowledge bases for. + * // Format: `projects/`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "knowledgeBases": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.knowledgeBases.list * @memberOf! () * @@ -10461,10 +14373,71 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.knowledgeBases.patch * @desc Updates the specified knowledge base. Note: The `projects.agent.knowledgeBases` resource is deprecated; only use `projects.knowledgeBases`. - * @alias dialogflow.projects.knowledgeBases.patch - * @memberOf! () + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` * - * @param {object} params Parameters for request + * const {google} = require('googleapis'); + * const dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.knowledgeBases.patch({ + * // The knowledge base resource name. + * // The name must be empty when creating a knowledge base. + * // Format: `projects//knowledgeBases/`. + * name: 'projects/my-project/knowledgeBases/my-knowledgeBase', + * // Optional. Not specified means `update all`. + * // Currently, only `display_name` can be updated, an InvalidArgument will be + * // returned for attempting to update other fields. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "languageCode": "my_languageCode", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "languageCode": "my_languageCode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias dialogflow.projects.knowledgeBases.patch + * @memberOf! () + * + * @param {object} params Parameters for request * @param {string} params.name The knowledge base resource name. The name must be empty when creating a knowledge base. Format: `projects//knowledgeBases/`. * @param {string=} params.updateMask Optional. Not specified means `update all`. Currently, only `display_name` can be updated, an InvalidArgument will be returned for attempting to update other fields. * @param {().GoogleCloudDialogflowV2beta1KnowledgeBase} params.requestBody Request body data @@ -10651,6 +14624,70 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.knowledgeBases.documents.create * @desc Creates a new document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.knowledgeBases.documents.create({ + * // Required. The knoweldge base to create a document for. + * // Format: `projects//knowledgeBases/`. + * parent: 'projects/my-project/knowledgeBases/my-knowledgeBase', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "content": "my_content", + * // "contentUri": "my_contentUri", + * // "displayName": "my_displayName", + * // "enableAutoReload": false, + * // "knowledgeTypes": [], + * // "latestReloadStatus": {}, + * // "mimeType": "my_mimeType", + * // "name": "my_name", + * // "rawContent": "my_rawContent" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.knowledgeBases.documents.create * @memberOf! () * @@ -10733,6 +14770,56 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.knowledgeBases.documents.delete * @desc Deletes the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.knowledgeBases.documents.delete({ + * // The name of the document to delete. + * // Format: `projects//knowledgeBases//documents/`. + * name: + * 'projects/my-project/knowledgeBases/my-knowledgeBase/documents/my-document', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.knowledgeBases.documents.delete * @memberOf! () * @@ -10811,6 +14898,60 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.knowledgeBases.documents.get * @desc Retrieves the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.knowledgeBases.documents.get({ + * // Required. The name of the document to retrieve. + * // Format `projects//knowledgeBases//documents/`. + * name: + * 'projects/my-project/knowledgeBases/my-knowledgeBase/documents/my-document', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "content": "my_content", + * // "contentUri": "my_contentUri", + * // "displayName": "my_displayName", + * // "enableAutoReload": false, + * // "knowledgeTypes": [], + * // "latestReloadStatus": {}, + * // "mimeType": "my_mimeType", + * // "name": "my_name", + * // "rawContent": "my_rawContent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.knowledgeBases.documents.get * @memberOf! () * @@ -10899,6 +15040,56 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.knowledgeBases.documents.list * @desc Returns the list of all documents of the knowledge base. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.knowledgeBases.documents.list({ + * // Optional. The maximum number of items to return in a single page. By + * // default 10 and at most 100. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The knowledge base to list all documents for. + * // Format: `projects//knowledgeBases/`. + * parent: 'projects/my-project/knowledgeBases/my-knowledgeBase', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "documents": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.knowledgeBases.documents.list * @memberOf! () * @@ -10999,6 +15190,77 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.knowledgeBases.documents.patch * @desc Updates the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.knowledgeBases.documents.patch({ + * // The document resource name. + * // The name must be empty when creating a document. + * // Format: `projects//knowledgeBases//documents/`. + * name: + * 'projects/my-project/knowledgeBases/my-knowledgeBase/documents/my-document', + * // Optional. Not specified means `update all`. + * // Currently, only `display_name` can be updated, an InvalidArgument will be + * // returned for attempting to update other fields. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "content": "my_content", + * // "contentUri": "my_contentUri", + * // "displayName": "my_displayName", + * // "enableAutoReload": false, + * // "knowledgeTypes": [], + * // "latestReloadStatus": {}, + * // "mimeType": "my_mimeType", + * // "name": "my_name", + * // "rawContent": "my_rawContent" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.knowledgeBases.documents.patch * @memberOf! () * @@ -11079,6 +15341,64 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.knowledgeBases.documents.reload * @desc Reloads the specified document from its specified source, content_uri or content. The previously loaded content of the document will be deleted. Note: Even when the content of the document has not changed, there still may be side effects because of internal implementation changes. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use `projects.knowledgeBases.documents`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.knowledgeBases.documents.reload({ + * // The name of the document to reload. + * // Format: `projects//knowledgeBases//documents/` + * name: + * 'projects/my-project/knowledgeBases/my-knowledgeBase/documents/my-document', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "gcsSource": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.knowledgeBases.documents.reload * @memberOf! () * @@ -11274,6 +15594,48 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.deleteAgent * @desc Deletes the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.deleteAgent({ + * // Required. The project that the agent to delete is associated with. + * // Format: `projects/`. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.deleteAgent * @memberOf! () * @@ -11350,6 +15712,61 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.getAgent * @desc Retrieves the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.getAgent({ + * // Required. The project that the agent to fetch is associated with. + * // Format: `projects/`. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "avatarUri": "my_avatarUri", + * // "classificationThreshold": {}, + * // "defaultLanguageCode": "my_defaultLanguageCode", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "enableLogging": false, + * // "matchMode": "my_matchMode", + * // "parent": "my_parent", + * // "supportedLanguageCodes": [], + * // "tier": "my_tier", + * // "timeZone": "my_timeZone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.getAgent * @memberOf! () * @@ -11433,6 +15850,82 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.setAgent * @desc Creates/updates the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.setAgent({ + * // Required. The project of this agent. + * // Format: `projects/`. + * parent: 'projects/my-project/locations/my-location', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "avatarUri": "my_avatarUri", + * // "classificationThreshold": {}, + * // "defaultLanguageCode": "my_defaultLanguageCode", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "enableLogging": false, + * // "matchMode": "my_matchMode", + * // "parent": "my_parent", + * // "supportedLanguageCodes": [], + * // "tier": "my_tier", + * // "timeZone": "my_timeZone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "avatarUri": "my_avatarUri", + * // "classificationThreshold": {}, + * // "defaultLanguageCode": "my_defaultLanguageCode", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "enableLogging": false, + * // "matchMode": "my_matchMode", + * // "parent": "my_parent", + * // "supportedLanguageCodes": [], + * // "tier": "my_tier", + * // "timeZone": "my_timeZone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.setAgent * @memberOf! () * @@ -11587,6 +16080,62 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.export * @desc Exports the specified agent to a ZIP file. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.export({ + * // Required. The project that the agent to export is associated with. + * // Format: `projects/`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "agentUri": "my_agentUri" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.export * @memberOf! () * @@ -11669,6 +16218,69 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.fulfillment * @desc Updates the fulfillment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.fulfillment({ + * // Required. The unique identifier of the fulfillment. + * // Format: `projects//agent/fulfillment`. + * name: 'projects/my-project/locations/my-location/agent/fulfillment', + * // Required. The mask to control which fields get updated. If the mask is not + * // present, all fields will be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "enabled": false, + * // "features": [], + * // "genericWebService": {}, + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "enabled": false, + * // "features": [], + * // "genericWebService": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.fulfillment * @memberOf! () * @@ -11759,6 +16371,54 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.getFulfillment * @desc Retrieves the fulfillment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.getFulfillment({ + * // Required. The name of the fulfillment. + * // Format: `projects//agent/fulfillment`. + * name: 'projects/my-project/locations/my-location/agent/fulfillment', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "enabled": false, + * // "features": [], + * // "genericWebService": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.getFulfillment * @memberOf! () * @@ -11847,6 +16507,63 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.import * @desc Imports the specified agent from a ZIP file. Uploads new intents and entity types without deleting the existing ones. Intents and entity types with the same name are replaced with the new versions from ImportAgentRequest. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.import({ + * // Required. The project that the agent to import is associated with. + * // Format: `projects/`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "agentContent": "my_agentContent", + * // "agentUri": "my_agentUri" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.import * @memberOf! () * @@ -11929,6 +16646,63 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.restore * @desc Restores the specified agent from a ZIP file. Replaces the current agent version with a new one. All the intents and entity types in the older version are deleted. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.restore({ + * // Required. The project that the agent to restore is associated with. + * // Format: `projects/`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "agentContent": "my_agentContent", + * // "agentUri": "my_agentUri" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.restore * @memberOf! () * @@ -12011,6 +16785,60 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.train * @desc Trains the specified agent. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.train({ + * // Required. The project that the agent to train is associated with. + * // Format: `projects/`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.train * @memberOf! () * @@ -12206,6 +17034,64 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.entityTypes.batchDelete * @desc Deletes entity types in the specified agent. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.entityTypes.batchDelete( + * { + * // Required. The name of the agent to delete all entities types for. Format: + * // `projects//agent`. + * parent: 'projects/my-project/locations/my-location/agent', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entityTypeNames": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.entityTypes.batchDelete * @memberOf! () * @@ -12287,6 +17173,67 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.entityTypes.batchUpdate * @desc Updates/Creates multiple entity types in the specified agent. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.entityTypes.batchUpdate( + * { + * // Required. The name of the agent to update or create entity types in. + * // Format: `projects//agent`. + * parent: 'projects/my-project/locations/my-location/agent', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entityTypeBatchInline": {}, + * // "entityTypeBatchUri": "my_entityTypeBatchUri", + * // "languageCode": "my_languageCode", + * // "updateMask": "my_updateMask" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.entityTypes.batchUpdate * @memberOf! () * @@ -12368,6 +17315,74 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.entityTypes.create * @desc Creates an entity type in the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.entityTypes.create({ + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // Required. The agent to create a entity type for. + * // Format: `projects//agent`. + * parent: 'projects/my-project/locations/my-location/agent', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoExpansionMode": "my_autoExpansionMode", + * // "displayName": "my_displayName", + * // "enableFuzzyExtraction": false, + * // "entities": [], + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoExpansionMode": "my_autoExpansionMode", + * // "displayName": "my_displayName", + * // "enableFuzzyExtraction": false, + * // "entities": [], + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.entityTypes.create * @memberOf! () * @@ -12461,6 +17476,49 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.entityTypes.delete * @desc Deletes the specified entity type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.entityTypes.delete({ + * // Required. The name of the entity type to delete. + * // Format: `projects//agent/entityTypes/`. + * name: + * 'projects/my-project/locations/my-location/agent/entityTypes/my-entityType', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.entityTypes.delete * @memberOf! () * @@ -12532,6 +17590,62 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.entityTypes.get * @desc Retrieves the specified entity type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.entityTypes.get({ + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // Required. The name of the entity type. + * // Format: `projects//agent/entityTypes/`. + * name: + * 'projects/my-project/locations/my-location/agent/entityTypes/my-entityType', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoExpansionMode": "my_autoExpansionMode", + * // "displayName": "my_displayName", + * // "enableFuzzyExtraction": false, + * // "entities": [], + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.entityTypes.get * @memberOf! () * @@ -12621,6 +17735,62 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.entityTypes.list * @desc Returns the list of all entity types in the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.entityTypes.list({ + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // Optional. The maximum number of items to return in a single page. By + * // default 100 and at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The agent to list all entity types from. + * // Format: `projects//agent`. + * parent: 'projects/my-project/locations/my-location/agent', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entityTypes": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.entityTypes.list * @memberOf! () * @@ -12724,6 +17894,79 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.entityTypes.patch * @desc Updates the specified entity type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.entityTypes.patch({ + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // The unique identifier of the entity type. + * // Required for EntityTypes.UpdateEntityType and + * // EntityTypes.BatchUpdateEntityTypes methods. + * // Format: `projects//agent/entityTypes/`. + * name: + * 'projects/my-project/locations/my-location/agent/entityTypes/my-entityType', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoExpansionMode": "my_autoExpansionMode", + * // "displayName": "my_displayName", + * // "enableFuzzyExtraction": false, + * // "entities": [], + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoExpansionMode": "my_autoExpansionMode", + * // "displayName": "my_displayName", + * // "enableFuzzyExtraction": false, + * // "entities": [], + * // "kind": "my_kind", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.entityTypes.patch * @memberOf! () * @@ -12955,6 +18198,66 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.entityTypes.entities.batchCreate * @desc Creates multiple new entities in the specified entity type. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.entityTypes.entities.batchCreate( + * { + * // Required. The name of the entity type to create entities in. Format: + * // `projects//agent/entityTypes/`. + * parent: + * 'projects/my-project/locations/my-location/agent/entityTypes/my-entityType', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entities": [], + * // "languageCode": "my_languageCode" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.entityTypes.entities.batchCreate * @memberOf! () * @@ -13037,6 +18340,66 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.entityTypes.entities.batchDelete * @desc Deletes entities in the specified entity type. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.entityTypes.entities.batchDelete( + * { + * // Required. The name of the entity type to delete entries for. Format: + * // `projects//agent/entityTypes/`. + * parent: + * 'projects/my-project/locations/my-location/agent/entityTypes/my-entityType', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entityValues": [], + * // "languageCode": "my_languageCode" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.entityTypes.entities.batchDelete * @memberOf! () * @@ -13119,6 +18482,67 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.entityTypes.entities.batchUpdate * @desc Updates or creates multiple entities in the specified entity type. This method does not affect entities in the entity type that aren't explicitly specified in the request. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.entityTypes.entities.batchUpdate( + * { + * // Required. The name of the entity type to update or create entities in. + * // Format: `projects//agent/entityTypes/`. + * parent: + * 'projects/my-project/locations/my-location/agent/entityTypes/my-entityType', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entities": [], + * // "languageCode": "my_languageCode", + * // "updateMask": "my_updateMask" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.entityTypes.entities.batchUpdate * @memberOf! () * @@ -13264,6 +18688,56 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.environments.list * @desc Returns the list of all non-draft environments of the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.environments.list({ + * // Optional. The maximum number of items to return in a single page. By default 100 and + * // at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The agent to list all environments from. + * // Format: `projects//agent`. + * parent: 'projects/my-project/locations/my-location/agent', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "environments": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.environments.list * @memberOf! () * @@ -13413,6 +18887,54 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.environments.users.sessions.deleteContexts * @desc Deletes all active contexts in the specified session. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.environments.users.sessions.deleteContexts( + * { + * // Required. The name of the session to delete all contexts from. Format: + * // `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * parent: + * 'projects/my-project/locations/my-location/agent/environments/my-environment/users/my-user/sessions/my-session', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.environments.users.sessions.deleteContexts * @memberOf! () * @@ -13489,6 +19011,77 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.environments.users.sessions.detectIntent * @desc Processes a natural language query and returns structured, actionable data as a result. This method is not idempotent, because it may cause contexts and session entity types to be updated, which in turn might affect results of future queries. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.environments.users.sessions.detectIntent( + * { + * // Required. The name of the session this query is sent to. Format: + * // `projects//agent/sessions/`, or + * // `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * // default 'draft' environment. If `User ID` is not specified, we are using + * // "-". It's up to the API caller to choose an appropriate `Session ID` and + * // `User Id`. They can be a random number or some type of user and session + * // identifiers (preferably hashed). The length of the `Session ID` and + * // `User ID` must not exceed 36 characters. + * session: + * 'projects/my-project/locations/my-location/agent/environments/my-environment/users/my-user/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inputAudio": "my_inputAudio", + * // "outputAudioConfig": {}, + * // "outputAudioConfigMask": "my_outputAudioConfigMask", + * // "queryInput": {}, + * // "queryParams": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "alternativeQueryResults": [], + * // "outputAudio": "my_outputAudio", + * // "outputAudioConfig": {}, + * // "queryResult": {}, + * // "responseId": "my_responseId", + * // "webhookStatus": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.environments.users.sessions.detectIntent * @memberOf! () * @@ -13625,6 +19218,69 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.environments.users.sessions.contexts.create * @desc Creates a context. If the specified context already exists, overrides the context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.environments.users.sessions.contexts.create( + * { + * // Required. The session to create a context for. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * // default 'draft' environment. If `User ID` is not specified, we assume + * // default '-' user. + * parent: + * 'projects/my-project/locations/my-location/agent/environments/my-environment/users/my-user/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.environments.users.sessions.contexts.create * @memberOf! () * @@ -13711,6 +19367,55 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.environments.users.sessions.contexts.delete * @desc Deletes the specified context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.environments.users.sessions.contexts.delete( + * { + * // Required. The name of the context to delete. Format: + * // `projects//agent/sessions//contexts/` + * // or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + * // not specified, we assume default 'draft' environment. If `User ID` is not + * // specified, we assume default '-' user. + * name: + * 'projects/my-project/locations/my-location/agent/environments/my-environment/users/my-user/sessions/my-session/contexts/my-context', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.environments.users.sessions.contexts.delete * @memberOf! () * @@ -13782,6 +19487,59 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.environments.users.sessions.contexts.get * @desc Retrieves the specified context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.environments.users.sessions.contexts.get( + * { + * // Required. The name of the context. Format: + * // `projects//agent/sessions//contexts/` + * // or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + * // not specified, we assume default 'draft' environment. If `User ID` is not + * // specified, we assume default '-' user. + * name: + * 'projects/my-project/locations/my-location/agent/environments/my-environment/users/my-user/sessions/my-session/contexts/my-context', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.environments.users.sessions.contexts.get * @memberOf! () * @@ -13864,6 +19622,63 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.environments.users.sessions.contexts.list * @desc Returns the list of all contexts in the specified session. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.environments.users.sessions.contexts.list( + * { + * // Optional. The maximum number of items to return in a single page. By + * // default 100 and at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The session to list all contexts from. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * // default 'draft' environment. If `User ID` is not specified, we assume + * // default '-' user. + * parent: + * 'projects/my-project/locations/my-location/agent/environments/my-environment/users/my-user/sessions/my-session', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contexts": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.environments.users.sessions.contexts.list * @memberOf! () * @@ -13964,6 +19779,82 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.environments.users.sessions.contexts.patch * @desc Updates the specified context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.environments.users.sessions.contexts.patch( + * { + * // Required. The unique identifier of the context. Format: + * // `projects//agent/sessions//contexts/`, + * // or `projects//agent/environments//users//sessions//contexts/`. + * // + * // The `Context ID` is always converted to lowercase, may only contain + * // characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + * // + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * // + * // The following context names are reserved for internal use by Dialogflow. + * // You should not use these contexts or create contexts with these names: + * // + * // * `__system_counters__` + * // * `*_id_dialog_context` + * // * `*_dialog_params_size` + * name: + * 'projects/my-project/locations/my-location/agent/environments/my-environment/users/my-user/sessions/my-session/contexts/my-context', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.environments.users.sessions.contexts.patch * @memberOf! () * @@ -14138,6 +20029,69 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.environments.users.sessions.entityTypes.create * @desc Creates a session entity type. If the specified session entity type already exists, overrides the session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.environments.users.sessions.entityTypes.create( + * { + * // Required. The session to create a session entity type for. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users// + * // sessions/`. If `Environment ID` is not specified, we assume + * // default 'draft' environment. If `User ID` is not specified, we assume + * // default '-' user. + * parent: + * 'projects/my-project/locations/my-location/agent/environments/my-environment/users/my-user/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.environments.users.sessions.entityTypes.create * @memberOf! () * @@ -14238,6 +20192,55 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.environments.users.sessions.entityTypes.delete * @desc Deletes the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.environments.users.sessions.entityTypes.delete( + * { + * // Required. The name of the entity type to delete. Format: + * // `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * name: + * 'projects/my-project/locations/my-location/agent/environments/my-environment/users/my-user/sessions/my-session/entityTypes/my-entityType', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.environments.users.sessions.entityTypes.delete * @memberOf! () * @@ -14309,6 +20312,59 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.environments.users.sessions.entityTypes.get * @desc Retrieves the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.environments.users.sessions.entityTypes.get( + * { + * // Required. The name of the session entity type. Format: + * // `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * name: + * 'projects/my-project/locations/my-location/agent/environments/my-environment/users/my-user/sessions/my-session/entityTypes/my-entityType', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.environments.users.sessions.entityTypes.get * @memberOf! () * @@ -14405,6 +20461,63 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.environments.users.sessions.entityTypes.list * @desc Returns the list of all session entity types in the specified session. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.environments.users.sessions.entityTypes.list( + * { + * // Optional. The maximum number of items to return in a single page. By + * // default 100 and at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The session to list all session entity types from. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users// + * // sessions/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * parent: + * 'projects/my-project/locations/my-location/agent/environments/my-environment/users/my-user/sessions/my-session', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "sessionEntityTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.environments.users.sessions.entityTypes.list * @memberOf! () * @@ -14507,6 +20620,75 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.environments.users.sessions.entityTypes.patch * @desc Updates the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.environments.users.sessions.entityTypes.patch( + * { + * // Required. The unique identifier of this session entity type. Format: + * // `projects//agent/sessions//entityTypes/`, or + * // `projects//agent/environments//users//sessions//entityTypes/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * // + * // `` must be the display name of an existing entity + * // type in the same agent that will be overridden or supplemented. + * name: + * 'projects/my-project/locations/my-location/agent/environments/my-environment/users/my-user/sessions/my-session/entityTypes/my-entityType', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.environments.users.sessions.entityTypes.patch * @memberOf! () * @@ -14695,6 +20877,62 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.intents.batchDelete * @desc Deletes intents in the specified agent. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.intents.batchDelete({ + * // Required. The name of the agent to delete all entities types for. Format: + * // `projects//agent`. + * parent: 'projects/my-project/locations/my-location/agent', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "intents": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.intents.batchDelete * @memberOf! () * @@ -14777,6 +21015,66 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.intents.batchUpdate * @desc Updates/Creates multiple intents in the specified agent. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.intents.batchUpdate({ + * // Required. The name of the agent to update or create intents in. + * // Format: `projects//agent`. + * parent: 'projects/my-project/locations/my-location/agent', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "intentBatchInline": {}, + * // "intentBatchUri": "my_intentBatchUri", + * // "intentView": "my_intentView", + * // "languageCode": "my_languageCode", + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.intents.batchUpdate * @memberOf! () * @@ -14859,6 +21157,104 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.intents.create * @desc Creates an intent in the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.intents.create({ + * // Optional. The resource view to apply to the returned intent. + * intentView: 'placeholder-value', + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // Required. The agent to create a intent for. + * // Format: `projects//agent`. + * parent: 'projects/my-project/locations/my-location/agent', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "defaultResponsePlatforms": [], + * // "displayName": "my_displayName", + * // "endInteraction": false, + * // "events": [], + * // "followupIntentInfo": [], + * // "inputContextNames": [], + * // "isFallback": false, + * // "messages": [], + * // "mlDisabled": false, + * // "mlEnabled": false, + * // "name": "my_name", + * // "outputContexts": [], + * // "parameters": [], + * // "parentFollowupIntentName": "my_parentFollowupIntentName", + * // "priority": 0, + * // "resetContexts": false, + * // "rootFollowupIntentName": "my_rootFollowupIntentName", + * // "trainingPhrases": [], + * // "webhookState": "my_webhookState" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "defaultResponsePlatforms": [], + * // "displayName": "my_displayName", + * // "endInteraction": false, + * // "events": [], + * // "followupIntentInfo": [], + * // "inputContextNames": [], + * // "isFallback": false, + * // "messages": [], + * // "mlDisabled": false, + * // "mlEnabled": false, + * // "name": "my_name", + * // "outputContexts": [], + * // "parameters": [], + * // "parentFollowupIntentName": "my_parentFollowupIntentName", + * // "priority": 0, + * // "resetContexts": false, + * // "rootFollowupIntentName": "my_rootFollowupIntentName", + * // "trainingPhrases": [], + * // "webhookState": "my_webhookState" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.intents.create * @memberOf! () * @@ -14945,6 +21341,50 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.intents.delete * @desc Deletes the specified intent and its direct or indirect followup intents. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.intents.delete({ + * // Required. The name of the intent to delete. If this intent has direct or + * // indirect followup intents, we also delete them. + * // + * // Format: `projects//agent/intents/`. + * name: 'projects/my-project/locations/my-location/agent/intents/my-intent', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.intents.delete * @memberOf! () * @@ -15016,6 +21456,77 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.intents.get * @desc Retrieves the specified intent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.intents.get({ + * // Optional. The resource view to apply to the returned intent. + * intentView: 'placeholder-value', + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // Required. The name of the intent. + * // Format: `projects//agent/intents/`. + * name: 'projects/my-project/locations/my-location/agent/intents/my-intent', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "defaultResponsePlatforms": [], + * // "displayName": "my_displayName", + * // "endInteraction": false, + * // "events": [], + * // "followupIntentInfo": [], + * // "inputContextNames": [], + * // "isFallback": false, + * // "messages": [], + * // "mlDisabled": false, + * // "mlEnabled": false, + * // "name": "my_name", + * // "outputContexts": [], + * // "parameters": [], + * // "parentFollowupIntentName": "my_parentFollowupIntentName", + * // "priority": 0, + * // "resetContexts": false, + * // "rootFollowupIntentName": "my_rootFollowupIntentName", + * // "trainingPhrases": [], + * // "webhookState": "my_webhookState" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.intents.get * @memberOf! () * @@ -15098,6 +21609,64 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.intents.list * @desc Returns the list of all intents in the specified agent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.intents.list({ + * // Optional. The resource view to apply to the returned intent. + * intentView: 'placeholder-value', + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // Optional. The maximum number of items to return in a single page. By + * // default 100 and at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The agent to list all intents from. + * // Format: `projects//agent`. + * parent: 'projects/my-project/locations/my-location/agent', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "intents": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.intents.list * @memberOf! () * @@ -15200,6 +21769,108 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.intents.patch * @desc Updates the specified intent. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.intents.patch({ + * // Optional. The resource view to apply to the returned intent. + * intentView: 'placeholder-value', + * // Optional. The language used to access language-specific data. + * // If not specified, the agent's default language is used. + * // For more information, see + * // [Multilingual intent and entity + * // data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * languageCode: 'placeholder-value', + * // The unique identifier of this intent. + * // Required for Intents.UpdateIntent and Intents.BatchUpdateIntents + * // methods. + * // Format: `projects//agent/intents/`. + * name: 'projects/my-project/locations/my-location/agent/intents/my-intent', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "defaultResponsePlatforms": [], + * // "displayName": "my_displayName", + * // "endInteraction": false, + * // "events": [], + * // "followupIntentInfo": [], + * // "inputContextNames": [], + * // "isFallback": false, + * // "messages": [], + * // "mlDisabled": false, + * // "mlEnabled": false, + * // "name": "my_name", + * // "outputContexts": [], + * // "parameters": [], + * // "parentFollowupIntentName": "my_parentFollowupIntentName", + * // "priority": 0, + * // "resetContexts": false, + * // "rootFollowupIntentName": "my_rootFollowupIntentName", + * // "trainingPhrases": [], + * // "webhookState": "my_webhookState" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "defaultResponsePlatforms": [], + * // "displayName": "my_displayName", + * // "endInteraction": false, + * // "events": [], + * // "followupIntentInfo": [], + * // "inputContextNames": [], + * // "isFallback": false, + * // "messages": [], + * // "mlDisabled": false, + * // "mlEnabled": false, + * // "name": "my_name", + * // "outputContexts": [], + * // "parameters": [], + * // "parentFollowupIntentName": "my_parentFollowupIntentName", + * // "priority": 0, + * // "resetContexts": false, + * // "rootFollowupIntentName": "my_rootFollowupIntentName", + * // "trainingPhrases": [], + * // "webhookState": "my_webhookState" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.intents.patch * @memberOf! () * @@ -15448,6 +22119,54 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.sessions.deleteContexts * @desc Deletes all active contexts in the specified session. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.sessions.deleteContexts( + * { + * // Required. The name of the session to delete all contexts from. Format: + * // `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * parent: + * 'projects/my-project/locations/my-location/agent/sessions/my-session', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.sessions.deleteContexts * @memberOf! () * @@ -15524,6 +22243,75 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.sessions.detectIntent * @desc Processes a natural language query and returns structured, actionable data as a result. This method is not idempotent, because it may cause contexts and session entity types to be updated, which in turn might affect results of future queries. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.sessions.detectIntent({ + * // Required. The name of the session this query is sent to. Format: + * // `projects//agent/sessions/`, or + * // `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * // default 'draft' environment. If `User ID` is not specified, we are using + * // "-". It's up to the API caller to choose an appropriate `Session ID` and + * // `User Id`. They can be a random number or some type of user and session + * // identifiers (preferably hashed). The length of the `Session ID` and + * // `User ID` must not exceed 36 characters. + * session: + * 'projects/my-project/locations/my-location/agent/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inputAudio": "my_inputAudio", + * // "outputAudioConfig": {}, + * // "outputAudioConfigMask": "my_outputAudioConfigMask", + * // "queryInput": {}, + * // "queryParams": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternativeQueryResults": [], + * // "outputAudio": "my_outputAudio", + * // "outputAudioConfig": {}, + * // "queryResult": {}, + * // "responseId": "my_responseId", + * // "webhookStatus": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.sessions.detectIntent * @memberOf! () * @@ -15660,6 +22448,69 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.sessions.contexts.create * @desc Creates a context. If the specified context already exists, overrides the context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.sessions.contexts.create( + * { + * // Required. The session to create a context for. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * // default 'draft' environment. If `User ID` is not specified, we assume + * // default '-' user. + * parent: + * 'projects/my-project/locations/my-location/agent/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.sessions.contexts.create * @memberOf! () * @@ -15746,6 +22597,55 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.sessions.contexts.delete * @desc Deletes the specified context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.sessions.contexts.delete( + * { + * // Required. The name of the context to delete. Format: + * // `projects//agent/sessions//contexts/` + * // or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + * // not specified, we assume default 'draft' environment. If `User ID` is not + * // specified, we assume default '-' user. + * name: + * 'projects/my-project/locations/my-location/agent/sessions/my-session/contexts/my-context', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.sessions.contexts.delete * @memberOf! () * @@ -15817,6 +22717,57 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.sessions.contexts.get * @desc Retrieves the specified context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.sessions.contexts.get({ + * // Required. The name of the context. Format: + * // `projects//agent/sessions//contexts/` + * // or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + * // not specified, we assume default 'draft' environment. If `User ID` is not + * // specified, we assume default '-' user. + * name: + * 'projects/my-project/locations/my-location/agent/sessions/my-session/contexts/my-context', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.sessions.contexts.get * @memberOf! () * @@ -15899,6 +22850,61 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.sessions.contexts.list * @desc Returns the list of all contexts in the specified session. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.sessions.contexts.list({ + * // Optional. The maximum number of items to return in a single page. By + * // default 100 and at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The session to list all contexts from. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * // default 'draft' environment. If `User ID` is not specified, we assume + * // default '-' user. + * parent: + * 'projects/my-project/locations/my-location/agent/sessions/my-session', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contexts": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.sessions.contexts.list * @memberOf! () * @@ -15999,6 +23005,82 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.sessions.contexts.patch * @desc Updates the specified context. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.sessions.contexts.patch( + * { + * // Required. The unique identifier of the context. Format: + * // `projects//agent/sessions//contexts/`, + * // or `projects//agent/environments//users//sessions//contexts/`. + * // + * // The `Context ID` is always converted to lowercase, may only contain + * // characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + * // + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * // + * // The following context names are reserved for internal use by Dialogflow. + * // You should not use these contexts or create contexts with these names: + * // + * // * `__system_counters__` + * // * `*_id_dialog_context` + * // * `*_dialog_params_size` + * name: + * 'projects/my-project/locations/my-location/agent/sessions/my-session/contexts/my-context', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "lifespanCount": 0, + * // "name": "my_name", + * // "parameters": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.sessions.contexts.patch * @memberOf! () * @@ -16173,6 +23255,69 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.sessions.entityTypes.create * @desc Creates a session entity type. If the specified session entity type already exists, overrides the session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.sessions.entityTypes.create( + * { + * // Required. The session to create a session entity type for. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users// + * // sessions/`. If `Environment ID` is not specified, we assume + * // default 'draft' environment. If `User ID` is not specified, we assume + * // default '-' user. + * parent: + * 'projects/my-project/locations/my-location/agent/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.sessions.entityTypes.create * @memberOf! () * @@ -16273,6 +23418,55 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.sessions.entityTypes.delete * @desc Deletes the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.sessions.entityTypes.delete( + * { + * // Required. The name of the entity type to delete. Format: + * // `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * name: + * 'projects/my-project/locations/my-location/agent/sessions/my-session/entityTypes/my-entityType', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.sessions.entityTypes.delete * @memberOf! () * @@ -16344,6 +23538,59 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.sessions.entityTypes.get * @desc Retrieves the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.sessions.entityTypes.get( + * { + * // Required. The name of the session entity type. Format: + * // `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * name: + * 'projects/my-project/locations/my-location/agent/sessions/my-session/entityTypes/my-entityType', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.sessions.entityTypes.get * @memberOf! () * @@ -16440,6 +23687,63 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.sessions.entityTypes.list * @desc Returns the list of all session entity types in the specified session. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.sessions.entityTypes.list( + * { + * // Optional. The maximum number of items to return in a single page. By + * // default 100 and at most 1000. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous list request. + * pageToken: 'placeholder-value', + * // Required. The session to list all session entity types from. + * // Format: `projects//agent/sessions/` or + * // `projects//agent/environments//users// + * // sessions/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * parent: + * 'projects/my-project/locations/my-location/agent/sessions/my-session', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "sessionEntityTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.sessions.entityTypes.list * @memberOf! () * @@ -16542,6 +23846,75 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.agent.sessions.entityTypes.patch * @desc Updates the specified session entity type. This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.agent.sessions.entityTypes.patch( + * { + * // Required. The unique identifier of this session entity type. Format: + * // `projects//agent/sessions//entityTypes/`, or + * // `projects//agent/environments//users//sessions//entityTypes/`. + * // If `Environment ID` is not specified, we assume default 'draft' + * // environment. If `User ID` is not specified, we assume default '-' user. + * // + * // `` must be the display name of an existing entity + * // type in the same agent that will be overridden or supplemented. + * name: + * 'projects/my-project/locations/my-location/agent/sessions/my-session/entityTypes/my-entityType', + * // Optional. The mask to control which fields get updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "entityOverrideMode": "my_entityOverrideMode", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.agent.sessions.entityTypes.patch * @memberOf! () * @@ -16730,6 +24103,47 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.operations.cancel * @memberOf! () * @@ -16804,6 +24218,53 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.operations.get * @memberOf! () * @@ -16882,6 +24343,56 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.locations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.locations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.locations.operations.list * @memberOf! () * @@ -17032,6 +24543,47 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.operations.cancel * @memberOf! () * @@ -17106,6 +24658,53 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.operations.get * @memberOf! () * @@ -17184,6 +24783,56 @@ export namespace dialogflow_v2beta1 { /** * dialogflow.projects.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dialogflow.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 dialogflow = google.dialogflow('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/dialogflow', + * ], + * }); + * + * // 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 dialogflow.projects.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dialogflow.projects.operations.list * @memberOf! () * diff --git a/src/apis/digitalassetlinks/v1.ts b/src/apis/digitalassetlinks/v1.ts index 6a603ec7b6f..24f2b0f54be 100644 --- a/src/apis/digitalassetlinks/v1.ts +++ b/src/apis/digitalassetlinks/v1.ts @@ -228,6 +228,186 @@ export namespace digitalassetlinks_v1 { /** * digitalassetlinks.assetlinks.check * @desc Determines whether the specified (directional) relationship exists between the specified source and target assets. The relation describes the intent of the link between the two assets as claimed by the source asset. An example for such relationships is the delegation of privileges or permissions. This command is most often used by infrastructure systems to check preconditions for an action. For example, a client may want to know if it is OK to send a web URL to a particular mobile app instead. The client can check for the relevant asset link from the website to the mobile app to decide if the operation should be allowed. A note about security: if you specify a secure asset as the source, such as an HTTPS website or an Android app, the API will ensure that any statements used to generate the response have been made in a secure way by the owner of that asset. Conversely, if the source asset is an insecure HTTP website (that is, the URL starts with `http://` instead of `https://`), the API cannot verify its statements securely, and it is not possible to ensure that the website's statements have not been altered by a third party. For more information, see the [Digital Asset Links technical design specification](https://github.com/google/digitalassetlinks/blob/master/well-known/details.md). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/digitalassetlinks.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 digitalassetlinks = google.digitalassetlinks('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: [], + * }); + * + * // 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 digitalassetlinks.assetlinks.check({ + * // Query string for the relation. + * // + * // We identify relations with strings of the format `/`, where + * // `` must be one of a set of pre-defined purpose categories, and + * // `` is a free-form lowercase alphanumeric string that describes the + * // specific use case of the statement. + * // + * // Refer to [our API documentation](/digital-asset-links/v1/relation-strings) + * // for the current list of supported relations. + * // + * // For a query to match an asset link, both the query's and the asset link's + * // relation strings must match exactly. + * // + * // Example: A query with relation `delegate_permission/common.handle_all_urls` + * // matches an asset link with relation + * // `delegate_permission/common.handle_all_urls`. + * relation: 'placeholder-value', + * // The uppercase SHA-265 fingerprint of the certificate. From the PEM + * // certificate, it can be acquired like this: + * // + * // $ keytool -printcert -file $CERTFILE | grep SHA256: + * // SHA256: 14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83: \ + * // 42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 + * // + * // or like this: + * // + * // $ openssl x509 -in $CERTFILE -noout -fingerprint -sha256 + * // SHA256 Fingerprint=14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64: \ + * // 16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 + * // + * // In this example, the contents of this field would be `14:6D:E9:83:C5:73: + * // 06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF: + * // 44:E5`. + * // + * // If these tools are not available to you, you can convert the PEM + * // certificate into the DER format, compute the SHA-256 hash of that string + * // and represent the result as a hexstring (that is, uppercase hexadecimal + * // representations of each octet, separated by colons). + * 'source.androidApp.certificate.sha256Fingerprint': 'placeholder-value', + * // Android App assets are naturally identified by their Java package name. + * // For example, the Google Maps app uses the package name + * // `com.google.android.apps.maps`. + * // REQUIRED + * 'source.androidApp.packageName': 'placeholder-value', + * // Web assets are identified by a URL that contains only the scheme, hostname + * // and port parts. The format is + * // + * // http[s]://[:] + * // + * // Hostnames must be fully qualified: they must end in a single period + * // ("`.`"). + * // + * // Only the schemes "http" and "https" are currently allowed. + * // + * // Port numbers are given as a decimal number, and they must be omitted if the + * // standard port numbers are used: 80 for http and 443 for https. + * // + * // We call this limited URL the "site". All URLs that share the same scheme, + * // hostname and port are considered to be a part of the site and thus belong + * // to the web asset. + * // + * // Example: the asset with the site `https://www.google.com` contains all + * // these URLs: + * // + * // * `https://www.google.com/` + * // * `https://www.google.com:443/` + * // * `https://www.google.com/foo` + * // * `https://www.google.com/foo?bar` + * // * `https://www.google.com/foo#bar` + * // * `https://user@password:www.google.com/` + * // + * // But it does not contain these URLs: + * // + * // * `http://www.google.com/` (wrong scheme) + * // * `https://google.com/` (hostname does not match) + * // * `https://www.google.com:444/` (port does not match) + * // REQUIRED + * 'source.web.site': 'placeholder-value', + * // The uppercase SHA-265 fingerprint of the certificate. From the PEM + * // certificate, it can be acquired like this: + * // + * // $ keytool -printcert -file $CERTFILE | grep SHA256: + * // SHA256: 14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83: \ + * // 42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 + * // + * // or like this: + * // + * // $ openssl x509 -in $CERTFILE -noout -fingerprint -sha256 + * // SHA256 Fingerprint=14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64: \ + * // 16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 + * // + * // In this example, the contents of this field would be `14:6D:E9:83:C5:73: + * // 06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF: + * // 44:E5`. + * // + * // If these tools are not available to you, you can convert the PEM + * // certificate into the DER format, compute the SHA-256 hash of that string + * // and represent the result as a hexstring (that is, uppercase hexadecimal + * // representations of each octet, separated by colons). + * 'target.androidApp.certificate.sha256Fingerprint': 'placeholder-value', + * // Android App assets are naturally identified by their Java package name. + * // For example, the Google Maps app uses the package name + * // `com.google.android.apps.maps`. + * // REQUIRED + * 'target.androidApp.packageName': 'placeholder-value', + * // Web assets are identified by a URL that contains only the scheme, hostname + * // and port parts. The format is + * // + * // http[s]://[:] + * // + * // Hostnames must be fully qualified: they must end in a single period + * // ("`.`"). + * // + * // Only the schemes "http" and "https" are currently allowed. + * // + * // Port numbers are given as a decimal number, and they must be omitted if the + * // standard port numbers are used: 80 for http and 443 for https. + * // + * // We call this limited URL the "site". All URLs that share the same scheme, + * // hostname and port are considered to be a part of the site and thus belong + * // to the web asset. + * // + * // Example: the asset with the site `https://www.google.com` contains all + * // these URLs: + * // + * // * `https://www.google.com/` + * // * `https://www.google.com:443/` + * // * `https://www.google.com/foo` + * // * `https://www.google.com/foo?bar` + * // * `https://www.google.com/foo#bar` + * // * `https://user@password:www.google.com/` + * // + * // But it does not contain these URLs: + * // + * // * `http://www.google.com/` (wrong scheme) + * // * `https://google.com/` (hostname does not match) + * // * `https://www.google.com:444/` (port does not match) + * // REQUIRED + * 'target.web.site': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "debugString": "my_debugString", + * // "errorCode": [], + * // "linked": false, + * // "maxAge": "my_maxAge" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias digitalassetlinks.assetlinks.check * @memberOf! () * @@ -351,6 +531,123 @@ export namespace digitalassetlinks_v1 { /** * digitalassetlinks.statements.list * @desc Retrieves a list of all statements from a given source that match the specified target and statement string. The API guarantees that all statements with secure source assets, such as HTTPS websites or Android apps, have been made in a secure way by the owner of those assets, as described in the [Digital Asset Links technical design specification](https://github.com/google/digitalassetlinks/blob/master/well-known/details.md). Specifically, you should consider that for insecure websites (that is, where the URL starts with `http://` instead of `https://`), this guarantee cannot be made. The `List` command is most useful in cases where the API client wants to know all the ways in which two assets are related, or enumerate all the relationships from a particular source asset. Example: a feature that helps users navigate to related items. When a mobile app is running on a device, the feature would make it easy to navigate to the corresponding web site or Google+ profile. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/digitalassetlinks.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 digitalassetlinks = google.digitalassetlinks('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: [], + * }); + * + * // 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 digitalassetlinks.statements.list({ + * // Use only associations that match the specified relation. + * // + * // See the [`Statement`](#Statement) message for a detailed definition of + * // relation strings. + * // + * // For a query to match a statement, one of the following must be true: + * // + * // * both the query's and the statement's relation strings match exactly, + * // or + * // * the query's relation string is empty or missing. + * // + * // Example: A query with relation `delegate_permission/common.handle_all_urls` + * // matches an asset link with relation + * // `delegate_permission/common.handle_all_urls`. + * relation: 'placeholder-value', + * // The uppercase SHA-265 fingerprint of the certificate. From the PEM + * // certificate, it can be acquired like this: + * // + * // $ keytool -printcert -file $CERTFILE | grep SHA256: + * // SHA256: 14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83: \ + * // 42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 + * // + * // or like this: + * // + * // $ openssl x509 -in $CERTFILE -noout -fingerprint -sha256 + * // SHA256 Fingerprint=14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64: \ + * // 16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 + * // + * // In this example, the contents of this field would be `14:6D:E9:83:C5:73: + * // 06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF: + * // 44:E5`. + * // + * // If these tools are not available to you, you can convert the PEM + * // certificate into the DER format, compute the SHA-256 hash of that string + * // and represent the result as a hexstring (that is, uppercase hexadecimal + * // representations of each octet, separated by colons). + * 'source.androidApp.certificate.sha256Fingerprint': 'placeholder-value', + * // Android App assets are naturally identified by their Java package name. + * // For example, the Google Maps app uses the package name + * // `com.google.android.apps.maps`. + * // REQUIRED + * 'source.androidApp.packageName': 'placeholder-value', + * // Web assets are identified by a URL that contains only the scheme, hostname + * // and port parts. The format is + * // + * // http[s]://[:] + * // + * // Hostnames must be fully qualified: they must end in a single period + * // ("`.`"). + * // + * // Only the schemes "http" and "https" are currently allowed. + * // + * // Port numbers are given as a decimal number, and they must be omitted if the + * // standard port numbers are used: 80 for http and 443 for https. + * // + * // We call this limited URL the "site". All URLs that share the same scheme, + * // hostname and port are considered to be a part of the site and thus belong + * // to the web asset. + * // + * // Example: the asset with the site `https://www.google.com` contains all + * // these URLs: + * // + * // * `https://www.google.com/` + * // * `https://www.google.com:443/` + * // * `https://www.google.com/foo` + * // * `https://www.google.com/foo?bar` + * // * `https://www.google.com/foo#bar` + * // * `https://user@password:www.google.com/` + * // + * // But it does not contain these URLs: + * // + * // * `http://www.google.com/` (wrong scheme) + * // * `https://google.com/` (hostname does not match) + * // * `https://www.google.com:444/` (port does not match) + * // REQUIRED + * 'source.web.site': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "debugString": "my_debugString", + * // "errorCode": [], + * // "maxAge": "my_maxAge", + * // "statements": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias digitalassetlinks.statements.list * @memberOf! () * diff --git a/src/apis/discovery/v1.ts b/src/apis/discovery/v1.ts index 89703a29ecd..9277e4c6411 100644 --- a/src/apis/discovery/v1.ts +++ b/src/apis/discovery/v1.ts @@ -417,6 +417,77 @@ export namespace discovery_v1 { /** * discovery.apis.getRest * @desc Retrieve the description of a particular version of an api. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/discovery.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 discovery = google.discovery('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: [], + * }); + * + * // 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 discovery.apis.getRest({ + * // The name of the API. + * api: 'placeholder-value', + * // The version of the API. + * version: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auth": {}, + * // "basePath": "my_basePath", + * // "baseUrl": "my_baseUrl", + * // "batchPath": "my_batchPath", + * // "canonicalName": "my_canonicalName", + * // "description": "my_description", + * // "discoveryVersion": "my_discoveryVersion", + * // "documentationLink": "my_documentationLink", + * // "etag": "my_etag", + * // "exponentialBackoffDefault": false, + * // "features": [], + * // "icons": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": [], + * // "methods": {}, + * // "name": "my_name", + * // "ownerDomain": "my_ownerDomain", + * // "ownerName": "my_ownerName", + * // "packagePath": "my_packagePath", + * // "parameters": {}, + * // "protocol": "my_protocol", + * // "resources": {}, + * // "revision": "my_revision", + * // "rootUrl": "my_rootUrl", + * // "schemas": {}, + * // "servicePath": "my_servicePath", + * // "title": "my_title", + * // "version": "my_version", + * // "version_module": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias discovery.apis.getRest * @memberOf! () * @@ -491,6 +562,50 @@ export namespace discovery_v1 { /** * discovery.apis.list * @desc Retrieve the list of APIs supported at this endpoint. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/discovery.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 discovery = google.discovery('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: [], + * }); + * + * // 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 discovery.apis.list({ + * // Only include APIs with the given name. + * name: 'placeholder-value', + * // Return only the preferred version of an API. + * preferred: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "discoveryVersion": "my_discoveryVersion", + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias discovery.apis.list * @memberOf! () * diff --git a/src/apis/displayvideo/v1.ts b/src/apis/displayvideo/v1.ts index a80aab62d34..d0d84511e15 100644 --- a/src/apis/displayvideo/v1.ts +++ b/src/apis/displayvideo/v1.ts @@ -3410,6 +3410,71 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.create * @desc Creates a new advertiser. Returns the newly created advertiser if successful. This method can take up to 180 seconds to complete. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adServerConfig": {}, + * // "advertiserId": "my_advertiserId", + * // "creativeConfig": {}, + * // "dataAccessConfig": {}, + * // "displayName": "my_displayName", + * // "entityStatus": "my_entityStatus", + * // "generalConfig": {}, + * // "integrationDetails": {}, + * // "name": "my_name", + * // "partnerId": "my_partnerId", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adServerConfig": {}, + * // "advertiserId": "my_advertiserId", + * // "creativeConfig": {}, + * // "dataAccessConfig": {}, + * // "displayName": "my_displayName", + * // "entityStatus": "my_entityStatus", + * // "generalConfig": {}, + * // "integrationDetails": {}, + * // "name": "my_name", + * // "partnerId": "my_partnerId", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.create * @memberOf! () * @@ -3481,6 +3546,44 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.delete * @desc Deletes an advertiser. Deleting an advertiser will delete all of its child resources, for example, campaigns, insertion orders and line items. A deleted advertiser cannot be recovered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.delete({ + * // The ID of the advertiser we need to delete. + * advertiserId: '[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.delete * @memberOf! () * @@ -3553,6 +3656,56 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.get * @desc Gets an advertiser. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.get({ + * // Required. The ID of the advertiser to fetch. + * advertiserId: '[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adServerConfig": {}, + * // "advertiserId": "my_advertiserId", + * // "creativeConfig": {}, + * // "dataAccessConfig": {}, + * // "displayName": "my_displayName", + * // "entityStatus": "my_entityStatus", + * // "generalConfig": {}, + * // "integrationDetails": {}, + * // "name": "my_name", + * // "partnerId": "my_partnerId", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.get * @memberOf! () * @@ -3626,6 +3779,86 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.list * @desc Lists advertisers that are accessible to the current user. The order is defined by the order_by parameter. A single partner_id is required. Cross-partner listing is not supported. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.list({ + * // Allows filtering by advertiser properties. + * // + * // Supported syntax: + * // + * // * Filter expressions are made up of one or more restrictions. + * // * Restrictions can be combined by `AND` or `OR` logical operators. A + * // sequence of restrictions implicitly uses `AND`. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * The operator must be `EQUALS (=)`. + * // * Supported fields: + * // - `entityStatus` + * // + * // Examples: + * // + * // * All active advertisers under a partner: + * // `entityStatus="ENTITY_STATUS_ACTIVE"` + * // + * // The length of this field should be no more than 500 characters. + * filter: 'placeholder-value', + * // Field by which to sort the list. + * // Acceptable values are: + * // + * // * `displayName` (default) + * // * `entityStatus` + * // + * // The default sorting order is ascending. To specify descending order for + * // a field, a suffix "desc" should be added to the field name. For example, + * // `displayName desc`. + * orderBy: 'placeholder-value', + * // Requested page size. Must be between `1` and `100`. If unspecified will + * // default to `100`. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // next_page_token + * // returned from the previous call to `ListAdvertisers` method. + * // If not specified, the first page of results will be returned. + * pageToken: 'placeholder-value', + * // Required. The ID of the partner that the fetched advertisers should all belong to. + * // The system only supports listing advertisers for one partner at a time. + * partnerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertisers": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.list * @memberOf! () * @@ -3702,6 +3935,76 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.patch * @desc Updates an existing advertiser. Returns the updated advertiser if successful. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.patch({ + * // Output only. The unique ID of the advertiser. Assigned by the system. + * advertiserId: '[^/]+', + * // Required. The mask to control which fields to update. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "adServerConfig": {}, + * // "advertiserId": "my_advertiserId", + * // "creativeConfig": {}, + * // "dataAccessConfig": {}, + * // "displayName": "my_displayName", + * // "entityStatus": "my_entityStatus", + * // "generalConfig": {}, + * // "integrationDetails": {}, + * // "name": "my_name", + * // "partnerId": "my_partnerId", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adServerConfig": {}, + * // "advertiserId": "my_advertiserId", + * // "creativeConfig": {}, + * // "dataAccessConfig": {}, + * // "displayName": "my_displayName", + * // "entityStatus": "my_entityStatus", + * // "generalConfig": {}, + * // "integrationDetails": {}, + * // "name": "my_name", + * // "partnerId": "my_partnerId", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.patch * @memberOf! () * @@ -3869,6 +4172,58 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.assets.upload * @desc Uploads an asset. Returns the ID of the newly uploaded asset if successful. The asset file size should be no more than 10 MB for images, 200 MB for ZIP files, and 1 GB for videos. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.assets.upload({ + * // Required. The ID of the advertiser this asset belongs to. + * advertiserId: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "filename": "my_filename" + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "asset": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.assets.upload * @memberOf! () * @@ -3990,6 +4345,70 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.campaigns.create * @desc Creates a new campaign. Returns the newly created campaign if successful. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.campaigns.create({ + * // Output only. The unique ID of the advertiser the campaign belongs to. + * advertiserId: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "advertiserId": "my_advertiserId", + * // "campaignFlight": {}, + * // "campaignGoal": {}, + * // "campaignId": "my_campaignId", + * // "displayName": "my_displayName", + * // "entityStatus": "my_entityStatus", + * // "frequencyCap": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "campaignFlight": {}, + * // "campaignGoal": {}, + * // "campaignId": "my_campaignId", + * // "displayName": "my_displayName", + * // "entityStatus": "my_entityStatus", + * // "frequencyCap": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.campaigns.create * @memberOf! () * @@ -4062,6 +4481,46 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.campaigns.delete * @desc Permanently deletes a campaign. A deleted campaign cannot be recovered. The campaign should be archived first, i.e. set entity_status to `ENTITY_STATUS_ARCHIVED`, to be able to delete it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.campaigns.delete({ + * // The ID of the advertiser this campaign belongs to. + * advertiserId: '[^/]+', + * // The ID of the campaign we need to delete. + * campaignId: '[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.campaigns.delete * @memberOf! () * @@ -4135,6 +4594,56 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.campaigns.get * @desc Gets a campaign. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.campaigns.get({ + * // Required. The ID of the advertiser this campaign belongs to. + * advertiserId: '[^/]+', + * // Required. The ID of the campaign to fetch. + * campaignId: '[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "campaignFlight": {}, + * // "campaignGoal": {}, + * // "campaignId": "my_campaignId", + * // "displayName": "my_displayName", + * // "entityStatus": "my_entityStatus", + * // "frequencyCap": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.campaigns.get * @memberOf! () * @@ -4208,6 +4717,87 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.campaigns.list * @desc Lists campaigns in an advertiser. The order is defined by the order_by parameter. If a filter by entity_status is not specified, campaigns with `ENTITY_STATUS_ARCHIVED` will not be included in the results. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.campaigns.list({ + * // The ID of the advertiser to list campaigns for. + * advertiserId: '[^/]+', + * // Allows filtering by campaign properties. + * // + * // Supported syntax: + * // + * // * Filter expressions are made up of one or more restrictions. + * // * Restrictions can be combined by `AND` or `OR` logical operators. A + * // sequence of restrictions implicitly uses `AND`. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * The operator must be `EQUALS (=)`. + * // * Supported fields: + * // - `entityStatus` + * // + * // Examples: + * // + * // * All `ENTITY_STATUS_ACTIVE` or `ENTITY_STATUS_PAUSED` campaigns under an + * // advertiser: + * // `(entityStatus="ENTITY_STATUS_ACTIVE" OR + * // entityStatus="ENTITY_STATUS_PAUSED")` + * // + * // The length of this field should be no more than 500 characters. + * filter: 'placeholder-value', + * // Field by which to sort the list. + * // Acceptable values are: + * // + * // * `displayName` (default) + * // * `entityStatus` + * // + * // The default sorting order is ascending. To specify descending order for + * // a field, a suffix "desc" should be added to the field name. Example: + * // `displayName desc`. + * orderBy: 'placeholder-value', + * // Requested page size. Must be between `1` and `100`. If unspecified will + * // default to `100`. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // next_page_token returned from the + * // previous call to `ListCampaigns` method. If not specified, the first page + * // of results will be returned. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "campaigns": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.campaigns.list * @memberOf! () * @@ -4287,6 +4877,74 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.campaigns.patch * @desc Updates an existing campaign. Returns the updated campaign if successful. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.campaigns.patch({ + * // Output only. The unique ID of the advertiser the campaign belongs to. + * advertiserId: '[^/]+', + * // Output only. The unique ID of the campaign. Assigned by the system. + * campaignId: '[^/]+', + * // Required. The mask to control which fields to update. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "advertiserId": "my_advertiserId", + * // "campaignFlight": {}, + * // "campaignGoal": {}, + * // "campaignId": "my_campaignId", + * // "displayName": "my_displayName", + * // "entityStatus": "my_entityStatus", + * // "frequencyCap": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "campaignFlight": {}, + * // "campaignGoal": {}, + * // "campaignId": "my_campaignId", + * // "displayName": "my_displayName", + * // "entityStatus": "my_entityStatus", + * // "frequencyCap": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.campaigns.patch * @memberOf! () * @@ -4472,6 +5130,54 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.channels.get * @desc Gets a channel for a partner or advertiser. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.channels.get({ + * // The ID of the advertiser that owns the fetched channel. + * advertiserId: '[^/]+', + * // Required. The ID of the channel to fetch. + * channelId: '[^/]+', + * // The ID of the partner that owns the fetched channel. + * partnerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "channelId": "my_channelId", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "partnerId": "my_partnerId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.channels.get * @memberOf! () * @@ -4545,6 +5251,87 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.channels.list * @desc Lists channels for a partner or advertiser. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.channels.list({ + * // The ID of the advertiser that owns the channels. + * advertiserId: '[^/]+', + * // Allows filtering by channel fields. + * // + * // Supported syntax: + * // + * // * Filter expressions for channel currently can only contain at most one + * // * restriction. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * The operator must be `CONTAINS (:)`. + * // * Supported fields: + * // - `displayName` + * // + * // Examples: + * // + * // * All channels for which the display name contains "google": + * // `displayName : "google"`. + * // + * // The length of this field should be no more than 500 characters. + * filter: 'placeholder-value', + * // Field by which to sort the list. + * // Acceptable values are: + * // + * // * `displayName` (default) + * // * `channelId` + * // + * // The default sorting order is ascending. To specify descending order for a + * // field, a suffix " desc" should be added to the field name. Example: + * // `displayName desc`. + * orderBy: 'placeholder-value', + * // Requested page size. Must be between `1` and `100`. If unspecified will + * // default to `100`. Returns error code `INVALID_ARGUMENT` if an invalid value + * // is specified. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // next_page_token returned from the + * // previous call to `ListChannels` method. If not specified, the first page + * // of results will be returned. + * pageToken: 'placeholder-value', + * // The ID of the partner that owns the channels. + * partnerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "channels": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.channels.list * @memberOf! () * @@ -4686,6 +5473,140 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.creatives.create * @desc Creates a new creative. Returns the newly created creative if successful. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.creatives.create({ + * // Output only. The unique ID of the advertiser the creative belongs to. + * advertiserId: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "additionalDimensions": [], + * // "advertiserId": "my_advertiserId", + * // "appendedTag": "my_appendedTag", + * // "assets": [], + * // "cmPlacementId": "my_cmPlacementId", + * // "cmTrackingAd": {}, + * // "companionCreativeIds": [], + * // "counterEvents": [], + * // "createTime": "my_createTime", + * // "creativeAttributes": [], + * // "creativeId": "my_creativeId", + * // "creativeType": "my_creativeType", + * // "dimensions": {}, + * // "displayName": "my_displayName", + * // "dynamic": false, + * // "entityStatus": "my_entityStatus", + * // "exitEvents": [], + * // "expandOnHover": false, + * // "expandingDirection": "my_expandingDirection", + * // "hostingSource": "my_hostingSource", + * // "html5Video": false, + * // "iasCampaignMonitoring": false, + * // "integrationCode": "my_integrationCode", + * // "jsTrackerUrl": "my_jsTrackerUrl", + * // "mediaDuration": "my_mediaDuration", + * // "name": "my_name", + * // "notes": "my_notes", + * // "obaIcon": {}, + * // "progressOffset": {}, + * // "requireHtml5": false, + * // "requireMraid": false, + * // "requirePingForAttribution": false, + * // "reviewStatus": {}, + * // "skipOffset": {}, + * // "skippable": false, + * // "thirdPartyTag": "my_thirdPartyTag", + * // "thirdPartyUrls": [], + * // "timerEvents": [], + * // "trackerUrls": [], + * // "transcodes": [], + * // "universalAdId": {}, + * // "updateTime": "my_updateTime", + * // "vastTagUrl": "my_vastTagUrl", + * // "vpaid": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "additionalDimensions": [], + * // "advertiserId": "my_advertiserId", + * // "appendedTag": "my_appendedTag", + * // "assets": [], + * // "cmPlacementId": "my_cmPlacementId", + * // "cmTrackingAd": {}, + * // "companionCreativeIds": [], + * // "counterEvents": [], + * // "createTime": "my_createTime", + * // "creativeAttributes": [], + * // "creativeId": "my_creativeId", + * // "creativeType": "my_creativeType", + * // "dimensions": {}, + * // "displayName": "my_displayName", + * // "dynamic": false, + * // "entityStatus": "my_entityStatus", + * // "exitEvents": [], + * // "expandOnHover": false, + * // "expandingDirection": "my_expandingDirection", + * // "hostingSource": "my_hostingSource", + * // "html5Video": false, + * // "iasCampaignMonitoring": false, + * // "integrationCode": "my_integrationCode", + * // "jsTrackerUrl": "my_jsTrackerUrl", + * // "mediaDuration": "my_mediaDuration", + * // "name": "my_name", + * // "notes": "my_notes", + * // "obaIcon": {}, + * // "progressOffset": {}, + * // "requireHtml5": false, + * // "requireMraid": false, + * // "requirePingForAttribution": false, + * // "reviewStatus": {}, + * // "skipOffset": {}, + * // "skippable": false, + * // "thirdPartyTag": "my_thirdPartyTag", + * // "thirdPartyUrls": [], + * // "timerEvents": [], + * // "trackerUrls": [], + * // "transcodes": [], + * // "universalAdId": {}, + * // "updateTime": "my_updateTime", + * // "vastTagUrl": "my_vastTagUrl", + * // "vpaid": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.creatives.create * @memberOf! () * @@ -4758,6 +5679,46 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.creatives.delete * @desc Deletes a creative. Returns error code `NOT_FOUND` if the creative does not exist. The creative should be archived first, i.e. set entity_status to `ENTITY_STATUS_ARCHIVED`, before it can be deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.creatives.delete({ + * // The ID of the advertiser this creative belongs to. + * advertiserId: '[^/]+', + * // The ID of the creative to be deleted. + * creativeId: '[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.creatives.delete * @memberOf! () * @@ -4831,6 +5792,91 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.creatives.get * @desc Gets a creative. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.creatives.get({ + * // Required. The ID of the advertiser this creative belongs to. + * advertiserId: '[^/]+', + * // Required. The ID of the creative to fetch. + * creativeId: '[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "additionalDimensions": [], + * // "advertiserId": "my_advertiserId", + * // "appendedTag": "my_appendedTag", + * // "assets": [], + * // "cmPlacementId": "my_cmPlacementId", + * // "cmTrackingAd": {}, + * // "companionCreativeIds": [], + * // "counterEvents": [], + * // "createTime": "my_createTime", + * // "creativeAttributes": [], + * // "creativeId": "my_creativeId", + * // "creativeType": "my_creativeType", + * // "dimensions": {}, + * // "displayName": "my_displayName", + * // "dynamic": false, + * // "entityStatus": "my_entityStatus", + * // "exitEvents": [], + * // "expandOnHover": false, + * // "expandingDirection": "my_expandingDirection", + * // "hostingSource": "my_hostingSource", + * // "html5Video": false, + * // "iasCampaignMonitoring": false, + * // "integrationCode": "my_integrationCode", + * // "jsTrackerUrl": "my_jsTrackerUrl", + * // "mediaDuration": "my_mediaDuration", + * // "name": "my_name", + * // "notes": "my_notes", + * // "obaIcon": {}, + * // "progressOffset": {}, + * // "requireHtml5": false, + * // "requireMraid": false, + * // "requirePingForAttribution": false, + * // "reviewStatus": {}, + * // "skipOffset": {}, + * // "skippable": false, + * // "thirdPartyTag": "my_thirdPartyTag", + * // "thirdPartyUrls": [], + * // "timerEvents": [], + * // "trackerUrls": [], + * // "transcodes": [], + * // "universalAdId": {}, + * // "updateTime": "my_updateTime", + * // "vastTagUrl": "my_vastTagUrl", + * // "vpaid": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.creatives.get * @memberOf! () * @@ -4904,6 +5950,111 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.creatives.list * @desc Lists creatives in an advertiser. The order is defined by the order_by parameter. If a filter by entity_status is not specified, creatives with `ENTITY_STATUS_ARCHIVED` will not be included in the results. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.creatives.list({ + * // Required. The ID of the advertiser to list creatives for. + * advertiserId: '[^/]+', + * // Allows filtering by creative properties. + * // + * // Supported syntax: + * // + * // * Filter expressions are made up of one or more restrictions. + * // * Restriction for the same field must be combined by `OR`. + * // * Restriction for different fields must be combined by `AND`. + * // * Between `(` and `)` there can only be restrictions combined by `OR` + * // for the same field. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * The operator must be `EQUALS (=)`. + * // * Supported fields: + * // - `entityStatus` + * // - `creativeType`. + * // - `dimensions` + * // - `minDuration` + * // - `maxDuration` + * // - `approvalStatus` + * // - `exchangeReviewStatus` + * // - `dynamic` + * // * For `entityStatus`, `minDuration`, `maxDuration`, and `dynamic` there may + * // be at most one restriction. + * // * For `dimensions`, the value is in the form of `"{width}x{height}"`. + * // * For `exchangeReviewStatus`, the value is in the form of + * // `{exchange}-{reviewStatus}`. + * // * For `minDuration` and `maxDuration`, the value is in the form of + * // `"{duration}s"`. Only seconds are supported with millisecond granularity. + * // + * // Examples: + * // + * // * All native creatives: `creativeType="CREATIVE_TYPE_NATIVE"` + * // * All active creatives with 300x400 or 50x100 dimensions: + * // `entityStatus="ENTITY_STATUS_ACTIVE" AND (dimensions="300x400" + * // OR dimensions="50x100")` + * // * All dynamic creatives that are approved by AdX or + * // AppNexus, with a minimum duration of 5 seconds and 200ms. + * // `dynamic="true" AND minDuration="5.2s" AND + * // (exchangeReviewStatus="EXCHANGE_GOOGLE_AD_MANAGER-REVIEW_STATUS_APPROVED" + * // OR exchangeReviewStatus="EXCHANGE_APPNEXUS-REVIEW_STATUS_APPROVED")` + * // + * // The length of this field should be no more than 500 characters. + * filter: 'placeholder-value', + * // Field by which to sort the list. + * // Acceptable values are: + * // + * // * `creativeId` (default) + * // * `createTime` + * // * `mediaDuration` + * // * `dimensions` (sorts by width first, then by height) + * // + * // The default sorting order is ascending. To specify descending order for + * // a field, a suffix "desc" should be added to the field name. + * // Example: `createTime desc`. + * orderBy: 'placeholder-value', + * // Requested page size. Must be between `1` and `100`. If unspecified will + * // default to `100`. Returns error code `INVALID_ARGUMENT` if an invalid value + * // is specified. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // next_page_token + * // returned from the previous call to `ListCreatives` method. + * // If not specified, the first page of results will be returned. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creatives": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.creatives.list * @memberOf! () * @@ -4983,6 +6134,144 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.creatives.patch * @desc Updates an existing creative. Returns the updated creative if successful. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.creatives.patch({ + * // Output only. The unique ID of the advertiser the creative belongs to. + * advertiserId: '[^/]+', + * // Output only. The unique ID of the creative. Assigned by the system. + * creativeId: '[^/]+', + * // Required. The mask to control which fields to update. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "additionalDimensions": [], + * // "advertiserId": "my_advertiserId", + * // "appendedTag": "my_appendedTag", + * // "assets": [], + * // "cmPlacementId": "my_cmPlacementId", + * // "cmTrackingAd": {}, + * // "companionCreativeIds": [], + * // "counterEvents": [], + * // "createTime": "my_createTime", + * // "creativeAttributes": [], + * // "creativeId": "my_creativeId", + * // "creativeType": "my_creativeType", + * // "dimensions": {}, + * // "displayName": "my_displayName", + * // "dynamic": false, + * // "entityStatus": "my_entityStatus", + * // "exitEvents": [], + * // "expandOnHover": false, + * // "expandingDirection": "my_expandingDirection", + * // "hostingSource": "my_hostingSource", + * // "html5Video": false, + * // "iasCampaignMonitoring": false, + * // "integrationCode": "my_integrationCode", + * // "jsTrackerUrl": "my_jsTrackerUrl", + * // "mediaDuration": "my_mediaDuration", + * // "name": "my_name", + * // "notes": "my_notes", + * // "obaIcon": {}, + * // "progressOffset": {}, + * // "requireHtml5": false, + * // "requireMraid": false, + * // "requirePingForAttribution": false, + * // "reviewStatus": {}, + * // "skipOffset": {}, + * // "skippable": false, + * // "thirdPartyTag": "my_thirdPartyTag", + * // "thirdPartyUrls": [], + * // "timerEvents": [], + * // "trackerUrls": [], + * // "transcodes": [], + * // "universalAdId": {}, + * // "updateTime": "my_updateTime", + * // "vastTagUrl": "my_vastTagUrl", + * // "vpaid": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "additionalDimensions": [], + * // "advertiserId": "my_advertiserId", + * // "appendedTag": "my_appendedTag", + * // "assets": [], + * // "cmPlacementId": "my_cmPlacementId", + * // "cmTrackingAd": {}, + * // "companionCreativeIds": [], + * // "counterEvents": [], + * // "createTime": "my_createTime", + * // "creativeAttributes": [], + * // "creativeId": "my_creativeId", + * // "creativeType": "my_creativeType", + * // "dimensions": {}, + * // "displayName": "my_displayName", + * // "dynamic": false, + * // "entityStatus": "my_entityStatus", + * // "exitEvents": [], + * // "expandOnHover": false, + * // "expandingDirection": "my_expandingDirection", + * // "hostingSource": "my_hostingSource", + * // "html5Video": false, + * // "iasCampaignMonitoring": false, + * // "integrationCode": "my_integrationCode", + * // "jsTrackerUrl": "my_jsTrackerUrl", + * // "mediaDuration": "my_mediaDuration", + * // "name": "my_name", + * // "notes": "my_notes", + * // "obaIcon": {}, + * // "progressOffset": {}, + * // "requireHtml5": false, + * // "requireMraid": false, + * // "requirePingForAttribution": false, + * // "reviewStatus": {}, + * // "skipOffset": {}, + * // "skippable": false, + * // "thirdPartyTag": "my_thirdPartyTag", + * // "thirdPartyUrls": [], + * // "timerEvents": [], + * // "trackerUrls": [], + * // "transcodes": [], + * // "universalAdId": {}, + * // "updateTime": "my_updateTime", + * // "vastTagUrl": "my_vastTagUrl", + * // "vpaid": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.creatives.patch * @memberOf! () * @@ -5168,6 +6457,80 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.insertionOrders.create * @desc Creates a new insertion order. Returns the newly created insertion order if successful. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.insertionOrders.create({ + * // Output only. The unique ID of the advertiser the insertion order belongs to. + * advertiserId: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "advertiserId": "my_advertiserId", + * // "bidStrategy": {}, + * // "budget": {}, + * // "campaignId": "my_campaignId", + * // "displayName": "my_displayName", + * // "entityStatus": "my_entityStatus", + * // "frequencyCap": {}, + * // "insertionOrderId": "my_insertionOrderId", + * // "integrationDetails": {}, + * // "name": "my_name", + * // "pacing": {}, + * // "partnerCosts": [], + * // "performanceGoal": {}, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "bidStrategy": {}, + * // "budget": {}, + * // "campaignId": "my_campaignId", + * // "displayName": "my_displayName", + * // "entityStatus": "my_entityStatus", + * // "frequencyCap": {}, + * // "insertionOrderId": "my_insertionOrderId", + * // "integrationDetails": {}, + * // "name": "my_name", + * // "pacing": {}, + * // "partnerCosts": [], + * // "performanceGoal": {}, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.insertionOrders.create * @memberOf! () * @@ -5242,6 +6605,46 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.insertionOrders.delete * @desc Deletes an insertion order. Returns error code `NOT_FOUND` if the insertion order does not exist. The insertion order should be archived first, i.e. set entity_status to `ENTITY_STATUS_ARCHIVED`, to be able to delete it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.insertionOrders.delete({ + * // The ID of the advertiser this insertion order belongs to. + * advertiserId: '[^/]+', + * // The ID of the insertion order we need to delete. + * insertionOrderId: '[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.insertionOrders.delete * @memberOf! () * @@ -5315,6 +6718,61 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.insertionOrders.get * @desc Gets an insertion order. Returns error code `NOT_FOUND` if the insertion order does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.insertionOrders.get({ + * // Required. The ID of the advertiser this insertion order belongs to. + * advertiserId: '[^/]+', + * // Required. The ID of the insertion order to fetch. + * insertionOrderId: '[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "bidStrategy": {}, + * // "budget": {}, + * // "campaignId": "my_campaignId", + * // "displayName": "my_displayName", + * // "entityStatus": "my_entityStatus", + * // "frequencyCap": {}, + * // "insertionOrderId": "my_insertionOrderId", + * // "integrationDetails": {}, + * // "name": "my_name", + * // "pacing": {}, + * // "partnerCosts": [], + * // "performanceGoal": {}, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.insertionOrders.get * @memberOf! () * @@ -5390,6 +6848,90 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.insertionOrders.list * @desc Lists insertion orders in an advertiser. The order is defined by the order_by parameter. If a filter by entity_status is not specified, insertion orders with `ENTITY_STATUS_ARCHIVED` will not be included in the results. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.insertionOrders.list({ + * // Required. The ID of the advertiser to list insertion orders for. + * advertiserId: '[^/]+', + * // Allows filtering by insertion order properties. + * // + * // Supported syntax: + * // + * // * Filter expressions are made up of one or more restrictions. + * // * Restrictions can be combined by `AND` or `OR` logical operators. A + * // sequence of restrictions implicitly uses `AND`. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * The operator must be `EQUALS (=)`. + * // * Supported fields: + * // - `campaignId` + * // - `entityStatus` + * // + * // Examples: + * // + * // * All insertion orders under a campaign: `campaignId="1234"` + * // * All `ENTITY_STATUS_ACTIVE` or `ENTITY_STATUS_PAUSED` insertion orders + * // under an advertiser: + * // `(entityStatus="ENTITY_STATUS_ACTIVE" OR + * // entityStatus="ENTITY_STATUS_PAUSED")` + * // + * // The length of this field should be no more than 500 characters. + * filter: 'placeholder-value', + * // Field by which to sort the list. + * // Acceptable values are: + * // + * // * "displayName" (default) + * // * "entityStatus" + * // + * // The default sorting order is ascending. To specify descending order for + * // a field, a suffix "desc" should be added to the field name. Example: + * // `displayName desc`. + * orderBy: 'placeholder-value', + * // Requested page size. Must be between `1` and `100`. If unspecified will + * // default to `100`. Returns error code `INVALID_ARGUMENT` if an invalid value + * // is specified. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // next_page_token returned + * // from the previous call to `ListInsertionOrders` method. If not specified, + * // the first page of results will be returned. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "insertionOrders": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.insertionOrders.list * @memberOf! () * @@ -5474,6 +7016,84 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.insertionOrders.patch * @desc Updates an existing insertion order. Returns the updated insertion order if successful. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.insertionOrders.patch({ + * // Output only. The unique ID of the advertiser the insertion order belongs to. + * advertiserId: '[^/]+', + * // Output only. The unique ID of the insertion order. Assigned by the system. + * insertionOrderId: '[^/]+', + * // Required. The mask to control which fields to update. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "advertiserId": "my_advertiserId", + * // "bidStrategy": {}, + * // "budget": {}, + * // "campaignId": "my_campaignId", + * // "displayName": "my_displayName", + * // "entityStatus": "my_entityStatus", + * // "frequencyCap": {}, + * // "insertionOrderId": "my_insertionOrderId", + * // "integrationDetails": {}, + * // "name": "my_name", + * // "pacing": {}, + * // "partnerCosts": [], + * // "performanceGoal": {}, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "bidStrategy": {}, + * // "budget": {}, + * // "campaignId": "my_campaignId", + * // "displayName": "my_displayName", + * // "entityStatus": "my_entityStatus", + * // "frequencyCap": {}, + * // "insertionOrderId": "my_insertionOrderId", + * // "integrationDetails": {}, + * // "name": "my_name", + * // "pacing": {}, + * // "partnerCosts": [], + * // "performanceGoal": {}, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.insertionOrders.patch * @memberOf! () * @@ -5665,6 +7285,59 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.lineItems.bulkEditLineItemAssignedTargetingOptions * @desc Bulk edits targeting options under a single line item. The operation will delete the assigned targeting options provided in BulkEditLineItemAssignedTargetingOptionsRequest.delete_requests and then create the assigned targeting options provided in BulkEditLineItemAssignedTargetingOptionsRequest.create_requests . + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.lineItems.bulkEditLineItemAssignedTargetingOptions( + * { + * // Required. The ID of the advertiser the line item belongs to. + * advertiserId: '[^/]+', + * // Required. The ID of the line item the assigned targeting option will belong to. + * lineItemId: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createRequests": [], + * // "deleteRequests": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "createdAssignedTargetingOptions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.lineItems.bulkEditLineItemAssignedTargetingOptions * @memberOf! () * @@ -5765,6 +7438,96 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.lineItems.bulkListLineItemAssignedTargetingOptions * @desc Lists assigned targeting options of a line item across targeting types. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.lineItems.bulkListLineItemAssignedTargetingOptions( + * { + * // Required. The ID of the advertiser the line item belongs to. + * advertiserId: '[^/]+', + * // Allows filtering by assigned targeting option properties. + * // Supported syntax: + * // + * // * Filter expressions are made up of one or more restrictions. + * // * Restrictions can be combined by the logical operator `OR` on the same + * // field. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * The operator must be `EQUALS (=)`. + * // * Supported fields: + * // - `targetingType` + * // - `inheritance` + * // + * // Examples: + * // + * // * AssignedTargetingOptions of targeting type + * // TARGETING_TYPE_PROXIMITY_LOCATION_LIST or TARGETING_TYPE_CHANNEL + * // `targetingType="TARGETING_TYPE_PROXIMITY_LOCATION_LIST" OR + * // targetingType="TARGETING_TYPE_CHANNEL"` + * // * AssignedTargetingOptions with inheritance status of NOT_INHERITED or + * // INHERITED_FROM_PARTNER + * // `inheritance="NOT_INHERITED" OR inheritance="INHERITED_FROM_PARTNER"` + * // + * // The length of this field should be no more than 500 characters. + * filter: 'placeholder-value', + * // Required. The ID of the line item to list assigned targeting options for. + * lineItemId: '[^/]+', + * // Field by which to sort the list. + * // Acceptable values are: + * // + * // * `targetingType` (default) + * // + * // The default sorting order is ascending. To specify descending order for + * // a field, a suffix "desc" should be added to the field name. Example: + * // `targetingType desc`. + * orderBy: 'placeholder-value', + * // Requested page size. + * // The size must be an integer between `1` and `5000`. If unspecified, + * // the default is '5000'. Returns error code `INVALID_ARGUMENT` if an invalid + * // value is specified. + * pageSize: 'placeholder-value', + * // A token that lets the client fetch the next page of results. + * // Typically, this is the value of + * // next_page_token + * // returned from the previous call to + * // `BulkListLineItemAssignedTargetingOptions` method. + * // If not specified, the first page of results will be returned. + * pageToken: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "assignedTargetingOptions": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.lineItems.bulkListLineItemAssignedTargetingOptions * @memberOf! () * @@ -5868,6 +7631,92 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.lineItems.create * @desc Creates a new line item. Returns the newly created line item if successful. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.lineItems.create({ + * // Output only. The unique ID of the advertiser the line item belongs to. + * advertiserId: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "advertiserId": "my_advertiserId", + * // "bidStrategy": {}, + * // "budget": {}, + * // "campaignId": "my_campaignId", + * // "conversionCounting": {}, + * // "creativeIds": [], + * // "displayName": "my_displayName", + * // "entityStatus": "my_entityStatus", + * // "flight": {}, + * // "frequencyCap": {}, + * // "insertionOrderId": "my_insertionOrderId", + * // "integrationDetails": {}, + * // "inventorySourceIds": [], + * // "lineItemId": "my_lineItemId", + * // "lineItemType": "my_lineItemType", + * // "name": "my_name", + * // "pacing": {}, + * // "partnerCosts": [], + * // "partnerRevenueModel": {}, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "bidStrategy": {}, + * // "budget": {}, + * // "campaignId": "my_campaignId", + * // "conversionCounting": {}, + * // "creativeIds": [], + * // "displayName": "my_displayName", + * // "entityStatus": "my_entityStatus", + * // "flight": {}, + * // "frequencyCap": {}, + * // "insertionOrderId": "my_insertionOrderId", + * // "integrationDetails": {}, + * // "inventorySourceIds": [], + * // "lineItemId": "my_lineItemId", + * // "lineItemType": "my_lineItemType", + * // "name": "my_name", + * // "pacing": {}, + * // "partnerCosts": [], + * // "partnerRevenueModel": {}, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.lineItems.create * @memberOf! () * @@ -5940,6 +7789,46 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.lineItems.delete * @desc Deletes a line item. Returns error code `NOT_FOUND` if the line item does not exist. The line item should be archived first, i.e. set entity_status to `ENTITY_STATUS_ARCHIVED`, to be able to delete it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.lineItems.delete({ + * // The ID of the advertiser this line item belongs to. + * advertiserId: '[^/]+', + * // The ID of the line item we need to fetch. + * lineItemId: '[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.lineItems.delete * @memberOf! () * @@ -6013,6 +7902,67 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.lineItems.get * @desc Gets a line item. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.lineItems.get({ + * // Required. The ID of the advertiser this line item belongs to. + * advertiserId: '[^/]+', + * // Required. The ID of the line item to fetch. + * lineItemId: '[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "bidStrategy": {}, + * // "budget": {}, + * // "campaignId": "my_campaignId", + * // "conversionCounting": {}, + * // "creativeIds": [], + * // "displayName": "my_displayName", + * // "entityStatus": "my_entityStatus", + * // "flight": {}, + * // "frequencyCap": {}, + * // "insertionOrderId": "my_insertionOrderId", + * // "integrationDetails": {}, + * // "inventorySourceIds": [], + * // "lineItemId": "my_lineItemId", + * // "lineItemType": "my_lineItemType", + * // "name": "my_name", + * // "pacing": {}, + * // "partnerCosts": [], + * // "partnerRevenueModel": {}, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.lineItems.get * @memberOf! () * @@ -6086,6 +8036,93 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.lineItems.list * @desc Lists line items in an advertiser. The order is defined by the order_by parameter. If a filter by entity_status is not specified, line items with `ENTITY_STATUS_ARCHIVED` will not be included in the results. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.lineItems.list({ + * // Required. The ID of the advertiser to list line items for. + * advertiserId: '[^/]+', + * // Allows filtering by line item properties. + * // + * // Supported syntax: + * // + * // * Filter expressions are made up of one or more restrictions. + * // * Restrictions can be combined by `AND` or `OR` logical operators. A + * // sequence of restrictions implicitly uses `AND`. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * The operator must be `EQUALS (=)`. + * // * Supported fields: + * // - `campaignId` + * // - `insertionOrderId` + * // - `entityStatus` + * // - `lineItemType`. + * // + * // Examples: + * // + * // * All line items under an insertion order: `insertionOrderId="1234"` + * // * All `ENTITY_STATUS_ACTIVE` or `ENTITY_STATUS_PAUSED` + * // and `LINE_ITEM_TYPE_DISPLAY_DEFAULT` line items under an advertiser: + * // `(entityStatus="ENTITY_STATUS_ACTIVE" OR + * // entityStatus="ENTITY_STATUS_PAUSED") AND + * // lineItemType="LINE_ITEM_TYPE_DISPLAY_DEFAULT"` + * // + * // The length of this field should be no more than 500 characters. + * filter: 'placeholder-value', + * // Field by which to sort the list. + * // Acceptable values are: + * // + * // * "displayName" (default) + * // * "entityStatus" + * // + * // The default sorting order is ascending. To specify descending order for + * // a field, a suffix "desc" should be added to the field name. Example: + * // `displayName desc`. + * orderBy: 'placeholder-value', + * // Requested page size. Must be between `1` and `100`. If unspecified will + * // default to `100`. Returns error code `INVALID_ARGUMENT` if an invalid value + * // is specified. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // next_page_token + * // returned from the previous call to `ListLineItems` method. + * // If not specified, the first page of results will be returned. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "lineItems": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.lineItems.list * @memberOf! () * @@ -6165,6 +8202,96 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.lineItems.patch * @desc Updates an existing line item. Returns the updated line item if successful. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.lineItems.patch({ + * // Output only. The unique ID of the advertiser the line item belongs to. + * advertiserId: '[^/]+', + * // Output only. The unique ID of the line item. Assigned by the system. + * lineItemId: '[^/]+', + * // Required. The mask to control which fields to update. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "advertiserId": "my_advertiserId", + * // "bidStrategy": {}, + * // "budget": {}, + * // "campaignId": "my_campaignId", + * // "conversionCounting": {}, + * // "creativeIds": [], + * // "displayName": "my_displayName", + * // "entityStatus": "my_entityStatus", + * // "flight": {}, + * // "frequencyCap": {}, + * // "insertionOrderId": "my_insertionOrderId", + * // "integrationDetails": {}, + * // "inventorySourceIds": [], + * // "lineItemId": "my_lineItemId", + * // "lineItemType": "my_lineItemType", + * // "name": "my_name", + * // "pacing": {}, + * // "partnerCosts": [], + * // "partnerRevenueModel": {}, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "bidStrategy": {}, + * // "budget": {}, + * // "campaignId": "my_campaignId", + * // "conversionCounting": {}, + * // "creativeIds": [], + * // "displayName": "my_displayName", + * // "entityStatus": "my_entityStatus", + * // "flight": {}, + * // "frequencyCap": {}, + * // "insertionOrderId": "my_insertionOrderId", + * // "integrationDetails": {}, + * // "inventorySourceIds": [], + * // "lineItemId": "my_lineItemId", + * // "lineItemType": "my_lineItemType", + * // "name": "my_name", + * // "pacing": {}, + * // "partnerCosts": [], + * // "partnerRevenueModel": {}, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.lineItems.patch * @memberOf! () * @@ -6414,6 +8541,140 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.lineItems.targetingTypes.assignedTargetingOptions.create * @desc Assigns a targeting option to a line item. Returns the assigned targeting option if successful. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.lineItems.targetingTypes.assignedTargetingOptions.create( + * { + * // Required. The ID of the advertiser the line item belongs to. + * advertiserId: '[^/]+', + * // Required. The ID of the line item the assigned targeting option will belong to. + * lineItemId: '[^/]+', + * // Required. Identifies the type of this assigned targeting option. + * targetingType: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ageRangeDetails": {}, + * // "appCategoryDetails": {}, + * // "appDetails": {}, + * // "assignedTargetingOptionId": "my_assignedTargetingOptionId", + * // "audienceGroupDetails": {}, + * // "authorizedSellerStatusDetails": {}, + * // "browserDetails": {}, + * // "carrierAndIspDetails": {}, + * // "categoryDetails": {}, + * // "channelDetails": {}, + * // "contentInstreamPositionDetails": {}, + * // "contentOutstreamPositionDetails": {}, + * // "dayAndTimeDetails": {}, + * // "deviceMakeModelDetails": {}, + * // "deviceTypeDetails": {}, + * // "digitalContentLabelExclusionDetails": {}, + * // "environmentDetails": {}, + * // "exchangeDetails": {}, + * // "genderDetails": {}, + * // "geoRegionDetails": {}, + * // "householdIncomeDetails": {}, + * // "inheritance": "my_inheritance", + * // "inventorySourceDetails": {}, + * // "inventorySourceGroupDetails": {}, + * // "keywordDetails": {}, + * // "languageDetails": {}, + * // "name": "my_name", + * // "negativeKeywordListDetails": {}, + * // "onScreenPositionDetails": {}, + * // "operatingSystemDetails": {}, + * // "parentalStatusDetails": {}, + * // "proximityLocationListDetails": {}, + * // "regionalLocationListDetails": {}, + * // "sensitiveCategoryExclusionDetails": {}, + * // "subExchangeDetails": {}, + * // "targetingType": "my_targetingType", + * // "thirdPartyVerifierDetails": {}, + * // "urlDetails": {}, + * // "userRewardedContentDetails": {}, + * // "videoPlayerSizeDetails": {}, + * // "viewabilityDetails": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "ageRangeDetails": {}, + * // "appCategoryDetails": {}, + * // "appDetails": {}, + * // "assignedTargetingOptionId": "my_assignedTargetingOptionId", + * // "audienceGroupDetails": {}, + * // "authorizedSellerStatusDetails": {}, + * // "browserDetails": {}, + * // "carrierAndIspDetails": {}, + * // "categoryDetails": {}, + * // "channelDetails": {}, + * // "contentInstreamPositionDetails": {}, + * // "contentOutstreamPositionDetails": {}, + * // "dayAndTimeDetails": {}, + * // "deviceMakeModelDetails": {}, + * // "deviceTypeDetails": {}, + * // "digitalContentLabelExclusionDetails": {}, + * // "environmentDetails": {}, + * // "exchangeDetails": {}, + * // "genderDetails": {}, + * // "geoRegionDetails": {}, + * // "householdIncomeDetails": {}, + * // "inheritance": "my_inheritance", + * // "inventorySourceDetails": {}, + * // "inventorySourceGroupDetails": {}, + * // "keywordDetails": {}, + * // "languageDetails": {}, + * // "name": "my_name", + * // "negativeKeywordListDetails": {}, + * // "onScreenPositionDetails": {}, + * // "operatingSystemDetails": {}, + * // "parentalStatusDetails": {}, + * // "proximityLocationListDetails": {}, + * // "regionalLocationListDetails": {}, + * // "sensitiveCategoryExclusionDetails": {}, + * // "subExchangeDetails": {}, + * // "targetingType": "my_targetingType", + * // "thirdPartyVerifierDetails": {}, + * // "urlDetails": {}, + * // "userRewardedContentDetails": {}, + * // "videoPlayerSizeDetails": {}, + * // "viewabilityDetails": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.lineItems.targetingTypes.assignedTargetingOptions.create * @memberOf! () * @@ -6495,6 +8756,52 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.lineItems.targetingTypes.assignedTargetingOptions.delete * @desc Deletes an assigned targeting option from a line item. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.lineItems.targetingTypes.assignedTargetingOptions.delete( + * { + * // Required. The ID of the advertiser the line item belongs to. + * advertiserId: '[^/]+', + * // Required. The ID of the assigned targeting option to delete. + * assignedTargetingOptionId: '[^/]+', + * // Required. The ID of the line item the assigned targeting option belongs to. + * lineItemId: '[^/]+', + * // Required. Identifies the type of this assigned targeting option. + * targetingType: '[^/]+', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.lineItems.targetingTypes.assignedTargetingOptions.delete * @memberOf! () * @@ -6580,6 +8887,95 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.lineItems.targetingTypes.assignedTargetingOptions.get * @desc Gets a single targeting option assigned to a line item. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.lineItems.targetingTypes.assignedTargetingOptions.get( + * { + * // Required. The ID of the advertiser the line item belongs to. + * advertiserId: '[^/]+', + * // Required. An identifier unique to the targeting type in this line item that + * // identifies the assigned targeting option being requested. + * assignedTargetingOptionId: '[^/]+', + * // Required. The ID of the line item the assigned targeting option belongs to. + * lineItemId: '[^/]+', + * // Required. Identifies the type of this assigned targeting option. + * targetingType: '[^/]+', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "ageRangeDetails": {}, + * // "appCategoryDetails": {}, + * // "appDetails": {}, + * // "assignedTargetingOptionId": "my_assignedTargetingOptionId", + * // "audienceGroupDetails": {}, + * // "authorizedSellerStatusDetails": {}, + * // "browserDetails": {}, + * // "carrierAndIspDetails": {}, + * // "categoryDetails": {}, + * // "channelDetails": {}, + * // "contentInstreamPositionDetails": {}, + * // "contentOutstreamPositionDetails": {}, + * // "dayAndTimeDetails": {}, + * // "deviceMakeModelDetails": {}, + * // "deviceTypeDetails": {}, + * // "digitalContentLabelExclusionDetails": {}, + * // "environmentDetails": {}, + * // "exchangeDetails": {}, + * // "genderDetails": {}, + * // "geoRegionDetails": {}, + * // "householdIncomeDetails": {}, + * // "inheritance": "my_inheritance", + * // "inventorySourceDetails": {}, + * // "inventorySourceGroupDetails": {}, + * // "keywordDetails": {}, + * // "languageDetails": {}, + * // "name": "my_name", + * // "negativeKeywordListDetails": {}, + * // "onScreenPositionDetails": {}, + * // "operatingSystemDetails": {}, + * // "parentalStatusDetails": {}, + * // "proximityLocationListDetails": {}, + * // "regionalLocationListDetails": {}, + * // "sensitiveCategoryExclusionDetails": {}, + * // "subExchangeDetails": {}, + * // "targetingType": "my_targetingType", + * // "thirdPartyVerifierDetails": {}, + * // "urlDetails": {}, + * // "userRewardedContentDetails": {}, + * // "videoPlayerSizeDetails": {}, + * // "viewabilityDetails": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.lineItems.targetingTypes.assignedTargetingOptions.get * @memberOf! () * @@ -6669,6 +9065,94 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.lineItems.targetingTypes.assignedTargetingOptions.list * @desc Lists the targeting options assigned to a line item. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.lineItems.targetingTypes.assignedTargetingOptions.list( + * { + * // Required. The ID of the advertiser the line item belongs to. + * advertiserId: '[^/]+', + * // Allows filtering by assigned targeting option properties. + * // + * // Supported syntax: + * // + * // * Filter expressions are made up of one or more restrictions. + * // * Restrictions can be combined by the logical operator `OR`. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * The operator must be `EQUALS (=)`. + * // * Supported fields: + * // - `assignedTargetingOptionId` + * // - `inheritance` + * // + * // Examples: + * // + * // * AssignedTargetingOptions with ID 1 or 2 + * // `assignedTargetingOptionId="1" OR assignedTargetingOptionId="2"` + * // * AssignedTargetingOptions with inheritance status of NOT_INHERITED or + * // INHERITED_FROM_PARTNER + * // `inheritance="NOT_INHERITED" OR inheritance="INHERITED_FROM_PARTNER"` + * // + * // The length of this field should be no more than 500 characters. + * filter: 'placeholder-value', + * // Required. The ID of the line item to list assigned targeting options for. + * lineItemId: '[^/]+', + * // Field by which to sort the list. + * // Acceptable values are: + * // + * // * `assignedTargetingOptionId` (default) + * // + * // The default sorting order is ascending. To specify descending order for + * // a field, a suffix "desc" should be added to the field name. Example: + * // `assignedTargetingOptionId desc`. + * orderBy: 'placeholder-value', + * // Requested page size. Must be between `1` and `100`. If unspecified will + * // default to `100`. Returns error code `INVALID_ARGUMENT` if an invalid value + * // is specified. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // next_page_token + * // returned from the previous call to `ListLineItemAssignedTargetingOptions` + * // method. If not specified, the first page of results will be returned. + * pageToken: 'placeholder-value', + * // Required. Identifies the type of assigned targeting options to list. + * targetingType: '[^/]+', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "assignedTargetingOptions": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.lineItems.targetingTypes.assignedTargetingOptions.list * @memberOf! () * @@ -6891,6 +9375,52 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.locationLists.get * @desc Gets a location list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.locationLists.get({ + * // Required. The ID of the DV360 advertiser to which the fetched location list belongs. + * advertiserId: '[^/]+', + * // Required. The ID of the location list to fetch. + * locationListId: '[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "displayName": "my_displayName", + * // "locationListId": "my_locationListId", + * // "locationType": "my_locationType", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.locationLists.get * @memberOf! () * @@ -6966,6 +9496,87 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.locationLists.list * @desc Lists location lists based on a given advertiser id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.locationLists.list({ + * // Required. The ID of the DV360 advertiser to which the fetched location lists belong. + * advertiserId: '[^/]+', + * // Allows filtering by location list fields. + * // + * // Supported syntax: + * // + * // * Filter expressions are made up of one or more restrictions. + * // * Restrictions can be combined by `AND` or `OR` logical operators. A + * // sequence of restrictions implicitly uses `AND`. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * The operator must be `EQUALS (=)`. + * // * Supported fields: + * // - `locationType` + * // + * // Examples: + * // + * // * All regional location list: + * // `locationType="TARGETING_LOCATION_TYPE_REGIONAL"` + * // * All proximity location list: + * // `locationType="TARGETING_LOCATION_TYPE_PROXIMITY"` + * filter: 'placeholder-value', + * // Field by which to sort the list. + * // Acceptable values are: + * // + * // * `locationListId` (default) + * // * `displayName` + * // + * // The default sorting order is ascending. To specify descending order for + * // a field, a suffix "desc" should be added to the field name. Example: + * // `displayName desc`. + * orderBy: 'placeholder-value', + * // Requested page size. Must be between `1` and `100`. + * // Defaults to `100` if not set. Returns error code `INVALID_ARGUMENT` if an + * // invalid value is specified. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // + * // Typically, this is the value of + * // next_page_token + * // returned from the previous call to `ListLocationLists` method. + * // If not specified, the first page of results will be returned. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locationLists": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.locationLists.list * @memberOf! () * @@ -7102,6 +9713,52 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.negativeKeywordLists.get * @desc Gets a negative keyword list given an advertiser ID and a negative keyword list ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.negativeKeywordLists.get({ + * // Required. The ID of the DV360 advertiser to which the fetched negative keyword list + * // belongs. + * advertiserId: '[^/]+', + * // Required. The ID of the negative keyword list to fetch. + * negativeKeywordListId: '[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "negativeKeywordListId": "my_negativeKeywordListId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.negativeKeywordLists.get * @memberOf! () * @@ -7177,6 +9834,59 @@ export namespace displayvideo_v1 { /** * displayvideo.advertisers.negativeKeywordLists.list * @desc Lists negative keyword lists based on a given advertiser id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.advertisers.negativeKeywordLists.list({ + * // Required. The ID of the DV360 advertiser to which the fetched negative keyword lists + * // belong. + * advertiserId: '[^/]+', + * // Requested page size. Must be between `1` and `100`. + * // Defaults to `100` if not set. Returns error code `INVALID_ARGUMENT` if an + * // invalid value is specified. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // + * // Typically, this is the value of + * // next_page_token + * // returned from the previous call to `ListNegativeKeywordLists` method. + * // If not specified, the first page of results will be returned. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "negativeKeywordLists": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.advertisers.negativeKeywordLists.list * @memberOf! () * @@ -7305,6 +10015,53 @@ export namespace displayvideo_v1 { /** * displayvideo.combinedAudiences.get * @desc Gets a combined audience. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.combinedAudiences.get({ + * // The ID of the advertiser that has access to the fetched combined + * // audience. + * advertiserId: 'placeholder-value', + * // Required. The ID of the combined audience to fetch. + * combinedAudienceId: '[^/]+', + * // The ID of the partner that has access to the fetched combined audience. + * partnerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "combinedAudienceId": "my_combinedAudienceId", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.combinedAudiences.get * @memberOf! () * @@ -7380,6 +10137,88 @@ export namespace displayvideo_v1 { /** * displayvideo.combinedAudiences.list * @desc Lists combined audiences. The order is defined by the order_by parameter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.combinedAudiences.list({ + * // The ID of the advertiser that has access to the fetched combined + * // audiences. + * advertiserId: 'placeholder-value', + * // Allows filtering by combined audience fields. + * // + * // Supported syntax: + * // + * // * Filter expressions for combined audiences currently can only contain at + * // most one restriction. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * The operator must be `CONTAINS (:)`. + * // * Supported fields: + * // - `displayName` + * // + * // Examples: + * // + * // * All combined audiences for which the display name contains "Google": + * // `displayName : "Google"`. + * // + * // The length of this field should be no more than 500 characters. + * filter: 'placeholder-value', + * // Field by which to sort the list. + * // Acceptable values are: + * // + * // * `combinedAudienceId` (default) + * // * `displayName` + * // + * // The default sorting order is ascending. To specify descending order for + * // a field, a suffix "desc" should be added to the field name. Example: + * // `displayName desc`. + * orderBy: 'placeholder-value', + * // Requested page size. Must be between `1` and `100`. If unspecified will + * // default to `100`. Returns error code `INVALID_ARGUMENT` if an invalid value + * // is specified. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // next_page_token + * // returned from the previous call to `ListCombinedAudiences` method. + * // If not specified, the first page of results will be returned. + * pageToken: 'placeholder-value', + * // The ID of the partner that has access to the fetched combined audiences. + * partnerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "combinedAudiences": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.combinedAudiences.list * @memberOf! () * @@ -7528,6 +10367,51 @@ export namespace displayvideo_v1 { /** * displayvideo.customLists.get * @desc Gets a custom list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.customLists.get({ + * // The ID of the DV360 advertiser that has access to the fetched custom + * // lists. + * advertiserId: 'placeholder-value', + * // Required. The ID of the custom list to fetch. + * customListId: '[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "customListId": "my_customListId", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.customLists.get * @memberOf! () * @@ -7602,6 +10486,86 @@ export namespace displayvideo_v1 { /** * displayvideo.customLists.list * @desc Lists custom lists. The order is defined by the order_by parameter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.customLists.list({ + * // The ID of the DV360 advertiser that has access to the fetched custom + * // lists. + * advertiserId: 'placeholder-value', + * // Allows filtering by custom list fields. + * // + * // Supported syntax: + * // + * // * Filter expressions for custom lists currently can only contain at + * // most one restriction. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * The operator must be `CONTAINS (:)`. + * // * Supported fields: + * // - `displayName` + * // + * // Examples: + * // + * // * All custom lists for which the display name contains "Google": + * // `displayName : "Google"`. + * // + * // The length of this field should be no more than 500 characters. + * filter: 'placeholder-value', + * // Field by which to sort the list. + * // Acceptable values are: + * // + * // * `customListId` (default) + * // * `displayName` + * // + * // The default sorting order is ascending. To specify descending order for + * // a field, a suffix "desc" should be added to the field name. Example: + * // `displayName desc`. + * orderBy: 'placeholder-value', + * // Requested page size. Must be between `1` and `100`. If unspecified will + * // default to `100`. Returns error code `INVALID_ARGUMENT` if an invalid value + * // is specified. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // next_page_token + * // returned from the previous call to `ListCustomLists` method. + * // If not specified, the first page of results will be returned. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "customLists": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.customLists.list * @memberOf! () * @@ -7728,6 +10692,55 @@ export namespace displayvideo_v1 { /** * displayvideo.firstAndThirdPartyAudiences.get * @desc Gets a first and third party audience. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.firstAndThirdPartyAudiences.get({ + * // The ID of the advertiser that has access to the fetched first and + * // third party audience. + * advertiserId: 'placeholder-value', + * // Required. The ID of the first and third party audience to fetch. + * firstAndThirdPartyAudienceId: '[^/]+', + * // The ID of the partner that has access to the fetched first and + * // third party audience. + * partnerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "firstAndThirdPartyAudienceId": "my_firstAndThirdPartyAudienceId", + * // "firstAndThirdPartyAudienceType": "my_firstAndThirdPartyAudienceType", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.firstAndThirdPartyAudiences.get * @memberOf! () * @@ -7811,6 +10824,89 @@ export namespace displayvideo_v1 { /** * displayvideo.firstAndThirdPartyAudiences.list * @desc Lists first and third party audiences. The order is defined by the order_by parameter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.firstAndThirdPartyAudiences.list({ + * // The ID of the advertiser that has access to the fetched first and + * // third party audiences. + * advertiserId: 'placeholder-value', + * // Allows filtering by first and third party audience fields. + * // + * // Supported syntax: + * // + * // * Filter expressions for first and third party audiences currently can + * // only contain at most one restriction. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * The operator must be `CONTAINS (:)`. + * // * Supported fields: + * // - `displayName` + * // + * // Examples: + * // + * // * All first and third party audiences for which the display name contains + * // "Google": `displayName : "Google"`. + * // + * // The length of this field should be no more than 500 characters. + * filter: 'placeholder-value', + * // Field by which to sort the list. + * // Acceptable values are: + * // + * // * `firstAndThirdPartyAudienceId` (default) + * // * `displayName` + * // + * // The default sorting order is ascending. To specify descending order for + * // a field, a suffix "desc" should be added to the field name. Example: + * // `displayName desc`. + * orderBy: 'placeholder-value', + * // Requested page size. Must be between `1` and `100`. If unspecified will + * // default to `100`. Returns error code `INVALID_ARGUMENT` if an invalid value + * // is specified. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // next_page_token + * // returned from the previous call to `ListFirstAndThirdPartyAudiences` + * // method. If not specified, the first page of results will be returned. + * pageToken: 'placeholder-value', + * // The ID of the partner that has access to the fetched first and + * // third party audiences. + * partnerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "firstAndThirdPartyAudiences": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.firstAndThirdPartyAudiences.list * @memberOf! () * @@ -7967,6 +11063,54 @@ export namespace displayvideo_v1 { /** * displayvideo.floodlightGroups.get * @desc Gets a Floodlight group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.floodlightGroups.get({ + * // Required. The ID of the Floodlight group to fetch. + * floodlightGroupId: '[^/]+', + * // Required. The partner context by which the Floodlight group is being accessed. + * partnerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeViewConfig": {}, + * // "customVariables": {}, + * // "displayName": "my_displayName", + * // "floodlightGroupId": "my_floodlightGroupId", + * // "lookbackWindow": {}, + * // "name": "my_name", + * // "webTagType": "my_webTagType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.floodlightGroups.get * @memberOf! () * @@ -8041,6 +11185,70 @@ export namespace displayvideo_v1 { /** * displayvideo.floodlightGroups.patch * @desc Updates an existing Floodlight group. Returns the updated Floodlight group if successful. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.floodlightGroups.patch({ + * // Output only. The unique ID of the Floodlight group. Assigned by the system. + * floodlightGroupId: 'placeholder-value', + * // Required. The partner context by which the Floodlight group is being accessed. + * partnerId: 'placeholder-value', + * // Required. The mask to control which fields to update. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "activeViewConfig": {}, + * // "customVariables": {}, + * // "displayName": "my_displayName", + * // "floodlightGroupId": "my_floodlightGroupId", + * // "lookbackWindow": {}, + * // "name": "my_name", + * // "webTagType": "my_webTagType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeViewConfig": {}, + * // "customVariables": {}, + * // "displayName": "my_displayName", + * // "floodlightGroupId": "my_floodlightGroupId", + * // "lookbackWindow": {}, + * // "name": "my_name", + * // "webTagType": "my_webTagType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.floodlightGroups.patch * @memberOf! () * @@ -8167,6 +11375,53 @@ export namespace displayvideo_v1 { /** * displayvideo.googleAudiences.get * @desc Gets a Google audience. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.googleAudiences.get({ + * // The ID of the advertiser that has access to the fetched Google audience. + * advertiserId: 'placeholder-value', + * // Required. The ID of the Google audience to fetch. + * googleAudienceId: '[^/]+', + * // The ID of the partner that has access to the fetched Google audience. + * partnerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "googleAudienceId": "my_googleAudienceId", + * // "googleAudienceType": "my_googleAudienceType", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.googleAudiences.get * @memberOf! () * @@ -8243,6 +11498,87 @@ export namespace displayvideo_v1 { /** * displayvideo.googleAudiences.list * @desc Lists Google audiences. The order is defined by the order_by parameter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.googleAudiences.list({ + * // The ID of the advertiser that has access to the fetched Google audiences. + * advertiserId: 'placeholder-value', + * // Allows filtering by Google audience fields. + * // + * // Supported syntax: + * // + * // * Filter expressions for Google audiences currently can only contain at + * // most one restriction. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * The operator must be `CONTAINS (:)`. + * // * Supported fields: + * // - `displayName` + * // + * // Examples: + * // + * // * All Google audiences for which the display name contains "Google": + * // `displayName : "Google"`. + * // + * // The length of this field should be no more than 500 characters. + * filter: 'placeholder-value', + * // Field by which to sort the list. + * // Acceptable values are: + * // + * // * `googleAudienceId` (default) + * // * `displayName` + * // + * // The default sorting order is ascending. To specify descending order for + * // a field, a suffix "desc" should be added to the field name. Example: + * // `displayName desc`. + * orderBy: 'placeholder-value', + * // Requested page size. Must be between `1` and `100`. If unspecified will + * // default to `100`. Returns error code `INVALID_ARGUMENT` if an invalid value + * // is specified. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // next_page_token + * // returned from the previous call to `ListGoogleAudiences` method. + * // If not specified, the first page of results will be returned. + * pageToken: 'placeholder-value', + * // The ID of the partner that has access to the fetched Google audiences. + * partnerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "googleAudiences": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.googleAudiences.list * @memberOf! () * @@ -8389,6 +11725,57 @@ export namespace displayvideo_v1 { /** * displayvideo.inventorySourceGroups.get * @desc Gets an inventory source group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.inventorySourceGroups.get({ + * // The ID of the advertiser that has access to the inventory source group. + * // + * // If an inventory source group is partner-owned, only advertisers to which + * // the group is explicitly shared can access the group. + * advertiserId: 'placeholder-value', + * // Required. The ID of the inventory source group to fetch. + * inventorySourceGroupId: '[^/]+', + * // The ID of the partner that has access to the inventory source group. + * // + * // A partner cannot access an advertiser-owned inventory source group. + * partnerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "inventorySourceGroupId": "my_inventorySourceGroupId", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.inventorySourceGroups.get * @memberOf! () * @@ -8466,6 +11853,86 @@ export namespace displayvideo_v1 { /** * displayvideo.inventorySourceGroups.list * @desc Lists inventory source groups that are accessible to the current user. The order is defined by the order_by parameter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.inventorySourceGroups.list({ + * // The ID of the advertiser that has access to the inventory source group. + * // + * // If an inventory source group is partner-owned, only advertisers to which + * // the group is explicitly shared can access the group. + * advertiserId: 'placeholder-value', + * // Allows filtering by inventory source group properties. + * // + * // Supported syntax: + * // + * // * Filter expressions are made up of one or more restrictions. + * // * Restrictions can be combined by the logical operator `OR`. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * The operator must be `EQUALS (=)`. + * // * Supported fields: + * // - `inventorySourceGroupId` + * // + * // The length of this field should be no more than 500 characters. + * filter: 'placeholder-value', + * // Field by which to sort the list. + * // Acceptable values are: + * // + * // * `displayName` (default) + * // * `inventorySourceGroupId` + * // + * // The default sorting order is ascending. To specify descending order for + * // a field, a suffix "desc" should be added to the field name. For example, + * // `displayName desc`. + * orderBy: 'placeholder-value', + * // Requested page size. Must be between `1` and `100`. If unspecified will + * // default to `100`. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // next_page_token + * // returned from the previous call to `ListInventorySources` method. + * // If not specified, the first page of results will be returned. + * pageToken: 'placeholder-value', + * // The ID of the partner that has access to the inventory source group. + * // + * // A partner cannot access advertiser-owned inventory source groups. + * partnerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "inventorySourceGroups": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.inventorySourceGroups.list * @memberOf! () * @@ -8614,6 +12081,62 @@ export namespace displayvideo_v1 { /** * displayvideo.inventorySources.get * @desc Gets an inventory source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.inventorySources.get({ + * // Required. The ID of the inventory source to fetch. + * inventorySourceId: '[^/]+', + * // Required. The ID of the DV360 partner to which the fetched inventory source + * // is permissioned. + * partnerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "commitment": "my_commitment", + * // "creativeConfigs": [], + * // "dealId": "my_dealId", + * // "deliveryMethod": "my_deliveryMethod", + * // "displayName": "my_displayName", + * // "exchange": "my_exchange", + * // "inventorySourceId": "my_inventorySourceId", + * // "inventorySourceType": "my_inventorySourceType", + * // "name": "my_name", + * // "publisherName": "my_publisherName", + * // "rateDetails": {}, + * // "status": {}, + * // "timeRange": {}, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.inventorySources.get * @memberOf! () * @@ -8688,6 +12211,92 @@ export namespace displayvideo_v1 { /** * displayvideo.inventorySources.list * @desc Lists inventory sources that are accessible to the current user. The order is defined by the order_by parameter. If a filter by entity_status is not specified, inventory sources with entity status `ENTITY_STATUS_ARCHIVED` will not be included in the results. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.inventorySources.list({ + * // The ID of the advertiser that has access to the inventory source. + * advertiserId: 'placeholder-value', + * // Allows filtering by inventory source properties. + * // + * // Supported syntax: + * // + * // * Filter expressions are made up of one or more restrictions. + * // * Restrictions can be combined by `AND` or `OR` logical operators. A + * // sequence of restrictions implicitly uses `AND`. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * The operator must be `EQUALS (=)`. + * // * Supported fields: + * // - `status.entityStatus` + * // - `commitment` + * // - `deliveryMethod` + * // - `rateDetails.rateType` + * // - `exchange` + * // + * // Examples: + * // + * // * All active inventory sources: + * // `status.entityStatus="ENTITY_STATUS_ACTIVE"` + * // * Inventory sources belonging to Google Ad Manager or Rubicon exchanges: + * // `exchange="EXCHANGE_GOOGLE_AD_MANAGER" OR exchange="EXCHANGE_RUBICON"` + * // + * // The length of this field should be no more than 500 characters. + * filter: 'placeholder-value', + * // Field by which to sort the list. + * // Acceptable values are: + * // + * // * `displayName` (default) + * // + * // The default sorting order is ascending. To specify descending order for + * // a field, a suffix "desc" should be added to the field name. For example, + * // `displayName desc`. + * orderBy: 'placeholder-value', + * // Requested page size. Must be between `1` and `100`. If unspecified will + * // default to `100`. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // next_page_token + * // returned from the previous call to `ListInventorySources` method. + * // If not specified, the first page of results will be returned. + * pageToken: 'placeholder-value', + * // The ID of the partner that has access to the inventory source. + * partnerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "inventorySources": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.inventorySources.list * @memberOf! () * @@ -8832,6 +12441,50 @@ export namespace displayvideo_v1 { /** * displayvideo.media.download * @desc Downloads media. Download is supported on the URI `/download/{resource_name=**}?alt=media.` **Note**: Download requests will not be successful without including `alt=media` query string. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video', + * 'https://www.googleapis.com/auth/doubleclickbidmanager', + * ], + * }); + * + * // 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 displayvideo.media.download({ + * // Name of the media that is being downloaded. See + * // ReadRequest.resource_name. + * resourceName: '.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "resourceName": "my_resourceName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.media.download * @memberOf! () * @@ -8937,6 +12590,54 @@ export namespace displayvideo_v1 { /** * displayvideo.partners.channels.get * @desc Gets a channel for a partner or advertiser. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.partners.channels.get({ + * // The ID of the advertiser that owns the fetched channel. + * advertiserId: 'placeholder-value', + * // Required. The ID of the channel to fetch. + * channelId: '[^/]+', + * // The ID of the partner that owns the fetched channel. + * partnerId: '[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "advertiserId": "my_advertiserId", + * // "channelId": "my_channelId", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "partnerId": "my_partnerId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.partners.channels.get * @memberOf! () * @@ -9010,6 +12711,87 @@ export namespace displayvideo_v1 { /** * displayvideo.partners.channels.list * @desc Lists channels for a partner or advertiser. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.partners.channels.list({ + * // The ID of the advertiser that owns the channels. + * advertiserId: 'placeholder-value', + * // Allows filtering by channel fields. + * // + * // Supported syntax: + * // + * // * Filter expressions for channel currently can only contain at most one + * // * restriction. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * The operator must be `CONTAINS (:)`. + * // * Supported fields: + * // - `displayName` + * // + * // Examples: + * // + * // * All channels for which the display name contains "google": + * // `displayName : "google"`. + * // + * // The length of this field should be no more than 500 characters. + * filter: 'placeholder-value', + * // Field by which to sort the list. + * // Acceptable values are: + * // + * // * `displayName` (default) + * // * `channelId` + * // + * // The default sorting order is ascending. To specify descending order for a + * // field, a suffix " desc" should be added to the field name. Example: + * // `displayName desc`. + * orderBy: 'placeholder-value', + * // Requested page size. Must be between `1` and `100`. If unspecified will + * // default to `100`. Returns error code `INVALID_ARGUMENT` if an invalid value + * // is specified. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // next_page_token returned from the + * // previous call to `ListChannels` method. If not specified, the first page + * // of results will be returned. + * pageToken: 'placeholder-value', + * // The ID of the partner that owns the channels. + * partnerId: '[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "channels": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.partners.channels.list * @memberOf! () * @@ -9153,6 +12935,60 @@ export namespace displayvideo_v1 { /** * displayvideo.sdfdownloadtasks.create * @desc Creates an SDF Download Task. Returns an Operation. An SDF Download Task is a long-running, asynchronous operation. The metadata type of this operation is SdfDownloadTaskMetadata. If the request is successful, the response type of the operation is SdfDownloadTask. The response will not include the download files, which must be retrieved with media.download. The state of operation can be retrieved with sdfdownloadtask.operations.get. Any errors can be found in the error.message. Note that error.details is expected to be empty. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.sdfdownloadtasks.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "advertiserId": "my_advertiserId", + * // "idFilter": {}, + * // "inventorySourceFilter": {}, + * // "parentEntityFilter": {}, + * // "partnerId": "my_partnerId", + * // "version": "my_version" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.sdfdownloadtasks.create * @memberOf! () * @@ -9247,6 +13083,53 @@ export namespace displayvideo_v1 { /** * displayvideo.sdfdownloadtasks.operations.get * @desc Gets the latest state of an asynchronous SDF download task operation. Clients should poll this method at intervals of 30 seconds. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video', + * 'https://www.googleapis.com/auth/doubleclickbidmanager', + * ], + * }); + * + * // 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 displayvideo.sdfdownloadtasks.operations.get({ + * // The name of the operation resource. + * name: 'sdfdownloadtasks/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.sdfdownloadtasks.operations.get * @memberOf! () * @@ -9349,6 +13232,77 @@ export namespace displayvideo_v1 { /** * displayvideo.targetingTypes.targetingOptions.get * @desc Gets a single targeting option. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.targetingTypes.targetingOptions.get({ + * // Required. The Advertiser this request is being made in the context of. + * advertiserId: 'placeholder-value', + * // Required. The ID of the of targeting option to retrieve. + * targetingOptionId: '[^/]+', + * // Required. The type of targeting option to retrieve. + * targetingType: '[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ageRangeDetails": {}, + * // "appCategoryDetails": {}, + * // "authorizedSellerStatusDetails": {}, + * // "browserDetails": {}, + * // "carrierAndIspDetails": {}, + * // "categoryDetails": {}, + * // "contentInstreamPositionDetails": {}, + * // "contentOutstreamPositionDetails": {}, + * // "deviceMakeModelDetails": {}, + * // "deviceTypeDetails": {}, + * // "digitalContentLabelDetails": {}, + * // "environmentDetails": {}, + * // "exchangeDetails": {}, + * // "genderDetails": {}, + * // "geoRegionDetails": {}, + * // "householdIncomeDetails": {}, + * // "languageDetails": {}, + * // "name": "my_name", + * // "onScreenPositionDetails": {}, + * // "operatingSystemDetails": {}, + * // "parentalStatusDetails": {}, + * // "sensitiveCategoryDetails": {}, + * // "subExchangeDetails": {}, + * // "targetingOptionId": "my_targetingOptionId", + * // "targetingType": "my_targetingType", + * // "userRewardedContentDetails": {}, + * // "videoPlayerSizeDetails": {}, + * // "viewabilityDetails": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.targetingTypes.targetingOptions.get * @memberOf! () * @@ -9425,6 +13379,81 @@ export namespace displayvideo_v1 { /** * displayvideo.targetingTypes.targetingOptions.list * @desc Lists targeting options of a given type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/displayvideo.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 displayvideo = google.displayvideo('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/display-video'], + * }); + * + * // 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 displayvideo.targetingTypes.targetingOptions.list({ + * // Required. The Advertiser this request is being made in the context of. + * advertiserId: 'placeholder-value', + * // Allows filtering by targeting option properties. + * // + * // Supported syntax: + * // + * // * Filter expressions are made up of one or more restrictions. + * // * Restrictions can be combined by `OR` logical operators. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * The operator must be "=" (equal sign). + * // * Supported fields: + * // - `targetingOptionId` + * // + * // The length of this field should be no more than 500 characters. + * filter: 'placeholder-value', + * // Field by which to sort the list. + * // Acceptable values are: + * // + * // * `targetingOptionId` (default) + * // + * // The default sorting order is ascending. To specify descending order for + * // a field, a suffix "desc" should be added to the field name. + * // Example: `targetingOptionId desc`. + * orderBy: 'placeholder-value', + * // Requested page size. Must be between `1` and `100`. If unspecified will + * // default to `100`. Returns error code `INVALID_ARGUMENT` if an invalid value + * // is specified. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // next_page_token + * // returned from the previous call to `ListTargetingOptions` method. + * // If not specified, the first page of results will be returned. + * pageToken: 'placeholder-value', + * // Required. The type of targeting option to be listed. + * targetingType: '[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "targetingOptions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias displayvideo.targetingTypes.targetingOptions.list * @memberOf! () * diff --git a/src/apis/dlp/v2.ts b/src/apis/dlp/v2.ts index 509e6ef31d2..cc58046f0ec 100644 --- a/src/apis/dlp/v2.ts +++ b/src/apis/dlp/v2.ts @@ -3132,6 +3132,54 @@ export namespace dlp_v2 { /** * dlp.infoTypes.list * @desc Returns a list of the sensitive information types that the DLP API supports. See https://cloud.google.com/dlp/docs/infotypes-reference to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.infoTypes.list({ + * // filter to only return infoTypes supported by certain parts of the + * // API. Defaults to supported_by=INSPECT. + * filter: 'placeholder-value', + * // BCP-47 language code for localized infoType friendly + * // names. If omitted, or if localized strings are not available, + * // en-US strings will be returned. + * languageCode: 'placeholder-value', + * // The geographic location to list info types. Reserved for future + * // extensions. + * locationId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "infoTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.infoTypes.list * @memberOf! () * @@ -3257,6 +3305,54 @@ export namespace dlp_v2 { /** * dlp.locations.infoTypes.list * @desc Returns a list of the sensitive information types that the DLP API supports. See https://cloud.google.com/dlp/docs/infotypes-reference to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.locations.infoTypes.list({ + * // filter to only return infoTypes supported by certain parts of the + * // API. Defaults to supported_by=INSPECT. + * filter: 'placeholder-value', + * // BCP-47 language code for localized infoType friendly + * // names. If omitted, or if localized strings are not available, + * // en-US strings will be returned. + * languageCode: 'placeholder-value', + * // The geographic location to list info types. Reserved for future + * // extensions. + * locationId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "infoTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.locations.infoTypes.list * @memberOf! () * @@ -3399,6 +3495,62 @@ export namespace dlp_v2 { /** * dlp.organizations.deidentifyTemplates.create * @desc Creates a DeidentifyTemplate for re-using frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.deidentifyTemplates.create({ + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deidentifyTemplate": {}, + * // "locationId": "my_locationId", + * // "templateId": "my_templateId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "deidentifyConfig": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.deidentifyTemplates.create * @memberOf! () * @@ -3491,6 +3643,47 @@ export namespace dlp_v2 { /** * dlp.organizations.deidentifyTemplates.delete * @desc Deletes a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.deidentifyTemplates.delete({ + * // Required. Resource name of the organization and deidentify template to be deleted, + * // for example `organizations/433245324/deidentifyTemplates/432452342` or + * // projects/project-id/deidentifyTemplates/432452342. + * name: + * 'organizations/my-organization/deidentifyTemplates/my-deidentifyTemplate', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.deidentifyTemplates.delete * @memberOf! () * @@ -3562,6 +3755,54 @@ export namespace dlp_v2 { /** * dlp.organizations.deidentifyTemplates.get * @desc Gets a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.deidentifyTemplates.get({ + * // Required. Resource name of the organization and deidentify template to be read, for + * // example `organizations/433245324/deidentifyTemplates/432452342` or + * // projects/project-id/deidentifyTemplates/432452342. + * name: + * 'organizations/my-organization/deidentifyTemplates/my-deidentifyTemplate', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "deidentifyConfig": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.deidentifyTemplates.get * @memberOf! () * @@ -3650,6 +3891,71 @@ export namespace dlp_v2 { /** * dlp.organizations.deidentifyTemplates.list * @desc Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.deidentifyTemplates.list({ + * // The geographic location where deidentifications templates will be retrieved + * // from. Use `-` for all locations. Reserved for future extensions. + * locationId: 'placeholder-value', + * // Comma separated list of fields to order by, + * // followed by `asc` or `desc` postfix. This list is case-insensitive, + * // default sorting order is ascending, redundant space characters are + * // insignificant. + * // + * // Example: `name asc,update_time, create_time desc` + * // + * // Supported fields are: + * // + * // - `create_time`: corresponds to time the template was created. + * // - `update_time`: corresponds to time the template was last updated. + * // - `name`: corresponds to template's name. + * // - `display_name`: corresponds to template's display name. + * orderBy: 'placeholder-value', + * // Size of the page, can be limited by server. If zero server returns + * // a page of max size 100. + * pageSize: 'placeholder-value', + * // Page token to continue retrieval. Comes from previous call + * // to `ListDeidentifyTemplates`. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'organizations/my-organization', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deidentifyTemplates": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.deidentifyTemplates.list * @memberOf! () * @@ -3752,6 +4058,63 @@ export namespace dlp_v2 { /** * dlp.organizations.deidentifyTemplates.patch * @desc Updates the DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.deidentifyTemplates.patch({ + * // Required. Resource name of organization and deidentify template to be updated, for + * // example `organizations/433245324/deidentifyTemplates/432452342` or + * // projects/project-id/deidentifyTemplates/432452342. + * name: + * 'organizations/my-organization/deidentifyTemplates/my-deidentifyTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deidentifyTemplate": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "deidentifyConfig": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.deidentifyTemplates.patch * @memberOf! () * @@ -3935,6 +4298,62 @@ export namespace dlp_v2 { /** * dlp.organizations.inspectTemplates.create * @desc Creates an InspectTemplate for re-using frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.inspectTemplates.create({ + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inspectTemplate": {}, + * // "locationId": "my_locationId", + * // "templateId": "my_templateId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "inspectConfig": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.inspectTemplates.create * @memberOf! () * @@ -4019,6 +4438,46 @@ export namespace dlp_v2 { /** * dlp.organizations.inspectTemplates.delete * @desc Deletes an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.inspectTemplates.delete({ + * // Required. Resource name of the organization and inspectTemplate to be deleted, for + * // example `organizations/433245324/inspectTemplates/432452342` or + * // projects/project-id/inspectTemplates/432452342. + * name: 'organizations/my-organization/inspectTemplates/my-inspectTemplate', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.inspectTemplates.delete * @memberOf! () * @@ -4090,6 +4549,53 @@ export namespace dlp_v2 { /** * dlp.organizations.inspectTemplates.get * @desc Gets an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.inspectTemplates.get({ + * // Required. Resource name of the organization and inspectTemplate to be read, for + * // example `organizations/433245324/inspectTemplates/432452342` or + * // projects/project-id/inspectTemplates/432452342. + * name: 'organizations/my-organization/inspectTemplates/my-inspectTemplate', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "inspectConfig": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.inspectTemplates.get * @memberOf! () * @@ -4170,6 +4676,71 @@ export namespace dlp_v2 { /** * dlp.organizations.inspectTemplates.list * @desc Lists InspectTemplates. See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.inspectTemplates.list({ + * // The geographic location where inspection templates will be retrieved from. + * // Use `-` for all locations. Reserved for future extensions. + * locationId: 'placeholder-value', + * // Comma separated list of fields to order by, + * // followed by `asc` or `desc` postfix. This list is case-insensitive, + * // default sorting order is ascending, redundant space characters are + * // insignificant. + * // + * // Example: `name asc,update_time, create_time desc` + * // + * // Supported fields are: + * // + * // - `create_time`: corresponds to time the template was created. + * // - `update_time`: corresponds to time the template was last updated. + * // - `name`: corresponds to template's name. + * // - `display_name`: corresponds to template's display name. + * orderBy: 'placeholder-value', + * // Size of the page, can be limited by server. If zero server returns + * // a page of max size 100. + * pageSize: 'placeholder-value', + * // Page token to continue retrieval. Comes from previous call + * // to `ListInspectTemplates`. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'organizations/my-organization', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "inspectTemplates": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.inspectTemplates.list * @memberOf! () * @@ -4273,6 +4844,62 @@ export namespace dlp_v2 { /** * dlp.organizations.inspectTemplates.patch * @desc Updates the InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.inspectTemplates.patch({ + * // Required. Resource name of organization and inspectTemplate to be updated, for + * // example `organizations/433245324/inspectTemplates/432452342` or + * // projects/project-id/inspectTemplates/432452342. + * name: 'organizations/my-organization/inspectTemplates/my-inspectTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inspectTemplate": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "inspectConfig": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.inspectTemplates.patch * @memberOf! () * @@ -4467,6 +5094,65 @@ export namespace dlp_v2 { /** * dlp.organizations.locations.deidentifyTemplates.create * @desc Creates a DeidentifyTemplate for re-using frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.locations.deidentifyTemplates.create({ + * // The geographic location to store the deidentification template. Reserved + * // for future extensions. + * locationId: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deidentifyTemplate": {}, + * // "locationId": "my_locationId", + * // "templateId": "my_templateId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "deidentifyConfig": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.locations.deidentifyTemplates.create * @memberOf! () * @@ -4560,6 +5246,47 @@ export namespace dlp_v2 { /** * dlp.organizations.locations.deidentifyTemplates.delete * @desc Deletes a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.locations.deidentifyTemplates.delete({ + * // Required. Resource name of the organization and deidentify template to be deleted, + * // for example `organizations/433245324/deidentifyTemplates/432452342` or + * // projects/project-id/deidentifyTemplates/432452342. + * name: + * 'organizations/my-organization/locations/my-location/deidentifyTemplates/my-deidentifyTemplate', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.locations.deidentifyTemplates.delete * @memberOf! () * @@ -4631,6 +5358,54 @@ export namespace dlp_v2 { /** * dlp.organizations.locations.deidentifyTemplates.get * @desc Gets a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.locations.deidentifyTemplates.get({ + * // Required. Resource name of the organization and deidentify template to be read, for + * // example `organizations/433245324/deidentifyTemplates/432452342` or + * // projects/project-id/deidentifyTemplates/432452342. + * name: + * 'organizations/my-organization/locations/my-location/deidentifyTemplates/my-deidentifyTemplate', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "deidentifyConfig": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.locations.deidentifyTemplates.get * @memberOf! () * @@ -4719,6 +5494,71 @@ export namespace dlp_v2 { /** * dlp.organizations.locations.deidentifyTemplates.list * @desc Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.locations.deidentifyTemplates.list({ + * // The geographic location where deidentifications templates will be retrieved + * // from. Use `-` for all locations. Reserved for future extensions. + * locationId: 'placeholder-value', + * // Comma separated list of fields to order by, + * // followed by `asc` or `desc` postfix. This list is case-insensitive, + * // default sorting order is ascending, redundant space characters are + * // insignificant. + * // + * // Example: `name asc,update_time, create_time desc` + * // + * // Supported fields are: + * // + * // - `create_time`: corresponds to time the template was created. + * // - `update_time`: corresponds to time the template was last updated. + * // - `name`: corresponds to template's name. + * // - `display_name`: corresponds to template's display name. + * orderBy: 'placeholder-value', + * // Size of the page, can be limited by server. If zero server returns + * // a page of max size 100. + * pageSize: 'placeholder-value', + * // Page token to continue retrieval. Comes from previous call + * // to `ListDeidentifyTemplates`. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'organizations/my-organization', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deidentifyTemplates": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.locations.deidentifyTemplates.list * @memberOf! () * @@ -4821,6 +5661,63 @@ export namespace dlp_v2 { /** * dlp.organizations.locations.deidentifyTemplates.patch * @desc Updates the DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.locations.deidentifyTemplates.patch({ + * // Required. Resource name of organization and deidentify template to be updated, for + * // example `organizations/433245324/deidentifyTemplates/432452342` or + * // projects/project-id/deidentifyTemplates/432452342. + * name: + * 'organizations/my-organization/locations/my-location/deidentifyTemplates/my-deidentifyTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deidentifyTemplate": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "deidentifyConfig": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.locations.deidentifyTemplates.patch * @memberOf! () * @@ -5008,6 +5905,65 @@ export namespace dlp_v2 { /** * dlp.organizations.locations.inspectTemplates.create * @desc Creates an InspectTemplate for re-using frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.locations.inspectTemplates.create({ + * // The geographic location to store the inspection template. Reserved for + * // future extensions. + * locationId: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inspectTemplate": {}, + * // "locationId": "my_locationId", + * // "templateId": "my_templateId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "inspectConfig": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.locations.inspectTemplates.create * @memberOf! () * @@ -5092,6 +6048,47 @@ export namespace dlp_v2 { /** * dlp.organizations.locations.inspectTemplates.delete * @desc Deletes an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.locations.inspectTemplates.delete({ + * // Required. Resource name of the organization and inspectTemplate to be deleted, for + * // example `organizations/433245324/inspectTemplates/432452342` or + * // projects/project-id/inspectTemplates/432452342. + * name: + * 'organizations/my-organization/locations/my-location/inspectTemplates/my-inspectTemplate', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.locations.inspectTemplates.delete * @memberOf! () * @@ -5163,6 +6160,54 @@ export namespace dlp_v2 { /** * dlp.organizations.locations.inspectTemplates.get * @desc Gets an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.locations.inspectTemplates.get({ + * // Required. Resource name of the organization and inspectTemplate to be read, for + * // example `organizations/433245324/inspectTemplates/432452342` or + * // projects/project-id/inspectTemplates/432452342. + * name: + * 'organizations/my-organization/locations/my-location/inspectTemplates/my-inspectTemplate', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "inspectConfig": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.locations.inspectTemplates.get * @memberOf! () * @@ -5243,6 +6288,71 @@ export namespace dlp_v2 { /** * dlp.organizations.locations.inspectTemplates.list * @desc Lists InspectTemplates. See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.locations.inspectTemplates.list({ + * // The geographic location where inspection templates will be retrieved from. + * // Use `-` for all locations. Reserved for future extensions. + * locationId: 'placeholder-value', + * // Comma separated list of fields to order by, + * // followed by `asc` or `desc` postfix. This list is case-insensitive, + * // default sorting order is ascending, redundant space characters are + * // insignificant. + * // + * // Example: `name asc,update_time, create_time desc` + * // + * // Supported fields are: + * // + * // - `create_time`: corresponds to time the template was created. + * // - `update_time`: corresponds to time the template was last updated. + * // - `name`: corresponds to template's name. + * // - `display_name`: corresponds to template's display name. + * orderBy: 'placeholder-value', + * // Size of the page, can be limited by server. If zero server returns + * // a page of max size 100. + * pageSize: 'placeholder-value', + * // Page token to continue retrieval. Comes from previous call + * // to `ListInspectTemplates`. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'organizations/my-organization', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "inspectTemplates": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.locations.inspectTemplates.list * @memberOf! () * @@ -5345,6 +6455,63 @@ export namespace dlp_v2 { /** * dlp.organizations.locations.inspectTemplates.patch * @desc Updates the InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.locations.inspectTemplates.patch({ + * // Required. Resource name of organization and inspectTemplate to be updated, for + * // example `organizations/433245324/inspectTemplates/432452342` or + * // projects/project-id/inspectTemplates/432452342. + * name: + * 'organizations/my-organization/locations/my-location/inspectTemplates/my-inspectTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inspectTemplate": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "inspectConfig": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.locations.inspectTemplates.patch * @memberOf! () * @@ -5524,6 +6691,62 @@ export namespace dlp_v2 { /** * dlp.organizations.locations.storedInfoTypes.create * @desc Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.locations.storedInfoTypes.create({ + * // The geographic location to store the stored infoType. Reserved for + * // future extensions. + * locationId: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "locationId": "my_locationId", + * // "storedInfoTypeId": "my_storedInfoTypeId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "currentVersion": {}, + * // "name": "my_name", + * // "pendingVersions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.locations.storedInfoTypes.create * @memberOf! () * @@ -5608,6 +6831,47 @@ export namespace dlp_v2 { /** * dlp.organizations.locations.storedInfoTypes.delete * @desc Deletes a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.locations.storedInfoTypes.delete({ + * // Required. Resource name of the organization and storedInfoType to be deleted, for + * // example `organizations/433245324/storedInfoTypes/432452342` or + * // projects/project-id/storedInfoTypes/432452342. + * name: + * 'organizations/my-organization/locations/my-location/storedInfoTypes/my-storedInfoType', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.locations.storedInfoTypes.delete * @memberOf! () * @@ -5679,6 +6943,51 @@ export namespace dlp_v2 { /** * dlp.organizations.locations.storedInfoTypes.get * @desc Gets a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.locations.storedInfoTypes.get({ + * // Required. Resource name of the organization and storedInfoType to be read, for + * // example `organizations/433245324/storedInfoTypes/432452342` or + * // projects/project-id/storedInfoTypes/432452342. + * name: + * 'organizations/my-organization/locations/my-location/storedInfoTypes/my-storedInfoType', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "currentVersion": {}, + * // "name": "my_name", + * // "pendingVersions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.locations.storedInfoTypes.get * @memberOf! () * @@ -5759,6 +7068,72 @@ export namespace dlp_v2 { /** * dlp.organizations.locations.storedInfoTypes.list * @desc Lists stored infoTypes. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.locations.storedInfoTypes.list({ + * // The geographic location where stored infoTypes will be retrieved from. + * // Use `-` for all locations. Reserved for future extensions. + * locationId: 'placeholder-value', + * // Comma separated list of fields to order by, + * // followed by `asc` or `desc` postfix. This list is case-insensitive, + * // default sorting order is ascending, redundant space characters are + * // insignificant. + * // + * // Example: `name asc, display_name, create_time desc` + * // + * // Supported fields are: + * // + * // - `create_time`: corresponds to time the most recent version of the + * // resource was created. + * // - `state`: corresponds to the state of the resource. + * // - `name`: corresponds to resource name. + * // - `display_name`: corresponds to info type's display name. + * orderBy: 'placeholder-value', + * // Size of the page, can be limited by server. If zero server returns + * // a page of max size 100. + * pageSize: 'placeholder-value', + * // Page token to continue retrieval. Comes from previous call + * // to `ListStoredInfoTypes`. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'organizations/my-organization', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "storedInfoTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.locations.storedInfoTypes.list * @memberOf! () * @@ -5861,6 +7236,60 @@ export namespace dlp_v2 { /** * dlp.organizations.locations.storedInfoTypes.patch * @desc Updates the stored infoType by creating a new version. The existing version will continue to be used until the new version is ready. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.locations.storedInfoTypes.patch({ + * // Required. Resource name of organization and storedInfoType to be updated, for + * // example `organizations/433245324/storedInfoTypes/432452342` or + * // projects/project-id/storedInfoTypes/432452342. + * name: + * 'organizations/my-organization/locations/my-location/storedInfoTypes/my-storedInfoType', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "currentVersion": {}, + * // "name": "my_name", + * // "pendingVersions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.locations.storedInfoTypes.patch * @memberOf! () * @@ -6040,6 +7469,59 @@ export namespace dlp_v2 { /** * dlp.organizations.storedInfoTypes.create * @desc Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.storedInfoTypes.create({ + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "locationId": "my_locationId", + * // "storedInfoTypeId": "my_storedInfoTypeId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "currentVersion": {}, + * // "name": "my_name", + * // "pendingVersions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.storedInfoTypes.create * @memberOf! () * @@ -6124,6 +7606,46 @@ export namespace dlp_v2 { /** * dlp.organizations.storedInfoTypes.delete * @desc Deletes a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.storedInfoTypes.delete({ + * // Required. Resource name of the organization and storedInfoType to be deleted, for + * // example `organizations/433245324/storedInfoTypes/432452342` or + * // projects/project-id/storedInfoTypes/432452342. + * name: 'organizations/my-organization/storedInfoTypes/my-storedInfoType', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.storedInfoTypes.delete * @memberOf! () * @@ -6195,6 +7717,50 @@ export namespace dlp_v2 { /** * dlp.organizations.storedInfoTypes.get * @desc Gets a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.storedInfoTypes.get({ + * // Required. Resource name of the organization and storedInfoType to be read, for + * // example `organizations/433245324/storedInfoTypes/432452342` or + * // projects/project-id/storedInfoTypes/432452342. + * name: 'organizations/my-organization/storedInfoTypes/my-storedInfoType', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "currentVersion": {}, + * // "name": "my_name", + * // "pendingVersions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.storedInfoTypes.get * @memberOf! () * @@ -6275,6 +7841,72 @@ export namespace dlp_v2 { /** * dlp.organizations.storedInfoTypes.list * @desc Lists stored infoTypes. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.storedInfoTypes.list({ + * // The geographic location where stored infoTypes will be retrieved from. + * // Use `-` for all locations. Reserved for future extensions. + * locationId: 'placeholder-value', + * // Comma separated list of fields to order by, + * // followed by `asc` or `desc` postfix. This list is case-insensitive, + * // default sorting order is ascending, redundant space characters are + * // insignificant. + * // + * // Example: `name asc, display_name, create_time desc` + * // + * // Supported fields are: + * // + * // - `create_time`: corresponds to time the most recent version of the + * // resource was created. + * // - `state`: corresponds to the state of the resource. + * // - `name`: corresponds to resource name. + * // - `display_name`: corresponds to info type's display name. + * orderBy: 'placeholder-value', + * // Size of the page, can be limited by server. If zero server returns + * // a page of max size 100. + * pageSize: 'placeholder-value', + * // Page token to continue retrieval. Comes from previous call + * // to `ListStoredInfoTypes`. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'organizations/my-organization', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "storedInfoTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.storedInfoTypes.list * @memberOf! () * @@ -6378,6 +8010,59 @@ export namespace dlp_v2 { /** * dlp.organizations.storedInfoTypes.patch * @desc Updates the stored infoType by creating a new version. The existing version will continue to be used until the new version is ready. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.organizations.storedInfoTypes.patch({ + * // Required. Resource name of organization and storedInfoType to be updated, for + * // example `organizations/433245324/storedInfoTypes/432452342` or + * // projects/project-id/storedInfoTypes/432452342. + * name: 'organizations/my-organization/storedInfoTypes/my-storedInfoType', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "currentVersion": {}, + * // "name": "my_name", + * // "pendingVersions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.organizations.storedInfoTypes.patch * @memberOf! () * @@ -6582,6 +8267,60 @@ export namespace dlp_v2 { /** * dlp.projects.content.deidentify * @desc De-identifies potentially sensitive info from a ContentItem. This method has limits on input size and output size. See https://cloud.google.com/dlp/docs/deidentify-sensitive-data to learn more. When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.content.deidentify({ + * // The parent resource name, for example projects/my-project-id. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deidentifyConfig": {}, + * // "deidentifyTemplateName": "my_deidentifyTemplateName", + * // "inspectConfig": {}, + * // "inspectTemplateName": "my_inspectTemplateName", + * // "item": {}, + * // "locationId": "my_locationId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "item": {}, + * // "overview": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.content.deidentify * @memberOf! () * @@ -6682,6 +8421,57 @@ export namespace dlp_v2 { /** * dlp.projects.content.inspect * @desc Finds potentially sensitive info in content. This method has limits on input size, processing time, and output size. When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated. For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images and https://cloud.google.com/dlp/docs/inspecting-text, + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.content.inspect({ + * // The parent resource name, for example projects/my-project-id. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inspectConfig": {}, + * // "inspectTemplateName": "my_inspectTemplateName", + * // "item": {}, + * // "locationId": "my_locationId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "result": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.content.inspect * @memberOf! () * @@ -6774,11 +8564,65 @@ export namespace dlp_v2 { /** * dlp.projects.content.reidentify * @desc Re-identifies content that has been de-identified. See https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example to learn more. - * @alias dlp.projects.content.reidentify - * @memberOf! () + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The parent resource name. + * const {google} = require('googleapis'); + * const dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.content.reidentify({ + * // Required. The parent resource name. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inspectConfig": {}, + * // "inspectTemplateName": "my_inspectTemplateName", + * // "item": {}, + * // "locationId": "my_locationId", + * // "reidentifyConfig": {}, + * // "reidentifyTemplateName": "my_reidentifyTemplateName" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "item": {}, + * // "overview": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias dlp.projects.content.reidentify + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The parent resource name. * @param {().GooglePrivacyDlpV2ReidentifyContentRequest} params.requestBody 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. @@ -6933,6 +8777,62 @@ export namespace dlp_v2 { /** * dlp.projects.deidentifyTemplates.create * @desc Creates a DeidentifyTemplate for re-using frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.deidentifyTemplates.create({ + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deidentifyTemplate": {}, + * // "locationId": "my_locationId", + * // "templateId": "my_templateId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "deidentifyConfig": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.deidentifyTemplates.create * @memberOf! () * @@ -7025,6 +8925,46 @@ export namespace dlp_v2 { /** * dlp.projects.deidentifyTemplates.delete * @desc Deletes a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.deidentifyTemplates.delete({ + * // Required. Resource name of the organization and deidentify template to be deleted, + * // for example `organizations/433245324/deidentifyTemplates/432452342` or + * // projects/project-id/deidentifyTemplates/432452342. + * name: 'projects/my-project/deidentifyTemplates/my-deidentifyTemplate', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.deidentifyTemplates.delete * @memberOf! () * @@ -7096,6 +9036,53 @@ export namespace dlp_v2 { /** * dlp.projects.deidentifyTemplates.get * @desc Gets a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.deidentifyTemplates.get({ + * // Required. Resource name of the organization and deidentify template to be read, for + * // example `organizations/433245324/deidentifyTemplates/432452342` or + * // projects/project-id/deidentifyTemplates/432452342. + * name: 'projects/my-project/deidentifyTemplates/my-deidentifyTemplate', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "deidentifyConfig": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.deidentifyTemplates.get * @memberOf! () * @@ -7184,6 +9171,71 @@ export namespace dlp_v2 { /** * dlp.projects.deidentifyTemplates.list * @desc Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.deidentifyTemplates.list({ + * // The geographic location where deidentifications templates will be retrieved + * // from. Use `-` for all locations. Reserved for future extensions. + * locationId: 'placeholder-value', + * // Comma separated list of fields to order by, + * // followed by `asc` or `desc` postfix. This list is case-insensitive, + * // default sorting order is ascending, redundant space characters are + * // insignificant. + * // + * // Example: `name asc,update_time, create_time desc` + * // + * // Supported fields are: + * // + * // - `create_time`: corresponds to time the template was created. + * // - `update_time`: corresponds to time the template was last updated. + * // - `name`: corresponds to template's name. + * // - `display_name`: corresponds to template's display name. + * orderBy: 'placeholder-value', + * // Size of the page, can be limited by server. If zero server returns + * // a page of max size 100. + * pageSize: 'placeholder-value', + * // Page token to continue retrieval. Comes from previous call + * // to `ListDeidentifyTemplates`. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deidentifyTemplates": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.deidentifyTemplates.list * @memberOf! () * @@ -7286,6 +9338,62 @@ export namespace dlp_v2 { /** * dlp.projects.deidentifyTemplates.patch * @desc Updates the DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.deidentifyTemplates.patch({ + * // Required. Resource name of organization and deidentify template to be updated, for + * // example `organizations/433245324/deidentifyTemplates/432452342` or + * // projects/project-id/deidentifyTemplates/432452342. + * name: 'projects/my-project/deidentifyTemplates/my-deidentifyTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deidentifyTemplate": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "deidentifyConfig": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.deidentifyTemplates.patch * @memberOf! () * @@ -7469,6 +9577,50 @@ export namespace dlp_v2 { /** * dlp.projects.dlpJobs.cancel * @desc Starts asynchronous cancellation on a long-running DlpJob. The server makes a best effort to cancel the DlpJob, but success is not guaranteed. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.dlpJobs.cancel({ + * // Required. The name of the DlpJob resource to be cancelled. + * name: 'projects/my-project/dlpJobs/my-dlpJob', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.dlpJobs.cancel * @memberOf! () * @@ -7541,6 +9693,66 @@ export namespace dlp_v2 { /** * dlp.projects.dlpJobs.create * @desc Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.dlpJobs.create({ + * // Required. The parent resource name, for example projects/my-project-id. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inspectJob": {}, + * // "jobId": "my_jobId", + * // "locationId": "my_locationId", + * // "riskJob": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "endTime": "my_endTime", + * // "errors": [], + * // "inspectDetails": {}, + * // "jobTriggerName": "my_jobTriggerName", + * // "name": "my_name", + * // "riskDetails": {}, + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.dlpJobs.create * @memberOf! () * @@ -7620,6 +9832,44 @@ export namespace dlp_v2 { /** * dlp.projects.dlpJobs.delete * @desc Deletes a long-running DlpJob. This method indicates that the client is no longer interested in the DlpJob result. The job will be cancelled if possible. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.dlpJobs.delete({ + * // Required. The name of the DlpJob resource to be deleted. + * name: 'projects/my-project/dlpJobs/my-dlpJob', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.dlpJobs.delete * @memberOf! () * @@ -7691,6 +9941,55 @@ export namespace dlp_v2 { /** * dlp.projects.dlpJobs.get * @desc Gets the latest state of a long-running DlpJob. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.dlpJobs.get({ + * // Required. The name of the DlpJob resource. + * name: 'projects/my-project/dlpJobs/my-dlpJob', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "endTime": "my_endTime", + * // "errors": [], + * // "inspectDetails": {}, + * // "jobTriggerName": "my_jobTriggerName", + * // "name": "my_name", + * // "riskDetails": {}, + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.dlpJobs.get * @memberOf! () * @@ -7764,6 +10063,99 @@ export namespace dlp_v2 { /** * dlp.projects.dlpJobs.list * @desc Lists DlpJobs that match the specified filter in the request. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.dlpJobs.list({ + * // Allows filtering. + * // + * // Supported syntax: + * // + * // * Filter expressions are made up of one or more restrictions. + * // * Restrictions can be combined by `AND` or `OR` logical operators. A + * // sequence of restrictions implicitly uses `AND`. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * Supported fields/values for inspect jobs: + * // - `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED + * // - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY + * // - `trigger_name` - The resource name of the trigger that created job. + * // - 'end_time` - Corresponds to time the job finished. + * // - 'start_time` - Corresponds to time the job finished. + * // * Supported fields for risk analysis jobs: + * // - `state` - RUNNING|CANCELED|FINISHED|FAILED + * // - 'end_time` - Corresponds to time the job finished. + * // - 'start_time` - Corresponds to time the job finished. + * // * The operator must be `=` or `!=`. + * // + * // Examples: + * // + * // * inspected_storage = cloud_storage AND state = done + * // * inspected_storage = cloud_storage OR inspected_storage = bigquery + * // * inspected_storage = cloud_storage AND (state = done OR state = canceled) + * // * end_time > \"2017-12-12T00:00:00+00:00\" + * // + * // The length of this field should be no more than 500 characters. + * filter: 'placeholder-value', + * // The geographic location where jobs will be retrieved from. + * // Use `-` for all locations. Reserved for future extensions. + * locationId: 'placeholder-value', + * // Comma separated list of fields to order by, + * // followed by `asc` or `desc` postfix. This list is case-insensitive, + * // default sorting order is ascending, redundant space characters are + * // insignificant. + * // + * // Example: `name asc, end_time asc, create_time desc` + * // + * // Supported fields are: + * // + * // - `create_time`: corresponds to time the job was created. + * // - `end_time`: corresponds to time the job ended. + * // - `name`: corresponds to job's name. + * // - `state`: corresponds to `state` + * orderBy: 'placeholder-value', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id. + * parent: 'projects/my-project', + * // The type of job. Defaults to `DlpJobType.INSPECT` + * type: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "jobs": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.dlpJobs.list * @memberOf! () * @@ -7963,6 +10355,60 @@ export namespace dlp_v2 { /** * dlp.projects.image.redact * @desc Redacts potentially sensitive info from an image. This method has limits on input size, processing time, and output size. See https://cloud.google.com/dlp/docs/redacting-sensitive-data-images to learn more. When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.image.redact({ + * // The parent resource name, for example projects/my-project-id. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "byteItem": {}, + * // "imageRedactionConfigs": [], + * // "includeFindings": false, + * // "inspectConfig": {}, + * // "locationId": "my_locationId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "extractedText": "my_extractedText", + * // "inspectResult": {}, + * // "redactedImage": "my_redactedImage" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.image.redact * @memberOf! () * @@ -8080,6 +10526,62 @@ export namespace dlp_v2 { /** * dlp.projects.inspectTemplates.create * @desc Creates an InspectTemplate for re-using frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.inspectTemplates.create({ + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inspectTemplate": {}, + * // "locationId": "my_locationId", + * // "templateId": "my_templateId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "inspectConfig": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.inspectTemplates.create * @memberOf! () * @@ -8164,6 +10666,46 @@ export namespace dlp_v2 { /** * dlp.projects.inspectTemplates.delete * @desc Deletes an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.inspectTemplates.delete({ + * // Required. Resource name of the organization and inspectTemplate to be deleted, for + * // example `organizations/433245324/inspectTemplates/432452342` or + * // projects/project-id/inspectTemplates/432452342. + * name: 'projects/my-project/inspectTemplates/my-inspectTemplate', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.inspectTemplates.delete * @memberOf! () * @@ -8235,6 +10777,53 @@ export namespace dlp_v2 { /** * dlp.projects.inspectTemplates.get * @desc Gets an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.inspectTemplates.get({ + * // Required. Resource name of the organization and inspectTemplate to be read, for + * // example `organizations/433245324/inspectTemplates/432452342` or + * // projects/project-id/inspectTemplates/432452342. + * name: 'projects/my-project/inspectTemplates/my-inspectTemplate', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "inspectConfig": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.inspectTemplates.get * @memberOf! () * @@ -8315,6 +10904,71 @@ export namespace dlp_v2 { /** * dlp.projects.inspectTemplates.list * @desc Lists InspectTemplates. See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.inspectTemplates.list({ + * // The geographic location where inspection templates will be retrieved from. + * // Use `-` for all locations. Reserved for future extensions. + * locationId: 'placeholder-value', + * // Comma separated list of fields to order by, + * // followed by `asc` or `desc` postfix. This list is case-insensitive, + * // default sorting order is ascending, redundant space characters are + * // insignificant. + * // + * // Example: `name asc,update_time, create_time desc` + * // + * // Supported fields are: + * // + * // - `create_time`: corresponds to time the template was created. + * // - `update_time`: corresponds to time the template was last updated. + * // - `name`: corresponds to template's name. + * // - `display_name`: corresponds to template's display name. + * orderBy: 'placeholder-value', + * // Size of the page, can be limited by server. If zero server returns + * // a page of max size 100. + * pageSize: 'placeholder-value', + * // Page token to continue retrieval. Comes from previous call + * // to `ListInspectTemplates`. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "inspectTemplates": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.inspectTemplates.list * @memberOf! () * @@ -8418,6 +11072,62 @@ export namespace dlp_v2 { /** * dlp.projects.inspectTemplates.patch * @desc Updates the InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.inspectTemplates.patch({ + * // Required. Resource name of organization and inspectTemplate to be updated, for + * // example `organizations/433245324/inspectTemplates/432452342` or + * // projects/project-id/inspectTemplates/432452342. + * name: 'projects/my-project/inspectTemplates/my-inspectTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inspectTemplate": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "inspectConfig": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.inspectTemplates.patch * @memberOf! () * @@ -8593,6 +11303,62 @@ export namespace dlp_v2 { /** * dlp.projects.jobTriggers.activate * @desc Activate a job trigger. Causes the immediate execute of a trigger instead of waiting on the trigger event to occur. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.jobTriggers.activate({ + * // Required. Resource name of the trigger to activate, for example + * // `projects/dlp-test-project/jobTriggers/53234423`. + * name: 'projects/my-project/jobTriggers/my-jobTrigger', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "endTime": "my_endTime", + * // "errors": [], + * // "inspectDetails": {}, + * // "jobTriggerName": "my_jobTriggerName", + * // "name": "my_name", + * // "riskDetails": {}, + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.jobTriggers.activate * @memberOf! () * @@ -8672,6 +11438,65 @@ export namespace dlp_v2 { /** * dlp.projects.jobTriggers.create * @desc Creates a job trigger to run DLP actions such as scanning storage for sensitive information on a set schedule. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.jobTriggers.create({ + * // Required. The parent resource name, for example projects/my-project-id. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "jobTrigger": {}, + * // "locationId": "my_locationId", + * // "triggerId": "my_triggerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "errors": [], + * // "inspectJob": {}, + * // "lastRunTime": "my_lastRunTime", + * // "name": "my_name", + * // "status": "my_status", + * // "triggers": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.jobTriggers.create * @memberOf! () * @@ -8756,6 +11581,45 @@ export namespace dlp_v2 { /** * dlp.projects.jobTriggers.delete * @desc Deletes a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.jobTriggers.delete({ + * // Required. Resource name of the project and the triggeredJob, for example + * // `projects/dlp-test-project/jobTriggers/53234423`. + * name: 'projects/my-project/jobTriggers/my-jobTrigger', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.jobTriggers.delete * @memberOf! () * @@ -8827,6 +11691,56 @@ export namespace dlp_v2 { /** * dlp.projects.jobTriggers.get * @desc Gets a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.jobTriggers.get({ + * // Required. Resource name of the project and the triggeredJob, for example + * // `projects/dlp-test-project/jobTriggers/53234423`. + * name: 'projects/my-project/jobTriggers/my-jobTrigger', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "errors": [], + * // "inspectJob": {}, + * // "lastRunTime": "my_lastRunTime", + * // "name": "my_name", + * // "status": "my_status", + * // "triggers": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.jobTriggers.get * @memberOf! () * @@ -8907,6 +11821,97 @@ export namespace dlp_v2 { /** * dlp.projects.jobTriggers.list * @desc Lists job triggers. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.jobTriggers.list({ + * // Allows filtering. + * // + * // Supported syntax: + * // + * // * Filter expressions are made up of one or more restrictions. + * // * Restrictions can be combined by `AND` or `OR` logical operators. A + * // sequence of restrictions implicitly uses `AND`. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * Supported fields/values for inspect jobs: + * // - `status` - HEALTHY|PAUSED|CANCELLED + * // - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY + * // - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by + * // quotation marks. Nanoseconds are ignored. + * // - 'error_count' - Number of errors that have occurred while running. + * // * The operator must be `=` or `!=` for status and inspected_storage. + * // + * // Examples: + * // + * // * inspected_storage = cloud_storage AND status = HEALTHY + * // * inspected_storage = cloud_storage OR inspected_storage = bigquery + * // * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY) + * // * last_run_time > \"2017-12-12T00:00:00+00:00\" + * // + * // The length of this field should be no more than 500 characters. + * filter: 'placeholder-value', + * // The geographic location where job triggers will be retrieved from. + * // Use `-` for all locations. Reserved for future extensions. + * locationId: 'placeholder-value', + * // Comma separated list of triggeredJob fields to order by, + * // followed by `asc` or `desc` postfix. This list is case-insensitive, + * // default sorting order is ascending, redundant space characters are + * // insignificant. + * // + * // Example: `name asc,update_time, create_time desc` + * // + * // Supported fields are: + * // + * // - `create_time`: corresponds to time the JobTrigger was created. + * // - `update_time`: corresponds to time the JobTrigger was last updated. + * // - `last_run_time`: corresponds to the last time the JobTrigger ran. + * // - `name`: corresponds to JobTrigger's name. + * // - `display_name`: corresponds to JobTrigger's display name. + * // - `status`: corresponds to JobTrigger's status. + * orderBy: 'placeholder-value', + * // Size of the page, can be limited by a server. + * pageSize: 'placeholder-value', + * // Page token to continue retrieval. Comes from previous call + * // to ListJobTriggers. `order_by` field must not + * // change for subsequent calls. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example `projects/my-project-id`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "jobTriggers": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.jobTriggers.list * @memberOf! () * @@ -9009,6 +12014,65 @@ export namespace dlp_v2 { /** * dlp.projects.jobTriggers.patch * @desc Updates a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.jobTriggers.patch({ + * // Required. Resource name of the project and the triggeredJob, for example + * // `projects/dlp-test-project/jobTriggers/53234423`. + * name: 'projects/my-project/jobTriggers/my-jobTrigger', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "jobTrigger": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "errors": [], + * // "inspectJob": {}, + * // "lastRunTime": "my_lastRunTime", + * // "name": "my_name", + * // "status": "my_status", + * // "triggers": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.jobTriggers.patch * @memberOf! () * @@ -9234,6 +12298,63 @@ export namespace dlp_v2 { /** * dlp.projects.locations.content.deidentify * @desc De-identifies potentially sensitive info from a ContentItem. This method has limits on input size and output size. See https://cloud.google.com/dlp/docs/deidentify-sensitive-data to learn more. When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.content.deidentify({ + * // The geographic location to process de-identification. Reserved for future + * // extensions. + * locationId: 'placeholder-value', + * // The parent resource name, for example projects/my-project-id. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deidentifyConfig": {}, + * // "deidentifyTemplateName": "my_deidentifyTemplateName", + * // "inspectConfig": {}, + * // "inspectTemplateName": "my_inspectTemplateName", + * // "item": {}, + * // "locationId": "my_locationId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "item": {}, + * // "overview": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.content.deidentify * @memberOf! () * @@ -9335,6 +12456,62 @@ export namespace dlp_v2 { /** * dlp.projects.locations.content.inspect * @desc Finds potentially sensitive info in content. This method has limits on input size, processing time, and output size. When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated. For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images and https://cloud.google.com/dlp/docs/inspecting-text, + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.content.inspect({ + * // The geographic location to process content inspection. Reserved for future + * // extensions. + * // When inspecting images location is restricted to 'global', 'us', 'asia', + * // and 'europe'. + * locationId: 'placeholder-value', + * // The parent resource name, for example projects/my-project-id. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inspectConfig": {}, + * // "inspectTemplateName": "my_inspectTemplateName", + * // "item": {}, + * // "locationId": "my_locationId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "result": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.content.inspect * @memberOf! () * @@ -9427,6 +12604,63 @@ export namespace dlp_v2 { /** * dlp.projects.locations.content.reidentify * @desc Re-identifies content that has been de-identified. See https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.content.reidentify({ + * // The geographic location to process content reidentification. Reserved for + * // future extensions. + * locationId: 'placeholder-value', + * // Required. The parent resource name. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inspectConfig": {}, + * // "inspectTemplateName": "my_inspectTemplateName", + * // "item": {}, + * // "locationId": "my_locationId", + * // "reidentifyConfig": {}, + * // "reidentifyTemplateName": "my_reidentifyTemplateName" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "item": {}, + * // "overview": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.content.reidentify * @memberOf! () * @@ -9599,6 +12833,65 @@ export namespace dlp_v2 { /** * dlp.projects.locations.deidentifyTemplates.create * @desc Creates a DeidentifyTemplate for re-using frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.deidentifyTemplates.create({ + * // The geographic location to store the deidentification template. Reserved + * // for future extensions. + * locationId: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deidentifyTemplate": {}, + * // "locationId": "my_locationId", + * // "templateId": "my_templateId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "deidentifyConfig": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.deidentifyTemplates.create * @memberOf! () * @@ -9692,6 +12985,47 @@ export namespace dlp_v2 { /** * dlp.projects.locations.deidentifyTemplates.delete * @desc Deletes a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.deidentifyTemplates.delete({ + * // Required. Resource name of the organization and deidentify template to be deleted, + * // for example `organizations/433245324/deidentifyTemplates/432452342` or + * // projects/project-id/deidentifyTemplates/432452342. + * name: + * 'projects/my-project/locations/my-location/deidentifyTemplates/my-deidentifyTemplate', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.deidentifyTemplates.delete * @memberOf! () * @@ -9763,6 +13097,54 @@ export namespace dlp_v2 { /** * dlp.projects.locations.deidentifyTemplates.get * @desc Gets a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.deidentifyTemplates.get({ + * // Required. Resource name of the organization and deidentify template to be read, for + * // example `organizations/433245324/deidentifyTemplates/432452342` or + * // projects/project-id/deidentifyTemplates/432452342. + * name: + * 'projects/my-project/locations/my-location/deidentifyTemplates/my-deidentifyTemplate', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "deidentifyConfig": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.deidentifyTemplates.get * @memberOf! () * @@ -9851,6 +13233,71 @@ export namespace dlp_v2 { /** * dlp.projects.locations.deidentifyTemplates.list * @desc Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.deidentifyTemplates.list({ + * // The geographic location where deidentifications templates will be retrieved + * // from. Use `-` for all locations. Reserved for future extensions. + * locationId: 'placeholder-value', + * // Comma separated list of fields to order by, + * // followed by `asc` or `desc` postfix. This list is case-insensitive, + * // default sorting order is ascending, redundant space characters are + * // insignificant. + * // + * // Example: `name asc,update_time, create_time desc` + * // + * // Supported fields are: + * // + * // - `create_time`: corresponds to time the template was created. + * // - `update_time`: corresponds to time the template was last updated. + * // - `name`: corresponds to template's name. + * // - `display_name`: corresponds to template's display name. + * orderBy: 'placeholder-value', + * // Size of the page, can be limited by server. If zero server returns + * // a page of max size 100. + * pageSize: 'placeholder-value', + * // Page token to continue retrieval. Comes from previous call + * // to `ListDeidentifyTemplates`. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deidentifyTemplates": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.deidentifyTemplates.list * @memberOf! () * @@ -9953,6 +13400,63 @@ export namespace dlp_v2 { /** * dlp.projects.locations.deidentifyTemplates.patch * @desc Updates the DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.deidentifyTemplates.patch({ + * // Required. Resource name of organization and deidentify template to be updated, for + * // example `organizations/433245324/deidentifyTemplates/432452342` or + * // projects/project-id/deidentifyTemplates/432452342. + * name: + * 'projects/my-project/locations/my-location/deidentifyTemplates/my-deidentifyTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deidentifyTemplate": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "deidentifyConfig": {}, + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.deidentifyTemplates.patch * @memberOf! () * @@ -10140,6 +13644,50 @@ export namespace dlp_v2 { /** * dlp.projects.locations.dlpJobs.cancel * @desc Starts asynchronous cancellation on a long-running DlpJob. The server makes a best effort to cancel the DlpJob, but success is not guaranteed. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.dlpJobs.cancel({ + * // Required. The name of the DlpJob resource to be cancelled. + * name: 'projects/my-project/locations/my-location/dlpJobs/my-dlpJob', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.dlpJobs.cancel * @memberOf! () * @@ -10212,6 +13760,69 @@ export namespace dlp_v2 { /** * dlp.projects.locations.dlpJobs.create * @desc Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.dlpJobs.create({ + * // The geographic location to store and process the job. Reserved for + * // future extensions. + * locationId: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inspectJob": {}, + * // "jobId": "my_jobId", + * // "locationId": "my_locationId", + * // "riskJob": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "endTime": "my_endTime", + * // "errors": [], + * // "inspectDetails": {}, + * // "jobTriggerName": "my_jobTriggerName", + * // "name": "my_name", + * // "riskDetails": {}, + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.dlpJobs.create * @memberOf! () * @@ -10291,6 +13902,44 @@ export namespace dlp_v2 { /** * dlp.projects.locations.dlpJobs.delete * @desc Deletes a long-running DlpJob. This method indicates that the client is no longer interested in the DlpJob result. The job will be cancelled if possible. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.dlpJobs.delete({ + * // Required. The name of the DlpJob resource to be deleted. + * name: 'projects/my-project/locations/my-location/dlpJobs/my-dlpJob', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.dlpJobs.delete * @memberOf! () * @@ -10362,6 +14011,50 @@ export namespace dlp_v2 { /** * dlp.projects.locations.dlpJobs.finish * @desc Finish a running hybrid DlpJob. Triggers the finalization steps and running of any enabled actions that have not yet run. Early access feature is in a pre-release state and might change or have limited support. For more information, see https://cloud.google.com/products#product-launch-stages. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.dlpJobs.finish({ + * // Required. The name of the DlpJob resource to be cancelled. + * name: 'projects/my-project/locations/my-location/dlpJobs/my-dlpJob', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.dlpJobs.finish * @memberOf! () * @@ -10434,6 +14127,55 @@ export namespace dlp_v2 { /** * dlp.projects.locations.dlpJobs.get * @desc Gets the latest state of a long-running DlpJob. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.dlpJobs.get({ + * // Required. The name of the DlpJob resource. + * name: 'projects/my-project/locations/my-location/dlpJobs/my-dlpJob', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "endTime": "my_endTime", + * // "errors": [], + * // "inspectDetails": {}, + * // "jobTriggerName": "my_jobTriggerName", + * // "name": "my_name", + * // "riskDetails": {}, + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.dlpJobs.get * @memberOf! () * @@ -10507,6 +14249,53 @@ export namespace dlp_v2 { /** * dlp.projects.locations.dlpJobs.hybridInspect * @desc Inspect hybrid content and store findings to a job. To review the findings inspect the job. Inspection will occur asynchronously. Early access feature is in a pre-release state and might change or have limited support. For more information, see https://cloud.google.com/products#product-launch-stages. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.dlpJobs.hybridInspect({ + * // Required. Resource name of the job to execute a hybrid inspect on, for example + * // `projects/dlp-test-project/dlpJob/53234423`. + * name: 'projects/my-project/locations/my-location/dlpJobs/my-dlpJob', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "hybridItem": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.dlpJobs.hybridInspect * @memberOf! () * @@ -10599,6 +14388,99 @@ export namespace dlp_v2 { /** * dlp.projects.locations.dlpJobs.list * @desc Lists DlpJobs that match the specified filter in the request. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.dlpJobs.list({ + * // Allows filtering. + * // + * // Supported syntax: + * // + * // * Filter expressions are made up of one or more restrictions. + * // * Restrictions can be combined by `AND` or `OR` logical operators. A + * // sequence of restrictions implicitly uses `AND`. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * Supported fields/values for inspect jobs: + * // - `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED + * // - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY + * // - `trigger_name` - The resource name of the trigger that created job. + * // - 'end_time` - Corresponds to time the job finished. + * // - 'start_time` - Corresponds to time the job finished. + * // * Supported fields for risk analysis jobs: + * // - `state` - RUNNING|CANCELED|FINISHED|FAILED + * // - 'end_time` - Corresponds to time the job finished. + * // - 'start_time` - Corresponds to time the job finished. + * // * The operator must be `=` or `!=`. + * // + * // Examples: + * // + * // * inspected_storage = cloud_storage AND state = done + * // * inspected_storage = cloud_storage OR inspected_storage = bigquery + * // * inspected_storage = cloud_storage AND (state = done OR state = canceled) + * // * end_time > \"2017-12-12T00:00:00+00:00\" + * // + * // The length of this field should be no more than 500 characters. + * filter: 'placeholder-value', + * // The geographic location where jobs will be retrieved from. + * // Use `-` for all locations. Reserved for future extensions. + * locationId: 'placeholder-value', + * // Comma separated list of fields to order by, + * // followed by `asc` or `desc` postfix. This list is case-insensitive, + * // default sorting order is ascending, redundant space characters are + * // insignificant. + * // + * // Example: `name asc, end_time asc, create_time desc` + * // + * // Supported fields are: + * // + * // - `create_time`: corresponds to time the job was created. + * // - `end_time`: corresponds to time the job ended. + * // - `name`: corresponds to job's name. + * // - `state`: corresponds to `state` + * orderBy: 'placeholder-value', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id. + * parent: 'projects/my-project', + * // The type of job. Defaults to `DlpJobType.INSPECT` + * type: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "jobs": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.dlpJobs.list * @memberOf! () * @@ -10835,6 +14717,64 @@ export namespace dlp_v2 { /** * dlp.projects.locations.image.redact * @desc Redacts potentially sensitive info from an image. This method has limits on input size, processing time, and output size. See https://cloud.google.com/dlp/docs/redacting-sensitive-data-images to learn more. When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.image.redact({ + * // The geographic location to process the request. Reserved for future + * // extensions. + * // Location is restricted to 'global', 'us', 'asia', and 'europe'. + * locationId: 'placeholder-value', + * // The parent resource name, for example projects/my-project-id. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "byteItem": {}, + * // "imageRedactionConfigs": [], + * // "includeFindings": false, + * // "inspectConfig": {}, + * // "locationId": "my_locationId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "extractedText": "my_extractedText", + * // "inspectResult": {}, + * // "redactedImage": "my_redactedImage" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.image.redact * @memberOf! () * @@ -10956,6 +14896,65 @@ export namespace dlp_v2 { /** * dlp.projects.locations.inspectTemplates.create * @desc Creates an InspectTemplate for re-using frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.inspectTemplates.create({ + * // The geographic location to store the inspection template. Reserved for + * // future extensions. + * locationId: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inspectTemplate": {}, + * // "locationId": "my_locationId", + * // "templateId": "my_templateId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "inspectConfig": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.inspectTemplates.create * @memberOf! () * @@ -11040,6 +15039,47 @@ export namespace dlp_v2 { /** * dlp.projects.locations.inspectTemplates.delete * @desc Deletes an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.inspectTemplates.delete({ + * // Required. Resource name of the organization and inspectTemplate to be deleted, for + * // example `organizations/433245324/inspectTemplates/432452342` or + * // projects/project-id/inspectTemplates/432452342. + * name: + * 'projects/my-project/locations/my-location/inspectTemplates/my-inspectTemplate', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.inspectTemplates.delete * @memberOf! () * @@ -11111,6 +15151,54 @@ export namespace dlp_v2 { /** * dlp.projects.locations.inspectTemplates.get * @desc Gets an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.inspectTemplates.get({ + * // Required. Resource name of the organization and inspectTemplate to be read, for + * // example `organizations/433245324/inspectTemplates/432452342` or + * // projects/project-id/inspectTemplates/432452342. + * name: + * 'projects/my-project/locations/my-location/inspectTemplates/my-inspectTemplate', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "inspectConfig": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.inspectTemplates.get * @memberOf! () * @@ -11191,6 +15279,71 @@ export namespace dlp_v2 { /** * dlp.projects.locations.inspectTemplates.list * @desc Lists InspectTemplates. See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.inspectTemplates.list({ + * // The geographic location where inspection templates will be retrieved from. + * // Use `-` for all locations. Reserved for future extensions. + * locationId: 'placeholder-value', + * // Comma separated list of fields to order by, + * // followed by `asc` or `desc` postfix. This list is case-insensitive, + * // default sorting order is ascending, redundant space characters are + * // insignificant. + * // + * // Example: `name asc,update_time, create_time desc` + * // + * // Supported fields are: + * // + * // - `create_time`: corresponds to time the template was created. + * // - `update_time`: corresponds to time the template was last updated. + * // - `name`: corresponds to template's name. + * // - `display_name`: corresponds to template's display name. + * orderBy: 'placeholder-value', + * // Size of the page, can be limited by server. If zero server returns + * // a page of max size 100. + * pageSize: 'placeholder-value', + * // Page token to continue retrieval. Comes from previous call + * // to `ListInspectTemplates`. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "inspectTemplates": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.inspectTemplates.list * @memberOf! () * @@ -11293,6 +15446,63 @@ export namespace dlp_v2 { /** * dlp.projects.locations.inspectTemplates.patch * @desc Updates the InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.inspectTemplates.patch({ + * // Required. Resource name of organization and inspectTemplate to be updated, for + * // example `organizations/433245324/inspectTemplates/432452342` or + * // projects/project-id/inspectTemplates/432452342. + * name: + * 'projects/my-project/locations/my-location/inspectTemplates/my-inspectTemplate', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inspectTemplate": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "inspectConfig": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.inspectTemplates.patch * @memberOf! () * @@ -11472,6 +15682,62 @@ export namespace dlp_v2 { /** * dlp.projects.locations.jobTriggers.activate * @desc Activate a job trigger. Causes the immediate execute of a trigger instead of waiting on the trigger event to occur. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.jobTriggers.activate({ + * // Required. Resource name of the trigger to activate, for example + * // `projects/dlp-test-project/jobTriggers/53234423`. + * name: 'projects/my-project/locations/my-location/jobTriggers/my-jobTrigger', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "endTime": "my_endTime", + * // "errors": [], + * // "inspectDetails": {}, + * // "jobTriggerName": "my_jobTriggerName", + * // "name": "my_name", + * // "riskDetails": {}, + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.jobTriggers.activate * @memberOf! () * @@ -11551,6 +15817,68 @@ export namespace dlp_v2 { /** * dlp.projects.locations.jobTriggers.create * @desc Creates a job trigger to run DLP actions such as scanning storage for sensitive information on a set schedule. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.jobTriggers.create({ + * // The geographic location to store the job trigger. Reserved for + * // future extensions. + * locationId: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "jobTrigger": {}, + * // "locationId": "my_locationId", + * // "triggerId": "my_triggerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "errors": [], + * // "inspectJob": {}, + * // "lastRunTime": "my_lastRunTime", + * // "name": "my_name", + * // "status": "my_status", + * // "triggers": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.jobTriggers.create * @memberOf! () * @@ -11635,6 +15963,45 @@ export namespace dlp_v2 { /** * dlp.projects.locations.jobTriggers.delete * @desc Deletes a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.jobTriggers.delete({ + * // Required. Resource name of the project and the triggeredJob, for example + * // `projects/dlp-test-project/jobTriggers/53234423`. + * name: 'projects/my-project/locations/my-location/jobTriggers/my-jobTrigger', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.jobTriggers.delete * @memberOf! () * @@ -11706,6 +16073,56 @@ export namespace dlp_v2 { /** * dlp.projects.locations.jobTriggers.get * @desc Gets a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.jobTriggers.get({ + * // Required. Resource name of the project and the triggeredJob, for example + * // `projects/dlp-test-project/jobTriggers/53234423`. + * name: 'projects/my-project/locations/my-location/jobTriggers/my-jobTrigger', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "errors": [], + * // "inspectJob": {}, + * // "lastRunTime": "my_lastRunTime", + * // "name": "my_name", + * // "status": "my_status", + * // "triggers": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.jobTriggers.get * @memberOf! () * @@ -11786,6 +16203,53 @@ export namespace dlp_v2 { /** * dlp.projects.locations.jobTriggers.hybridInspect * @desc Inspect hybrid content and store findings to a trigger. The inspection will be processed asynchronously. To review the findings monitor the jobs within the trigger. Early access feature is in a pre-release state and might change or have limited support. For more information, see https://cloud.google.com/products#product-launch-stages. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.jobTriggers.hybridInspect({ + * // Required. Resource name of the trigger to execute a hybrid inspect on, for example + * // `projects/dlp-test-project/jobTriggers/53234423`. + * name: 'projects/my-project/locations/my-location/jobTriggers/my-jobTrigger', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "hybridItem": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.jobTriggers.hybridInspect * @memberOf! () * @@ -11878,6 +16342,97 @@ export namespace dlp_v2 { /** * dlp.projects.locations.jobTriggers.list * @desc Lists job triggers. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.jobTriggers.list({ + * // Allows filtering. + * // + * // Supported syntax: + * // + * // * Filter expressions are made up of one or more restrictions. + * // * Restrictions can be combined by `AND` or `OR` logical operators. A + * // sequence of restrictions implicitly uses `AND`. + * // * A restriction has the form of `{field} {operator} {value}`. + * // * Supported fields/values for inspect jobs: + * // - `status` - HEALTHY|PAUSED|CANCELLED + * // - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY + * // - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by + * // quotation marks. Nanoseconds are ignored. + * // - 'error_count' - Number of errors that have occurred while running. + * // * The operator must be `=` or `!=` for status and inspected_storage. + * // + * // Examples: + * // + * // * inspected_storage = cloud_storage AND status = HEALTHY + * // * inspected_storage = cloud_storage OR inspected_storage = bigquery + * // * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY) + * // * last_run_time > \"2017-12-12T00:00:00+00:00\" + * // + * // The length of this field should be no more than 500 characters. + * filter: 'placeholder-value', + * // The geographic location where job triggers will be retrieved from. + * // Use `-` for all locations. Reserved for future extensions. + * locationId: 'placeholder-value', + * // Comma separated list of triggeredJob fields to order by, + * // followed by `asc` or `desc` postfix. This list is case-insensitive, + * // default sorting order is ascending, redundant space characters are + * // insignificant. + * // + * // Example: `name asc,update_time, create_time desc` + * // + * // Supported fields are: + * // + * // - `create_time`: corresponds to time the JobTrigger was created. + * // - `update_time`: corresponds to time the JobTrigger was last updated. + * // - `last_run_time`: corresponds to the last time the JobTrigger ran. + * // - `name`: corresponds to JobTrigger's name. + * // - `display_name`: corresponds to JobTrigger's display name. + * // - `status`: corresponds to JobTrigger's status. + * orderBy: 'placeholder-value', + * // Size of the page, can be limited by a server. + * pageSize: 'placeholder-value', + * // Page token to continue retrieval. Comes from previous call + * // to ListJobTriggers. `order_by` field must not + * // change for subsequent calls. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example `projects/my-project-id`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "jobTriggers": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.jobTriggers.list * @memberOf! () * @@ -11979,6 +16534,65 @@ export namespace dlp_v2 { /** * dlp.projects.locations.jobTriggers.patch * @desc Updates a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.jobTriggers.patch({ + * // Required. Resource name of the project and the triggeredJob, for example + * // `projects/dlp-test-project/jobTriggers/53234423`. + * name: 'projects/my-project/locations/my-location/jobTriggers/my-jobTrigger', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "jobTrigger": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "errors": [], + * // "inspectJob": {}, + * // "lastRunTime": "my_lastRunTime", + * // "name": "my_name", + * // "status": "my_status", + * // "triggers": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.jobTriggers.patch * @memberOf! () * @@ -12196,6 +16810,62 @@ export namespace dlp_v2 { /** * dlp.projects.locations.storedInfoTypes.create * @desc Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.storedInfoTypes.create({ + * // The geographic location to store the stored infoType. Reserved for + * // future extensions. + * locationId: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "locationId": "my_locationId", + * // "storedInfoTypeId": "my_storedInfoTypeId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "currentVersion": {}, + * // "name": "my_name", + * // "pendingVersions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.storedInfoTypes.create * @memberOf! () * @@ -12280,6 +16950,47 @@ export namespace dlp_v2 { /** * dlp.projects.locations.storedInfoTypes.delete * @desc Deletes a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.storedInfoTypes.delete({ + * // Required. Resource name of the organization and storedInfoType to be deleted, for + * // example `organizations/433245324/storedInfoTypes/432452342` or + * // projects/project-id/storedInfoTypes/432452342. + * name: + * 'projects/my-project/locations/my-location/storedInfoTypes/my-storedInfoType', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.storedInfoTypes.delete * @memberOf! () * @@ -12351,6 +17062,51 @@ export namespace dlp_v2 { /** * dlp.projects.locations.storedInfoTypes.get * @desc Gets a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.storedInfoTypes.get({ + * // Required. Resource name of the organization and storedInfoType to be read, for + * // example `organizations/433245324/storedInfoTypes/432452342` or + * // projects/project-id/storedInfoTypes/432452342. + * name: + * 'projects/my-project/locations/my-location/storedInfoTypes/my-storedInfoType', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "currentVersion": {}, + * // "name": "my_name", + * // "pendingVersions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.storedInfoTypes.get * @memberOf! () * @@ -12431,6 +17187,72 @@ export namespace dlp_v2 { /** * dlp.projects.locations.storedInfoTypes.list * @desc Lists stored infoTypes. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.storedInfoTypes.list({ + * // The geographic location where stored infoTypes will be retrieved from. + * // Use `-` for all locations. Reserved for future extensions. + * locationId: 'placeholder-value', + * // Comma separated list of fields to order by, + * // followed by `asc` or `desc` postfix. This list is case-insensitive, + * // default sorting order is ascending, redundant space characters are + * // insignificant. + * // + * // Example: `name asc, display_name, create_time desc` + * // + * // Supported fields are: + * // + * // - `create_time`: corresponds to time the most recent version of the + * // resource was created. + * // - `state`: corresponds to the state of the resource. + * // - `name`: corresponds to resource name. + * // - `display_name`: corresponds to info type's display name. + * orderBy: 'placeholder-value', + * // Size of the page, can be limited by server. If zero server returns + * // a page of max size 100. + * pageSize: 'placeholder-value', + * // Page token to continue retrieval. Comes from previous call + * // to `ListStoredInfoTypes`. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "storedInfoTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.storedInfoTypes.list * @memberOf! () * @@ -12533,6 +17355,60 @@ export namespace dlp_v2 { /** * dlp.projects.locations.storedInfoTypes.patch * @desc Updates the stored infoType by creating a new version. The existing version will continue to be used until the new version is ready. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.locations.storedInfoTypes.patch({ + * // Required. Resource name of organization and storedInfoType to be updated, for + * // example `organizations/433245324/storedInfoTypes/432452342` or + * // projects/project-id/storedInfoTypes/432452342. + * name: + * 'projects/my-project/locations/my-location/storedInfoTypes/my-storedInfoType', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "currentVersion": {}, + * // "name": "my_name", + * // "pendingVersions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.locations.storedInfoTypes.patch * @memberOf! () * @@ -12712,6 +17588,59 @@ export namespace dlp_v2 { /** * dlp.projects.storedInfoTypes.create * @desc Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.storedInfoTypes.create({ + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "locationId": "my_locationId", + * // "storedInfoTypeId": "my_storedInfoTypeId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "currentVersion": {}, + * // "name": "my_name", + * // "pendingVersions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.storedInfoTypes.create * @memberOf! () * @@ -12796,6 +17725,46 @@ export namespace dlp_v2 { /** * dlp.projects.storedInfoTypes.delete * @desc Deletes a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.storedInfoTypes.delete({ + * // Required. Resource name of the organization and storedInfoType to be deleted, for + * // example `organizations/433245324/storedInfoTypes/432452342` or + * // projects/project-id/storedInfoTypes/432452342. + * name: 'projects/my-project/storedInfoTypes/my-storedInfoType', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.storedInfoTypes.delete * @memberOf! () * @@ -12867,6 +17836,50 @@ export namespace dlp_v2 { /** * dlp.projects.storedInfoTypes.get * @desc Gets a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.storedInfoTypes.get({ + * // Required. Resource name of the organization and storedInfoType to be read, for + * // example `organizations/433245324/storedInfoTypes/432452342` or + * // projects/project-id/storedInfoTypes/432452342. + * name: 'projects/my-project/storedInfoTypes/my-storedInfoType', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "currentVersion": {}, + * // "name": "my_name", + * // "pendingVersions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.storedInfoTypes.get * @memberOf! () * @@ -12947,6 +17960,72 @@ export namespace dlp_v2 { /** * dlp.projects.storedInfoTypes.list * @desc Lists stored infoTypes. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.storedInfoTypes.list({ + * // The geographic location where stored infoTypes will be retrieved from. + * // Use `-` for all locations. Reserved for future extensions. + * locationId: 'placeholder-value', + * // Comma separated list of fields to order by, + * // followed by `asc` or `desc` postfix. This list is case-insensitive, + * // default sorting order is ascending, redundant space characters are + * // insignificant. + * // + * // Example: `name asc, display_name, create_time desc` + * // + * // Supported fields are: + * // + * // - `create_time`: corresponds to time the most recent version of the + * // resource was created. + * // - `state`: corresponds to the state of the resource. + * // - `name`: corresponds to resource name. + * // - `display_name`: corresponds to info type's display name. + * orderBy: 'placeholder-value', + * // Size of the page, can be limited by server. If zero server returns + * // a page of max size 100. + * pageSize: 'placeholder-value', + * // Page token to continue retrieval. Comes from previous call + * // to `ListStoredInfoTypes`. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example projects/my-project-id or + * // organizations/my-org-id. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "storedInfoTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.storedInfoTypes.list * @memberOf! () * @@ -13050,6 +18129,59 @@ export namespace dlp_v2 { /** * dlp.projects.storedInfoTypes.patch * @desc Updates the stored infoType by creating a new version. The existing version will continue to be used until the new version is ready. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dlp.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 dlp = google.dlp('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 dlp.projects.storedInfoTypes.patch({ + * // Required. Resource name of organization and storedInfoType to be updated, for + * // example `organizations/433245324/storedInfoTypes/432452342` or + * // projects/project-id/storedInfoTypes/432452342. + * name: 'projects/my-project/storedInfoTypes/my-storedInfoType', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "currentVersion": {}, + * // "name": "my_name", + * // "pendingVersions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dlp.projects.storedInfoTypes.patch * @memberOf! () * diff --git a/src/apis/dns/v1.ts b/src/apis/dns/v1.ts index 0d9332add68..c1e8c8651bc 100644 --- a/src/apis/dns/v1.ts +++ b/src/apis/dns/v1.ts @@ -730,62 +730,72 @@ export namespace dns_v1 { * dns.changes.create * @desc Atomically update the ResourceRecordSet collection. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` * - * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * managedZone: 'my-managed-zone', // TODO: Update placeholder value. + * const {google} = require('googleapis'); + * const dns = google.dns('v1'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * dns.changes.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await dns.changes.create({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "additions": [], + * // "deletions": [], + * // "id": "my_id", + * // "isServing": false, + * // "kind": "my_kind", + * // "startTime": "my_startTime", + * // "status": "my_status" + * // } + * }, * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); + * // Example response + * // { + * // "additions": [], + * // "deletions": [], + * // "id": "my_id", + * // "isServing": false, + * // "kind": "my_kind", + * // "startTime": "my_startTime", + * // "status": "my_status" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.changes.create * @memberOf! () * @@ -861,61 +871,62 @@ export namespace dns_v1 { * dns.changes.get * @desc Fetch the representation of an existing Change. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` * - * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * managedZone: 'my-managed-zone', // TODO: Update placeholder value. - * - * // The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse. - * changeId: 'my-change-id', // TODO: Update placeholder value. + * const {google} = require('googleapis'); + * const dns = google.dns('v1'); * - * auth: authClient, - * }; + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * dns.changes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await dns.changes.get({ + * // The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse. + * changeId: 'placeholder-value', + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); + * // Example response + * // { + * // "additions": [], + * // "deletions": [], + * // "id": "my_id", + * // "isServing": false, + * // "kind": "my_kind", + * // "startTime": "my_startTime", + * // "status": "my_status" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.changes.get * @memberOf! () * @@ -991,71 +1002,63 @@ export namespace dns_v1 { * dns.changes.list * @desc Enumerate Changes to a ResourceRecordSet collection. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` * - * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * managedZone: 'my-managed-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var changesPage = response['changes']; - * if (!changesPage) { - * return; - * } - * for (var i = 0; i < changesPage.length; i++) { - * // TODO: Change code below to process each resource in `changesPage`: - * console.log(JSON.stringify(changesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dns.changes.list(request, handlePage); - * } - * }; - * - * dns.changes.list(request, handlePage); - * }); + * const {google} = require('googleapis'); + * const dns = google.dns('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); + * // 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 dns.changes.list({ + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * maxResults: 'placeholder-value', + * // Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * pageToken: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * // Sorting criterion. The only supported value is change sequence. + * sortBy: 'placeholder-value', + * // Sorting order direction: 'ascending' or 'descending'. + * sortOrder: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "changes": [], + * // "header": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.changes.list * @memberOf! () * @@ -1220,6 +1223,69 @@ export namespace dns_v1 { /** * dns.dnsKeys.get * @desc Fetch the representation of an existing DnsKey. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.dnsKeys.get({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed. + * digestType: 'placeholder-value', + * // The identifier of the requested DnsKey. + * dnsKeyId: 'placeholder-value', + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "algorithm": "my_algorithm", + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "digests": [], + * // "id": "my_id", + * // "isActive": false, + * // "keyLength": 0, + * // "keyTag": 0, + * // "kind": "my_kind", + * // "publicKey": "my_publicKey", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.dnsKeys.get * @memberOf! () * @@ -1295,6 +1361,62 @@ export namespace dns_v1 { /** * dns.dnsKeys.list * @desc Enumerate DnsKeys to a ResourceRecordSet collection. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.dnsKeys.list({ + * // An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed. + * digestType: 'placeholder-value', + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * maxResults: 'placeholder-value', + * // Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * pageToken: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dnsKeys": [], + * // "header": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.dnsKeys.list * @memberOf! () * @@ -1434,6 +1556,64 @@ export namespace dns_v1 { /** * dns.managedZoneOperations.get * @desc Fetch the representation of an existing Operation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.managedZoneOperations.get({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the managed zone addressed by this request. + * managedZone: 'placeholder-value', + * // Identifies the operation addressed by this request. + * operation: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dnsKeyContext": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "type": "my_type", + * // "user": "my_user", + * // "zoneContext": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.managedZoneOperations.get * @memberOf! () * @@ -1511,6 +1691,62 @@ export namespace dns_v1 { /** * dns.managedZoneOperations.list * @desc Enumerate Operations for the given ManagedZone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.managedZoneOperations.list({ + * // Identifies the managed zone addressed by this request. + * managedZone: 'placeholder-value', + * // Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * maxResults: 'placeholder-value', + * // Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * pageToken: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * // Sorting criterion. The only supported values are START_TIME and ID. + * sortBy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "header": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.managedZoneOperations.list * @memberOf! () * @@ -1659,59 +1895,84 @@ export namespace dns_v1 { * dns.managedZones.create * @desc Create a new ManagedZone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * const {google} = require('googleapis'); + * const dns = google.dns('v1'); * - * auth: authClient, - * }; + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * dns.managedZones.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); + * // Do the magic + * const res = await dns.managedZones.create({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "dnsName": "my_dnsName", + * // "dnssecConfig": {}, + * // "forwardingConfig": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "name": "my_name", + * // "nameServerSet": "my_nameServerSet", + * // "nameServers": [], + * // "peeringConfig": {}, + * // "privateVisibilityConfig": {}, + * // "visibility": "my_visibility" + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "dnsName": "my_dnsName", + * // "dnssecConfig": {}, + * // "forwardingConfig": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "name": "my_name", + * // "nameServerSet": "my_nameServerSet", + * // "nameServers": [], + * // "peeringConfig": {}, + * // "privateVisibilityConfig": {}, + * // "visibility": "my_visibility" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.managedZones.create * @memberOf! () * @@ -1789,55 +2050,47 @@ export namespace dns_v1 { * dns.managedZones.delete * @desc Delete a previously created ManagedZone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * managedZone: 'my-managed-zone', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` * - * auth: authClient, - * }; + * const {google} = require('googleapis'); + * const dns = google.dns('v1'); * - * dns.managedZones.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], * }); - * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); + * // 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 dns.managedZones.delete({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', * }); + * console.log(res.data); * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.managedZones.delete * @memberOf! () * @@ -1912,58 +2165,67 @@ export namespace dns_v1 { * dns.managedZones.get * @desc Fetch the representation of an existing ManagedZone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` * - * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * managedZone: 'my-managed-zone', // TODO: Update placeholder value. + * const {google} = require('googleapis'); + * const dns = google.dns('v1'); * - * auth: authClient, - * }; + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * dns.managedZones.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await dns.managedZones.get({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); - * }); + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "dnsName": "my_dnsName", + * // "dnssecConfig": {}, + * // "forwardingConfig": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "name": "my_name", + * // "nameServerSet": "my_nameServerSet", + * // "nameServers": [], + * // "peeringConfig": {}, + * // "privateVisibilityConfig": {}, + * // "visibility": "my_visibility" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.managedZones.get * @memberOf! () * @@ -2039,68 +2301,59 @@ export namespace dns_v1 { * dns.managedZones.list * @desc Enumerate ManagedZones that have been created but not yet deleted. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var managedZonesPage = response['managedZones']; - * if (!managedZonesPage) { - * return; - * } - * for (var i = 0; i < managedZonesPage.length; i++) { - * // TODO: Change code below to process each resource in `managedZonesPage`: - * console.log(JSON.stringify(managedZonesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dns.managedZones.list(request, handlePage); - * } - * }; - * - * dns.managedZones.list(request, handlePage); - * }); + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); + * // 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 dns.managedZones.list({ + * // Restricts the list to return only zones with this domain name. + * dnsName: 'placeholder-value', + * // Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * maxResults: 'placeholder-value', + * // Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * pageToken: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "header": {}, + * // "kind": "my_kind", + * // "managedZones": [], + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.managedZones.list * @memberOf! () * @@ -2180,6 +2433,81 @@ export namespace dns_v1 { /** * dns.managedZones.patch * @desc Apply a partial update to an existing ManagedZone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.managedZones.patch({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "dnsName": "my_dnsName", + * // "dnssecConfig": {}, + * // "forwardingConfig": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "name": "my_name", + * // "nameServerSet": "my_nameServerSet", + * // "nameServers": [], + * // "peeringConfig": {}, + * // "privateVisibilityConfig": {}, + * // "visibility": "my_visibility" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dnsKeyContext": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "type": "my_type", + * // "user": "my_user", + * // "zoneContext": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.managedZones.patch * @memberOf! () * @@ -2256,6 +2584,81 @@ export namespace dns_v1 { /** * dns.managedZones.update * @desc Update an existing ManagedZone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.managedZones.update({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "dnsName": "my_dnsName", + * // "dnssecConfig": {}, + * // "forwardingConfig": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "name": "my_name", + * // "nameServerSet": "my_nameServerSet", + * // "nameServers": [], + * // "peeringConfig": {}, + * // "privateVisibilityConfig": {}, + * // "visibility": "my_visibility" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dnsKeyContext": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "type": "my_type", + * // "user": "my_user", + * // "zoneContext": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.managedZones.update * @memberOf! () * @@ -2474,6 +2877,73 @@ export namespace dns_v1 { /** * dns.policies.create * @desc Create a new Policy + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.policies.create({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternativeNameServerConfig": {}, + * // "description": "my_description", + * // "enableInboundForwarding": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networks": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternativeNameServerConfig": {}, + * // "description": "my_description", + * // "enableInboundForwarding": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.policies.create * @memberOf! () * @@ -2547,6 +3017,48 @@ export namespace dns_v1 { /** * dns.policies.delete * @desc Delete a previously created Policy. Will fail if the policy is still being referenced by a network. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.policies.delete({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // User given friendly name of the policy addressed by this request. + * policy: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.policies.delete * @memberOf! () * @@ -2619,6 +3131,62 @@ export namespace dns_v1 { /** * dns.policies.get * @desc Fetch the representation of an existing Policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.policies.get({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // User given friendly name of the policy addressed by this request. + * policy: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternativeNameServerConfig": {}, + * // "description": "my_description", + * // "enableInboundForwarding": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.policies.get * @memberOf! () * @@ -2691,6 +3259,58 @@ export namespace dns_v1 { /** * dns.policies.list * @desc Enumerate all Policies associated with a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.policies.list({ + * // Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * maxResults: 'placeholder-value', + * // Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * pageToken: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "header": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "policies": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.policies.list * @memberOf! () * @@ -2768,6 +3388,69 @@ export namespace dns_v1 { /** * dns.policies.patch * @desc Apply a partial update to an existing Policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.policies.patch({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // User given friendly name of the policy addressed by this request. + * policy: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternativeNameServerConfig": {}, + * // "description": "my_description", + * // "enableInboundForwarding": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networks": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "header": {}, + * // "policy": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.policies.patch * @memberOf! () * @@ -2845,6 +3528,69 @@ export namespace dns_v1 { /** * dns.policies.update * @desc Update an existing Policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.policies.update({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // User given friendly name of the policy addressed by this request. + * policy: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternativeNameServerConfig": {}, + * // "description": "my_description", + * // "enableInboundForwarding": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networks": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "header": {}, + * // "policy": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.policies.update * @memberOf! () * @@ -3056,55 +3802,55 @@ export namespace dns_v1 { * dns.projects.get * @desc Fetch the representation of an existing Project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` * - * auth: authClient, - * }; + * const {google} = require('googleapis'); + * const dns = google.dns('v1'); * - * dns.projects.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], * }); - * }); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); + * // 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 dns.projects.get({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "number": "my_number", + * // "quota": {} + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.projects.get * @memberOf! () * @@ -3201,71 +3947,63 @@ export namespace dns_v1 { * dns.resourceRecordSets.list * @desc Enumerate ResourceRecordSets that have been created but not yet deleted. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` * - * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * managedZone: 'my-managed-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var rrsetsPage = response['rrsets']; - * if (!rrsetsPage) { - * return; - * } - * for (var i = 0; i < rrsetsPage.length; i++) { - * // TODO: Change code below to process each resource in `rrsetsPage`: - * console.log(JSON.stringify(rrsetsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dns.resourceRecordSets.list(request, handlePage); - * } - * }; - * - * dns.resourceRecordSets.list(request, handlePage); - * }); + * const {google} = require('googleapis'); + * const dns = google.dns('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * callback(authClient); + * // Do the magic + * const res = await dns.resourceRecordSets.list({ + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * maxResults: 'placeholder-value', + * // Restricts the list to return only records with this fully qualified domain name. + * name: 'placeholder-value', + * // Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * pageToken: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * // Restricts the list to return only records of this type. If present, the "name" parameter must also be present. + * type: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "header": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "rrsets": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.resourceRecordSets.list * @memberOf! () * diff --git a/src/apis/dns/v1beta2.ts b/src/apis/dns/v1beta2.ts index 2d47803ba15..9244b82bda4 100644 --- a/src/apis/dns/v1beta2.ts +++ b/src/apis/dns/v1beta2.ts @@ -747,6 +747,73 @@ export namespace dns_v1beta2 { /** * dns.changes.create * @desc Atomically update the ResourceRecordSet collection. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.changes.create({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "additions": [], + * // "deletions": [], + * // "id": "my_id", + * // "isServing": false, + * // "kind": "my_kind", + * // "startTime": "my_startTime", + * // "status": "my_status" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "additions": [], + * // "deletions": [], + * // "id": "my_id", + * // "isServing": false, + * // "kind": "my_kind", + * // "startTime": "my_startTime", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.changes.create * @memberOf! () * @@ -821,6 +888,63 @@ export namespace dns_v1beta2 { /** * dns.changes.get * @desc Fetch the representation of an existing Change. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.changes.get({ + * // The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse. + * changeId: 'placeholder-value', + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "additions": [], + * // "deletions": [], + * // "id": "my_id", + * // "isServing": false, + * // "kind": "my_kind", + * // "startTime": "my_startTime", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.changes.get * @memberOf! () * @@ -895,6 +1019,64 @@ export namespace dns_v1beta2 { /** * dns.changes.list * @desc Enumerate Changes to a ResourceRecordSet collection. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.changes.list({ + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * maxResults: 'placeholder-value', + * // Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * pageToken: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * // Sorting criterion. The only supported value is change sequence. + * sortBy: 'placeholder-value', + * // Sorting order direction: 'ascending' or 'descending'. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "changes": [], + * // "header": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.changes.list * @memberOf! () * @@ -1059,6 +1241,69 @@ export namespace dns_v1beta2 { /** * dns.dnsKeys.get * @desc Fetch the representation of an existing DnsKey. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.dnsKeys.get({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed. + * digestType: 'placeholder-value', + * // The identifier of the requested DnsKey. + * dnsKeyId: 'placeholder-value', + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "algorithm": "my_algorithm", + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "digests": [], + * // "id": "my_id", + * // "isActive": false, + * // "keyLength": 0, + * // "keyTag": 0, + * // "kind": "my_kind", + * // "publicKey": "my_publicKey", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.dnsKeys.get * @memberOf! () * @@ -1134,6 +1379,62 @@ export namespace dns_v1beta2 { /** * dns.dnsKeys.list * @desc Enumerate DnsKeys to a ResourceRecordSet collection. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.dnsKeys.list({ + * // An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed. + * digestType: 'placeholder-value', + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * maxResults: 'placeholder-value', + * // Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * pageToken: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dnsKeys": [], + * // "header": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.dnsKeys.list * @memberOf! () * @@ -1273,6 +1574,64 @@ export namespace dns_v1beta2 { /** * dns.managedZoneOperations.get * @desc Fetch the representation of an existing Operation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.managedZoneOperations.get({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the managed zone addressed by this request. + * managedZone: 'placeholder-value', + * // Identifies the operation addressed by this request. + * operation: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dnsKeyContext": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "type": "my_type", + * // "user": "my_user", + * // "zoneContext": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.managedZoneOperations.get * @memberOf! () * @@ -1350,6 +1709,62 @@ export namespace dns_v1beta2 { /** * dns.managedZoneOperations.list * @desc Enumerate Operations for the given ManagedZone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.managedZoneOperations.list({ + * // Identifies the managed zone addressed by this request. + * managedZone: 'placeholder-value', + * // Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * maxResults: 'placeholder-value', + * // Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * pageToken: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * // Sorting criterion. The only supported values are START_TIME and ID. + * sortBy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "header": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.managedZoneOperations.list * @memberOf! () * @@ -1497,6 +1912,87 @@ export namespace dns_v1beta2 { /** * dns.managedZones.create * @desc Create a new ManagedZone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.managedZones.create({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "dnsName": "my_dnsName", + * // "dnssecConfig": {}, + * // "forwardingConfig": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "name": "my_name", + * // "nameServerSet": "my_nameServerSet", + * // "nameServers": [], + * // "peeringConfig": {}, + * // "privateVisibilityConfig": {}, + * // "reverseLookupConfig": {}, + * // "visibility": "my_visibility" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "dnsName": "my_dnsName", + * // "dnssecConfig": {}, + * // "forwardingConfig": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "name": "my_name", + * // "nameServerSet": "my_nameServerSet", + * // "nameServers": [], + * // "peeringConfig": {}, + * // "privateVisibilityConfig": {}, + * // "reverseLookupConfig": {}, + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.managedZones.create * @memberOf! () * @@ -1572,6 +2068,48 @@ export namespace dns_v1beta2 { /** * dns.managedZones.delete * @desc Delete a previously created ManagedZone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.managedZones.delete({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.managedZones.delete * @memberOf! () * @@ -1646,6 +2184,69 @@ export namespace dns_v1beta2 { /** * dns.managedZones.get * @desc Fetch the representation of an existing ManagedZone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.managedZones.get({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "dnsName": "my_dnsName", + * // "dnssecConfig": {}, + * // "forwardingConfig": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "name": "my_name", + * // "nameServerSet": "my_nameServerSet", + * // "nameServers": [], + * // "peeringConfig": {}, + * // "privateVisibilityConfig": {}, + * // "reverseLookupConfig": {}, + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.managedZones.get * @memberOf! () * @@ -1721,6 +2322,60 @@ export namespace dns_v1beta2 { /** * dns.managedZones.list * @desc Enumerate ManagedZones that have been created but not yet deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.managedZones.list({ + * // Restricts the list to return only zones with this domain name. + * dnsName: 'placeholder-value', + * // Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * maxResults: 'placeholder-value', + * // Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * pageToken: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "header": {}, + * // "kind": "my_kind", + * // "managedZones": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.managedZones.list * @memberOf! () * @@ -1799,6 +2454,82 @@ export namespace dns_v1beta2 { /** * dns.managedZones.patch * @desc Apply a partial update to an existing ManagedZone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.managedZones.patch({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "dnsName": "my_dnsName", + * // "dnssecConfig": {}, + * // "forwardingConfig": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "name": "my_name", + * // "nameServerSet": "my_nameServerSet", + * // "nameServers": [], + * // "peeringConfig": {}, + * // "privateVisibilityConfig": {}, + * // "reverseLookupConfig": {}, + * // "visibility": "my_visibility" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dnsKeyContext": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "type": "my_type", + * // "user": "my_user", + * // "zoneContext": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.managedZones.patch * @memberOf! () * @@ -1876,6 +2607,82 @@ export namespace dns_v1beta2 { /** * dns.managedZones.update * @desc Update an existing ManagedZone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.managedZones.update({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "dnsName": "my_dnsName", + * // "dnssecConfig": {}, + * // "forwardingConfig": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "name": "my_name", + * // "nameServerSet": "my_nameServerSet", + * // "nameServers": [], + * // "peeringConfig": {}, + * // "privateVisibilityConfig": {}, + * // "reverseLookupConfig": {}, + * // "visibility": "my_visibility" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dnsKeyContext": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "type": "my_type", + * // "user": "my_user", + * // "zoneContext": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.managedZones.update * @memberOf! () * @@ -2095,6 +2902,73 @@ export namespace dns_v1beta2 { /** * dns.policies.create * @desc Create a new Policy + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.policies.create({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternativeNameServerConfig": {}, + * // "description": "my_description", + * // "enableInboundForwarding": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networks": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternativeNameServerConfig": {}, + * // "description": "my_description", + * // "enableInboundForwarding": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.policies.create * @memberOf! () * @@ -2168,6 +3042,48 @@ export namespace dns_v1beta2 { /** * dns.policies.delete * @desc Delete a previously created Policy. Will fail if the policy is still being referenced by a network. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.policies.delete({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // User given friendly name of the policy addressed by this request. + * policy: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.policies.delete * @memberOf! () * @@ -2240,6 +3156,62 @@ export namespace dns_v1beta2 { /** * dns.policies.get * @desc Fetch the representation of an existing Policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.policies.get({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // User given friendly name of the policy addressed by this request. + * policy: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternativeNameServerConfig": {}, + * // "description": "my_description", + * // "enableInboundForwarding": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.policies.get * @memberOf! () * @@ -2312,6 +3284,58 @@ export namespace dns_v1beta2 { /** * dns.policies.list * @desc Enumerate all Policies associated with a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.policies.list({ + * // Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * maxResults: 'placeholder-value', + * // Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * pageToken: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "header": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "policies": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.policies.list * @memberOf! () * @@ -2389,6 +3413,69 @@ export namespace dns_v1beta2 { /** * dns.policies.patch * @desc Apply a partial update to an existing Policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.policies.patch({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // User given friendly name of the policy addressed by this request. + * policy: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternativeNameServerConfig": {}, + * // "description": "my_description", + * // "enableInboundForwarding": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networks": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "header": {}, + * // "policy": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.policies.patch * @memberOf! () * @@ -2466,6 +3553,69 @@ export namespace dns_v1beta2 { /** * dns.policies.update * @desc Update an existing Policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.policies.update({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // User given friendly name of the policy addressed by this request. + * policy: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternativeNameServerConfig": {}, + * // "description": "my_description", + * // "enableInboundForwarding": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networks": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "header": {}, + * // "policy": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.policies.update * @memberOf! () * @@ -2676,6 +3826,56 @@ export namespace dns_v1beta2 { /** * dns.projects.get * @desc Fetch the representation of an existing Project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.projects.get({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "number": "my_number", + * // "quota": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.projects.get * @memberOf! () * @@ -2771,6 +3971,64 @@ export namespace dns_v1beta2 { /** * dns.resourceRecordSets.list * @desc Enumerate ResourceRecordSets that have been created but not yet deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.resourceRecordSets.list({ + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * maxResults: 'placeholder-value', + * // Restricts the list to return only records with this fully qualified domain name. + * name: 'placeholder-value', + * // Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * pageToken: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * // Restricts the list to return only records of this type. If present, the "name" parameter must also be present. + * type: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "header": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "rrsets": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.resourceRecordSets.list * @memberOf! () * diff --git a/src/apis/dns/v2beta1.ts b/src/apis/dns/v2beta1.ts index 99e3267207b..f4d5a617613 100644 --- a/src/apis/dns/v2beta1.ts +++ b/src/apis/dns/v2beta1.ts @@ -730,58 +730,72 @@ export namespace dns_v2beta1 { * dns.changes.create * @desc Atomically update the ResourceRecordSet collection. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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'); - * var dns = google.dns('v2beta1'); + * const dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. + * // 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 dns.changes.create({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * managedZone: 'my-managed-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "additions": [], + * // "deletions": [], + * // "id": "my_id", + * // "isServing": false, + * // "kind": "my_kind", + * // "startTime": "my_startTime", + * // "status": "my_status" + * // } * }, - * - * auth: authClient, - * }; - * - * dns.changes.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "additions": [], + * // "deletions": [], + * // "id": "my_id", + * // "isServing": false, + * // "kind": "my_kind", + * // "startTime": "my_startTime", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dns.changes.create * @memberOf! () * @@ -857,57 +871,62 @@ export namespace dns_v2beta1 { * dns.changes.get * @desc Fetch the representation of an existing Change. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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'); - * var dns = google.dns('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. + * const dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * managedZone: 'my-managed-zone', // TODO: Update placeholder value. + * // 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 dns.changes.get({ * // The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse. - * changeId: 'my-change-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dns.changes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * changeId: 'placeholder-value', + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "additions": [], + * // "deletions": [], + * // "id": "my_id", + * // "isServing": false, + * // "kind": "my_kind", + * // "startTime": "my_startTime", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dns.changes.get * @memberOf! () * @@ -983,67 +1002,63 @@ export namespace dns_v2beta1 { * dns.changes.list * @desc Enumerate Changes to a ResourceRecordSet collection. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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'); - * var dns = google.dns('v2beta1'); + * const dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. + * // 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 dns.changes.list({ * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * managedZone: 'my-managed-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var changesPage = response['changes']; - * if (!changesPage) { - * return; - * } - * for (var i = 0; i < changesPage.length; i++) { - * // TODO: Change code below to process each resource in `changesPage`: - * console.log(JSON.stringify(changesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dns.changes.list(request, handlePage); - * } - * }; - * - * dns.changes.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * managedZone: 'placeholder-value', + * // Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * maxResults: 'placeholder-value', + * // Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * pageToken: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * // Sorting criterion. The only supported value is change sequence. + * sortBy: 'placeholder-value', + * // Sorting order direction: 'ascending' or 'descending'. + * sortOrder: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "changes": [], + * // "header": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.changes.list * @memberOf! () * @@ -1209,57 +1224,68 @@ export namespace dns_v2beta1 { * dns.dnsKeys.get * @desc Fetch the representation of an existing DnsKey. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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'); - * var dns = google.dns('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. + * const dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * managedZone: 'my-managed-zone', // TODO: Update placeholder value. + * // 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 dns.dnsKeys.get({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed. + * digestType: 'placeholder-value', * // The identifier of the requested DnsKey. - * dnsKeyId: 'my-dns-key-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dns.dnsKeys.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * dnsKeyId: 'placeholder-value', + * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "algorithm": "my_algorithm", + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "digests": [], + * // "id": "my_id", + * // "isActive": false, + * // "keyLength": 0, + * // "keyTag": 0, + * // "kind": "my_kind", + * // "publicKey": "my_publicKey", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dns.dnsKeys.get * @memberOf! () * @@ -1336,67 +1362,61 @@ export namespace dns_v2beta1 { * dns.dnsKeys.list * @desc Enumerate DnsKeys to a ResourceRecordSet collection. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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'); - * var dns = google.dns('v2beta1'); + * const dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. + * // 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 dns.dnsKeys.list({ + * // An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed. + * digestType: 'placeholder-value', * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * managedZone: 'my-managed-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var dnsKeysPage = response['dnsKeys']; - * if (!dnsKeysPage) { - * return; - * } - * for (var i = 0; i < dnsKeysPage.length; i++) { - * // TODO: Change code below to process each resource in `dnsKeysPage`: - * console.log(JSON.stringify(dnsKeysPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dns.dnsKeys.list(request, handlePage); - * } - * }; - * - * dns.dnsKeys.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * managedZone: 'placeholder-value', + * // Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * maxResults: 'placeholder-value', + * // Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * pageToken: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dnsKeys": [], + * // "header": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.dnsKeys.list * @memberOf! () * @@ -1537,57 +1557,63 @@ export namespace dns_v2beta1 { * dns.managedZoneOperations.get * @desc Fetch the representation of an existing Operation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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'); - * var dns = google.dns('v2beta1'); + * const dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. + * // 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 dns.managedZoneOperations.get({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', * // Identifies the managed zone addressed by this request. - * managedZone: 'my-managed-zone', // TODO: Update placeholder value. - * + * managedZone: 'placeholder-value', * // Identifies the operation addressed by this request. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dns.managedZoneOperations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * operation: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dnsKeyContext": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "type": "my_type", + * // "user": "my_user", + * // "zoneContext": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dns.managedZoneOperations.get * @memberOf! () * @@ -1666,67 +1692,61 @@ export namespace dns_v2beta1 { * dns.managedZoneOperations.list * @desc Enumerate Operations for the given ManagedZone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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'); - * var dns = google.dns('v2beta1'); + * const dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. + * // 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 dns.managedZoneOperations.list({ * // Identifies the managed zone addressed by this request. - * managedZone: 'my-managed-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var operationsPage = response['operations']; - * if (!operationsPage) { - * return; - * } - * for (var i = 0; i < operationsPage.length; i++) { - * // TODO: Change code below to process each resource in `operationsPage`: - * console.log(JSON.stringify(operationsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dns.managedZoneOperations.list(request, handlePage); - * } - * }; - * - * dns.managedZoneOperations.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * managedZone: 'placeholder-value', + * // Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * maxResults: 'placeholder-value', + * // Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * pageToken: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * // Sorting criterion. The only supported values are START_TIME and ID. + * sortBy: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "header": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.managedZoneOperations.list * @memberOf! () * @@ -1875,55 +1895,84 @@ export namespace dns_v2beta1 { * dns.managedZones.create * @desc Create a new ManagedZone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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'); - * var dns = google.dns('v2beta1'); + * const dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await dns.managedZones.create({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "dnsName": "my_dnsName", + * // "dnssecConfig": {}, + * // "forwardingConfig": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "name": "my_name", + * // "nameServerSet": "my_nameServerSet", + * // "nameServers": [], + * // "peeringConfig": {}, + * // "privateVisibilityConfig": {}, + * // "visibility": "my_visibility" + * // } * }, - * - * auth: authClient, - * }; - * - * dns.managedZones.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "dnsName": "my_dnsName", + * // "dnssecConfig": {}, + * // "forwardingConfig": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "name": "my_name", + * // "nameServerSet": "my_nameServerSet", + * // "nameServers": [], + * // "peeringConfig": {}, + * // "privateVisibilityConfig": {}, + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dns.managedZones.create * @memberOf! () * @@ -2000,51 +2049,47 @@ export namespace dns_v2beta1 { * dns.managedZones.delete * @desc Delete a previously created ManagedZone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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'); - * var dns = google.dns('v2beta1'); + * const dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. + * // 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 dns.managedZones.delete({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * managedZone: 'my-managed-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dns.managedZones.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dns.managedZones.delete * @memberOf! () * @@ -2120,54 +2165,67 @@ export namespace dns_v2beta1 { * dns.managedZones.get * @desc Fetch the representation of an existing ManagedZone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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'); - * var dns = google.dns('v2beta1'); + * const dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. + * // 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 dns.managedZones.get({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * managedZone: 'my-managed-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dns.managedZones.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "dnsName": "my_dnsName", + * // "dnssecConfig": {}, + * // "forwardingConfig": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "name": "my_name", + * // "nameServerSet": "my_nameServerSet", + * // "nameServers": [], + * // "peeringConfig": {}, + * // "privateVisibilityConfig": {}, + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dns.managedZones.get * @memberOf! () * @@ -2244,64 +2302,59 @@ export namespace dns_v2beta1 { * dns.managedZones.list * @desc Enumerate ManagedZones that have been created but not yet deleted. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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'); - * var dns = google.dns('v2beta1'); + * const dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 dns.managedZones.list({ + * // Restricts the list to return only zones with this domain name. + * dnsName: 'placeholder-value', + * // Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * maxResults: 'placeholder-value', + * // Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * pageToken: 'placeholder-value', * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var managedZonesPage = response['managedZones']; - * if (!managedZonesPage) { - * return; - * } - * for (var i = 0; i < managedZonesPage.length; i++) { - * // TODO: Change code below to process each resource in `managedZonesPage`: - * console.log(JSON.stringify(managedZonesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dns.managedZones.list(request, handlePage); - * } - * }; - * - * dns.managedZones.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * project: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "header": {}, + * // "kind": "my_kind", + * // "managedZones": [], + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.managedZones.list * @memberOf! () * @@ -2381,59 +2434,80 @@ export namespace dns_v2beta1 { * dns.managedZones.patch * @desc Apply a partial update to an existing ManagedZone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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'); - * var dns = google.dns('v2beta1'); + * const dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. + * // 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 dns.managedZones.patch({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * managedZone: 'my-managed-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "dnsName": "my_dnsName", + * // "dnssecConfig": {}, + * // "forwardingConfig": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "name": "my_name", + * // "nameServerSet": "my_nameServerSet", + * // "nameServers": [], + * // "peeringConfig": {}, + * // "privateVisibilityConfig": {}, + * // "visibility": "my_visibility" + * // } * }, - * - * auth: authClient, - * }; - * - * dns.managedZones.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dnsKeyContext": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "type": "my_type", + * // "user": "my_user", + * // "zoneContext": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dns.managedZones.patch * @memberOf! () * @@ -2512,59 +2586,80 @@ export namespace dns_v2beta1 { * dns.managedZones.update * @desc Update an existing ManagedZone. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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'); - * var dns = google.dns('v2beta1'); + * const dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. + * // 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 dns.managedZones.update({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * managedZone: 'my-managed-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * managedZone: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTime": "my_creationTime", + * // "description": "my_description", + * // "dnsName": "my_dnsName", + * // "dnssecConfig": {}, + * // "forwardingConfig": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "name": "my_name", + * // "nameServerSet": "my_nameServerSet", + * // "nameServers": [], + * // "peeringConfig": {}, + * // "privateVisibilityConfig": {}, + * // "visibility": "my_visibility" + * // } * }, - * - * auth: authClient, - * }; - * - * dns.managedZones.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dnsKeyContext": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "type": "my_type", + * // "user": "my_user", + * // "zoneContext": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dns.managedZones.update * @memberOf! () * @@ -2784,6 +2879,73 @@ export namespace dns_v2beta1 { /** * dns.policies.create * @desc Create a new Policy + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.policies.create({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternativeNameServerConfig": {}, + * // "description": "my_description", + * // "enableInboundForwarding": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networks": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternativeNameServerConfig": {}, + * // "description": "my_description", + * // "enableInboundForwarding": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.policies.create * @memberOf! () * @@ -2857,6 +3019,48 @@ export namespace dns_v2beta1 { /** * dns.policies.delete * @desc Delete a previously created Policy. Will fail if the policy is still being referenced by a network. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.policies.delete({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // User given friendly name of the policy addressed by this request. + * policy: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.policies.delete * @memberOf! () * @@ -2929,6 +3133,62 @@ export namespace dns_v2beta1 { /** * dns.policies.get * @desc Fetch the representation of an existing Policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.policies.get({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // User given friendly name of the policy addressed by this request. + * policy: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternativeNameServerConfig": {}, + * // "description": "my_description", + * // "enableInboundForwarding": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.policies.get * @memberOf! () * @@ -3001,6 +3261,58 @@ export namespace dns_v2beta1 { /** * dns.policies.list * @desc Enumerate all Policies associated with a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.policies.list({ + * // Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * maxResults: 'placeholder-value', + * // Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * pageToken: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "header": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "policies": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.policies.list * @memberOf! () * @@ -3078,6 +3390,69 @@ export namespace dns_v2beta1 { /** * dns.policies.patch * @desc Apply a partial update to an existing Policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.policies.patch({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // User given friendly name of the policy addressed by this request. + * policy: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternativeNameServerConfig": {}, + * // "description": "my_description", + * // "enableInboundForwarding": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networks": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "header": {}, + * // "policy": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.policies.patch * @memberOf! () * @@ -3155,6 +3530,69 @@ export namespace dns_v2beta1 { /** * dns.policies.update * @desc Update an existing Policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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 dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); + * + * // 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 dns.policies.update({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // User given friendly name of the policy addressed by this request. + * policy: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternativeNameServerConfig": {}, + * // "description": "my_description", + * // "enableInboundForwarding": false, + * // "enableLogging": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "networks": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "header": {}, + * // "policy": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.policies.update * @memberOf! () * @@ -3366,51 +3804,55 @@ export namespace dns_v2beta1 { * dns.projects.get * @desc Fetch the representation of an existing Project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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'); - * var dns = google.dns('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * const dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * dns.projects.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await dns.projects.get({ + * // For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * clientOperationId: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind", + * // "number": "my_number", + * // "quota": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias dns.projects.get * @memberOf! () * @@ -3507,67 +3949,63 @@ export namespace dns_v2beta1 { * dns.resourceRecordSets.list * @desc Enumerate ResourceRecordSets that have been created but not yet deleted. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/dns.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'); - * var dns = google.dns('v2beta1'); + * const dns = google.dns('v2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + * 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. + * // 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 dns.resourceRecordSets.list({ * // Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * managedZone: 'my-managed-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var rrsetsPage = response['rrsets']; - * if (!rrsetsPage) { - * return; - * } - * for (var i = 0; i < rrsetsPage.length; i++) { - * // TODO: Change code below to process each resource in `rrsetsPage`: - * console.log(JSON.stringify(rrsetsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dns.resourceRecordSets.list(request, handlePage); - * } - * }; - * - * dns.resourceRecordSets.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * managedZone: 'placeholder-value', + * // Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * maxResults: 'placeholder-value', + * // Restricts the list to return only records with this fully qualified domain name. + * name: 'placeholder-value', + * // Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * pageToken: 'placeholder-value', + * // Identifies the project addressed by this request. + * project: 'placeholder-value', + * // Restricts the list to return only records of this type. If present, the "name" parameter must also be present. + * type: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "header": {}, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "rrsets": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias dns.resourceRecordSets.list * @memberOf! () * diff --git a/src/apis/docs/v1.ts b/src/apis/docs/v1.ts index a133023dfe7..89a07528bc3 100644 --- a/src/apis/docs/v1.ts +++ b/src/apis/docs/v1.ts @@ -3151,6 +3151,61 @@ export namespace docs_v1 { /** * docs.documents.batchUpdate * @desc Applies one or more updates to the document. Each request is validated before being applied. If any request is not valid, then the entire request will fail and nothing will be applied. Some requests have replies to give you some information about how they are applied. Other requests do not need to return information; these each return an empty reply. The order of replies matches that of the requests. For example, suppose you call batchUpdate with four updates, and only the third one returns information. The response would have two empty replies, the reply to the third request, and another empty reply, in that order. Because other users may be editing the document, the document might not exactly reflect your changes: your changes may be altered with respect to collaborator changes. If there are no collaborators, the document should reflect your changes. In any case, the updates in your request are guaranteed to be applied together atomically. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/docs.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 docs = google.docs('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/documents', + * 'https://www.googleapis.com/auth/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 docs.documents.batchUpdate({ + * // The ID of the document to update. + * documentId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "requests": [], + * // "writeControl": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "documentId": "my_documentId", + * // "replies": [], + * // "writeControl": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias docs.documents.batchUpdate * @memberOf! () * @@ -3233,6 +3288,85 @@ export namespace docs_v1 { /** * docs.documents.create * @desc Creates a blank document using the title given in the request. Other fields in the request, including any provided content, are ignored. Returns the created document. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/docs.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 docs = google.docs('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/documents', + * 'https://www.googleapis.com/auth/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 docs.documents.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "body": {}, + * // "documentId": "my_documentId", + * // "documentStyle": {}, + * // "footers": {}, + * // "footnotes": {}, + * // "headers": {}, + * // "inlineObjects": {}, + * // "lists": {}, + * // "namedRanges": {}, + * // "namedStyles": {}, + * // "positionedObjects": {}, + * // "revisionId": "my_revisionId", + * // "suggestedDocumentStyleChanges": {}, + * // "suggestedNamedStylesChanges": {}, + * // "suggestionsViewMode": "my_suggestionsViewMode", + * // "title": "my_title" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "body": {}, + * // "documentId": "my_documentId", + * // "documentStyle": {}, + * // "footers": {}, + * // "footnotes": {}, + * // "headers": {}, + * // "inlineObjects": {}, + * // "lists": {}, + * // "namedRanges": {}, + * // "namedStyles": {}, + * // "positionedObjects": {}, + * // "revisionId": "my_revisionId", + * // "suggestedDocumentStyleChanges": {}, + * // "suggestedNamedStylesChanges": {}, + * // "suggestionsViewMode": "my_suggestionsViewMode", + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias docs.documents.create * @memberOf! () * @@ -3301,6 +3435,72 @@ export namespace docs_v1 { /** * docs.documents.get * @desc Gets the latest version of the specified document. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/docs.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 docs = google.docs('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/documents', + * 'https://www.googleapis.com/auth/documents.readonly', + * 'https://www.googleapis.com/auth/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.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 docs.documents.get({ + * // The ID of the document to retrieve. + * documentId: 'placeholder-value', + * // The suggestions view mode to apply to the document. This allows viewing the + * // document with all suggestions inline, accepted or rejected. If one is not + * // specified, DEFAULT_FOR_CURRENT_ACCESS is + * // used. + * suggestionsViewMode: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "body": {}, + * // "documentId": "my_documentId", + * // "documentStyle": {}, + * // "footers": {}, + * // "footnotes": {}, + * // "headers": {}, + * // "inlineObjects": {}, + * // "lists": {}, + * // "namedRanges": {}, + * // "namedStyles": {}, + * // "positionedObjects": {}, + * // "revisionId": "my_revisionId", + * // "suggestedDocumentStyleChanges": {}, + * // "suggestedNamedStylesChanges": {}, + * // "suggestionsViewMode": "my_suggestionsViewMode", + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias docs.documents.get * @memberOf! () * diff --git a/src/apis/domainsrdap/v1.ts b/src/apis/domainsrdap/v1.ts index a2ff00dcbd7..90fc9520d6e 100644 --- a/src/apis/domainsrdap/v1.ts +++ b/src/apis/domainsrdap/v1.ts @@ -237,6 +237,51 @@ export namespace domainsrdap_v1 { /** * domainsrdap.autnum.get * @desc The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/domainsrdap.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 domainsrdap = google.domainsrdap('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: [], + * }); + * + * // 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 domainsrdap.autnum.get({ + * autnumId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": [], + * // "errorCode": 0, + * // "jsonResponse": {}, + * // "lang": "my_lang", + * // "notices": [], + * // "rdapConformance": [], + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias domainsrdap.autnum.get * @memberOf! () * @@ -329,6 +374,48 @@ export namespace domainsrdap_v1 { /** * domainsrdap.domain.get * @desc Look up RDAP information for a domain by name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/domainsrdap.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 domainsrdap = google.domainsrdap('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: [], + * }); + * + * // 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 domainsrdap.domain.get({ + * // Full domain name to look up. Example: "example.com" + * domainName: '[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias domainsrdap.domain.get * @memberOf! () * @@ -419,6 +506,51 @@ export namespace domainsrdap_v1 { /** * domainsrdap.entity.get * @desc The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/domainsrdap.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 domainsrdap = google.domainsrdap('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: [], + * }); + * + * // 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 domainsrdap.entity.get({ + * entityId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": [], + * // "errorCode": 0, + * // "jsonResponse": {}, + * // "lang": "my_lang", + * // "notices": [], + * // "rdapConformance": [], + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias domainsrdap.entity.get * @memberOf! () * @@ -511,6 +643,53 @@ export namespace domainsrdap_v1 { /** * domainsrdap.ip.get * @desc The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/domainsrdap.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 domainsrdap = google.domainsrdap('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: [], + * }); + * + * // 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 domainsrdap.ip.get({ + * ipId: 'placeholder-value', + * + * ipId1: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": [], + * // "errorCode": 0, + * // "jsonResponse": {}, + * // "lang": "my_lang", + * // "notices": [], + * // "rdapConformance": [], + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias domainsrdap.ip.get * @memberOf! () * @@ -608,6 +787,51 @@ export namespace domainsrdap_v1 { /** * domainsrdap.nameserver.get * @desc The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/domainsrdap.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 domainsrdap = google.domainsrdap('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: [], + * }); + * + * // 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 domainsrdap.nameserver.get({ + * nameserverId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": [], + * // "errorCode": 0, + * // "jsonResponse": {}, + * // "lang": "my_lang", + * // "notices": [], + * // "rdapConformance": [], + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias domainsrdap.nameserver.get * @memberOf! () * @@ -700,6 +924,49 @@ export namespace domainsrdap_v1 { /** * domainsrdap.getDomains * @desc The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/domainsrdap.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 domainsrdap = google.domainsrdap('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: [], + * }); + * + * // 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 domainsrdap.getDomains({}); + * console.log(res.data); + * + * // Example response + * // { + * // "description": [], + * // "errorCode": 0, + * // "jsonResponse": {}, + * // "lang": "my_lang", + * // "notices": [], + * // "rdapConformance": [], + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias domainsrdap.getDomains * @memberOf! () * @@ -769,6 +1036,49 @@ export namespace domainsrdap_v1 { /** * domainsrdap.getEntities * @desc The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/domainsrdap.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 domainsrdap = google.domainsrdap('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: [], + * }); + * + * // 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 domainsrdap.getEntities({}); + * console.log(res.data); + * + * // Example response + * // { + * // "description": [], + * // "errorCode": 0, + * // "jsonResponse": {}, + * // "lang": "my_lang", + * // "notices": [], + * // "rdapConformance": [], + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias domainsrdap.getEntities * @memberOf! () * @@ -838,6 +1148,45 @@ export namespace domainsrdap_v1 { /** * domainsrdap.getHelp * @desc Get help information for the RDAP API, including links to documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/domainsrdap.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 domainsrdap = google.domainsrdap('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: [], + * }); + * + * // 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 domainsrdap.getHelp({}); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias domainsrdap.getHelp * @memberOf! () * @@ -905,6 +1254,45 @@ export namespace domainsrdap_v1 { /** * domainsrdap.getIp * @desc The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/domainsrdap.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 domainsrdap = google.domainsrdap('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: [], + * }); + * + * // 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 domainsrdap.getIp({}); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias domainsrdap.getIp * @memberOf! () * @@ -972,6 +1360,49 @@ export namespace domainsrdap_v1 { /** * domainsrdap.getNameservers * @desc The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/domainsrdap.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 domainsrdap = google.domainsrdap('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: [], + * }); + * + * // 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 domainsrdap.getNameservers({}); + * console.log(res.data); + * + * // Example response + * // { + * // "description": [], + * // "errorCode": 0, + * // "jsonResponse": {}, + * // "lang": "my_lang", + * // "notices": [], + * // "rdapConformance": [], + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias domainsrdap.getNameservers * @memberOf! () * diff --git a/src/apis/doubleclickbidmanager/v1.1.ts b/src/apis/doubleclickbidmanager/v1.1.ts index 4b8b832d40e..b38d90b81f8 100644 --- a/src/apis/doubleclickbidmanager/v1.1.ts +++ b/src/apis/doubleclickbidmanager/v1.1.ts @@ -556,6 +556,54 @@ export namespace doubleclickbidmanager_v1_1 { /** * doubleclickbidmanager.lineitems.downloadlineitems * @desc Retrieves line items in CSV format. TrueView line items are not supported. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclickbidmanager.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 doubleclickbidmanager = google.doubleclickbidmanager('v1.1'); + * + * 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/doubleclickbidmanager'], + * }); + * + * // 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 doubleclickbidmanager.lineitems.downloadlineitems({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fileSpec": "my_fileSpec", + * // "filterIds": [], + * // "filterType": "my_filterType", + * // "format": "my_format" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "lineItems": "my_lineItems" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclickbidmanager.lineitems.downloadlineitems * @memberOf! () * @@ -637,6 +685,53 @@ export namespace doubleclickbidmanager_v1_1 { /** * doubleclickbidmanager.lineitems.uploadlineitems * @desc Uploads line items in CSV format. TrueView line items are not supported. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclickbidmanager.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 doubleclickbidmanager = google.doubleclickbidmanager('v1.1'); + * + * 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/doubleclickbidmanager'], + * }); + * + * // 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 doubleclickbidmanager.lineitems.uploadlineitems({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dryRun": false, + * // "format": "my_format", + * // "lineItems": "my_lineItems" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "uploadStatus": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclickbidmanager.lineitems.uploadlineitems * @memberOf! () * @@ -746,6 +841,68 @@ export namespace doubleclickbidmanager_v1_1 { /** * doubleclickbidmanager.queries.createquery * @desc Creates a query. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclickbidmanager.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 doubleclickbidmanager = google.doubleclickbidmanager('v1.1'); + * + * 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/doubleclickbidmanager'], + * }); + * + * // 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 doubleclickbidmanager.queries.createquery({ + * // If true, tries to run the query asynchronously. Only applicable when the frequency is ONE_TIME. + * asynchronous: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "metadata": {}, + * // "params": {}, + * // "queryId": "my_queryId", + * // "reportDataEndTimeMs": "my_reportDataEndTimeMs", + * // "reportDataStartTimeMs": "my_reportDataStartTimeMs", + * // "schedule": {}, + * // "timezoneCode": "my_timezoneCode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "metadata": {}, + * // "params": {}, + * // "queryId": "my_queryId", + * // "reportDataEndTimeMs": "my_reportDataEndTimeMs", + * // "reportDataStartTimeMs": "my_reportDataStartTimeMs", + * // "schedule": {}, + * // "timezoneCode": "my_timezoneCode" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclickbidmanager.queries.createquery * @memberOf! () * @@ -819,6 +976,41 @@ export namespace doubleclickbidmanager_v1_1 { /** * doubleclickbidmanager.queries.deletequery * @desc Deletes a stored query as well as the associated stored reports. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclickbidmanager.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 doubleclickbidmanager = google.doubleclickbidmanager('v1.1'); + * + * 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/doubleclickbidmanager'], + * }); + * + * // 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 doubleclickbidmanager.queries.deletequery({ + * // Query ID to delete. + * queryId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclickbidmanager.queries.deletequery * @memberOf! () * @@ -890,6 +1082,53 @@ export namespace doubleclickbidmanager_v1_1 { /** * doubleclickbidmanager.queries.getquery * @desc Retrieves a stored query. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclickbidmanager.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 doubleclickbidmanager = google.doubleclickbidmanager('v1.1'); + * + * 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/doubleclickbidmanager'], + * }); + * + * // 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 doubleclickbidmanager.queries.getquery({ + * // Query ID to retrieve. + * queryId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "metadata": {}, + * // "params": {}, + * // "queryId": "my_queryId", + * // "reportDataEndTimeMs": "my_reportDataEndTimeMs", + * // "reportDataStartTimeMs": "my_reportDataStartTimeMs", + * // "schedule": {}, + * // "timezoneCode": "my_timezoneCode" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclickbidmanager.queries.getquery * @memberOf! () * @@ -960,6 +1199,50 @@ export namespace doubleclickbidmanager_v1_1 { /** * doubleclickbidmanager.queries.listqueries * @desc Retrieves stored queries. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclickbidmanager.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 doubleclickbidmanager = google.doubleclickbidmanager('v1.1'); + * + * 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/doubleclickbidmanager'], + * }); + * + * // 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 doubleclickbidmanager.queries.listqueries({ + * // Maximum number of results per page. Must be between 1 and 100. Defaults to 100 if unspecified. + * pageSize: 'placeholder-value', + * // Optional pagination token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "queries": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclickbidmanager.queries.listqueries * @memberOf! () * @@ -1037,6 +1320,54 @@ export namespace doubleclickbidmanager_v1_1 { /** * doubleclickbidmanager.queries.runquery * @desc Runs a stored query to generate a report. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclickbidmanager.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 doubleclickbidmanager = google.doubleclickbidmanager('v1.1'); + * + * 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/doubleclickbidmanager'], + * }); + * + * // 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 doubleclickbidmanager.queries.runquery({ + * // If true, tries to run the query asynchronously. + * asynchronous: 'placeholder-value', + * // Query ID to run. + * queryId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dataRange": "my_dataRange", + * // "reportDataEndTimeMs": "my_reportDataEndTimeMs", + * // "reportDataStartTimeMs": "my_reportDataStartTimeMs", + * // "timezoneCode": "my_timezoneCode" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclickbidmanager.queries.runquery * @memberOf! () * @@ -1193,6 +1524,52 @@ export namespace doubleclickbidmanager_v1_1 { /** * doubleclickbidmanager.reports.listreports * @desc Retrieves stored reports. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclickbidmanager.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 doubleclickbidmanager = google.doubleclickbidmanager('v1.1'); + * + * 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/doubleclickbidmanager'], + * }); + * + * // 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 doubleclickbidmanager.reports.listreports({ + * // Maximum number of results per page. Must be between 1 and 100. Defaults to 100 if unspecified. + * pageSize: 'placeholder-value', + * // Optional pagination token. + * pageToken: 'placeholder-value', + * // Query ID with which the reports are associated. + * queryId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "reports": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclickbidmanager.reports.listreports * @memberOf! () * @@ -1298,6 +1675,59 @@ export namespace doubleclickbidmanager_v1_1 { /** * doubleclickbidmanager.sdf.download * @desc Retrieves entities in SDF format. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclickbidmanager.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 doubleclickbidmanager = google.doubleclickbidmanager('v1.1'); + * + * 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/doubleclickbidmanager'], + * }); + * + * // 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 doubleclickbidmanager.sdf.download({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fileTypes": [], + * // "filterIds": [], + * // "filterType": "my_filterType", + * // "version": "my_version" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adGroups": "my_adGroups", + * // "ads": "my_ads", + * // "campaigns": "my_campaigns", + * // "insertionOrders": "my_insertionOrders", + * // "inventorySources": "my_inventorySources", + * // "lineItems": "my_lineItems" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclickbidmanager.sdf.download * @memberOf! () * diff --git a/src/apis/doubleclickbidmanager/v1.ts b/src/apis/doubleclickbidmanager/v1.ts index e0afd1bba5a..570465b636f 100644 --- a/src/apis/doubleclickbidmanager/v1.ts +++ b/src/apis/doubleclickbidmanager/v1.ts @@ -531,6 +531,54 @@ export namespace doubleclickbidmanager_v1 { /** * doubleclickbidmanager.lineitems.downloadlineitems * @desc Retrieves line items in CSV format. TrueView line items are not supported. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclickbidmanager.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 doubleclickbidmanager = google.doubleclickbidmanager('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/doubleclickbidmanager'], + * }); + * + * // 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 doubleclickbidmanager.lineitems.downloadlineitems({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fileSpec": "my_fileSpec", + * // "filterIds": [], + * // "filterType": "my_filterType", + * // "format": "my_format" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "lineItems": "my_lineItems" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclickbidmanager.lineitems.downloadlineitems * @memberOf! () * @@ -611,6 +659,53 @@ export namespace doubleclickbidmanager_v1 { /** * doubleclickbidmanager.lineitems.uploadlineitems * @desc Uploads line items in CSV format. TrueView line items are not supported. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclickbidmanager.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 doubleclickbidmanager = google.doubleclickbidmanager('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/doubleclickbidmanager'], + * }); + * + * // 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 doubleclickbidmanager.lineitems.uploadlineitems({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dryRun": false, + * // "format": "my_format", + * // "lineItems": "my_lineItems" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "uploadStatus": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclickbidmanager.lineitems.uploadlineitems * @memberOf! () * @@ -720,6 +815,65 @@ export namespace doubleclickbidmanager_v1 { /** * doubleclickbidmanager.queries.createquery * @desc Creates a query. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclickbidmanager.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 doubleclickbidmanager = google.doubleclickbidmanager('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/doubleclickbidmanager'], + * }); + * + * // 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 doubleclickbidmanager.queries.createquery({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "metadata": {}, + * // "params": {}, + * // "queryId": "my_queryId", + * // "reportDataEndTimeMs": "my_reportDataEndTimeMs", + * // "reportDataStartTimeMs": "my_reportDataStartTimeMs", + * // "schedule": {}, + * // "timezoneCode": "my_timezoneCode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "metadata": {}, + * // "params": {}, + * // "queryId": "my_queryId", + * // "reportDataEndTimeMs": "my_reportDataEndTimeMs", + * // "reportDataStartTimeMs": "my_reportDataStartTimeMs", + * // "schedule": {}, + * // "timezoneCode": "my_timezoneCode" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclickbidmanager.queries.createquery * @memberOf! () * @@ -792,6 +946,41 @@ export namespace doubleclickbidmanager_v1 { /** * doubleclickbidmanager.queries.deletequery * @desc Deletes a stored query as well as the associated stored reports. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclickbidmanager.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 doubleclickbidmanager = google.doubleclickbidmanager('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/doubleclickbidmanager'], + * }); + * + * // 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 doubleclickbidmanager.queries.deletequery({ + * // Query ID to delete. + * queryId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclickbidmanager.queries.deletequery * @memberOf! () * @@ -863,6 +1052,53 @@ export namespace doubleclickbidmanager_v1 { /** * doubleclickbidmanager.queries.getquery * @desc Retrieves a stored query. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclickbidmanager.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 doubleclickbidmanager = google.doubleclickbidmanager('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/doubleclickbidmanager'], + * }); + * + * // 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 doubleclickbidmanager.queries.getquery({ + * // Query ID to retrieve. + * queryId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "metadata": {}, + * // "params": {}, + * // "queryId": "my_queryId", + * // "reportDataEndTimeMs": "my_reportDataEndTimeMs", + * // "reportDataStartTimeMs": "my_reportDataStartTimeMs", + * // "schedule": {}, + * // "timezoneCode": "my_timezoneCode" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclickbidmanager.queries.getquery * @memberOf! () * @@ -933,6 +1169,44 @@ export namespace doubleclickbidmanager_v1 { /** * doubleclickbidmanager.queries.listqueries * @desc Retrieves stored queries. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclickbidmanager.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 doubleclickbidmanager = google.doubleclickbidmanager('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/doubleclickbidmanager'], + * }); + * + * // 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 doubleclickbidmanager.queries.listqueries({}); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "queries": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclickbidmanager.queries.listqueries * @memberOf! () * @@ -1008,6 +1282,52 @@ export namespace doubleclickbidmanager_v1 { /** * doubleclickbidmanager.queries.runquery * @desc Runs a stored query to generate a report. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclickbidmanager.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 doubleclickbidmanager = google.doubleclickbidmanager('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/doubleclickbidmanager'], + * }); + * + * // 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 doubleclickbidmanager.queries.runquery({ + * // Query ID to run. + * queryId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dataRange": "my_dataRange", + * // "reportDataEndTimeMs": "my_reportDataEndTimeMs", + * // "reportDataStartTimeMs": "my_reportDataStartTimeMs", + * // "timezoneCode": "my_timezoneCode" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclickbidmanager.queries.runquery * @memberOf! () * @@ -1145,6 +1465,47 @@ export namespace doubleclickbidmanager_v1 { /** * doubleclickbidmanager.reports.listreports * @desc Retrieves stored reports. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclickbidmanager.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 doubleclickbidmanager = google.doubleclickbidmanager('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/doubleclickbidmanager'], + * }); + * + * // 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 doubleclickbidmanager.reports.listreports({ + * // Query ID with which the reports are associated. + * queryId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "reports": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclickbidmanager.reports.listreports * @memberOf! () * @@ -1240,6 +1601,59 @@ export namespace doubleclickbidmanager_v1 { /** * doubleclickbidmanager.sdf.download * @desc Retrieves entities in SDF format. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclickbidmanager.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 doubleclickbidmanager = google.doubleclickbidmanager('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/doubleclickbidmanager'], + * }); + * + * // 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 doubleclickbidmanager.sdf.download({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fileTypes": [], + * // "filterIds": [], + * // "filterType": "my_filterType", + * // "version": "my_version" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "adGroups": "my_adGroups", + * // "ads": "my_ads", + * // "campaigns": "my_campaigns", + * // "insertionOrders": "my_insertionOrders", + * // "inventorySources": "my_inventorySources", + * // "lineItems": "my_lineItems" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclickbidmanager.sdf.download * @memberOf! () * diff --git a/src/apis/doubleclicksearch/v2.ts b/src/apis/doubleclicksearch/v2.ts index 286db206bfd..93703ca3096 100644 --- a/src/apis/doubleclicksearch/v2.ts +++ b/src/apis/doubleclicksearch/v2.ts @@ -535,6 +535,67 @@ export namespace doubleclicksearch_v2 { /** * doubleclicksearch.conversion.get * @desc Retrieves a list of conversions from a DoubleClick Search engine account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclicksearch.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 doubleclicksearch = google.doubleclicksearch('v2'); + * + * 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/doubleclicksearch'], + * }); + * + * // 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 doubleclicksearch.conversion.get({ + * // Numeric ID of the ad group. + * adGroupId: 'placeholder-value', + * // Numeric ID of the ad. + * adId: 'placeholder-value', + * // Numeric ID of the advertiser. + * advertiserId: 'placeholder-value', + * // Numeric ID of the agency. + * agencyId: 'placeholder-value', + * // Numeric ID of the campaign. + * campaignId: 'placeholder-value', + * // Numeric ID of the criterion. + * criterionId: 'placeholder-value', + * // Last date (inclusive) on which to retrieve conversions. Format is yyyymmdd. + * endDate: 'placeholder-value', + * // Numeric ID of the engine account. + * engineAccountId: 'placeholder-value', + * // The number of conversions to return per call. + * rowCount: 'placeholder-value', + * // First date (inclusive) on which to retrieve conversions. Format is yyyymmdd. + * startDate: 'placeholder-value', + * // The 0-based starting index for retrieving conversions results. + * startRow: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "conversion": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclicksearch.conversion.get * @memberOf! () * @@ -626,6 +687,53 @@ export namespace doubleclicksearch_v2 { /** * doubleclicksearch.conversion.insert * @desc Inserts a batch of new conversions into DoubleClick Search. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclicksearch.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 doubleclicksearch = google.doubleclicksearch('v2'); + * + * 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/doubleclicksearch'], + * }); + * + * // 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 doubleclicksearch.conversion.insert({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "conversion": [], + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "conversion": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclicksearch.conversion.insert * @memberOf! () * @@ -700,6 +808,53 @@ export namespace doubleclicksearch_v2 { /** * doubleclicksearch.conversion.update * @desc Updates a batch of conversions in DoubleClick Search. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclicksearch.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 doubleclicksearch = google.doubleclicksearch('v2'); + * + * 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/doubleclicksearch'], + * }); + * + * // 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 doubleclicksearch.conversion.update({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "conversion": [], + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "conversion": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclicksearch.conversion.update * @memberOf! () * @@ -774,6 +929,51 @@ export namespace doubleclicksearch_v2 { /** * doubleclicksearch.conversion.updateAvailability * @desc Updates the availabilities of a batch of floodlight activities in DoubleClick Search. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclicksearch.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 doubleclicksearch = google.doubleclicksearch('v2'); + * + * 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/doubleclicksearch'], + * }); + * + * // 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 doubleclicksearch.conversion.updateAvailability({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "availabilities": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "availabilities": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclicksearch.conversion.updateAvailability * @memberOf! () * @@ -949,6 +1149,72 @@ export namespace doubleclicksearch_v2 { /** * doubleclicksearch.reports.generate * @desc Generates and returns a report immediately. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclicksearch.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 doubleclicksearch = google.doubleclicksearch('v2'); + * + * 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/doubleclicksearch'], + * }); + * + * // 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 doubleclicksearch.reports.generate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "columns": [], + * // "downloadFormat": "my_downloadFormat", + * // "filters": [], + * // "includeDeletedEntities": false, + * // "includeRemovedEntities": false, + * // "maxRowsPerFile": 0, + * // "orderBy": [], + * // "reportScope": {}, + * // "reportType": "my_reportType", + * // "rowCount": 0, + * // "startRow": 0, + * // "statisticsCurrency": "my_statisticsCurrency", + * // "timeRange": {}, + * // "verifySingleTimeZone": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "files": [], + * // "id": "my_id", + * // "isReportReady": false, + * // "kind": "my_kind", + * // "request": {}, + * // "rowCount": 0, + * // "rows": [], + * // "statisticsCurrencyCode": "my_statisticsCurrencyCode", + * // "statisticsTimeZone": "my_statisticsTimeZone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclicksearch.reports.generate * @memberOf! () * @@ -1020,6 +1286,54 @@ export namespace doubleclicksearch_v2 { /** * doubleclicksearch.reports.get * @desc Polls for the status of a report request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclicksearch.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 doubleclicksearch = google.doubleclicksearch('v2'); + * + * 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/doubleclicksearch'], + * }); + * + * // 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 doubleclicksearch.reports.get({ + * // ID of the report request being polled. + * reportId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "files": [], + * // "id": "my_id", + * // "isReportReady": false, + * // "kind": "my_kind", + * // "request": {}, + * // "rowCount": 0, + * // "rows": [], + * // "statisticsCurrencyCode": "my_statisticsCurrencyCode", + * // "statisticsTimeZone": "my_statisticsTimeZone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclicksearch.reports.get * @memberOf! () * @@ -1091,6 +1405,43 @@ export namespace doubleclicksearch_v2 { /** * doubleclicksearch.reports.getFile * @desc Downloads a report file encoded in UTF-8. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclicksearch.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 doubleclicksearch = google.doubleclicksearch('v2'); + * + * 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/doubleclicksearch'], + * }); + * + * // 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 doubleclicksearch.reports.getFile({ + * // The index of the report fragment to download. + * reportFragment: 'placeholder-value', + * // ID of the report. + * reportId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclicksearch.reports.getFile * @memberOf! () * @@ -1163,6 +1514,72 @@ export namespace doubleclicksearch_v2 { /** * doubleclicksearch.reports.request * @desc Inserts a report request into the reporting system. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclicksearch.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 doubleclicksearch = google.doubleclicksearch('v2'); + * + * 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/doubleclicksearch'], + * }); + * + * // 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 doubleclicksearch.reports.request({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "columns": [], + * // "downloadFormat": "my_downloadFormat", + * // "filters": [], + * // "includeDeletedEntities": false, + * // "includeRemovedEntities": false, + * // "maxRowsPerFile": 0, + * // "orderBy": [], + * // "reportScope": {}, + * // "reportType": "my_reportType", + * // "rowCount": 0, + * // "startRow": 0, + * // "statisticsCurrency": "my_statisticsCurrency", + * // "timeRange": {}, + * // "verifySingleTimeZone": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "files": [], + * // "id": "my_id", + * // "isReportReady": false, + * // "kind": "my_kind", + * // "request": {}, + * // "rowCount": 0, + * // "rows": [], + * // "statisticsCurrencyCode": "my_statisticsCurrencyCode", + * // "statisticsTimeZone": "my_statisticsTimeZone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclicksearch.reports.request * @memberOf! () * @@ -1290,6 +1707,49 @@ export namespace doubleclicksearch_v2 { /** * doubleclicksearch.savedColumns.list * @desc Retrieve the list of saved columns for a specified advertiser. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/doubleclicksearch.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 doubleclicksearch = google.doubleclicksearch('v2'); + * + * 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/doubleclicksearch'], + * }); + * + * // 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 doubleclicksearch.savedColumns.list({ + * // DS ID of the advertiser. + * advertiserId: 'placeholder-value', + * // DS ID of the agency. + * agencyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias doubleclicksearch.savedColumns.list * @memberOf! () * diff --git a/src/apis/drive/v2.ts b/src/apis/drive/v2.ts index 5cc1fcdb5c0..7a175d57c09 100644 --- a/src/apis/drive/v2.ts +++ b/src/apis/drive/v2.ts @@ -1680,6 +1680,85 @@ export namespace drive_v2 { /** * drive.about.get * @desc Gets the information about the current user along with Drive API settings + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.about.get({ + * // Whether to count changes outside the My Drive hierarchy. When set to false, changes to files such as those in the Application Data folder or shared files which have not been added to My Drive will be omitted from the maxChangeIdCount. + * includeSubscribed: 'placeholder-value', + * // Maximum number of remaining change IDs to count + * maxChangeIdCount: 'placeholder-value', + * // Change ID to start counting from when calculating number of remaining change IDs + * startChangeId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "additionalRoleInfo": [], + * // "canCreateDrives": false, + * // "canCreateTeamDrives": false, + * // "domainSharingPolicy": "my_domainSharingPolicy", + * // "driveThemes": [], + * // "etag": "my_etag", + * // "exportFormats": [], + * // "features": [], + * // "folderColorPalette": [], + * // "importFormats": [], + * // "isCurrentAppInstalled": false, + * // "kind": "my_kind", + * // "languageCode": "my_languageCode", + * // "largestChangeId": "my_largestChangeId", + * // "maxUploadSizes": [], + * // "name": "my_name", + * // "permissionId": "my_permissionId", + * // "quotaBytesByService": [], + * // "quotaBytesTotal": "my_quotaBytesTotal", + * // "quotaBytesUsed": "my_quotaBytesUsed", + * // "quotaBytesUsedAggregate": "my_quotaBytesUsedAggregate", + * // "quotaBytesUsedInTrash": "my_quotaBytesUsedInTrash", + * // "quotaType": "my_quotaType", + * // "remainingChangeIds": "my_remainingChangeIds", + * // "rootFolderId": "my_rootFolderId", + * // "selfLink": "my_selfLink", + * // "teamDriveThemes": [], + * // "user": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.about.get * @memberOf! () * @@ -1777,6 +1856,77 @@ export namespace drive_v2 { /** * drive.apps.get * @desc Gets a specific app. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.apps.readonly', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.apps.get({ + * // The ID of the app. + * appId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authorized": false, + * // "createInFolderTemplate": "my_createInFolderTemplate", + * // "createUrl": "my_createUrl", + * // "hasDriveWideScope": false, + * // "icons": [], + * // "id": "my_id", + * // "installed": false, + * // "kind": "my_kind", + * // "longDescription": "my_longDescription", + * // "name": "my_name", + * // "objectType": "my_objectType", + * // "openUrlTemplate": "my_openUrlTemplate", + * // "primaryFileExtensions": [], + * // "primaryMimeTypes": [], + * // "productId": "my_productId", + * // "productUrl": "my_productUrl", + * // "secondaryFileExtensions": [], + * // "secondaryMimeTypes": [], + * // "shortDescription": "my_shortDescription", + * // "supportsCreate": false, + * // "supportsImport": false, + * // "supportsMultiOpen": false, + * // "supportsOfflineCreate": false, + * // "useByDefault": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.apps.get * @memberOf! () * @@ -1848,6 +1998,54 @@ export namespace drive_v2 { /** * drive.apps.list * @desc Lists a user's installed apps. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive.apps.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 drive.apps.list({ + * // A comma-separated list of file extensions for open with filtering. All apps within the given app query scope which can open any of the given file extensions will be included in the response. If appFilterMimeTypes are provided as well, the result is a union of the two resulting app lists. + * appFilterExtensions: 'placeholder-value', + * // A comma-separated list of MIME types for open with filtering. All apps within the given app query scope which can open any of the given MIME types will be included in the response. If appFilterExtensions are provided as well, the result is a union of the two resulting app lists. + * appFilterMimeTypes: 'placeholder-value', + * // A language or locale code, as defined by BCP 47, with some extensions from Unicode's LDML format (http://www.unicode.org/reports/tr35/). + * languageCode: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "defaultAppIds": [], + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.apps.list * @memberOf! () * @@ -1956,6 +2154,75 @@ export namespace drive_v2 { /** * drive.changes.get * @desc Deprecated - Use changes.getStartPageToken and changes.list to retrieve recent changes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.apps.readonly', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.changes.get({ + * // The ID of the change. + * changeId: 'placeholder-value', + * // The shared drive from which the change is returned. + * driveId: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Deprecated use driveId instead. + * teamDriveId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "changeType": "my_changeType", + * // "deleted": false, + * // "drive": {}, + * // "driveId": "my_driveId", + * // "file": {}, + * // "fileId": "my_fileId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "modificationDate": "my_modificationDate", + * // "selfLink": "my_selfLink", + * // "teamDrive": {}, + * // "teamDriveId": "my_teamDriveId", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.changes.get * @memberOf! () * @@ -2031,6 +2298,62 @@ export namespace drive_v2 { /** * drive.changes.getStartPageToken * @desc Gets the starting pageToken for listing future changes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.apps.readonly', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.changes.getStartPageToken({ + * // The ID of the shared drive for which the starting pageToken for listing future changes from that shared drive is returned. + * driveId: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Deprecated use driveId instead. + * teamDriveId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "startPageToken": "my_startPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.changes.getStartPageToken * @memberOf! () * @@ -2110,6 +2433,86 @@ export namespace drive_v2 { /** * drive.changes.list * @desc Lists the changes for a user or shared drive. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.apps.readonly', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.changes.list({ + * // The shared drive from which changes are returned. If specified the change IDs will be reflective of the shared drive; use the combined drive ID and change ID as an identifier. + * driveId: 'placeholder-value', + * // Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file. + * includeCorpusRemovals: 'placeholder-value', + * // Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access. + * includeDeleted: 'placeholder-value', + * // Deprecated - Whether both My Drive and shared drive items should be included in results. This parameter will only be effective until June 1, 2020. Afterwards shared drive items are included in the results. + * includeItemsFromAllDrives: 'placeholder-value', + * // Whether to include changes outside the My Drive hierarchy in the result. When set to false, changes to files such as those in the Application Data folder or shared files which have not been added to My Drive are omitted from the result. + * includeSubscribed: 'placeholder-value', + * // Deprecated use includeItemsFromAllDrives instead. + * includeTeamDriveItems: 'placeholder-value', + * // Maximum number of changes to return. + * maxResults: 'placeholder-value', + * // The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method. + * pageToken: 'placeholder-value', + * // A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'. + * spaces: 'placeholder-value', + * // Deprecated - use pageToken instead. + * startChangeId: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Deprecated use driveId instead. + * teamDriveId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "largestChangeId": "my_largestChangeId", + * // "newStartPageToken": "my_newStartPageToken", + * // "nextLink": "my_nextLink", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.changes.list * @memberOf! () * @@ -2192,6 +2595,105 @@ export namespace drive_v2 { /** * drive.changes.watch * @desc Subscribe to changes for a user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.apps.readonly', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.changes.watch({ + * // The shared drive from which changes are returned. If specified the change IDs will be reflective of the shared drive; use the combined drive ID and change ID as an identifier. + * driveId: 'placeholder-value', + * // Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file. + * includeCorpusRemovals: 'placeholder-value', + * // Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access. + * includeDeleted: 'placeholder-value', + * // Deprecated - Whether both My Drive and shared drive items should be included in results. This parameter will only be effective until June 1, 2020. Afterwards shared drive items are included in the results. + * includeItemsFromAllDrives: 'placeholder-value', + * // Whether to include changes outside the My Drive hierarchy in the result. When set to false, changes to files such as those in the Application Data folder or shared files which have not been added to My Drive are omitted from the result. + * includeSubscribed: 'placeholder-value', + * // Deprecated use includeItemsFromAllDrives instead. + * includeTeamDriveItems: 'placeholder-value', + * // Maximum number of changes to return. + * maxResults: 'placeholder-value', + * // The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method. + * pageToken: 'placeholder-value', + * // A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'. + * spaces: 'placeholder-value', + * // Deprecated - use pageToken instead. + * startChangeId: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Deprecated use driveId instead. + * teamDriveId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.changes.watch * @memberOf! () * @@ -2458,6 +2960,64 @@ export namespace drive_v2 { /** * drive.channels.stop * @desc Stop watching resources through this channel + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.apps.readonly', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.channels.stop({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.channels.stop * @memberOf! () * @@ -2548,6 +3108,48 @@ export namespace drive_v2 { /** * drive.children.delete * @desc Removes a child from a folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.children.delete({ + * // The ID of the child. + * childId: 'placeholder-value', + * // Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. If the item's last parent is removed, the item is placed under its owner's root. + * enforceSingleParent: 'placeholder-value', + * // The ID of the folder. + * folderId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.children.delete * @memberOf! () * @@ -2620,6 +3222,59 @@ export namespace drive_v2 { /** * drive.children.get * @desc Gets a specific child reference. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.children.get({ + * // The ID of the child. + * childId: 'placeholder-value', + * // The ID of the folder. + * folderId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "childLink": "my_childLink", + * // "id": "my_id", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.children.get * @memberOf! () * @@ -2693,6 +3348,70 @@ export namespace drive_v2 { /** * drive.children.insert * @desc Inserts a file into a folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.children.insert({ + * // Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. If the child's owner makes the request, the child is removed from all current folders and placed in the requested folder. Any other requests that increase the number of the child's parents fail, except when the canAddMyDriveParent file capability is true and a single parent is being added. + * enforceSingleParent: 'placeholder-value', + * // The ID of the folder. + * folderId: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "childLink": "my_childLink", + * // "id": "my_id", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "childLink": "my_childLink", + * // "id": "my_id", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.children.insert * @memberOf! () * @@ -2770,6 +3489,67 @@ export namespace drive_v2 { /** * drive.children.list * @desc Lists a folder's children. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.children.list({ + * // The ID of the folder. + * folderId: 'placeholder-value', + * // Maximum number of children to return. + * maxResults: 'placeholder-value', + * // A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', and 'title'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored. + * orderBy: 'placeholder-value', + * // Page token for children. + * pageToken: 'placeholder-value', + * // Query string for searching children. + * q: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.children.list * @memberOf! () * @@ -2944,6 +3724,46 @@ export namespace drive_v2 { /** * drive.comments.delete * @desc Deletes a comment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.comments.delete({ + * // The ID of the comment. + * commentId: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.comments.delete * @memberOf! () * @@ -3015,6 +3835,68 @@ export namespace drive_v2 { /** * drive.comments.get * @desc Gets a comment by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.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 drive.comments.get({ + * // The ID of the comment. + * commentId: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * // If set, this will succeed when retrieving a deleted comment, and will include any deleted replies. + * includeDeleted: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "anchor": "my_anchor", + * // "author": {}, + * // "commentId": "my_commentId", + * // "content": "my_content", + * // "context": {}, + * // "createdDate": "my_createdDate", + * // "deleted": false, + * // "fileId": "my_fileId", + * // "fileTitle": "my_fileTitle", + * // "htmlContent": "my_htmlContent", + * // "kind": "my_kind", + * // "modifiedDate": "my_modifiedDate", + * // "replies": [], + * // "selfLink": "my_selfLink", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.comments.get * @memberOf! () * @@ -3087,6 +3969,85 @@ export namespace drive_v2 { /** * drive.comments.insert * @desc Creates a new comment on the given file. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.comments.insert({ + * // The ID of the file. + * fileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "anchor": "my_anchor", + * // "author": {}, + * // "commentId": "my_commentId", + * // "content": "my_content", + * // "context": {}, + * // "createdDate": "my_createdDate", + * // "deleted": false, + * // "fileId": "my_fileId", + * // "fileTitle": "my_fileTitle", + * // "htmlContent": "my_htmlContent", + * // "kind": "my_kind", + * // "modifiedDate": "my_modifiedDate", + * // "replies": [], + * // "selfLink": "my_selfLink", + * // "status": "my_status" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "anchor": "my_anchor", + * // "author": {}, + * // "commentId": "my_commentId", + * // "content": "my_content", + * // "context": {}, + * // "createdDate": "my_createdDate", + * // "deleted": false, + * // "fileId": "my_fileId", + * // "fileTitle": "my_fileTitle", + * // "htmlContent": "my_htmlContent", + * // "kind": "my_kind", + * // "modifiedDate": "my_modifiedDate", + * // "replies": [], + * // "selfLink": "my_selfLink", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.comments.insert * @memberOf! () * @@ -3159,6 +4120,62 @@ export namespace drive_v2 { /** * drive.comments.list * @desc Lists a file's comments. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.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 drive.comments.list({ + * // The ID of the file. + * fileId: 'placeholder-value', + * // If set, all comments and replies, including deleted comments and replies (with content stripped) will be returned. + * includeDeleted: 'placeholder-value', + * // The maximum number of discussions to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * // Only discussions that were updated after this timestamp will be returned. Formatted as an RFC 3339 timestamp. + * updatedMin: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.comments.list * @memberOf! () * @@ -3236,6 +4253,87 @@ export namespace drive_v2 { /** * drive.comments.patch * @desc Updates an existing comment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.comments.patch({ + * // The ID of the comment. + * commentId: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "anchor": "my_anchor", + * // "author": {}, + * // "commentId": "my_commentId", + * // "content": "my_content", + * // "context": {}, + * // "createdDate": "my_createdDate", + * // "deleted": false, + * // "fileId": "my_fileId", + * // "fileTitle": "my_fileTitle", + * // "htmlContent": "my_htmlContent", + * // "kind": "my_kind", + * // "modifiedDate": "my_modifiedDate", + * // "replies": [], + * // "selfLink": "my_selfLink", + * // "status": "my_status" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "anchor": "my_anchor", + * // "author": {}, + * // "commentId": "my_commentId", + * // "content": "my_content", + * // "context": {}, + * // "createdDate": "my_createdDate", + * // "deleted": false, + * // "fileId": "my_fileId", + * // "fileTitle": "my_fileTitle", + * // "htmlContent": "my_htmlContent", + * // "kind": "my_kind", + * // "modifiedDate": "my_modifiedDate", + * // "replies": [], + * // "selfLink": "my_selfLink", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.comments.patch * @memberOf! () * @@ -3308,6 +4406,87 @@ export namespace drive_v2 { /** * drive.comments.update * @desc Updates an existing comment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.comments.update({ + * // The ID of the comment. + * commentId: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "anchor": "my_anchor", + * // "author": {}, + * // "commentId": "my_commentId", + * // "content": "my_content", + * // "context": {}, + * // "createdDate": "my_createdDate", + * // "deleted": false, + * // "fileId": "my_fileId", + * // "fileTitle": "my_fileTitle", + * // "htmlContent": "my_htmlContent", + * // "kind": "my_kind", + * // "modifiedDate": "my_modifiedDate", + * // "replies": [], + * // "selfLink": "my_selfLink", + * // "status": "my_status" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "anchor": "my_anchor", + * // "author": {}, + * // "commentId": "my_commentId", + * // "content": "my_content", + * // "context": {}, + * // "createdDate": "my_createdDate", + * // "deleted": false, + * // "fileId": "my_fileId", + * // "fileTitle": "my_fileTitle", + * // "htmlContent": "my_htmlContent", + * // "kind": "my_kind", + * // "modifiedDate": "my_modifiedDate", + * // "replies": [], + * // "selfLink": "my_selfLink", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.comments.update * @memberOf! () * @@ -3505,6 +4684,41 @@ export namespace drive_v2 { /** * drive.drives.delete * @desc Permanently deletes a shared drive for which the user is an organizer. The shared drive cannot contain any untrashed items. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive'], + * }); + * + * // 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 drive.drives.delete({ + * // The ID of the shared drive. + * driveId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.drives.delete * @memberOf! () * @@ -3576,6 +4790,61 @@ export namespace drive_v2 { /** * drive.drives.get * @desc Gets a shared drive's metadata by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.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 drive.drives.get({ + * // The ID of the shared drive. + * driveId: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the shared drive belongs. + * useDomainAdminAccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdDate": "my_createdDate", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.drives.get * @memberOf! () * @@ -3648,6 +4917,56 @@ export namespace drive_v2 { /** * drive.drives.hide * @desc Hides a shared drive from the default view. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive'], + * }); + * + * // 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 drive.drives.hide({ + * // The ID of the shared drive. + * driveId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdDate": "my_createdDate", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.drives.hide * @memberOf! () * @@ -3719,6 +5038,74 @@ export namespace drive_v2 { /** * drive.drives.insert * @desc Creates a new shared drive. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive'], + * }); + * + * // 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 drive.drives.insert({ + * // An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a shared drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same shared drive. If the shared drive already exists a 409 error will be returned. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdDate": "my_createdDate", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdDate": "my_createdDate", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.drives.insert * @memberOf! () * @@ -3788,6 +5175,57 @@ export namespace drive_v2 { /** * drive.drives.list * @desc Lists the user's shared drives. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.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 drive.drives.list({ + * // Maximum number of shared drives to return. + * maxResults: 'placeholder-value', + * // Page token for shared drives. + * pageToken: 'placeholder-value', + * // Query string for searching shared drives. + * q: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then all shared drives of the domain in which the requester is an administrator are returned. + * useDomainAdminAccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.drives.list * @memberOf! () * @@ -3861,6 +5299,56 @@ export namespace drive_v2 { /** * drive.drives.unhide * @desc Restores a shared drive to the default view. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive'], + * }); + * + * // 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 drive.drives.unhide({ + * // The ID of the shared drive. + * driveId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdDate": "my_createdDate", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.drives.unhide * @memberOf! () * @@ -3932,6 +5420,76 @@ export namespace drive_v2 { /** * drive.drives.update * @desc Updates the metadata for a shared drive. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive'], + * }); + * + * // 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 drive.drives.update({ + * // The ID of the shared drive. + * driveId: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the shared drive belongs. + * useDomainAdminAccess: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdDate": "my_createdDate", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdDate": "my_createdDate", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.drives.update * @memberOf! () * @@ -4120,6 +5678,216 @@ export namespace drive_v2 { /** * drive.files.copy * @desc Creates a copy of the specified file. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.apps.readonly', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.photos.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 drive.files.copy({ + * // Whether to convert this file to the corresponding Google Docs format. + * convert: 'placeholder-value', + * // Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. Requests that specify more than one parent fail. + * enforceSingleParent: 'placeholder-value', + * // The ID of the file to copy. + * fileId: 'placeholder-value', + * // Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. + * ocr: 'placeholder-value', + * // If ocr is true, hints at the language to use. Valid values are BCP 47 codes. + * ocrLanguage: 'placeholder-value', + * // Whether to pin the head revision of the new copy. A file can have a maximum of 200 pinned revisions. + * pinned: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // The language of the timed text. + * timedTextLanguage: 'placeholder-value', + * // The timed text track name. + * timedTextTrackName: 'placeholder-value', + * // The visibility of the new file. This parameter is only relevant when the source is not a native Google Doc and convert=false. + * visibility: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternateLink": "my_alternateLink", + * // "appDataContents": false, + * // "canComment": false, + * // "canReadRevisions": false, + * // "capabilities": {}, + * // "copyRequiresWriterPermission": false, + * // "copyable": false, + * // "createdDate": "my_createdDate", + * // "defaultOpenWithLink": "my_defaultOpenWithLink", + * // "description": "my_description", + * // "downloadUrl": "my_downloadUrl", + * // "driveId": "my_driveId", + * // "editable": false, + * // "embedLink": "my_embedLink", + * // "etag": "my_etag", + * // "explicitlyTrashed": false, + * // "exportLinks": {}, + * // "fileExtension": "my_fileExtension", + * // "fileSize": "my_fileSize", + * // "folderColorRgb": "my_folderColorRgb", + * // "fullFileExtension": "my_fullFileExtension", + * // "hasAugmentedPermissions": false, + * // "hasThumbnail": false, + * // "headRevisionId": "my_headRevisionId", + * // "iconLink": "my_iconLink", + * // "id": "my_id", + * // "imageMediaMetadata": {}, + * // "indexableText": {}, + * // "isAppAuthorized": false, + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifyingUser": {}, + * // "lastModifyingUserName": "my_lastModifyingUserName", + * // "lastViewedByMeDate": "my_lastViewedByMeDate", + * // "markedViewedByMeDate": "my_markedViewedByMeDate", + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedByMeDate": "my_modifiedByMeDate", + * // "modifiedDate": "my_modifiedDate", + * // "openWithLinks": {}, + * // "originalFilename": "my_originalFilename", + * // "ownedByMe": false, + * // "ownerNames": [], + * // "owners": [], + * // "parents": [], + * // "permissionIds": [], + * // "permissions": [], + * // "properties": [], + * // "quotaBytesUsed": "my_quotaBytesUsed", + * // "selfLink": "my_selfLink", + * // "shareable": false, + * // "shared": false, + * // "sharedWithMeDate": "my_sharedWithMeDate", + * // "sharingUser": {}, + * // "shortcutDetails": {}, + * // "spaces": [], + * // "teamDriveId": "my_teamDriveId", + * // "thumbnail": {}, + * // "thumbnailLink": "my_thumbnailLink", + * // "thumbnailVersion": "my_thumbnailVersion", + * // "title": "my_title", + * // "trashedDate": "my_trashedDate", + * // "trashingUser": {}, + * // "userPermission": {}, + * // "version": "my_version", + * // "videoMediaMetadata": {}, + * // "webContentLink": "my_webContentLink", + * // "webViewLink": "my_webViewLink", + * // "writersCanShare": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "appDataContents": false, + * // "canComment": false, + * // "canReadRevisions": false, + * // "capabilities": {}, + * // "copyRequiresWriterPermission": false, + * // "copyable": false, + * // "createdDate": "my_createdDate", + * // "defaultOpenWithLink": "my_defaultOpenWithLink", + * // "description": "my_description", + * // "downloadUrl": "my_downloadUrl", + * // "driveId": "my_driveId", + * // "editable": false, + * // "embedLink": "my_embedLink", + * // "etag": "my_etag", + * // "explicitlyTrashed": false, + * // "exportLinks": {}, + * // "fileExtension": "my_fileExtension", + * // "fileSize": "my_fileSize", + * // "folderColorRgb": "my_folderColorRgb", + * // "fullFileExtension": "my_fullFileExtension", + * // "hasAugmentedPermissions": false, + * // "hasThumbnail": false, + * // "headRevisionId": "my_headRevisionId", + * // "iconLink": "my_iconLink", + * // "id": "my_id", + * // "imageMediaMetadata": {}, + * // "indexableText": {}, + * // "isAppAuthorized": false, + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifyingUser": {}, + * // "lastModifyingUserName": "my_lastModifyingUserName", + * // "lastViewedByMeDate": "my_lastViewedByMeDate", + * // "markedViewedByMeDate": "my_markedViewedByMeDate", + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedByMeDate": "my_modifiedByMeDate", + * // "modifiedDate": "my_modifiedDate", + * // "openWithLinks": {}, + * // "originalFilename": "my_originalFilename", + * // "ownedByMe": false, + * // "ownerNames": [], + * // "owners": [], + * // "parents": [], + * // "permissionIds": [], + * // "permissions": [], + * // "properties": [], + * // "quotaBytesUsed": "my_quotaBytesUsed", + * // "selfLink": "my_selfLink", + * // "shareable": false, + * // "shared": false, + * // "sharedWithMeDate": "my_sharedWithMeDate", + * // "sharingUser": {}, + * // "shortcutDetails": {}, + * // "spaces": [], + * // "teamDriveId": "my_teamDriveId", + * // "thumbnail": {}, + * // "thumbnailLink": "my_thumbnailLink", + * // "thumbnailVersion": "my_thumbnailVersion", + * // "title": "my_title", + * // "trashedDate": "my_trashedDate", + * // "trashingUser": {}, + * // "userPermission": {}, + * // "version": "my_version", + * // "videoMediaMetadata": {}, + * // "webContentLink": "my_webContentLink", + * // "webViewLink": "my_webViewLink", + * // "writersCanShare": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.copy * @memberOf! () * @@ -4202,6 +5970,49 @@ export namespace drive_v2 { /** * drive.files.delete * @desc Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file or be an organizer on the parent for shared drive files. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.files.delete({ + * // The ID of the file to delete. + * fileId: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.delete * @memberOf! () * @@ -4275,6 +6086,38 @@ export namespace drive_v2 { /** * drive.files.emptyTrash * @desc Permanently deletes all of the user's trashed files. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive'], + * }); + * + * // 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 drive.files.emptyTrash({}); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.emptyTrash * @memberOf! () * @@ -4345,6 +6188,47 @@ export namespace drive_v2 { /** * drive.files.export * @desc Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.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 drive.files.export({ + * // The ID of the file. + * fileId: 'placeholder-value', + * // The MIME type of the format requested for this export. + * mimeType: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.export * @memberOf! () * @@ -4417,6 +6301,54 @@ export namespace drive_v2 { /** * drive.files.generateIds * @desc Generates a set of file IDs which can be provided in insert or copy requests. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.files.generateIds({ + * // Maximum number of IDs to return. + * maxResults: 'placeholder-value', + * // The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'. + * space: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ids": [], + * // "kind": "my_kind", + * // "space": "my_space" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.generateIds * @memberOf! () * @@ -4492,6 +6424,134 @@ export namespace drive_v2 { /** * drive.files.get * @desc Gets a file's metadata by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.files.get({ + * // Whether the user is acknowledging the risk of downloading known malware or other abusive files. + * acknowledgeAbuse: 'placeholder-value', + * // The ID for the file in question. + * fileId: 'placeholder-value', + * // This parameter is deprecated and has no function. + * projection: 'placeholder-value', + * // Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified. + * revisionId: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body. + * updateViewedDate: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "appDataContents": false, + * // "canComment": false, + * // "canReadRevisions": false, + * // "capabilities": {}, + * // "copyRequiresWriterPermission": false, + * // "copyable": false, + * // "createdDate": "my_createdDate", + * // "defaultOpenWithLink": "my_defaultOpenWithLink", + * // "description": "my_description", + * // "downloadUrl": "my_downloadUrl", + * // "driveId": "my_driveId", + * // "editable": false, + * // "embedLink": "my_embedLink", + * // "etag": "my_etag", + * // "explicitlyTrashed": false, + * // "exportLinks": {}, + * // "fileExtension": "my_fileExtension", + * // "fileSize": "my_fileSize", + * // "folderColorRgb": "my_folderColorRgb", + * // "fullFileExtension": "my_fullFileExtension", + * // "hasAugmentedPermissions": false, + * // "hasThumbnail": false, + * // "headRevisionId": "my_headRevisionId", + * // "iconLink": "my_iconLink", + * // "id": "my_id", + * // "imageMediaMetadata": {}, + * // "indexableText": {}, + * // "isAppAuthorized": false, + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifyingUser": {}, + * // "lastModifyingUserName": "my_lastModifyingUserName", + * // "lastViewedByMeDate": "my_lastViewedByMeDate", + * // "markedViewedByMeDate": "my_markedViewedByMeDate", + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedByMeDate": "my_modifiedByMeDate", + * // "modifiedDate": "my_modifiedDate", + * // "openWithLinks": {}, + * // "originalFilename": "my_originalFilename", + * // "ownedByMe": false, + * // "ownerNames": [], + * // "owners": [], + * // "parents": [], + * // "permissionIds": [], + * // "permissions": [], + * // "properties": [], + * // "quotaBytesUsed": "my_quotaBytesUsed", + * // "selfLink": "my_selfLink", + * // "shareable": false, + * // "shared": false, + * // "sharedWithMeDate": "my_sharedWithMeDate", + * // "sharingUser": {}, + * // "shortcutDetails": {}, + * // "spaces": [], + * // "teamDriveId": "my_teamDriveId", + * // "thumbnail": {}, + * // "thumbnailLink": "my_thumbnailLink", + * // "thumbnailVersion": "my_thumbnailVersion", + * // "title": "my_title", + * // "trashedDate": "my_trashedDate", + * // "trashingUser": {}, + * // "userPermission": {}, + * // "version": "my_version", + * // "videoMediaMetadata": {}, + * // "webContentLink": "my_webContentLink", + * // "webViewLink": "my_webViewLink", + * // "writersCanShare": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.get * @memberOf! () * @@ -4569,6 +6629,219 @@ export namespace drive_v2 { /** * drive.files.insert * @desc Insert a new file. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.apps.readonly', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.files.insert({ + * // Whether to convert this file to the corresponding Google Docs format. + * convert: 'placeholder-value', + * // Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. Requests that specify more than one parent fail. + * enforceSingleParent: 'placeholder-value', + * // Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. + * ocr: 'placeholder-value', + * // If ocr is true, hints at the language to use. Valid values are BCP 47 codes. + * ocrLanguage: 'placeholder-value', + * // Whether to pin the head revision of the uploaded file. A file can have a maximum of 200 pinned revisions. + * pinned: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // The language of the timed text. + * timedTextLanguage: 'placeholder-value', + * // The timed text track name. + * timedTextTrackName: 'placeholder-value', + * // Whether to use the content as indexable text. + * useContentAsIndexableText: 'placeholder-value', + * // The visibility of the new file. This parameter is only relevant when convert=false. + * visibility: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternateLink": "my_alternateLink", + * // "appDataContents": false, + * // "canComment": false, + * // "canReadRevisions": false, + * // "capabilities": {}, + * // "copyRequiresWriterPermission": false, + * // "copyable": false, + * // "createdDate": "my_createdDate", + * // "defaultOpenWithLink": "my_defaultOpenWithLink", + * // "description": "my_description", + * // "downloadUrl": "my_downloadUrl", + * // "driveId": "my_driveId", + * // "editable": false, + * // "embedLink": "my_embedLink", + * // "etag": "my_etag", + * // "explicitlyTrashed": false, + * // "exportLinks": {}, + * // "fileExtension": "my_fileExtension", + * // "fileSize": "my_fileSize", + * // "folderColorRgb": "my_folderColorRgb", + * // "fullFileExtension": "my_fullFileExtension", + * // "hasAugmentedPermissions": false, + * // "hasThumbnail": false, + * // "headRevisionId": "my_headRevisionId", + * // "iconLink": "my_iconLink", + * // "id": "my_id", + * // "imageMediaMetadata": {}, + * // "indexableText": {}, + * // "isAppAuthorized": false, + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifyingUser": {}, + * // "lastModifyingUserName": "my_lastModifyingUserName", + * // "lastViewedByMeDate": "my_lastViewedByMeDate", + * // "markedViewedByMeDate": "my_markedViewedByMeDate", + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedByMeDate": "my_modifiedByMeDate", + * // "modifiedDate": "my_modifiedDate", + * // "openWithLinks": {}, + * // "originalFilename": "my_originalFilename", + * // "ownedByMe": false, + * // "ownerNames": [], + * // "owners": [], + * // "parents": [], + * // "permissionIds": [], + * // "permissions": [], + * // "properties": [], + * // "quotaBytesUsed": "my_quotaBytesUsed", + * // "selfLink": "my_selfLink", + * // "shareable": false, + * // "shared": false, + * // "sharedWithMeDate": "my_sharedWithMeDate", + * // "sharingUser": {}, + * // "shortcutDetails": {}, + * // "spaces": [], + * // "teamDriveId": "my_teamDriveId", + * // "thumbnail": {}, + * // "thumbnailLink": "my_thumbnailLink", + * // "thumbnailVersion": "my_thumbnailVersion", + * // "title": "my_title", + * // "trashedDate": "my_trashedDate", + * // "trashingUser": {}, + * // "userPermission": {}, + * // "version": "my_version", + * // "videoMediaMetadata": {}, + * // "webContentLink": "my_webContentLink", + * // "webViewLink": "my_webViewLink", + * // "writersCanShare": false + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "appDataContents": false, + * // "canComment": false, + * // "canReadRevisions": false, + * // "capabilities": {}, + * // "copyRequiresWriterPermission": false, + * // "copyable": false, + * // "createdDate": "my_createdDate", + * // "defaultOpenWithLink": "my_defaultOpenWithLink", + * // "description": "my_description", + * // "downloadUrl": "my_downloadUrl", + * // "driveId": "my_driveId", + * // "editable": false, + * // "embedLink": "my_embedLink", + * // "etag": "my_etag", + * // "explicitlyTrashed": false, + * // "exportLinks": {}, + * // "fileExtension": "my_fileExtension", + * // "fileSize": "my_fileSize", + * // "folderColorRgb": "my_folderColorRgb", + * // "fullFileExtension": "my_fullFileExtension", + * // "hasAugmentedPermissions": false, + * // "hasThumbnail": false, + * // "headRevisionId": "my_headRevisionId", + * // "iconLink": "my_iconLink", + * // "id": "my_id", + * // "imageMediaMetadata": {}, + * // "indexableText": {}, + * // "isAppAuthorized": false, + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifyingUser": {}, + * // "lastModifyingUserName": "my_lastModifyingUserName", + * // "lastViewedByMeDate": "my_lastViewedByMeDate", + * // "markedViewedByMeDate": "my_markedViewedByMeDate", + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedByMeDate": "my_modifiedByMeDate", + * // "modifiedDate": "my_modifiedDate", + * // "openWithLinks": {}, + * // "originalFilename": "my_originalFilename", + * // "ownedByMe": false, + * // "ownerNames": [], + * // "owners": [], + * // "parents": [], + * // "permissionIds": [], + * // "permissions": [], + * // "properties": [], + * // "quotaBytesUsed": "my_quotaBytesUsed", + * // "selfLink": "my_selfLink", + * // "shareable": false, + * // "shared": false, + * // "sharedWithMeDate": "my_sharedWithMeDate", + * // "sharingUser": {}, + * // "shortcutDetails": {}, + * // "spaces": [], + * // "teamDriveId": "my_teamDriveId", + * // "thumbnail": {}, + * // "thumbnailLink": "my_thumbnailLink", + * // "thumbnailVersion": "my_thumbnailVersion", + * // "title": "my_title", + * // "trashedDate": "my_trashedDate", + * // "trashingUser": {}, + * // "userPermission": {}, + * // "version": "my_version", + * // "videoMediaMetadata": {}, + * // "webContentLink": "my_webContentLink", + * // "webViewLink": "my_webViewLink", + * // "writersCanShare": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.insert * @memberOf! () * @@ -4655,6 +6928,87 @@ export namespace drive_v2 { /** * drive.files.list * @desc Lists the user's files. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.apps.readonly', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.files.list({ + * // Bodies of items (files/documents) to which the query applies. Supported bodies are 'default', 'domain', 'drive' and 'allDrives'. Prefer 'default' or 'drive' to 'allDrives' for efficiency. + * corpora: 'placeholder-value', + * // The body of items (files/documents) to which the query applies. Deprecated: use 'corpora' instead. + * corpus: 'placeholder-value', + * // ID of the shared drive to search. + * driveId: 'placeholder-value', + * // Deprecated - Whether both My Drive and shared drive items should be included in results. This parameter will only be effective until June 1, 2020. Afterwards shared drive items will be included in the results. + * includeItemsFromAllDrives: 'placeholder-value', + * // Deprecated use includeItemsFromAllDrives instead. + * includeTeamDriveItems: 'placeholder-value', + * // The maximum number of files to return per page. Partial or empty result pages are possible even before the end of the files list has been reached. + * maxResults: 'placeholder-value', + * // A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', 'title', and 'title_natural'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored. + * orderBy: 'placeholder-value', + * // Page token for files. + * pageToken: 'placeholder-value', + * // This parameter is deprecated and has no function. + * projection: 'placeholder-value', + * // Query string for searching files. + * q: 'placeholder-value', + * // A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'. + * spaces: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Deprecated use driveId instead. + * teamDriveId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "incompleteSearch": false, + * // "items": [], + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.list * @memberOf! () * @@ -4736,6 +7090,229 @@ export namespace drive_v2 { /** * drive.files.patch * @desc Updates file metadata and/or content. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.apps.readonly', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.scripts', + * ], + * }); + * + * // 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 drive.files.patch({ + * // Comma-separated list of parent IDs to add. + * addParents: 'placeholder-value', + * // This parameter is deprecated and has no function. + * convert: 'placeholder-value', + * // Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. If the item's owner makes a request to add a single parent, the item is removed from all current folders and placed in the requested folder. Other requests that increase the number of parents fail, except when the canAddMyDriveParent file capability is true and a single parent is being added. + * enforceSingleParent: 'placeholder-value', + * // The ID of the file to update. + * fileId: 'placeholder-value', + * // Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate. + * modifiedDateBehavior: 'placeholder-value', + * // Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions. For details on how revisions are retained, see the Drive Help Center. + * newRevision: 'placeholder-value', + * // Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. + * ocr: 'placeholder-value', + * // If ocr is true, hints at the language to use. Valid values are BCP 47 codes. + * ocrLanguage: 'placeholder-value', + * // Whether to pin the new revision. A file can have a maximum of 200 pinned revisions. + * pinned: 'placeholder-value', + * // Comma-separated list of parent IDs to remove. + * removeParents: 'placeholder-value', + * // Whether to set the modified date using the value supplied in the request body. Setting this field to true is equivalent to modifiedDateBehavior=fromBodyOrNow, and false is equivalent to modifiedDateBehavior=now. To prevent any changes to the modified date set modifiedDateBehavior=noChange. + * setModifiedDate: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // The language of the timed text. + * timedTextLanguage: 'placeholder-value', + * // The timed text track name. + * timedTextTrackName: 'placeholder-value', + * // Whether to update the view date after successfully updating the file. + * updateViewedDate: 'placeholder-value', + * // Whether to use the content as indexable text. + * useContentAsIndexableText: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternateLink": "my_alternateLink", + * // "appDataContents": false, + * // "canComment": false, + * // "canReadRevisions": false, + * // "capabilities": {}, + * // "copyRequiresWriterPermission": false, + * // "copyable": false, + * // "createdDate": "my_createdDate", + * // "defaultOpenWithLink": "my_defaultOpenWithLink", + * // "description": "my_description", + * // "downloadUrl": "my_downloadUrl", + * // "driveId": "my_driveId", + * // "editable": false, + * // "embedLink": "my_embedLink", + * // "etag": "my_etag", + * // "explicitlyTrashed": false, + * // "exportLinks": {}, + * // "fileExtension": "my_fileExtension", + * // "fileSize": "my_fileSize", + * // "folderColorRgb": "my_folderColorRgb", + * // "fullFileExtension": "my_fullFileExtension", + * // "hasAugmentedPermissions": false, + * // "hasThumbnail": false, + * // "headRevisionId": "my_headRevisionId", + * // "iconLink": "my_iconLink", + * // "id": "my_id", + * // "imageMediaMetadata": {}, + * // "indexableText": {}, + * // "isAppAuthorized": false, + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifyingUser": {}, + * // "lastModifyingUserName": "my_lastModifyingUserName", + * // "lastViewedByMeDate": "my_lastViewedByMeDate", + * // "markedViewedByMeDate": "my_markedViewedByMeDate", + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedByMeDate": "my_modifiedByMeDate", + * // "modifiedDate": "my_modifiedDate", + * // "openWithLinks": {}, + * // "originalFilename": "my_originalFilename", + * // "ownedByMe": false, + * // "ownerNames": [], + * // "owners": [], + * // "parents": [], + * // "permissionIds": [], + * // "permissions": [], + * // "properties": [], + * // "quotaBytesUsed": "my_quotaBytesUsed", + * // "selfLink": "my_selfLink", + * // "shareable": false, + * // "shared": false, + * // "sharedWithMeDate": "my_sharedWithMeDate", + * // "sharingUser": {}, + * // "shortcutDetails": {}, + * // "spaces": [], + * // "teamDriveId": "my_teamDriveId", + * // "thumbnail": {}, + * // "thumbnailLink": "my_thumbnailLink", + * // "thumbnailVersion": "my_thumbnailVersion", + * // "title": "my_title", + * // "trashedDate": "my_trashedDate", + * // "trashingUser": {}, + * // "userPermission": {}, + * // "version": "my_version", + * // "videoMediaMetadata": {}, + * // "webContentLink": "my_webContentLink", + * // "webViewLink": "my_webViewLink", + * // "writersCanShare": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "appDataContents": false, + * // "canComment": false, + * // "canReadRevisions": false, + * // "capabilities": {}, + * // "copyRequiresWriterPermission": false, + * // "copyable": false, + * // "createdDate": "my_createdDate", + * // "defaultOpenWithLink": "my_defaultOpenWithLink", + * // "description": "my_description", + * // "downloadUrl": "my_downloadUrl", + * // "driveId": "my_driveId", + * // "editable": false, + * // "embedLink": "my_embedLink", + * // "etag": "my_etag", + * // "explicitlyTrashed": false, + * // "exportLinks": {}, + * // "fileExtension": "my_fileExtension", + * // "fileSize": "my_fileSize", + * // "folderColorRgb": "my_folderColorRgb", + * // "fullFileExtension": "my_fullFileExtension", + * // "hasAugmentedPermissions": false, + * // "hasThumbnail": false, + * // "headRevisionId": "my_headRevisionId", + * // "iconLink": "my_iconLink", + * // "id": "my_id", + * // "imageMediaMetadata": {}, + * // "indexableText": {}, + * // "isAppAuthorized": false, + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifyingUser": {}, + * // "lastModifyingUserName": "my_lastModifyingUserName", + * // "lastViewedByMeDate": "my_lastViewedByMeDate", + * // "markedViewedByMeDate": "my_markedViewedByMeDate", + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedByMeDate": "my_modifiedByMeDate", + * // "modifiedDate": "my_modifiedDate", + * // "openWithLinks": {}, + * // "originalFilename": "my_originalFilename", + * // "ownedByMe": false, + * // "ownerNames": [], + * // "owners": [], + * // "parents": [], + * // "permissionIds": [], + * // "permissions": [], + * // "properties": [], + * // "quotaBytesUsed": "my_quotaBytesUsed", + * // "selfLink": "my_selfLink", + * // "shareable": false, + * // "shared": false, + * // "sharedWithMeDate": "my_sharedWithMeDate", + * // "sharingUser": {}, + * // "shortcutDetails": {}, + * // "spaces": [], + * // "teamDriveId": "my_teamDriveId", + * // "thumbnail": {}, + * // "thumbnailLink": "my_thumbnailLink", + * // "thumbnailVersion": "my_thumbnailVersion", + * // "title": "my_title", + * // "trashedDate": "my_trashedDate", + * // "trashingUser": {}, + * // "userPermission": {}, + * // "version": "my_version", + * // "videoMediaMetadata": {}, + * // "webContentLink": "my_webContentLink", + * // "webViewLink": "my_webViewLink", + * // "writersCanShare": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.patch * @memberOf! () * @@ -4824,6 +7401,124 @@ export namespace drive_v2 { /** * drive.files.touch * @desc Set the file's updated time to the current server time. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.apps.readonly', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * ], + * }); + * + * // 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 drive.files.touch({ + * // The ID of the file to update. + * fileId: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "appDataContents": false, + * // "canComment": false, + * // "canReadRevisions": false, + * // "capabilities": {}, + * // "copyRequiresWriterPermission": false, + * // "copyable": false, + * // "createdDate": "my_createdDate", + * // "defaultOpenWithLink": "my_defaultOpenWithLink", + * // "description": "my_description", + * // "downloadUrl": "my_downloadUrl", + * // "driveId": "my_driveId", + * // "editable": false, + * // "embedLink": "my_embedLink", + * // "etag": "my_etag", + * // "explicitlyTrashed": false, + * // "exportLinks": {}, + * // "fileExtension": "my_fileExtension", + * // "fileSize": "my_fileSize", + * // "folderColorRgb": "my_folderColorRgb", + * // "fullFileExtension": "my_fullFileExtension", + * // "hasAugmentedPermissions": false, + * // "hasThumbnail": false, + * // "headRevisionId": "my_headRevisionId", + * // "iconLink": "my_iconLink", + * // "id": "my_id", + * // "imageMediaMetadata": {}, + * // "indexableText": {}, + * // "isAppAuthorized": false, + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifyingUser": {}, + * // "lastModifyingUserName": "my_lastModifyingUserName", + * // "lastViewedByMeDate": "my_lastViewedByMeDate", + * // "markedViewedByMeDate": "my_markedViewedByMeDate", + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedByMeDate": "my_modifiedByMeDate", + * // "modifiedDate": "my_modifiedDate", + * // "openWithLinks": {}, + * // "originalFilename": "my_originalFilename", + * // "ownedByMe": false, + * // "ownerNames": [], + * // "owners": [], + * // "parents": [], + * // "permissionIds": [], + * // "permissions": [], + * // "properties": [], + * // "quotaBytesUsed": "my_quotaBytesUsed", + * // "selfLink": "my_selfLink", + * // "shareable": false, + * // "shared": false, + * // "sharedWithMeDate": "my_sharedWithMeDate", + * // "sharingUser": {}, + * // "shortcutDetails": {}, + * // "spaces": [], + * // "teamDriveId": "my_teamDriveId", + * // "thumbnail": {}, + * // "thumbnailLink": "my_thumbnailLink", + * // "thumbnailVersion": "my_thumbnailVersion", + * // "title": "my_title", + * // "trashedDate": "my_trashedDate", + * // "trashingUser": {}, + * // "userPermission": {}, + * // "version": "my_version", + * // "videoMediaMetadata": {}, + * // "webContentLink": "my_webContentLink", + * // "webViewLink": "my_webViewLink", + * // "writersCanShare": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.touch * @memberOf! () * @@ -4897,6 +7592,123 @@ export namespace drive_v2 { /** * drive.files.trash * @desc Moves a file to the trash. The currently authenticated user must own the file or be at least a fileOrganizer on the parent for shared drive files. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.apps.readonly', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.files.trash({ + * // The ID of the file to trash. + * fileId: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "appDataContents": false, + * // "canComment": false, + * // "canReadRevisions": false, + * // "capabilities": {}, + * // "copyRequiresWriterPermission": false, + * // "copyable": false, + * // "createdDate": "my_createdDate", + * // "defaultOpenWithLink": "my_defaultOpenWithLink", + * // "description": "my_description", + * // "downloadUrl": "my_downloadUrl", + * // "driveId": "my_driveId", + * // "editable": false, + * // "embedLink": "my_embedLink", + * // "etag": "my_etag", + * // "explicitlyTrashed": false, + * // "exportLinks": {}, + * // "fileExtension": "my_fileExtension", + * // "fileSize": "my_fileSize", + * // "folderColorRgb": "my_folderColorRgb", + * // "fullFileExtension": "my_fullFileExtension", + * // "hasAugmentedPermissions": false, + * // "hasThumbnail": false, + * // "headRevisionId": "my_headRevisionId", + * // "iconLink": "my_iconLink", + * // "id": "my_id", + * // "imageMediaMetadata": {}, + * // "indexableText": {}, + * // "isAppAuthorized": false, + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifyingUser": {}, + * // "lastModifyingUserName": "my_lastModifyingUserName", + * // "lastViewedByMeDate": "my_lastViewedByMeDate", + * // "markedViewedByMeDate": "my_markedViewedByMeDate", + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedByMeDate": "my_modifiedByMeDate", + * // "modifiedDate": "my_modifiedDate", + * // "openWithLinks": {}, + * // "originalFilename": "my_originalFilename", + * // "ownedByMe": false, + * // "ownerNames": [], + * // "owners": [], + * // "parents": [], + * // "permissionIds": [], + * // "permissions": [], + * // "properties": [], + * // "quotaBytesUsed": "my_quotaBytesUsed", + * // "selfLink": "my_selfLink", + * // "shareable": false, + * // "shared": false, + * // "sharedWithMeDate": "my_sharedWithMeDate", + * // "sharingUser": {}, + * // "shortcutDetails": {}, + * // "spaces": [], + * // "teamDriveId": "my_teamDriveId", + * // "thumbnail": {}, + * // "thumbnailLink": "my_thumbnailLink", + * // "thumbnailVersion": "my_thumbnailVersion", + * // "title": "my_title", + * // "trashedDate": "my_trashedDate", + * // "trashingUser": {}, + * // "userPermission": {}, + * // "version": "my_version", + * // "videoMediaMetadata": {}, + * // "webContentLink": "my_webContentLink", + * // "webViewLink": "my_webViewLink", + * // "writersCanShare": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.trash * @memberOf! () * @@ -4970,6 +7782,123 @@ export namespace drive_v2 { /** * drive.files.untrash * @desc Restores a file from the trash. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.apps.readonly', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.files.untrash({ + * // The ID of the file to untrash. + * fileId: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "appDataContents": false, + * // "canComment": false, + * // "canReadRevisions": false, + * // "capabilities": {}, + * // "copyRequiresWriterPermission": false, + * // "copyable": false, + * // "createdDate": "my_createdDate", + * // "defaultOpenWithLink": "my_defaultOpenWithLink", + * // "description": "my_description", + * // "downloadUrl": "my_downloadUrl", + * // "driveId": "my_driveId", + * // "editable": false, + * // "embedLink": "my_embedLink", + * // "etag": "my_etag", + * // "explicitlyTrashed": false, + * // "exportLinks": {}, + * // "fileExtension": "my_fileExtension", + * // "fileSize": "my_fileSize", + * // "folderColorRgb": "my_folderColorRgb", + * // "fullFileExtension": "my_fullFileExtension", + * // "hasAugmentedPermissions": false, + * // "hasThumbnail": false, + * // "headRevisionId": "my_headRevisionId", + * // "iconLink": "my_iconLink", + * // "id": "my_id", + * // "imageMediaMetadata": {}, + * // "indexableText": {}, + * // "isAppAuthorized": false, + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifyingUser": {}, + * // "lastModifyingUserName": "my_lastModifyingUserName", + * // "lastViewedByMeDate": "my_lastViewedByMeDate", + * // "markedViewedByMeDate": "my_markedViewedByMeDate", + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedByMeDate": "my_modifiedByMeDate", + * // "modifiedDate": "my_modifiedDate", + * // "openWithLinks": {}, + * // "originalFilename": "my_originalFilename", + * // "ownedByMe": false, + * // "ownerNames": [], + * // "owners": [], + * // "parents": [], + * // "permissionIds": [], + * // "permissions": [], + * // "properties": [], + * // "quotaBytesUsed": "my_quotaBytesUsed", + * // "selfLink": "my_selfLink", + * // "shareable": false, + * // "shared": false, + * // "sharedWithMeDate": "my_sharedWithMeDate", + * // "sharingUser": {}, + * // "shortcutDetails": {}, + * // "spaces": [], + * // "teamDriveId": "my_teamDriveId", + * // "thumbnail": {}, + * // "thumbnailLink": "my_thumbnailLink", + * // "thumbnailVersion": "my_thumbnailVersion", + * // "title": "my_title", + * // "trashedDate": "my_trashedDate", + * // "trashingUser": {}, + * // "userPermission": {}, + * // "version": "my_version", + * // "videoMediaMetadata": {}, + * // "webContentLink": "my_webContentLink", + * // "webViewLink": "my_webViewLink", + * // "writersCanShare": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.untrash * @memberOf! () * @@ -5043,6 +7972,233 @@ export namespace drive_v2 { /** * drive.files.update * @desc Updates file metadata and/or content. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.apps.readonly', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.scripts', + * ], + * }); + * + * // 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 drive.files.update({ + * // Comma-separated list of parent IDs to add. + * addParents: 'placeholder-value', + * // This parameter is deprecated and has no function. + * convert: 'placeholder-value', + * // Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. If the item's owner makes a request to add a single parent, the item is removed from all current folders and placed in the requested folder. Other requests that increase the number of parents fail, except when the canAddMyDriveParent file capability is true and a single parent is being added. + * enforceSingleParent: 'placeholder-value', + * // The ID of the file to update. + * fileId: 'placeholder-value', + * // Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate. + * modifiedDateBehavior: 'placeholder-value', + * // Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions. For details on how revisions are retained, see the Drive Help Center. + * newRevision: 'placeholder-value', + * // Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. + * ocr: 'placeholder-value', + * // If ocr is true, hints at the language to use. Valid values are BCP 47 codes. + * ocrLanguage: 'placeholder-value', + * // Whether to pin the new revision. A file can have a maximum of 200 pinned revisions. + * pinned: 'placeholder-value', + * // Comma-separated list of parent IDs to remove. + * removeParents: 'placeholder-value', + * // Whether to set the modified date using the value supplied in the request body. Setting this field to true is equivalent to modifiedDateBehavior=fromBodyOrNow, and false is equivalent to modifiedDateBehavior=now. To prevent any changes to the modified date set modifiedDateBehavior=noChange. + * setModifiedDate: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // The language of the timed text. + * timedTextLanguage: 'placeholder-value', + * // The timed text track name. + * timedTextTrackName: 'placeholder-value', + * // Whether to update the view date after successfully updating the file. + * updateViewedDate: 'placeholder-value', + * // Whether to use the content as indexable text. + * useContentAsIndexableText: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternateLink": "my_alternateLink", + * // "appDataContents": false, + * // "canComment": false, + * // "canReadRevisions": false, + * // "capabilities": {}, + * // "copyRequiresWriterPermission": false, + * // "copyable": false, + * // "createdDate": "my_createdDate", + * // "defaultOpenWithLink": "my_defaultOpenWithLink", + * // "description": "my_description", + * // "downloadUrl": "my_downloadUrl", + * // "driveId": "my_driveId", + * // "editable": false, + * // "embedLink": "my_embedLink", + * // "etag": "my_etag", + * // "explicitlyTrashed": false, + * // "exportLinks": {}, + * // "fileExtension": "my_fileExtension", + * // "fileSize": "my_fileSize", + * // "folderColorRgb": "my_folderColorRgb", + * // "fullFileExtension": "my_fullFileExtension", + * // "hasAugmentedPermissions": false, + * // "hasThumbnail": false, + * // "headRevisionId": "my_headRevisionId", + * // "iconLink": "my_iconLink", + * // "id": "my_id", + * // "imageMediaMetadata": {}, + * // "indexableText": {}, + * // "isAppAuthorized": false, + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifyingUser": {}, + * // "lastModifyingUserName": "my_lastModifyingUserName", + * // "lastViewedByMeDate": "my_lastViewedByMeDate", + * // "markedViewedByMeDate": "my_markedViewedByMeDate", + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedByMeDate": "my_modifiedByMeDate", + * // "modifiedDate": "my_modifiedDate", + * // "openWithLinks": {}, + * // "originalFilename": "my_originalFilename", + * // "ownedByMe": false, + * // "ownerNames": [], + * // "owners": [], + * // "parents": [], + * // "permissionIds": [], + * // "permissions": [], + * // "properties": [], + * // "quotaBytesUsed": "my_quotaBytesUsed", + * // "selfLink": "my_selfLink", + * // "shareable": false, + * // "shared": false, + * // "sharedWithMeDate": "my_sharedWithMeDate", + * // "sharingUser": {}, + * // "shortcutDetails": {}, + * // "spaces": [], + * // "teamDriveId": "my_teamDriveId", + * // "thumbnail": {}, + * // "thumbnailLink": "my_thumbnailLink", + * // "thumbnailVersion": "my_thumbnailVersion", + * // "title": "my_title", + * // "trashedDate": "my_trashedDate", + * // "trashingUser": {}, + * // "userPermission": {}, + * // "version": "my_version", + * // "videoMediaMetadata": {}, + * // "webContentLink": "my_webContentLink", + * // "webViewLink": "my_webViewLink", + * // "writersCanShare": false + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateLink": "my_alternateLink", + * // "appDataContents": false, + * // "canComment": false, + * // "canReadRevisions": false, + * // "capabilities": {}, + * // "copyRequiresWriterPermission": false, + * // "copyable": false, + * // "createdDate": "my_createdDate", + * // "defaultOpenWithLink": "my_defaultOpenWithLink", + * // "description": "my_description", + * // "downloadUrl": "my_downloadUrl", + * // "driveId": "my_driveId", + * // "editable": false, + * // "embedLink": "my_embedLink", + * // "etag": "my_etag", + * // "explicitlyTrashed": false, + * // "exportLinks": {}, + * // "fileExtension": "my_fileExtension", + * // "fileSize": "my_fileSize", + * // "folderColorRgb": "my_folderColorRgb", + * // "fullFileExtension": "my_fullFileExtension", + * // "hasAugmentedPermissions": false, + * // "hasThumbnail": false, + * // "headRevisionId": "my_headRevisionId", + * // "iconLink": "my_iconLink", + * // "id": "my_id", + * // "imageMediaMetadata": {}, + * // "indexableText": {}, + * // "isAppAuthorized": false, + * // "kind": "my_kind", + * // "labels": {}, + * // "lastModifyingUser": {}, + * // "lastModifyingUserName": "my_lastModifyingUserName", + * // "lastViewedByMeDate": "my_lastViewedByMeDate", + * // "markedViewedByMeDate": "my_markedViewedByMeDate", + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedByMeDate": "my_modifiedByMeDate", + * // "modifiedDate": "my_modifiedDate", + * // "openWithLinks": {}, + * // "originalFilename": "my_originalFilename", + * // "ownedByMe": false, + * // "ownerNames": [], + * // "owners": [], + * // "parents": [], + * // "permissionIds": [], + * // "permissions": [], + * // "properties": [], + * // "quotaBytesUsed": "my_quotaBytesUsed", + * // "selfLink": "my_selfLink", + * // "shareable": false, + * // "shared": false, + * // "sharedWithMeDate": "my_sharedWithMeDate", + * // "sharingUser": {}, + * // "shortcutDetails": {}, + * // "spaces": [], + * // "teamDriveId": "my_teamDriveId", + * // "thumbnail": {}, + * // "thumbnailLink": "my_thumbnailLink", + * // "thumbnailVersion": "my_thumbnailVersion", + * // "title": "my_title", + * // "trashedDate": "my_trashedDate", + * // "trashingUser": {}, + * // "userPermission": {}, + * // "version": "my_version", + * // "videoMediaMetadata": {}, + * // "webContentLink": "my_webContentLink", + * // "webViewLink": "my_webViewLink", + * // "writersCanShare": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.update * @memberOf! () * @@ -5138,6 +8294,92 @@ export namespace drive_v2 { /** * drive.files.watch * @desc Subscribe to changes on a file + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.files.watch({ + * // Whether the user is acknowledging the risk of downloading known malware or other abusive files. + * acknowledgeAbuse: 'placeholder-value', + * // The ID for the file in question. + * fileId: 'placeholder-value', + * // This parameter is deprecated and has no function. + * projection: 'placeholder-value', + * // Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified. + * revisionId: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body. + * updateViewedDate: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.watch * @memberOf! () * @@ -5777,6 +9019,48 @@ export namespace drive_v2 { /** * drive.parents.delete * @desc Removes a parent from a file. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.parents.delete({ + * // Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. If the item's last parent is removed, the item is placed under its owner's root. + * enforceSingleParent: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * // The ID of the parent. + * parentId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.parents.delete * @memberOf! () * @@ -5849,6 +9133,60 @@ export namespace drive_v2 { /** * drive.parents.get * @desc Gets a specific parent reference. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.parents.get({ + * // The ID of the file. + * fileId: 'placeholder-value', + * // The ID of the parent. + * parentId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "isRoot": false, + * // "kind": "my_kind", + * // "parentLink": "my_parentLink", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.parents.get * @memberOf! () * @@ -5922,6 +9260,72 @@ export namespace drive_v2 { /** * drive.parents.insert * @desc Adds a parent folder for a file. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.parents.insert({ + * // Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. If the child's owner makes the request, the child is removed from all current folders and placed in the requested folder. Any other requests that increase the number of the child's parents fail, except when the canAddMyDriveParent file capability is true and a single parent is being added. + * enforceSingleParent: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "isRoot": false, + * // "kind": "my_kind", + * // "parentLink": "my_parentLink", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "isRoot": false, + * // "kind": "my_kind", + * // "parentLink": "my_parentLink", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.parents.insert * @memberOf! () * @@ -5999,6 +9403,57 @@ export namespace drive_v2 { /** * drive.parents.list * @desc Lists a file's parents. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.parents.list({ + * // The ID of the file. + * fileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.parents.list * @memberOf! () * @@ -6153,6 +9608,52 @@ export namespace drive_v2 { /** * drive.permissions.delete * @desc Deletes a permission from a file or shared drive. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.permissions.delete({ + * // The ID for the file or shared drive. + * fileId: 'placeholder-value', + * // The ID for the permission. + * permissionId: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs. + * useDomainAdminAccess: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.permissions.delete * @memberOf! () * @@ -6228,6 +9729,78 @@ export namespace drive_v2 { /** * drive.permissions.get * @desc Gets a permission by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.permissions.get({ + * // The ID for the file or shared drive. + * fileId: 'placeholder-value', + * // The ID for the permission. + * permissionId: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs. + * useDomainAdminAccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "additionalRoles": [], + * // "authKey": "my_authKey", + * // "deleted": false, + * // "domain": "my_domain", + * // "emailAddress": "my_emailAddress", + * // "etag": "my_etag", + * // "expirationDate": "my_expirationDate", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "permissionDetails": [], + * // "photoLink": "my_photoLink", + * // "role": "my_role", + * // "selfLink": "my_selfLink", + * // "teamDrivePermissionDetails": [], + * // "type": "my_type", + * // "value": "my_value", + * // "withLink": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.permissions.get * @memberOf! () * @@ -6304,6 +9877,56 @@ export namespace drive_v2 { /** * drive.permissions.getIdForEmail * @desc Returns the permission ID for an email address. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.apps.readonly', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.permissions.getIdForEmail({ + * // The email address for which to return a permission ID + * email: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.permissions.getIdForEmail * @memberOf! () * @@ -6378,6 +10001,105 @@ export namespace drive_v2 { /** * drive.permissions.insert * @desc Inserts a permission for a file or shared drive. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.permissions.insert({ + * // A plain text custom message to include in notification emails. + * emailMessage: 'placeholder-value', + * // Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. See moveToNewOwnersRoot for details. + * enforceSingleParent: 'placeholder-value', + * // The ID for the file or shared drive. + * fileId: 'placeholder-value', + * // This parameter only takes effect if the item is not in a shared drive and the request is attempting to transfer the ownership of the item. When set to true, the item will be moved to the new owner's My Drive root folder and all prior parents removed. If set to false, when enforceSingleParent=true, parents are not changed. If set to false, when enforceSingleParent=false, existing parents are not changed; however, the file will be added to the new owner's My Drive root folder, unless it is already in the new owner's My Drive. + * moveToNewOwnersRoot: 'placeholder-value', + * // Whether to send notification emails when sharing to users or groups. This parameter is ignored and an email is sent if the role is owner. + * sendNotificationEmails: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs. + * useDomainAdminAccess: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "additionalRoles": [], + * // "authKey": "my_authKey", + * // "deleted": false, + * // "domain": "my_domain", + * // "emailAddress": "my_emailAddress", + * // "etag": "my_etag", + * // "expirationDate": "my_expirationDate", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "permissionDetails": [], + * // "photoLink": "my_photoLink", + * // "role": "my_role", + * // "selfLink": "my_selfLink", + * // "teamDrivePermissionDetails": [], + * // "type": "my_type", + * // "value": "my_value", + * // "withLink": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "additionalRoles": [], + * // "authKey": "my_authKey", + * // "deleted": false, + * // "domain": "my_domain", + * // "emailAddress": "my_emailAddress", + * // "etag": "my_etag", + * // "expirationDate": "my_expirationDate", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "permissionDetails": [], + * // "photoLink": "my_photoLink", + * // "role": "my_role", + * // "selfLink": "my_selfLink", + * // "teamDrivePermissionDetails": [], + * // "type": "my_type", + * // "value": "my_value", + * // "withLink": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.permissions.insert * @memberOf! () * @@ -6460,6 +10182,67 @@ export namespace drive_v2 { /** * drive.permissions.list * @desc Lists a file's or shared drive's permissions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.permissions.list({ + * // The ID for the file or shared drive. + * fileId: 'placeholder-value', + * // The maximum number of permissions to return per page. When not set for files in a shared drive, at most 100 results will be returned. When not set for files that are not in a shared drive, the entire list will be returned. + * maxResults: 'placeholder-value', + * // The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. + * pageToken: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs. + * useDomainAdminAccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.permissions.list * @memberOf! () * @@ -6538,6 +10321,103 @@ export namespace drive_v2 { /** * drive.permissions.patch * @desc Updates a permission using patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.permissions.patch({ + * // The ID for the file or shared drive. + * fileId: 'placeholder-value', + * // The ID for the permission. + * permissionId: 'placeholder-value', + * // Whether to remove the expiration date. + * removeExpiration: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'. + * transferOwnership: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs. + * useDomainAdminAccess: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "additionalRoles": [], + * // "authKey": "my_authKey", + * // "deleted": false, + * // "domain": "my_domain", + * // "emailAddress": "my_emailAddress", + * // "etag": "my_etag", + * // "expirationDate": "my_expirationDate", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "permissionDetails": [], + * // "photoLink": "my_photoLink", + * // "role": "my_role", + * // "selfLink": "my_selfLink", + * // "teamDrivePermissionDetails": [], + * // "type": "my_type", + * // "value": "my_value", + * // "withLink": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "additionalRoles": [], + * // "authKey": "my_authKey", + * // "deleted": false, + * // "domain": "my_domain", + * // "emailAddress": "my_emailAddress", + * // "etag": "my_etag", + * // "expirationDate": "my_expirationDate", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "permissionDetails": [], + * // "photoLink": "my_photoLink", + * // "role": "my_role", + * // "selfLink": "my_selfLink", + * // "teamDrivePermissionDetails": [], + * // "type": "my_type", + * // "value": "my_value", + * // "withLink": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.permissions.patch * @memberOf! () * @@ -6618,6 +10498,103 @@ export namespace drive_v2 { /** * drive.permissions.update * @desc Updates a permission. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.permissions.update({ + * // The ID for the file or shared drive. + * fileId: 'placeholder-value', + * // The ID for the permission. + * permissionId: 'placeholder-value', + * // Whether to remove the expiration date. + * removeExpiration: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'. + * transferOwnership: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs. + * useDomainAdminAccess: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "additionalRoles": [], + * // "authKey": "my_authKey", + * // "deleted": false, + * // "domain": "my_domain", + * // "emailAddress": "my_emailAddress", + * // "etag": "my_etag", + * // "expirationDate": "my_expirationDate", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "permissionDetails": [], + * // "photoLink": "my_photoLink", + * // "role": "my_role", + * // "selfLink": "my_selfLink", + * // "teamDrivePermissionDetails": [], + * // "type": "my_type", + * // "value": "my_value", + * // "withLink": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "additionalRoles": [], + * // "authKey": "my_authKey", + * // "deleted": false, + * // "domain": "my_domain", + * // "emailAddress": "my_emailAddress", + * // "etag": "my_etag", + * // "expirationDate": "my_expirationDate", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "permissionDetails": [], + * // "photoLink": "my_photoLink", + * // "role": "my_role", + * // "selfLink": "my_selfLink", + * // "teamDrivePermissionDetails": [], + * // "type": "my_type", + * // "value": "my_value", + * // "withLink": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.permissions.update * @memberOf! () * @@ -6931,6 +10908,50 @@ export namespace drive_v2 { /** * drive.properties.delete * @desc Deletes a property. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * ], + * }); + * + * // 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 drive.properties.delete({ + * // The ID of the file. + * fileId: 'placeholder-value', + * // The key of the property. + * propertyKey: 'placeholder-value', + * // The visibility of the property. + * visibility: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.properties.delete * @memberOf! () * @@ -7004,6 +11025,63 @@ export namespace drive_v2 { /** * drive.properties.get * @desc Gets a property by its key. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.properties.get({ + * // The ID of the file. + * fileId: 'placeholder-value', + * // The key of the property. + * propertyKey: 'placeholder-value', + * // The visibility of the property. + * visibility: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "key": "my_key", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "value": "my_value", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.properties.get * @memberOf! () * @@ -7076,6 +11154,69 @@ export namespace drive_v2 { /** * drive.properties.insert * @desc Adds a property to a file, or updates it if it already exists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * ], + * }); + * + * // 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 drive.properties.insert({ + * // The ID of the file. + * fileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "key": "my_key", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "value": "my_value", + * // "visibility": "my_visibility" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "key": "my_key", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "value": "my_value", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.properties.insert * @memberOf! () * @@ -7149,6 +11290,57 @@ export namespace drive_v2 { /** * drive.properties.list * @desc Lists a file's properties. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.properties.list({ + * // The ID of the file. + * fileId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.properties.list * @memberOf! () * @@ -7222,6 +11414,73 @@ export namespace drive_v2 { /** * drive.properties.patch * @desc Updates a property. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * ], + * }); + * + * // 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 drive.properties.patch({ + * // The ID of the file. + * fileId: 'placeholder-value', + * // The key of the property. + * propertyKey: 'placeholder-value', + * // The visibility of the property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE) + * visibility: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "key": "my_key", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "value": "my_value", + * // "visibility": "my_visibility" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "key": "my_key", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "value": "my_value", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.properties.patch * @memberOf! () * @@ -7295,6 +11554,73 @@ export namespace drive_v2 { /** * drive.properties.update * @desc Updates a property. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * ], + * }); + * + * // 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 drive.properties.update({ + * // The ID of the file. + * fileId: 'placeholder-value', + * // The key of the property. + * propertyKey: 'placeholder-value', + * // The visibility of the property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE) + * visibility: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "key": "my_key", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "value": "my_value", + * // "visibility": "my_visibility" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "key": "my_key", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "value": "my_value", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.properties.update * @memberOf! () * @@ -7493,6 +11819,48 @@ export namespace drive_v2 { /** * drive.replies.delete * @desc Deletes a reply. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.replies.delete({ + * // The ID of the comment. + * commentId: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * // The ID of the reply. + * replyId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.replies.delete * @memberOf! () * @@ -7566,6 +11934,64 @@ export namespace drive_v2 { /** * drive.replies.get * @desc Gets a reply. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.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 drive.replies.get({ + * // The ID of the comment. + * commentId: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * // If set, this will succeed when retrieving a deleted reply. + * includeDeleted: 'placeholder-value', + * // The ID of the reply. + * replyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "content": "my_content", + * // "createdDate": "my_createdDate", + * // "deleted": false, + * // "htmlContent": "my_htmlContent", + * // "kind": "my_kind", + * // "modifiedDate": "my_modifiedDate", + * // "replyId": "my_replyId", + * // "verb": "my_verb" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.replies.get * @memberOf! () * @@ -7642,6 +12068,75 @@ export namespace drive_v2 { /** * drive.replies.insert * @desc Creates a new reply to the given comment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.replies.insert({ + * // The ID of the comment. + * commentId: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "author": {}, + * // "content": "my_content", + * // "createdDate": "my_createdDate", + * // "deleted": false, + * // "htmlContent": "my_htmlContent", + * // "kind": "my_kind", + * // "modifiedDate": "my_modifiedDate", + * // "replyId": "my_replyId", + * // "verb": "my_verb" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "content": "my_content", + * // "createdDate": "my_createdDate", + * // "deleted": false, + * // "htmlContent": "my_htmlContent", + * // "kind": "my_kind", + * // "modifiedDate": "my_modifiedDate", + * // "replyId": "my_replyId", + * // "verb": "my_verb" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.replies.insert * @memberOf! () * @@ -7716,6 +12211,62 @@ export namespace drive_v2 { /** * drive.replies.list * @desc Lists all of the replies to a comment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.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 drive.replies.list({ + * // The ID of the comment. + * commentId: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * // If set, all replies, including deleted replies (with content stripped) will be returned. + * includeDeleted: 'placeholder-value', + * // The maximum number of replies to include in the response, used for paging. + * maxResults: 'placeholder-value', + * // The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.replies.list * @memberOf! () * @@ -7792,6 +12343,77 @@ export namespace drive_v2 { /** * drive.replies.patch * @desc Updates an existing reply. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.replies.patch({ + * // The ID of the comment. + * commentId: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * // The ID of the reply. + * replyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "author": {}, + * // "content": "my_content", + * // "createdDate": "my_createdDate", + * // "deleted": false, + * // "htmlContent": "my_htmlContent", + * // "kind": "my_kind", + * // "modifiedDate": "my_modifiedDate", + * // "replyId": "my_replyId", + * // "verb": "my_verb" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "content": "my_content", + * // "createdDate": "my_createdDate", + * // "deleted": false, + * // "htmlContent": "my_htmlContent", + * // "kind": "my_kind", + * // "modifiedDate": "my_modifiedDate", + * // "replyId": "my_replyId", + * // "verb": "my_verb" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.replies.patch * @memberOf! () * @@ -7868,6 +12490,77 @@ export namespace drive_v2 { /** * drive.replies.update * @desc Updates an existing reply. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.replies.update({ + * // The ID of the comment. + * commentId: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * // The ID of the reply. + * replyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "author": {}, + * // "content": "my_content", + * // "createdDate": "my_createdDate", + * // "deleted": false, + * // "htmlContent": "my_htmlContent", + * // "kind": "my_kind", + * // "modifiedDate": "my_modifiedDate", + * // "replyId": "my_replyId", + * // "verb": "my_verb" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": {}, + * // "content": "my_content", + * // "createdDate": "my_createdDate", + * // "deleted": false, + * // "htmlContent": "my_htmlContent", + * // "kind": "my_kind", + * // "modifiedDate": "my_modifiedDate", + * // "replyId": "my_replyId", + * // "verb": "my_verb" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.replies.update * @memberOf! () * @@ -8089,6 +12782,47 @@ export namespace drive_v2 { /** * drive.revisions.delete * @desc Permanently deletes a file version. You can only delete revisions for files with binary content, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can't be deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.revisions.delete({ + * // The ID of the file. + * fileId: 'placeholder-value', + * // The ID of the revision. + * revisionId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.revisions.delete * @memberOf! () * @@ -8160,6 +12894,73 @@ export namespace drive_v2 { /** * drive.revisions.get * @desc Gets a specific revision. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.revisions.get({ + * // The ID of the file. + * fileId: 'placeholder-value', + * // The ID of the revision. + * revisionId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "downloadUrl": "my_downloadUrl", + * // "etag": "my_etag", + * // "exportLinks": {}, + * // "fileSize": "my_fileSize", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifyingUser": {}, + * // "lastModifyingUserName": "my_lastModifyingUserName", + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedDate": "my_modifiedDate", + * // "originalFilename": "my_originalFilename", + * // "pinned": false, + * // "publishAuto": false, + * // "published": false, + * // "publishedLink": "my_publishedLink", + * // "publishedOutsideDomain": false, + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.revisions.get * @memberOf! () * @@ -8231,6 +13032,62 @@ export namespace drive_v2 { /** * drive.revisions.list * @desc Lists a file's revisions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.revisions.list({ + * // The ID of the file. + * fileId: 'placeholder-value', + * // Maximum number of revisions to return. + * maxResults: 'placeholder-value', + * // Page token for revisions. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.revisions.list * @memberOf! () * @@ -8306,6 +13163,94 @@ export namespace drive_v2 { /** * drive.revisions.patch * @desc Updates a revision. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.revisions.patch({ + * // The ID for the file. + * fileId: 'placeholder-value', + * // The ID for the revision. + * revisionId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "downloadUrl": "my_downloadUrl", + * // "etag": "my_etag", + * // "exportLinks": {}, + * // "fileSize": "my_fileSize", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifyingUser": {}, + * // "lastModifyingUserName": "my_lastModifyingUserName", + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedDate": "my_modifiedDate", + * // "originalFilename": "my_originalFilename", + * // "pinned": false, + * // "publishAuto": false, + * // "published": false, + * // "publishedLink": "my_publishedLink", + * // "publishedOutsideDomain": false, + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "downloadUrl": "my_downloadUrl", + * // "etag": "my_etag", + * // "exportLinks": {}, + * // "fileSize": "my_fileSize", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifyingUser": {}, + * // "lastModifyingUserName": "my_lastModifyingUserName", + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedDate": "my_modifiedDate", + * // "originalFilename": "my_originalFilename", + * // "pinned": false, + * // "publishAuto": false, + * // "published": false, + * // "publishedLink": "my_publishedLink", + * // "publishedOutsideDomain": false, + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.revisions.patch * @memberOf! () * @@ -8378,6 +13323,94 @@ export namespace drive_v2 { /** * drive.revisions.update * @desc Updates a revision. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.revisions.update({ + * // The ID for the file. + * fileId: 'placeholder-value', + * // The ID for the revision. + * revisionId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "downloadUrl": "my_downloadUrl", + * // "etag": "my_etag", + * // "exportLinks": {}, + * // "fileSize": "my_fileSize", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifyingUser": {}, + * // "lastModifyingUserName": "my_lastModifyingUserName", + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedDate": "my_modifiedDate", + * // "originalFilename": "my_originalFilename", + * // "pinned": false, + * // "publishAuto": false, + * // "published": false, + * // "publishedLink": "my_publishedLink", + * // "publishedOutsideDomain": false, + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "downloadUrl": "my_downloadUrl", + * // "etag": "my_etag", + * // "exportLinks": {}, + * // "fileSize": "my_fileSize", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifyingUser": {}, + * // "lastModifyingUserName": "my_lastModifyingUserName", + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedDate": "my_modifiedDate", + * // "originalFilename": "my_originalFilename", + * // "pinned": false, + * // "publishAuto": false, + * // "published": false, + * // "publishedLink": "my_publishedLink", + * // "publishedOutsideDomain": false, + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.revisions.update * @memberOf! () * @@ -8547,6 +13580,41 @@ export namespace drive_v2 { /** * drive.teamdrives.delete * @desc Deprecated use drives.delete instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive'], + * }); + * + * // 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 drive.teamdrives.delete({ + * // The ID of the Team Drive + * teamDriveId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.teamdrives.delete * @memberOf! () * @@ -8619,6 +13687,60 @@ export namespace drive_v2 { /** * drive.teamdrives.get * @desc Deprecated use drives.get instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.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 drive.teamdrives.get({ + * // The ID of the Team Drive + * teamDriveId: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs. + * useDomainAdminAccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdDate": "my_createdDate", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.teamdrives.get * @memberOf! () * @@ -8693,6 +13815,72 @@ export namespace drive_v2 { /** * drive.teamdrives.insert * @desc Deprecated use drives.insert instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive'], + * }); + * + * // 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 drive.teamdrives.insert({ + * // An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a Team Drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same Team Drive. If the Team Drive already exists a 409 error will be returned. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdDate": "my_createdDate", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdDate": "my_createdDate", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.teamdrives.insert * @memberOf! () * @@ -8768,6 +13956,57 @@ export namespace drive_v2 { /** * drive.teamdrives.list * @desc Deprecated use drives.list instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.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 drive.teamdrives.list({ + * // Maximum number of Team Drives to return. + * maxResults: 'placeholder-value', + * // Page token for Team Drives. + * pageToken: 'placeholder-value', + * // Query string for searching Team Drives. + * q: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then all Team Drives of the domain in which the requester is an administrator are returned. + * useDomainAdminAccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.teamdrives.list * @memberOf! () * @@ -8844,6 +14083,74 @@ export namespace drive_v2 { /** * drive.teamdrives.update * @desc Deprecated use drives.update instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v2'); + * + * 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/drive'], + * }); + * + * // 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 drive.teamdrives.update({ + * // The ID of the Team Drive + * teamDriveId: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs. + * useDomainAdminAccess: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdDate": "my_createdDate", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdDate": "my_createdDate", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.teamdrives.update * @memberOf! () * diff --git a/src/apis/drive/v3.ts b/src/apis/drive/v3.ts index a608e7be7be..adba770cef6 100644 --- a/src/apis/drive/v3.ts +++ b/src/apis/drive/v3.ts @@ -1151,6 +1151,63 @@ export namespace drive_v3 { /** * drive.about.get * @desc Gets information about the user, the user's Drive, and system capabilities. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.about.get({}); + * console.log(res.data); + * + * // Example response + * // { + * // "appInstalled": false, + * // "canCreateDrives": false, + * // "canCreateTeamDrives": false, + * // "driveThemes": [], + * // "exportFormats": {}, + * // "folderColorPalette": [], + * // "importFormats": {}, + * // "kind": "my_kind", + * // "maxImportSizes": {}, + * // "maxUploadSize": "my_maxUploadSize", + * // "storageQuota": {}, + * // "teamDriveThemes": [], + * // "user": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.about.get * @memberOf! () * @@ -1232,6 +1289,61 @@ export namespace drive_v3 { /** * drive.changes.getStartPageToken * @desc Gets the starting pageToken for listing future changes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.changes.getStartPageToken({ + * // The ID of the shared drive for which the starting pageToken for listing future changes from that shared drive is returned. + * driveId: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Deprecated use driveId instead. + * teamDriveId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "startPageToken": "my_startPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.changes.getStartPageToken * @memberOf! () * @@ -1311,6 +1423,79 @@ export namespace drive_v3 { /** * drive.changes.list * @desc Lists the changes for a user or shared drive. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.changes.list({ + * // The shared drive from which changes are returned. If specified the change IDs will be reflective of the shared drive; use the combined drive ID and change ID as an identifier. + * driveId: 'placeholder-value', + * // Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file. + * includeCorpusRemovals: 'placeholder-value', + * // Deprecated - Whether both My Drive and shared drive items should be included in results. This parameter will only be effective until June 1, 2020. Afterwards shared drive items are included in the results. + * includeItemsFromAllDrives: 'placeholder-value', + * // Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access. + * includeRemoved: 'placeholder-value', + * // Deprecated use includeItemsFromAllDrives instead. + * includeTeamDriveItems: 'placeholder-value', + * // The maximum number of changes to return per page. + * pageSize: 'placeholder-value', + * // The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method. + * pageToken: 'placeholder-value', + * // Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or shared files which have not been added to My Drive. + * restrictToMyDrive: 'placeholder-value', + * // A comma-separated list of spaces to query within the user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. + * spaces: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Deprecated use driveId instead. + * teamDriveId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "changes": [], + * // "kind": "my_kind", + * // "newStartPageToken": "my_newStartPageToken", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.changes.list * @memberOf! () * @@ -1392,6 +1577,102 @@ export namespace drive_v3 { /** * drive.changes.watch * @desc Subscribes to changes for a user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.changes.watch({ + * // The shared drive from which changes are returned. If specified the change IDs will be reflective of the shared drive; use the combined drive ID and change ID as an identifier. + * driveId: 'placeholder-value', + * // Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file. + * includeCorpusRemovals: 'placeholder-value', + * // Deprecated - Whether both My Drive and shared drive items should be included in results. This parameter will only be effective until June 1, 2020. Afterwards shared drive items are included in the results. + * includeItemsFromAllDrives: 'placeholder-value', + * // Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access. + * includeRemoved: 'placeholder-value', + * // Deprecated use includeItemsFromAllDrives instead. + * includeTeamDriveItems: 'placeholder-value', + * // The maximum number of changes to return per page. + * pageSize: 'placeholder-value', + * // The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method. + * pageToken: 'placeholder-value', + * // Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or shared files which have not been added to My Drive. + * restrictToMyDrive: 'placeholder-value', + * // A comma-separated list of spaces to query within the user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. + * spaces: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Deprecated use driveId instead. + * teamDriveId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.changes.watch * @memberOf! () * @@ -1622,6 +1903,63 @@ export namespace drive_v3 { /** * drive.channels.stop * @desc Stop watching resources through this channel + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.channels.stop({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.channels.stop * @memberOf! () * @@ -1712,6 +2050,79 @@ export namespace drive_v3 { /** * drive.comments.create * @desc Creates a new comment on a file. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.comments.create({ + * // The ID of the file. + * fileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "anchor": "my_anchor", + * // "author": {}, + * // "content": "my_content", + * // "createdTime": "my_createdTime", + * // "deleted": false, + * // "htmlContent": "my_htmlContent", + * // "id": "my_id", + * // "kind": "my_kind", + * // "modifiedTime": "my_modifiedTime", + * // "quotedFileContent": {}, + * // "replies": [], + * // "resolved": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "anchor": "my_anchor", + * // "author": {}, + * // "content": "my_content", + * // "createdTime": "my_createdTime", + * // "deleted": false, + * // "htmlContent": "my_htmlContent", + * // "id": "my_id", + * // "kind": "my_kind", + * // "modifiedTime": "my_modifiedTime", + * // "quotedFileContent": {}, + * // "replies": [], + * // "resolved": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.comments.create * @memberOf! () * @@ -1784,6 +2195,46 @@ export namespace drive_v3 { /** * drive.comments.delete * @desc Deletes a comment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.comments.delete({ + * // The ID of the comment. + * commentId: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.comments.delete * @memberOf! () * @@ -1855,6 +2306,65 @@ export namespace drive_v3 { /** * drive.comments.get * @desc Gets a comment by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.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 drive.comments.get({ + * // The ID of the comment. + * commentId: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * // Whether to return deleted comments. Deleted comments will not include their original content. + * includeDeleted: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "anchor": "my_anchor", + * // "author": {}, + * // "content": "my_content", + * // "createdTime": "my_createdTime", + * // "deleted": false, + * // "htmlContent": "my_htmlContent", + * // "id": "my_id", + * // "kind": "my_kind", + * // "modifiedTime": "my_modifiedTime", + * // "quotedFileContent": {}, + * // "replies": [], + * // "resolved": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.comments.get * @memberOf! () * @@ -1927,6 +2437,60 @@ export namespace drive_v3 { /** * drive.comments.list * @desc Lists a file's comments. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.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 drive.comments.list({ + * // The ID of the file. + * fileId: 'placeholder-value', + * // Whether to include deleted comments. Deleted comments will not include their original content. + * includeDeleted: 'placeholder-value', + * // The maximum number of comments to return per page. + * pageSize: 'placeholder-value', + * // The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. + * pageToken: 'placeholder-value', + * // The minimum value of 'modifiedTime' for the result comments (RFC 3339 date-time). + * startModifiedTime: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "comments": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.comments.list * @memberOf! () * @@ -2004,6 +2568,81 @@ export namespace drive_v3 { /** * drive.comments.update * @desc Updates a comment with patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.comments.update({ + * // The ID of the comment. + * commentId: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "anchor": "my_anchor", + * // "author": {}, + * // "content": "my_content", + * // "createdTime": "my_createdTime", + * // "deleted": false, + * // "htmlContent": "my_htmlContent", + * // "id": "my_id", + * // "kind": "my_kind", + * // "modifiedTime": "my_modifiedTime", + * // "quotedFileContent": {}, + * // "replies": [], + * // "resolved": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "anchor": "my_anchor", + * // "author": {}, + * // "content": "my_content", + * // "createdTime": "my_createdTime", + * // "deleted": false, + * // "htmlContent": "my_htmlContent", + * // "id": "my_id", + * // "kind": "my_kind", + * // "modifiedTime": "my_modifiedTime", + * // "quotedFileContent": {}, + * // "replies": [], + * // "resolved": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.comments.update * @memberOf! () * @@ -2181,6 +2820,74 @@ export namespace drive_v3 { /** * drive.drives.create * @desc Creates a new shared drive. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive'], + * }); + * + * // 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 drive.drives.create({ + * // An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a shared drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same shared drive. If the shared drive already exists a 409 error will be returned. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdTime": "my_createdTime", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdTime": "my_createdTime", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.drives.create * @memberOf! () * @@ -2250,6 +2957,41 @@ export namespace drive_v3 { /** * drive.drives.delete * @desc Permanently deletes a shared drive for which the user is an organizer. The shared drive cannot contain any untrashed items. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive'], + * }); + * + * // 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 drive.drives.delete({ + * // The ID of the shared drive. + * driveId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.drives.delete * @memberOf! () * @@ -2321,6 +3063,61 @@ export namespace drive_v3 { /** * drive.drives.get * @desc Gets a shared drive's metadata by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.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 drive.drives.get({ + * // The ID of the shared drive. + * driveId: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the shared drive belongs. + * useDomainAdminAccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdTime": "my_createdTime", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.drives.get * @memberOf! () * @@ -2393,6 +3190,56 @@ export namespace drive_v3 { /** * drive.drives.hide * @desc Hides a shared drive from the default view. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive'], + * }); + * + * // 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 drive.drives.hide({ + * // The ID of the shared drive. + * driveId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdTime": "my_createdTime", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.drives.hide * @memberOf! () * @@ -2464,6 +3311,57 @@ export namespace drive_v3 { /** * drive.drives.list * @desc Lists the user's shared drives. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.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 drive.drives.list({ + * // Maximum number of shared drives to return. + * pageSize: 'placeholder-value', + * // Page token for shared drives. + * pageToken: 'placeholder-value', + * // Query string for searching shared drives. + * q: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then all shared drives of the domain in which the requester is an administrator are returned. + * useDomainAdminAccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "drives": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.drives.list * @memberOf! () * @@ -2537,6 +3435,56 @@ export namespace drive_v3 { /** * drive.drives.unhide * @desc Restores a shared drive to the default view. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive'], + * }); + * + * // 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 drive.drives.unhide({ + * // The ID of the shared drive. + * driveId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdTime": "my_createdTime", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.drives.unhide * @memberOf! () * @@ -2608,6 +3556,76 @@ export namespace drive_v3 { /** * drive.drives.update * @desc Updates the metadate for a shared drive. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive'], + * }); + * + * // 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 drive.drives.update({ + * // The ID of the shared drive. + * driveId: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the shared drive belongs. + * useDomainAdminAccess: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdTime": "my_createdTime", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdTime": "my_createdTime", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.drives.update * @memberOf! () * @@ -2796,6 +3814,181 @@ export namespace drive_v3 { /** * drive.files.copy * @desc Creates a copy of a file and applies any requested updates with patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.photos.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 drive.files.copy({ + * // Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. Requests that specify more than one parent fail. + * enforceSingleParent: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * // Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders. + * ignoreDefaultVisibility: 'placeholder-value', + * // Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions. + * keepRevisionForever: 'placeholder-value', + * // A language hint for OCR processing during image import (ISO 639-1 code). + * ocrLanguage: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appProperties": {}, + * // "capabilities": {}, + * // "contentHints": {}, + * // "copyRequiresWriterPermission": false, + * // "createdTime": "my_createdTime", + * // "description": "my_description", + * // "driveId": "my_driveId", + * // "explicitlyTrashed": false, + * // "exportLinks": {}, + * // "fileExtension": "my_fileExtension", + * // "folderColorRgb": "my_folderColorRgb", + * // "fullFileExtension": "my_fullFileExtension", + * // "hasAugmentedPermissions": false, + * // "hasThumbnail": false, + * // "headRevisionId": "my_headRevisionId", + * // "iconLink": "my_iconLink", + * // "id": "my_id", + * // "imageMediaMetadata": {}, + * // "isAppAuthorized": false, + * // "kind": "my_kind", + * // "lastModifyingUser": {}, + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedByMe": false, + * // "modifiedByMeTime": "my_modifiedByMeTime", + * // "modifiedTime": "my_modifiedTime", + * // "name": "my_name", + * // "originalFilename": "my_originalFilename", + * // "ownedByMe": false, + * // "owners": [], + * // "parents": [], + * // "permissionIds": [], + * // "permissions": [], + * // "properties": {}, + * // "quotaBytesUsed": "my_quotaBytesUsed", + * // "shared": false, + * // "sharedWithMeTime": "my_sharedWithMeTime", + * // "sharingUser": {}, + * // "shortcutDetails": {}, + * // "size": "my_size", + * // "spaces": [], + * // "starred": false, + * // "teamDriveId": "my_teamDriveId", + * // "thumbnailLink": "my_thumbnailLink", + * // "thumbnailVersion": "my_thumbnailVersion", + * // "trashed": false, + * // "trashedTime": "my_trashedTime", + * // "trashingUser": {}, + * // "version": "my_version", + * // "videoMediaMetadata": {}, + * // "viewedByMe": false, + * // "viewedByMeTime": "my_viewedByMeTime", + * // "viewersCanCopyContent": false, + * // "webContentLink": "my_webContentLink", + * // "webViewLink": "my_webViewLink", + * // "writersCanShare": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appProperties": {}, + * // "capabilities": {}, + * // "contentHints": {}, + * // "copyRequiresWriterPermission": false, + * // "createdTime": "my_createdTime", + * // "description": "my_description", + * // "driveId": "my_driveId", + * // "explicitlyTrashed": false, + * // "exportLinks": {}, + * // "fileExtension": "my_fileExtension", + * // "folderColorRgb": "my_folderColorRgb", + * // "fullFileExtension": "my_fullFileExtension", + * // "hasAugmentedPermissions": false, + * // "hasThumbnail": false, + * // "headRevisionId": "my_headRevisionId", + * // "iconLink": "my_iconLink", + * // "id": "my_id", + * // "imageMediaMetadata": {}, + * // "isAppAuthorized": false, + * // "kind": "my_kind", + * // "lastModifyingUser": {}, + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedByMe": false, + * // "modifiedByMeTime": "my_modifiedByMeTime", + * // "modifiedTime": "my_modifiedTime", + * // "name": "my_name", + * // "originalFilename": "my_originalFilename", + * // "ownedByMe": false, + * // "owners": [], + * // "parents": [], + * // "permissionIds": [], + * // "permissions": [], + * // "properties": {}, + * // "quotaBytesUsed": "my_quotaBytesUsed", + * // "shared": false, + * // "sharedWithMeTime": "my_sharedWithMeTime", + * // "sharingUser": {}, + * // "shortcutDetails": {}, + * // "size": "my_size", + * // "spaces": [], + * // "starred": false, + * // "teamDriveId": "my_teamDriveId", + * // "thumbnailLink": "my_thumbnailLink", + * // "thumbnailVersion": "my_thumbnailVersion", + * // "trashed": false, + * // "trashedTime": "my_trashedTime", + * // "trashingUser": {}, + * // "version": "my_version", + * // "videoMediaMetadata": {}, + * // "viewedByMe": false, + * // "viewedByMeTime": "my_viewedByMeTime", + * // "viewersCanCopyContent": false, + * // "webContentLink": "my_webContentLink", + * // "webViewLink": "my_webViewLink", + * // "writersCanShare": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.copy * @memberOf! () * @@ -2874,6 +4067,184 @@ export namespace drive_v3 { /** * drive.files.create * @desc Creates a new file. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.files.create({ + * // Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. Requests that specify more than one parent fail. + * enforceSingleParent: 'placeholder-value', + * // Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders. + * ignoreDefaultVisibility: 'placeholder-value', + * // Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions. + * keepRevisionForever: 'placeholder-value', + * // A language hint for OCR processing during image import (ISO 639-1 code). + * ocrLanguage: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Whether to use the uploaded content as indexable text. + * useContentAsIndexableText: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appProperties": {}, + * // "capabilities": {}, + * // "contentHints": {}, + * // "copyRequiresWriterPermission": false, + * // "createdTime": "my_createdTime", + * // "description": "my_description", + * // "driveId": "my_driveId", + * // "explicitlyTrashed": false, + * // "exportLinks": {}, + * // "fileExtension": "my_fileExtension", + * // "folderColorRgb": "my_folderColorRgb", + * // "fullFileExtension": "my_fullFileExtension", + * // "hasAugmentedPermissions": false, + * // "hasThumbnail": false, + * // "headRevisionId": "my_headRevisionId", + * // "iconLink": "my_iconLink", + * // "id": "my_id", + * // "imageMediaMetadata": {}, + * // "isAppAuthorized": false, + * // "kind": "my_kind", + * // "lastModifyingUser": {}, + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedByMe": false, + * // "modifiedByMeTime": "my_modifiedByMeTime", + * // "modifiedTime": "my_modifiedTime", + * // "name": "my_name", + * // "originalFilename": "my_originalFilename", + * // "ownedByMe": false, + * // "owners": [], + * // "parents": [], + * // "permissionIds": [], + * // "permissions": [], + * // "properties": {}, + * // "quotaBytesUsed": "my_quotaBytesUsed", + * // "shared": false, + * // "sharedWithMeTime": "my_sharedWithMeTime", + * // "sharingUser": {}, + * // "shortcutDetails": {}, + * // "size": "my_size", + * // "spaces": [], + * // "starred": false, + * // "teamDriveId": "my_teamDriveId", + * // "thumbnailLink": "my_thumbnailLink", + * // "thumbnailVersion": "my_thumbnailVersion", + * // "trashed": false, + * // "trashedTime": "my_trashedTime", + * // "trashingUser": {}, + * // "version": "my_version", + * // "videoMediaMetadata": {}, + * // "viewedByMe": false, + * // "viewedByMeTime": "my_viewedByMeTime", + * // "viewersCanCopyContent": false, + * // "webContentLink": "my_webContentLink", + * // "webViewLink": "my_webViewLink", + * // "writersCanShare": false + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appProperties": {}, + * // "capabilities": {}, + * // "contentHints": {}, + * // "copyRequiresWriterPermission": false, + * // "createdTime": "my_createdTime", + * // "description": "my_description", + * // "driveId": "my_driveId", + * // "explicitlyTrashed": false, + * // "exportLinks": {}, + * // "fileExtension": "my_fileExtension", + * // "folderColorRgb": "my_folderColorRgb", + * // "fullFileExtension": "my_fullFileExtension", + * // "hasAugmentedPermissions": false, + * // "hasThumbnail": false, + * // "headRevisionId": "my_headRevisionId", + * // "iconLink": "my_iconLink", + * // "id": "my_id", + * // "imageMediaMetadata": {}, + * // "isAppAuthorized": false, + * // "kind": "my_kind", + * // "lastModifyingUser": {}, + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedByMe": false, + * // "modifiedByMeTime": "my_modifiedByMeTime", + * // "modifiedTime": "my_modifiedTime", + * // "name": "my_name", + * // "originalFilename": "my_originalFilename", + * // "ownedByMe": false, + * // "owners": [], + * // "parents": [], + * // "permissionIds": [], + * // "permissions": [], + * // "properties": {}, + * // "quotaBytesUsed": "my_quotaBytesUsed", + * // "shared": false, + * // "sharedWithMeTime": "my_sharedWithMeTime", + * // "sharingUser": {}, + * // "shortcutDetails": {}, + * // "size": "my_size", + * // "spaces": [], + * // "starred": false, + * // "teamDriveId": "my_teamDriveId", + * // "thumbnailLink": "my_thumbnailLink", + * // "thumbnailVersion": "my_thumbnailVersion", + * // "trashed": false, + * // "trashedTime": "my_trashedTime", + * // "trashingUser": {}, + * // "version": "my_version", + * // "videoMediaMetadata": {}, + * // "viewedByMe": false, + * // "viewedByMeTime": "my_viewedByMeTime", + * // "viewersCanCopyContent": false, + * // "webContentLink": "my_webContentLink", + * // "webViewLink": "my_webViewLink", + * // "writersCanShare": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.create * @memberOf! () * @@ -2956,6 +4327,49 @@ export namespace drive_v3 { /** * drive.files.delete * @desc Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a shared drive the user must be an organizer on the parent. If the target is a folder, all descendants owned by the user are also deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.files.delete({ + * // The ID of the file. + * fileId: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.delete * @memberOf! () * @@ -3029,6 +4443,38 @@ export namespace drive_v3 { /** * drive.files.emptyTrash * @desc Permanently deletes all of the user's trashed files. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive'], + * }); + * + * // 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 drive.files.emptyTrash({}); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.emptyTrash * @memberOf! () * @@ -3099,6 +4545,47 @@ export namespace drive_v3 { /** * drive.files.export * @desc Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.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 drive.files.export({ + * // The ID of the file. + * fileId: 'placeholder-value', + * // The MIME type of the format requested for this export. + * mimeType: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.export * @memberOf! () * @@ -3171,6 +4658,54 @@ export namespace drive_v3 { /** * drive.files.generateIds * @desc Generates a set of file IDs which can be provided in create or copy requests. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.files.generateIds({ + * // The number of IDs to return. + * count: 'placeholder-value', + * // The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'. + * space: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ids": [], + * // "kind": "my_kind", + * // "space": "my_space" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.generateIds * @memberOf! () * @@ -3246,6 +4781,115 @@ export namespace drive_v3 { /** * drive.files.get * @desc Gets a file's metadata or content by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.files.get({ + * // Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. + * acknowledgeAbuse: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appProperties": {}, + * // "capabilities": {}, + * // "contentHints": {}, + * // "copyRequiresWriterPermission": false, + * // "createdTime": "my_createdTime", + * // "description": "my_description", + * // "driveId": "my_driveId", + * // "explicitlyTrashed": false, + * // "exportLinks": {}, + * // "fileExtension": "my_fileExtension", + * // "folderColorRgb": "my_folderColorRgb", + * // "fullFileExtension": "my_fullFileExtension", + * // "hasAugmentedPermissions": false, + * // "hasThumbnail": false, + * // "headRevisionId": "my_headRevisionId", + * // "iconLink": "my_iconLink", + * // "id": "my_id", + * // "imageMediaMetadata": {}, + * // "isAppAuthorized": false, + * // "kind": "my_kind", + * // "lastModifyingUser": {}, + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedByMe": false, + * // "modifiedByMeTime": "my_modifiedByMeTime", + * // "modifiedTime": "my_modifiedTime", + * // "name": "my_name", + * // "originalFilename": "my_originalFilename", + * // "ownedByMe": false, + * // "owners": [], + * // "parents": [], + * // "permissionIds": [], + * // "permissions": [], + * // "properties": {}, + * // "quotaBytesUsed": "my_quotaBytesUsed", + * // "shared": false, + * // "sharedWithMeTime": "my_sharedWithMeTime", + * // "sharingUser": {}, + * // "shortcutDetails": {}, + * // "size": "my_size", + * // "spaces": [], + * // "starred": false, + * // "teamDriveId": "my_teamDriveId", + * // "thumbnailLink": "my_thumbnailLink", + * // "thumbnailVersion": "my_thumbnailVersion", + * // "trashed": false, + * // "trashedTime": "my_trashedTime", + * // "trashingUser": {}, + * // "version": "my_version", + * // "videoMediaMetadata": {}, + * // "viewedByMe": false, + * // "viewedByMeTime": "my_viewedByMeTime", + * // "viewersCanCopyContent": false, + * // "webContentLink": "my_webContentLink", + * // "webViewLink": "my_webViewLink", + * // "writersCanShare": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.get * @memberOf! () * @@ -3320,6 +4964,81 @@ export namespace drive_v3 { /** * drive.files.list * @desc Lists or searches files. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.files.list({ + * // Bodies of items (files/documents) to which the query applies. Supported bodies are 'user', 'domain', 'drive' and 'allDrives'. Prefer 'user' or 'drive' to 'allDrives' for efficiency. + * corpora: 'placeholder-value', + * // The source of files to list. Deprecated: use 'corpora' instead. + * corpus: 'placeholder-value', + * // ID of the shared drive to search. + * driveId: 'placeholder-value', + * // Deprecated - Whether both My Drive and shared drive items should be included in results. This parameter will only be effective until June 1, 2020. Afterwards shared drive items are included in the results. + * includeItemsFromAllDrives: 'placeholder-value', + * // Deprecated use includeItemsFromAllDrives instead. + * includeTeamDriveItems: 'placeholder-value', + * // A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'name_natural', 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime desc,name. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored. + * orderBy: 'placeholder-value', + * // The maximum number of files to return per page. Partial or empty result pages are possible even before the end of the files list has been reached. + * pageSize: 'placeholder-value', + * // The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. + * pageToken: 'placeholder-value', + * // A query for filtering the file results. See the "Search for Files" guide for supported syntax. + * q: 'placeholder-value', + * // A comma-separated list of spaces to query within the corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. + * spaces: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Deprecated use driveId instead. + * teamDriveId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "files": [], + * // "incompleteSearch": false, + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.list * @memberOf! () * @@ -3400,6 +5119,190 @@ export namespace drive_v3 { /** * drive.files.update * @desc Updates a file's metadata and/or content with patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.scripts', + * ], + * }); + * + * // 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 drive.files.update({ + * // A comma-separated list of parent IDs to add. + * addParents: 'placeholder-value', + * // Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. If the item's owner makes a request to add a single parent, the item is removed from all current folders and placed in the requested folder. Other requests that increase the number of parents fail, except when the canAddMyDriveParent file capability is true and a single parent is being added. + * enforceSingleParent: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * // Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions. + * keepRevisionForever: 'placeholder-value', + * // A language hint for OCR processing during image import (ISO 639-1 code). + * ocrLanguage: 'placeholder-value', + * // A comma-separated list of parent IDs to remove. + * removeParents: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Whether to use the uploaded content as indexable text. + * useContentAsIndexableText: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appProperties": {}, + * // "capabilities": {}, + * // "contentHints": {}, + * // "copyRequiresWriterPermission": false, + * // "createdTime": "my_createdTime", + * // "description": "my_description", + * // "driveId": "my_driveId", + * // "explicitlyTrashed": false, + * // "exportLinks": {}, + * // "fileExtension": "my_fileExtension", + * // "folderColorRgb": "my_folderColorRgb", + * // "fullFileExtension": "my_fullFileExtension", + * // "hasAugmentedPermissions": false, + * // "hasThumbnail": false, + * // "headRevisionId": "my_headRevisionId", + * // "iconLink": "my_iconLink", + * // "id": "my_id", + * // "imageMediaMetadata": {}, + * // "isAppAuthorized": false, + * // "kind": "my_kind", + * // "lastModifyingUser": {}, + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedByMe": false, + * // "modifiedByMeTime": "my_modifiedByMeTime", + * // "modifiedTime": "my_modifiedTime", + * // "name": "my_name", + * // "originalFilename": "my_originalFilename", + * // "ownedByMe": false, + * // "owners": [], + * // "parents": [], + * // "permissionIds": [], + * // "permissions": [], + * // "properties": {}, + * // "quotaBytesUsed": "my_quotaBytesUsed", + * // "shared": false, + * // "sharedWithMeTime": "my_sharedWithMeTime", + * // "sharingUser": {}, + * // "shortcutDetails": {}, + * // "size": "my_size", + * // "spaces": [], + * // "starred": false, + * // "teamDriveId": "my_teamDriveId", + * // "thumbnailLink": "my_thumbnailLink", + * // "thumbnailVersion": "my_thumbnailVersion", + * // "trashed": false, + * // "trashedTime": "my_trashedTime", + * // "trashingUser": {}, + * // "version": "my_version", + * // "videoMediaMetadata": {}, + * // "viewedByMe": false, + * // "viewedByMeTime": "my_viewedByMeTime", + * // "viewersCanCopyContent": false, + * // "webContentLink": "my_webContentLink", + * // "webViewLink": "my_webViewLink", + * // "writersCanShare": false + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appProperties": {}, + * // "capabilities": {}, + * // "contentHints": {}, + * // "copyRequiresWriterPermission": false, + * // "createdTime": "my_createdTime", + * // "description": "my_description", + * // "driveId": "my_driveId", + * // "explicitlyTrashed": false, + * // "exportLinks": {}, + * // "fileExtension": "my_fileExtension", + * // "folderColorRgb": "my_folderColorRgb", + * // "fullFileExtension": "my_fullFileExtension", + * // "hasAugmentedPermissions": false, + * // "hasThumbnail": false, + * // "headRevisionId": "my_headRevisionId", + * // "iconLink": "my_iconLink", + * // "id": "my_id", + * // "imageMediaMetadata": {}, + * // "isAppAuthorized": false, + * // "kind": "my_kind", + * // "lastModifyingUser": {}, + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedByMe": false, + * // "modifiedByMeTime": "my_modifiedByMeTime", + * // "modifiedTime": "my_modifiedTime", + * // "name": "my_name", + * // "originalFilename": "my_originalFilename", + * // "ownedByMe": false, + * // "owners": [], + * // "parents": [], + * // "permissionIds": [], + * // "permissions": [], + * // "properties": {}, + * // "quotaBytesUsed": "my_quotaBytesUsed", + * // "shared": false, + * // "sharedWithMeTime": "my_sharedWithMeTime", + * // "sharingUser": {}, + * // "shortcutDetails": {}, + * // "size": "my_size", + * // "spaces": [], + * // "starred": false, + * // "teamDriveId": "my_teamDriveId", + * // "thumbnailLink": "my_thumbnailLink", + * // "thumbnailVersion": "my_thumbnailVersion", + * // "trashed": false, + * // "trashedTime": "my_trashedTime", + * // "trashingUser": {}, + * // "version": "my_version", + * // "videoMediaMetadata": {}, + * // "viewedByMe": false, + * // "viewedByMeTime": "my_viewedByMeTime", + * // "viewersCanCopyContent": false, + * // "webContentLink": "my_webContentLink", + * // "webViewLink": "my_webViewLink", + * // "writersCanShare": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.update * @memberOf! () * @@ -3487,6 +5390,86 @@ export namespace drive_v3 { /** * drive.files.watch * @desc Subscribes to changes to a file + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.files.watch({ + * // Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. + * acknowledgeAbuse: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.files.watch * @memberOf! () * @@ -3894,6 +5877,97 @@ export namespace drive_v3 { /** * drive.permissions.create * @desc Creates a permission for a file or shared drive. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.permissions.create({ + * // A plain text custom message to include in the notification email. + * emailMessage: 'placeholder-value', + * // Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. See moveToNewOwnersRoot for details. + * enforceSingleParent: 'placeholder-value', + * // The ID of the file or shared drive. + * fileId: 'placeholder-value', + * // This parameter only takes effect if the item is not in a shared drive and the request is attempting to transfer the ownership of the item. When set to true, the item is moved to the new owner's My Drive root folder and all prior parents removed. If set to false, when enforceSingleParent=true, parents are not changed. If set to false, when enforceSingleParent=false, existing parents are not changed; however, the file will be added to the new owner's My Drive root folder, unless it is already in the new owner's My Drive. + * moveToNewOwnersRoot: 'placeholder-value', + * // Whether to send a notification email when sharing to users or groups. This defaults to true for users and groups, and is not allowed for other requests. It must not be disabled for ownership transfers. + * sendNotificationEmail: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. + * transferOwnership: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs. + * useDomainAdminAccess: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "allowFileDiscovery": false, + * // "deleted": false, + * // "displayName": "my_displayName", + * // "domain": "my_domain", + * // "emailAddress": "my_emailAddress", + * // "expirationTime": "my_expirationTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "permissionDetails": [], + * // "photoLink": "my_photoLink", + * // "role": "my_role", + * // "teamDrivePermissionDetails": [], + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "allowFileDiscovery": false, + * // "deleted": false, + * // "displayName": "my_displayName", + * // "domain": "my_domain", + * // "emailAddress": "my_emailAddress", + * // "expirationTime": "my_expirationTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "permissionDetails": [], + * // "photoLink": "my_photoLink", + * // "role": "my_role", + * // "teamDrivePermissionDetails": [], + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.permissions.create * @memberOf! () * @@ -3977,6 +6051,52 @@ export namespace drive_v3 { /** * drive.permissions.delete * @desc Deletes a permission. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.permissions.delete({ + * // The ID of the file or shared drive. + * fileId: 'placeholder-value', + * // The ID of the permission. + * permissionId: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs. + * useDomainAdminAccess: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.permissions.delete * @memberOf! () * @@ -4052,6 +6172,73 @@ export namespace drive_v3 { /** * drive.permissions.get * @desc Gets a permission by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.permissions.get({ + * // The ID of the file. + * fileId: 'placeholder-value', + * // The ID of the permission. + * permissionId: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs. + * useDomainAdminAccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "allowFileDiscovery": false, + * // "deleted": false, + * // "displayName": "my_displayName", + * // "domain": "my_domain", + * // "emailAddress": "my_emailAddress", + * // "expirationTime": "my_expirationTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "permissionDetails": [], + * // "photoLink": "my_photoLink", + * // "role": "my_role", + * // "teamDrivePermissionDetails": [], + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.permissions.get * @memberOf! () * @@ -4128,6 +6315,65 @@ export namespace drive_v3 { /** * drive.permissions.list * @desc Lists a file's or shared drive's permissions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.permissions.list({ + * // The ID of the file or shared drive. + * fileId: 'placeholder-value', + * // The maximum number of permissions to return per page. When not set for files in a shared drive, at most 100 results will be returned. When not set for files that are not in a shared drive, the entire list will be returned. + * pageSize: 'placeholder-value', + * // The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. + * pageToken: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs. + * useDomainAdminAccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.permissions.list * @memberOf! () * @@ -4206,6 +6452,93 @@ export namespace drive_v3 { /** * drive.permissions.update * @desc Updates a permission with patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.permissions.update({ + * // The ID of the file or shared drive. + * fileId: 'placeholder-value', + * // The ID of the permission. + * permissionId: 'placeholder-value', + * // Whether to remove the expiration date. + * removeExpiration: 'placeholder-value', + * // Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + * supportsAllDrives: 'placeholder-value', + * // Deprecated use supportsAllDrives instead. + * supportsTeamDrives: 'placeholder-value', + * // Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. + * transferOwnership: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs. + * useDomainAdminAccess: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "allowFileDiscovery": false, + * // "deleted": false, + * // "displayName": "my_displayName", + * // "domain": "my_domain", + * // "emailAddress": "my_emailAddress", + * // "expirationTime": "my_expirationTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "permissionDetails": [], + * // "photoLink": "my_photoLink", + * // "role": "my_role", + * // "teamDrivePermissionDetails": [], + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "allowFileDiscovery": false, + * // "deleted": false, + * // "displayName": "my_displayName", + * // "domain": "my_domain", + * // "emailAddress": "my_emailAddress", + * // "expirationTime": "my_expirationTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "permissionDetails": [], + * // "photoLink": "my_photoLink", + * // "role": "my_role", + * // "teamDrivePermissionDetails": [], + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.permissions.update * @memberOf! () * @@ -4470,6 +6803,75 @@ export namespace drive_v3 { /** * drive.replies.create * @desc Creates a new reply to a comment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.replies.create({ + * // The ID of the comment. + * commentId: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "author": {}, + * // "content": "my_content", + * // "createdTime": "my_createdTime", + * // "deleted": false, + * // "htmlContent": "my_htmlContent", + * // "id": "my_id", + * // "kind": "my_kind", + * // "modifiedTime": "my_modifiedTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "author": {}, + * // "content": "my_content", + * // "createdTime": "my_createdTime", + * // "deleted": false, + * // "htmlContent": "my_htmlContent", + * // "id": "my_id", + * // "kind": "my_kind", + * // "modifiedTime": "my_modifiedTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.replies.create * @memberOf! () * @@ -4542,6 +6944,48 @@ export namespace drive_v3 { /** * drive.replies.delete * @desc Deletes a reply. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.replies.delete({ + * // The ID of the comment. + * commentId: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * // The ID of the reply. + * replyId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.replies.delete * @memberOf! () * @@ -4615,6 +7059,64 @@ export namespace drive_v3 { /** * drive.replies.get * @desc Gets a reply by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.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 drive.replies.get({ + * // The ID of the comment. + * commentId: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * // Whether to return deleted replies. Deleted replies will not include their original content. + * includeDeleted: 'placeholder-value', + * // The ID of the reply. + * replyId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "author": {}, + * // "content": "my_content", + * // "createdTime": "my_createdTime", + * // "deleted": false, + * // "htmlContent": "my_htmlContent", + * // "id": "my_id", + * // "kind": "my_kind", + * // "modifiedTime": "my_modifiedTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.replies.get * @memberOf! () * @@ -4689,6 +7191,60 @@ export namespace drive_v3 { /** * drive.replies.list * @desc Lists a comment's replies. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.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 drive.replies.list({ + * // The ID of the comment. + * commentId: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * // Whether to include deleted replies. Deleted replies will not include their original content. + * includeDeleted: 'placeholder-value', + * // The maximum number of replies to return per page. + * pageSize: 'placeholder-value', + * // The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "replies": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.replies.list * @memberOf! () * @@ -4765,6 +7321,77 @@ export namespace drive_v3 { /** * drive.replies.update * @desc Updates a reply with patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.replies.update({ + * // The ID of the comment. + * commentId: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * // The ID of the reply. + * replyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": "my_action", + * // "author": {}, + * // "content": "my_content", + * // "createdTime": "my_createdTime", + * // "deleted": false, + * // "htmlContent": "my_htmlContent", + * // "id": "my_id", + * // "kind": "my_kind", + * // "modifiedTime": "my_modifiedTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "author": {}, + * // "content": "my_content", + * // "createdTime": "my_createdTime", + * // "deleted": false, + * // "htmlContent": "my_htmlContent", + * // "id": "my_id", + * // "kind": "my_kind", + * // "modifiedTime": "my_modifiedTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.replies.update * @memberOf! () * @@ -4960,6 +7587,47 @@ export namespace drive_v3 { /** * drive.revisions.delete * @desc Permanently deletes a file version. You can only delete revisions for files with binary content in Google Drive, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can't be deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.revisions.delete({ + * // The ID of the file. + * fileId: 'placeholder-value', + * // The ID of the revision. + * revisionId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.revisions.delete * @memberOf! () * @@ -5031,6 +7699,70 @@ export namespace drive_v3 { /** * drive.revisions.get * @desc Gets a revision's metadata or content by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.revisions.get({ + * // Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. + * acknowledgeAbuse: 'placeholder-value', + * // The ID of the file. + * fileId: 'placeholder-value', + * // The ID of the revision. + * revisionId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "exportLinks": {}, + * // "id": "my_id", + * // "keepForever": false, + * // "kind": "my_kind", + * // "lastModifyingUser": {}, + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedTime": "my_modifiedTime", + * // "originalFilename": "my_originalFilename", + * // "publishAuto": false, + * // "published": false, + * // "publishedOutsideDomain": false, + * // "size": "my_size" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.revisions.get * @memberOf! () * @@ -5103,6 +7835,60 @@ export namespace drive_v3 { /** * drive.revisions.list * @desc Lists a file's revisions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.metadata', + * 'https://www.googleapis.com/auth/drive.metadata.readonly', + * 'https://www.googleapis.com/auth/drive.photos.readonly', + * 'https://www.googleapis.com/auth/drive.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 drive.revisions.list({ + * // The ID of the file. + * fileId: 'placeholder-value', + * // The maximum number of revisions to return per page. + * pageSize: 'placeholder-value', + * // The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "revisions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.revisions.list * @memberOf! () * @@ -5178,6 +7964,84 @@ export namespace drive_v3 { /** * drive.revisions.update * @desc Updates a revision with patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.appdata', + * 'https://www.googleapis.com/auth/drive.file', + * ], + * }); + * + * // 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 drive.revisions.update({ + * // The ID of the file. + * fileId: 'placeholder-value', + * // The ID of the revision. + * revisionId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "exportLinks": {}, + * // "id": "my_id", + * // "keepForever": false, + * // "kind": "my_kind", + * // "lastModifyingUser": {}, + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedTime": "my_modifiedTime", + * // "originalFilename": "my_originalFilename", + * // "publishAuto": false, + * // "published": false, + * // "publishedOutsideDomain": false, + * // "size": "my_size" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "exportLinks": {}, + * // "id": "my_id", + * // "keepForever": false, + * // "kind": "my_kind", + * // "lastModifyingUser": {}, + * // "md5Checksum": "my_md5Checksum", + * // "mimeType": "my_mimeType", + * // "modifiedTime": "my_modifiedTime", + * // "originalFilename": "my_originalFilename", + * // "publishAuto": false, + * // "published": false, + * // "publishedOutsideDomain": false, + * // "size": "my_size" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.revisions.update * @memberOf! () * @@ -5331,6 +8195,72 @@ export namespace drive_v3 { /** * drive.teamdrives.create * @desc Deprecated use drives.create instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive'], + * }); + * + * // 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 drive.teamdrives.create({ + * // An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a Team Drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same Team Drive. If the Team Drive already exists a 409 error will be returned. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdTime": "my_createdTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdTime": "my_createdTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.teamdrives.create * @memberOf! () * @@ -5406,6 +8336,41 @@ export namespace drive_v3 { /** * drive.teamdrives.delete * @desc Deprecated use drives.delete instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive'], + * }); + * + * // 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 drive.teamdrives.delete({ + * // The ID of the Team Drive + * teamDriveId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.teamdrives.delete * @memberOf! () * @@ -5478,6 +8443,60 @@ export namespace drive_v3 { /** * drive.teamdrives.get * @desc Deprecated use drives.get instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.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 drive.teamdrives.get({ + * // The ID of the Team Drive + * teamDriveId: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs. + * useDomainAdminAccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdTime": "my_createdTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.teamdrives.get * @memberOf! () * @@ -5552,6 +8571,57 @@ export namespace drive_v3 { /** * drive.teamdrives.list * @desc Deprecated use drives.list instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.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 drive.teamdrives.list({ + * // Maximum number of Team Drives to return. + * pageSize: 'placeholder-value', + * // Page token for Team Drives. + * pageToken: 'placeholder-value', + * // Query string for searching Team Drives. + * q: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then all Team Drives of the domain in which the requester is an administrator are returned. + * useDomainAdminAccess: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "teamDrives": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.teamdrives.list * @memberOf! () * @@ -5628,6 +8698,74 @@ export namespace drive_v3 { /** * drive.teamdrives.update * @desc Deprecated use drives.update instead + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/drive.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 drive = google.drive('v3'); + * + * 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/drive'], + * }); + * + * // 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 drive.teamdrives.update({ + * // The ID of the Team Drive + * teamDriveId: 'placeholder-value', + * // Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs. + * useDomainAdminAccess: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdTime": "my_createdTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backgroundImageFile": {}, + * // "backgroundImageLink": "my_backgroundImageLink", + * // "capabilities": {}, + * // "colorRgb": "my_colorRgb", + * // "createdTime": "my_createdTime", + * // "id": "my_id", + * // "kind": "my_kind", + * // "name": "my_name", + * // "restrictions": {}, + * // "themeId": "my_themeId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias drive.teamdrives.update * @memberOf! () * diff --git a/src/apis/driveactivity/v2.ts b/src/apis/driveactivity/v2.ts index 32162ee7cf9..04c75d4d898 100644 --- a/src/apis/driveactivity/v2.ts +++ b/src/apis/driveactivity/v2.ts @@ -869,6 +869,60 @@ export namespace driveactivity_v2 { /** * driveactivity.activity.query * @desc Query past activity in Google Drive. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/driveactivity.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 driveactivity = google.driveactivity('v2'); + * + * 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/drive.activity', + * 'https://www.googleapis.com/auth/drive.activity.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 driveactivity.activity.query({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ancestorName": "my_ancestorName", + * // "consolidationStrategy": {}, + * // "filter": "my_filter", + * // "itemName": "my_itemName", + * // "pageSize": 0, + * // "pageToken": "my_pageToken" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activities": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias driveactivity.activity.query * @memberOf! () * diff --git a/src/apis/factchecktools/v1alpha1.ts b/src/apis/factchecktools/v1alpha1.ts index d9224e32213..65deff9d75f 100644 --- a/src/apis/factchecktools/v1alpha1.ts +++ b/src/apis/factchecktools/v1alpha1.ts @@ -347,6 +347,69 @@ export namespace factchecktools_v1alpha1 { /** * factchecktools.claims.search * @desc Search through fact-checked claims. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/factchecktools.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 factchecktools = google.factchecktools('v1alpha1'); + * + * 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: [], + * }); + * + * // 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 factchecktools.claims.search({ + * // The BCP-47 language code, such as "en-US" or "sr-Latn". Can be used to + * // restrict results by language, though we do not currently consider the + * // region. + * languageCode: 'placeholder-value', + * // The maximum age of the returned search results, in days. + * // Age is determined by either claim date or review date, whichever is newer. + * maxAgeDays: 'placeholder-value', + * // An integer that specifies the current offset (that is, starting result + * // location) in search results. This field is only considered if `page_token` + * // is unset. For example, 0 means to return results starting from the first + * // matching result, and 10 means to return from the 11th result. + * offset: 'placeholder-value', + * // The pagination size. We will return up to that many results. Defaults to + * // 10 if not set. + * pageSize: 'placeholder-value', + * // The pagination token. You may provide the `next_page_token` returned from a + * // previous List request, if any, in order to get the next page. All other + * // fields must have the same values as in the previous request. + * pageToken: 'placeholder-value', + * // Textual query string. Required unless `review_publisher_site_filter` is + * // specified. + * query: 'placeholder-value', + * // The review publisher site to filter results by, e.g. nytimes.com. + * reviewPublisherSiteFilter: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "claims": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias factchecktools.claims.search * @memberOf! () * @@ -496,6 +559,61 @@ export namespace factchecktools_v1alpha1 { /** * factchecktools.pages.create * @desc Create `ClaimReview` markup on a page. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/factchecktools.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 factchecktools = google.factchecktools('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 factchecktools.pages.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "claimReviewAuthor": {}, + * // "claimReviewMarkups": [], + * // "name": "my_name", + * // "pageUrl": "my_pageUrl", + * // "publishDate": "my_publishDate", + * // "versionId": "my_versionId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "claimReviewAuthor": {}, + * // "claimReviewMarkups": [], + * // "name": "my_name", + * // "pageUrl": "my_pageUrl", + * // "publishDate": "my_publishDate", + * // "versionId": "my_versionId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias factchecktools.pages.create * @memberOf! () * @@ -593,6 +711,44 @@ export namespace factchecktools_v1alpha1 { /** * factchecktools.pages.delete * @desc Delete all `ClaimReview` markup on a page. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/factchecktools.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 factchecktools = google.factchecktools('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 factchecktools.pages.delete({ + * // The name of the resource to delete, in the form of `pages/{page_id}`. + * name: 'pages/my-page', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias factchecktools.pages.delete * @memberOf! () * @@ -664,6 +820,51 @@ export namespace factchecktools_v1alpha1 { /** * factchecktools.pages.get * @desc Get all `ClaimReview` markup on a page. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/factchecktools.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 factchecktools = google.factchecktools('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 factchecktools.pages.get({ + * // The name of the resource to get, in the form of `pages/{page_id}`. + * name: 'pages/my-page', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "claimReviewAuthor": {}, + * // "claimReviewMarkups": [], + * // "name": "my_name", + * // "pageUrl": "my_pageUrl", + * // "publishDate": "my_publishDate", + * // "versionId": "my_versionId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias factchecktools.pages.get * @memberOf! () * @@ -761,6 +962,66 @@ export namespace factchecktools_v1alpha1 { /** * factchecktools.pages.list * @desc List the `ClaimReview` markup pages for a specific URL or for an organization. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/factchecktools.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 factchecktools = google.factchecktools('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 factchecktools.pages.list({ + * // An integer that specifies the current offset (that is, starting result + * // location) in search results. This field is only considered if `page_token` + * // is unset, and if the request is not for a specific URL. For example, 0 + * // means to return results starting from the first matching result, and 10 + * // means to return from the 11th result. + * offset: 'placeholder-value', + * // The organization for which we want to fetch markups for. For instance, + * // "site.com". Cannot be specified along with an URL. + * organization: 'placeholder-value', + * // The pagination size. We will return up to that many results. Defaults to + * // 10 if not set. Has no effect if a URL is requested. + * pageSize: 'placeholder-value', + * // The pagination token. You may provide the `next_page_token` returned from a + * // previous List request, if any, in order to get the next page. All other + * // fields must have the same values as in the previous request. + * pageToken: 'placeholder-value', + * // The URL from which to get `ClaimReview` markup. There will be at most one + * // result. If markup is associated with a more canonical version of the URL + * // provided, we will return that URL instead. Cannot be specified along with + * // an organization. + * url: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "claimReviewMarkupPages": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias factchecktools.pages.list * @memberOf! () * @@ -862,6 +1123,66 @@ export namespace factchecktools_v1alpha1 { /** * factchecktools.pages.update * @desc Update for all `ClaimReview` markup on a page Note that this is a full update. To retain the existing `ClaimReview` markup on a page, first perform a Get operation, then modify the returned markup, and finally call Update with the entire `ClaimReview` markup as the body. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/factchecktools.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 factchecktools = google.factchecktools('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 factchecktools.pages.update({ + * // The name of this `ClaimReview` markup page resource, in the form of + * // `pages/{page_id}`. Except for update requests, this field is output-only + * // and should not be set by the user. + * name: 'pages/my-page', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "claimReviewAuthor": {}, + * // "claimReviewMarkups": [], + * // "name": "my_name", + * // "pageUrl": "my_pageUrl", + * // "publishDate": "my_publishDate", + * // "versionId": "my_versionId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "claimReviewAuthor": {}, + * // "claimReviewMarkups": [], + * // "name": "my_name", + * // "pageUrl": "my_pageUrl", + * // "publishDate": "my_publishDate", + * // "versionId": "my_versionId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias factchecktools.pages.update * @memberOf! () * diff --git a/src/apis/fcm/v1.ts b/src/apis/fcm/v1.ts index fe246b0600d..678abdff9d3 100644 --- a/src/apis/fcm/v1.ts +++ b/src/apis/fcm/v1.ts @@ -469,6 +469,67 @@ export namespace fcm_v1 { /** * fcm.projects.messages.send * @desc Send a message to specified target (a registration token, topic or condition). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/fcm.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 fcm = google.fcm('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/cloud-platform'], + * }); + * + * // 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 fcm.projects.messages.send({ + * // Required. It contains the Firebase project id (i.e. the unique identifier + * // for your Firebase project), in the format of `projects/{project_id}`. + * // For legacy support, the numeric project number with no padding is also + * // supported in the format of `projects/{project_number}`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "message": {}, + * // "validateOnly": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "android": {}, + * // "apns": {}, + * // "condition": "my_condition", + * // "data": {}, + * // "fcmOptions": {}, + * // "name": "my_name", + * // "notification": {}, + * // "token": "my_token", + * // "topic": "my_topic", + * // "webpush": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias fcm.projects.messages.send * @memberOf! () * diff --git a/src/apis/file/v1.ts b/src/apis/file/v1.ts index de795e5046a..d39beb66d92 100644 --- a/src/apis/file/v1.ts +++ b/src/apis/file/v1.ts @@ -536,6 +536,50 @@ export namespace file_v1 { /** * file.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.get * @memberOf! () * @@ -605,6 +649,56 @@ export namespace file_v1 { /** * file.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // If true, the returned list will include locations which are not yet + * // revealed. + * includeUnrevealedLocations: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.list * @memberOf! () * @@ -733,6 +827,72 @@ export namespace file_v1 { /** * file.projects.locations.instances.create * @desc Creates an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.instances.create({ + * // Required. The name of the instance to create. + * // The name must be unique for the specified project and location. + * instanceId: 'placeholder-value', + * // Required. The instance's project and location, in the format + * // projects/{project_id}/locations/{location}. In Cloud Filestore, + * // locations map to GCP zones, for example **us-west1-b**. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "fileShares": [], + * // "labels": {}, + * // "name": "my_name", + * // "networks": [], + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "tier": "my_tier" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.instances.create * @memberOf! () * @@ -809,6 +969,51 @@ export namespace file_v1 { /** * file.projects.locations.instances.delete * @desc Deletes an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.instances.delete({ + * // Required. The instance resource name, in the format + * // projects/{project_id}/locations/{location}/instances/{instance_id} + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.instances.delete * @memberOf! () * @@ -880,6 +1085,56 @@ export namespace file_v1 { /** * file.projects.locations.instances.get * @desc Gets the details of a specific instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.instances.get({ + * // Required. The instance resource name, in the format + * // projects/{project_id}/locations/{location}/instances/{instance_id}. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "fileShares": [], + * // "labels": {}, + * // "name": "my_name", + * // "networks": [], + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "tier": "my_tier" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.instances.get * @memberOf! () * @@ -949,6 +1204,61 @@ export namespace file_v1 { /** * file.projects.locations.instances.list * @desc Lists all instances in a project for either a specified location or for all locations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.instances.list({ + * // List filter. + * filter: 'placeholder-value', + * // Sort results. Supported values are "name", "name desc" or "" (unsorted). + * orderBy: 'placeholder-value', + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value to use if there are additional + * // results to retrieve for this list request. + * pageToken: 'placeholder-value', + * // Required. The project and location for which to retrieve instance information, + * // in the format projects/{project_id}/locations/{location}. In Cloud + * // Filestore, locations map to GCP zones, for example **us-west1-b**. To + * // retrieve instance information for all locations, use "-" for the {location} + * // value. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "instances": [], + * // "nextPageToken": "my_nextPageToken", + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.instances.list * @memberOf! () * @@ -1029,6 +1339,76 @@ export namespace file_v1 { /** * file.projects.locations.instances.patch * @desc Updates the settings of a specific instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.instances.patch({ + * // Output only. The resource name of the instance, in the format + * // projects/{project}/locations/{location}/instances/{instance}. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * // Mask of fields to update. At least one path must be supplied in this + * // field. The elements of the repeated paths field may only include these + * // fields: + * // + * // * "description" + * // * "file_shares" + * // * "labels" + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "fileShares": [], + * // "labels": {}, + * // "name": "my_name", + * // "networks": [], + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "tier": "my_tier" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.instances.patch * @memberOf! () * @@ -1204,6 +1584,50 @@ export namespace file_v1 { /** * file.projects.locations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.operations.cancel * @memberOf! () * @@ -1274,6 +1698,44 @@ export namespace file_v1 { /** * file.projects.locations.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.operations.delete * @memberOf! () * @@ -1343,6 +1805,50 @@ export namespace file_v1 { /** * file.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.operations.get * @memberOf! () * @@ -1414,6 +1920,53 @@ export namespace file_v1 { /** * file.projects.locations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.operations.list * @memberOf! () * diff --git a/src/apis/file/v1beta1.ts b/src/apis/file/v1beta1.ts index fba0f858aad..d6b2e3c01b6 100644 --- a/src/apis/file/v1beta1.ts +++ b/src/apis/file/v1beta1.ts @@ -536,6 +536,50 @@ export namespace file_v1beta1 { /** * file.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.get * @memberOf! () * @@ -605,6 +649,56 @@ export namespace file_v1beta1 { /** * file.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // If true, the returned list will include locations which are not yet + * // revealed. + * includeUnrevealedLocations: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.list * @memberOf! () * @@ -733,6 +827,75 @@ export namespace file_v1beta1 { /** * file.projects.locations.instances.create * @desc Creates an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.instances.create({ + * // Required. The ID of the instance to create. + * // The ID must be unique within the specified project and location. + * // + * // This value must start with a lowercase letter followed by up to 62 + * // lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + * instanceId: 'placeholder-value', + * // Required. The instance's project and location, in the format + * // projects/{project_id}/locations/{location}. In Cloud Filestore, + * // locations map to GCP zones, for example **us-west1-b**. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "fileShares": [], + * // "labels": {}, + * // "name": "my_name", + * // "networks": [], + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "tier": "my_tier" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.instances.create * @memberOf! () * @@ -809,6 +972,51 @@ export namespace file_v1beta1 { /** * file.projects.locations.instances.delete * @desc Deletes an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.instances.delete({ + * // Required. The instance resource name, in the format + * // projects/{project_id}/locations/{location}/instances/{instance_id} + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.instances.delete * @memberOf! () * @@ -880,6 +1088,56 @@ export namespace file_v1beta1 { /** * file.projects.locations.instances.get * @desc Gets the details of a specific instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.instances.get({ + * // Required. The instance resource name, in the format + * // projects/{project_id}/locations/{location}/instances/{instance_id}. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "fileShares": [], + * // "labels": {}, + * // "name": "my_name", + * // "networks": [], + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "tier": "my_tier" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.instances.get * @memberOf! () * @@ -949,6 +1207,61 @@ export namespace file_v1beta1 { /** * file.projects.locations.instances.list * @desc Lists all instances in a project for either a specified location or for all locations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.instances.list({ + * // List filter. + * filter: 'placeholder-value', + * // Sort results. Supported values are "name", "name desc" or "" (unsorted). + * orderBy: 'placeholder-value', + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value to use if there are additional + * // results to retrieve for this list request. + * pageToken: 'placeholder-value', + * // Required. The project and location for which to retrieve instance information, + * // in the format projects/{project_id}/locations/{location}. In Cloud + * // Filestore, locations map to GCP zones, for example **us-west1-b**. To + * // retrieve instance information for all locations, use "-" for the {location} + * // value. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "instances": [], + * // "nextPageToken": "my_nextPageToken", + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.instances.list * @memberOf! () * @@ -1029,6 +1342,76 @@ export namespace file_v1beta1 { /** * file.projects.locations.instances.patch * @desc Updates the settings of a specific instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.instances.patch({ + * // Output only. The resource name of the instance, in the format + * // projects/{project_id}/locations/{location_id}/instances/{instance_id}. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * // Required. Mask of fields to update. At least one path must be supplied in this + * // field. The elements of the repeated paths field may only include these + * // fields: + * // + * // * "description" + * // * "file_shares" + * // * "labels" + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "fileShares": [], + * // "labels": {}, + * // "name": "my_name", + * // "networks": [], + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "tier": "my_tier" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.instances.patch * @memberOf! () * @@ -1204,6 +1587,50 @@ export namespace file_v1beta1 { /** * file.projects.locations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.operations.cancel * @memberOf! () * @@ -1277,6 +1704,44 @@ export namespace file_v1beta1 { /** * file.projects.locations.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.operations.delete * @memberOf! () * @@ -1346,6 +1811,50 @@ export namespace file_v1beta1 { /** * file.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.operations.get * @memberOf! () * @@ -1417,6 +1926,53 @@ export namespace file_v1beta1 { /** * file.projects.locations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/file.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 file = google.file('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 file.projects.locations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias file.projects.locations.operations.list * @memberOf! () * diff --git a/src/apis/firebase/v1beta1.ts b/src/apis/firebase/v1beta1.ts index f5c5d6c5982..cfae242cab0 100644 --- a/src/apis/firebase/v1beta1.ts +++ b/src/apis/firebase/v1beta1.ts @@ -656,6 +656,61 @@ export namespace firebase_v1beta1 { /** * firebase.availableProjects.list * @desc Returns a list of [Google Cloud Platform (GCP) `Projects`] (https://cloud.google.com/resource-manager/reference/rest/v1/projects) that are available to have Firebase resources added to them.

                          A GCP `Project` will only be returned if:
                          1. The caller has sufficient [Google IAM](https://cloud.google.com/iam) permissions to call AddFirebase.

                          2. The GCP `Project` is not already a FirebaseProject.

                          3. The GCP `Project` is not in an Organization which has policies that prevent Firebase resources from being added.

                          + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebase.availableProjects.list({ + * // The maximum number of GCP `Projects` to return in the response. + * //
                          + * //
                          The server may return fewer than this value at its discretion. + * // If no value is specified (or too large a value is specified), the server + * // will impose its own limit. + * //
                          + * //
                          This value cannot be negative. + * pageSize: 'placeholder-value', + * // Token returned from a previous call to `ListAvailableProjects` + * // indicating where in the set of GCP `Projects` to resume listing. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "projectInfo": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.availableProjects.list * @memberOf! () * @@ -764,6 +819,55 @@ export namespace firebase_v1beta1 { /** * firebase.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebase.operations.get({ + * // The name of the operation resource. + * name: 'operations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.operations.get * @memberOf! () * @@ -867,6 +971,68 @@ export namespace firebase_v1beta1 { /** * firebase.projects.addFirebase * @desc Adds Firebase resources to the specified existing [Google Cloud Platform (GCP) `Project`] (https://cloud.google.com/resource-manager/reference/rest/v1/projects).

                          Since a FirebaseProject is actually also a GCP `Project`, a `FirebaseProject` uses underlying GCP identifiers (most importantly, the `projectId`) as its own for easy interop with GCP APIs.

                          The result of this call is an [`Operation`](../../v1beta1/operations). Poll the `Operation` to track the provisioning process by calling GetOperation until [`done`](../../v1beta1/operations#Operation.FIELDS.done) is `true`. When `done` is `true`, the `Operation` has either succeeded or failed. If the `Operation` succeeded, its [`response`](../../v1beta1/operations#Operation.FIELDS.response) is set to a FirebaseProject; if the `Operation` failed, its [`error`](../../v1beta1/operations#Operation.FIELDS.error) is set to a google.rpc.Status. The `Operation` is automatically deleted after completion, so there is no need to call DeleteOperation.

                          This method does not modify any billing account information on the underlying GCP `Project`.

                          To call `AddFirebase`, a member must be an Editor or Owner for the existing GCP `Project`. Service accounts cannot call `AddFirebase`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebase.projects.addFirebase({ + * // The resource name of the GCP `Project` to which Firebase resources will be + * // added, in the format: + * //
                          projects/projectId + * // After calling `AddFirebase`, the + * // [`projectId`](https://cloud.google.com/resource-manager/reference/rest/v1/projects#Project.FIELDS.project_id) + * // of the GCP `Project` is also the `projectId` of the FirebaseProject. + * project: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "locationId": "my_locationId", + * // "regionCode": "my_regionCode", + * // "timeZone": "my_timeZone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.addFirebase * @memberOf! () * @@ -942,6 +1108,64 @@ export namespace firebase_v1beta1 { /** * firebase.projects.addGoogleAnalytics * @desc Links a FirebaseProject with an existing [Google Analytics account](http://www.google.com/analytics/).

                          Using this call, you can either:
                          • Specify an `analyticsAccountId` to provision a new Google Analytics property within the specified account and associate the new property with your `FirebaseProject`.
                          • Specify an existing `analyticsPropertyId` to associate the property with your `FirebaseProject`.

                          Note that when you call `AddGoogleAnalytics`:
                          1. The first check determines if any existing data streams in the Google Analytics property correspond to any existing Firebase Apps in your `FirebaseProject` (based on the `packageName` or `bundleId` associated with the data stream). Then, as applicable, the data streams and apps are linked. Note that this auto-linking only applies to Android Apps and iOS Apps.
                          2. If no corresponding data streams are found for your Firebase Apps, new data streams are provisioned in the Google Analytics property for each of your Firebase Apps. Note that a new data stream is always provisioned for a Web App even if it was previously associated with a data stream in your Analytics property.
                          Learn more about the hierarchy and structure of Google Analytics accounts in the [Analytics documentation](https://support.google.com/analytics/answer/9303323).

                          The result of this call is an [`Operation`](../../v1beta1/operations). Poll the `Operation` to track the provisioning process by calling GetOperation until [`done`](../../v1beta1/operations#Operation.FIELDS.done) is `true`. When `done` is `true`, the `Operation` has either succeeded or failed. If the `Operation` succeeded, its [`response`](../../v1beta1/operations#Operation.FIELDS.response) is set to an AnalyticsDetails; if the `Operation` failed, its [`error`](../../v1beta1/operations#Operation.FIELDS.error) is set to a google.rpc.Status.

                          To call `AddGoogleAnalytics`, a member must be an Owner for the existing `FirebaseProject` and have the [`Edit` permission](https://support.google.com/analytics/answer/2884495) for the Google Analytics account.

                          If a `FirebaseProject` already has Google Analytics enabled, and you call `AddGoogleAnalytics` using an `analyticsPropertyId` that's different from the currently associated property, then the call will fail. Analytics may have already been enabled in the Firebase console or by specifying `timeZone` and `regionCode` in the call to [`AddFirebase`](../../v1beta1/projects/addFirebase). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebase.projects.addGoogleAnalytics({ + * // The parent `FirebaseProject` to link to an existing Google Analytics + * // account, in the format: + * //
                          projects/projectId + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "analyticsAccountId": "my_analyticsAccountId", + * // "analyticsPropertyId": "my_analyticsPropertyId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.addGoogleAnalytics * @memberOf! () * @@ -1017,6 +1241,56 @@ export namespace firebase_v1beta1 { /** * firebase.projects.get * @desc Gets the FirebaseProject identified by the specified resource name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebase.projects.get({ + * // The fully qualified resource name of the Project, in the format: + * //
                          projects/projectId + * name: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "projectNumber": "my_projectNumber", + * // "resources": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.get * @memberOf! () * @@ -1087,6 +1361,55 @@ export namespace firebase_v1beta1 { /** * firebase.projects.getAdminSdkConfig * @desc Gets the configuration artifact used by servers to simplify initialization.

                          Typically, this configuration is used with the Firebase Admin SDK [initializeApp](https://firebase.google.com/docs/admin/setup#initialize_the_sdk) command. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebase.projects.getAdminSdkConfig({ + * // The fully qualified resource name of the Project, in the format: + * //
                          projects/projectId/adminSdkConfig + * name: 'projects/my-project/adminSdkConfig', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "databaseURL": "my_databaseURL", + * // "locationId": "my_locationId", + * // "projectId": "my_projectId", + * // "storageBucket": "my_storageBucket" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.getAdminSdkConfig * @memberOf! () * @@ -1160,6 +1483,53 @@ export namespace firebase_v1beta1 { /** * firebase.projects.getAnalyticsDetails * @desc Gets the Google Analytics details currently associated with a FirebaseProject.

                          If the `FirebaseProject` is not yet linked to Google Analytics, then the response to `GetAnalyticsDetails` is NOT_FOUND. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebase.projects.getAnalyticsDetails({ + * // The fully qualified resource name, in the format: + * //
                          projects/projectId/analyticsDetails + * name: 'projects/my-project/analyticsDetails', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "analyticsProperty": {}, + * // "streamMappings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.getAnalyticsDetails * @memberOf! () * @@ -1233,6 +1603,61 @@ export namespace firebase_v1beta1 { /** * firebase.projects.list * @desc Lists each FirebaseProject accessible to the caller.

                          The elements are returned in no particular order, but they will be a consistent view of the Projects when additional requests are made with a `pageToken`.

                          This method is eventually consistent with Project mutations, which means newly provisioned Projects and recent modifications to existing Projects might not be reflected in the set of Projects. The list will include only ACTIVE Projects.

                          Use GetFirebaseProject for consistent reads as well as for additional Project details. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebase.projects.list({ + * // The maximum number of Projects to return in the response. + * //
                          + * //
                          The server may return fewer than this at its discretion. + * // If no value is specified (or too large a value is specified), the server + * // will impose its own limit. + * //
                          + * //
                          This value cannot be negative. + * pageSize: 'placeholder-value', + * // Token returned from a previous call to `ListFirebaseProjects` indicating + * // where in the set of Projects to resume listing. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "results": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.list * @memberOf! () * @@ -1313,6 +1738,72 @@ export namespace firebase_v1beta1 { /** * firebase.projects.patch * @desc Updates the attributes of the FirebaseProject identified by the specified resource name.

                          All [query parameters](#query-parameters) are required. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebase.projects.patch({ + * // The fully qualified resource name of the Project, in the format: + * //
                          projects/projectId + * name: 'projects/my-project', + * // Specifies which fields to update. + * //
                          + * //
                          If this list is empty, then no state will be updated. + * //
                          Note that the fields `name`, `project_id`, and `project_number` are all + * // immutable. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "projectNumber": "my_projectNumber", + * // "resources": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "projectId": "my_projectId", + * // "projectNumber": "my_projectNumber", + * // "resources": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.patch * @memberOf! () * @@ -1385,6 +1876,57 @@ export namespace firebase_v1beta1 { /** * firebase.projects.removeAnalytics * @desc Unlinks the specified `FirebaseProject` from its Google Analytics account.

                          This call removes the association of the specified `FirebaseProject` with its current Google Analytics property. However, this call does not delete the Google Analytics resources, such as the Google Analytics property or any data streams.

                          These resources may be re-associated later to the `FirebaseProject` by calling [`AddGoogleAnalytics`](../../v1beta1/projects/addGoogleAnalytics) and specifying the same `analyticsPropertyId`. For Android Apps and iOS Apps, this call re-links data streams with their corresponding apps. However, for Web Apps, this call provisions a new data stream for each Web App.

                          To call `RemoveAnalytics`, a member must be an Owner for the `FirebaseProject`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebase.projects.removeAnalytics({ + * // The parent `FirebaseProject` to unlink from its Google Analytics account, + * // in the format: + * //
                          projects/projectId + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "analyticsPropertyId": "my_analyticsPropertyId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.removeAnalytics * @memberOf! () * @@ -1458,6 +2000,64 @@ export namespace firebase_v1beta1 { /** * firebase.projects.searchApps * @desc A convenience method that lists all available Apps for the specified FirebaseProject.

                          Typically, interaction with an App should be done using the platform-specific service, but some tool use-cases require a summary of all known Apps (such as for App selector interfaces). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebase.projects.searchApps({ + * // The maximum number of Apps to return in the response. + * //
                          + * //
                          The server may return fewer than this value at its discretion. + * // If no value is specified (or too large a value is specified), then the + * // server will impose its own limit. + * //
                          + * //
                          This value cannot be negative. + * pageSize: 'placeholder-value', + * // Token returned from a previous call to `SearchFirebaseApps` indicating + * // where in the set of Apps to resume listing. + * pageToken: 'placeholder-value', + * // The parent Project for which to list Apps, in the format: + * //
                          projects/projectId + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apps": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.searchApps * @memberOf! () * @@ -1692,6 +2292,66 @@ export namespace firebase_v1beta1 { /** * firebase.projects.androidApps.create * @desc Requests that a new AndroidApp be created.

                          The result of this call is an `Operation` which can be used to track the provisioning process. The `Operation` is automatically deleted after completion, so there is no need to call `DeleteOperation`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebase.projects.androidApps.create({ + * // The parent Project in which to create an App, in the format: + * //
                          projects/projectId + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appId": "my_appId", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "packageName": "my_packageName", + * // "projectId": "my_projectId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.androidApps.create * @memberOf! () * @@ -1767,6 +2427,59 @@ export namespace firebase_v1beta1 { /** * firebase.projects.androidApps.get * @desc Gets the AndroidApp identified by the specified resource name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebase.projects.androidApps.get({ + * // The fully qualified resource name of the App, in the format: + * //
                          projects/projectId/androidApps/appId + * //
                          As an appId is a unique identifier, the Unique Resource + * // from Sub-Collection access pattern may be used here, in the format: + * //
                          projects/-/androidApps/appId + * name: 'projects/my-project/androidApps/my-androidApp', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appId": "my_appId", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "packageName": "my_packageName", + * // "projectId": "my_projectId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.androidApps.get * @memberOf! () * @@ -1838,6 +2551,56 @@ export namespace firebase_v1beta1 { /** * firebase.projects.androidApps.getConfig * @desc Gets the configuration artifact associated with the specified AndroidApp. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebase.projects.androidApps.getConfig({ + * // The resource name of the App configuration to download, in the format: + * //
                          projects/projectId/androidApps/appId/config + * //
                          As an appId is a unique identifier, the Unique Resource + * // from Sub-Collection access pattern may be used here, in the format: + * //
                          projects/-/androidApps/appId + * name: 'projects/my-project/androidApps/my-androidApp/config', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "configFileContents": "my_configFileContents", + * // "configFilename": "my_configFilename" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.androidApps.getConfig * @memberOf! () * @@ -1909,6 +2672,62 @@ export namespace firebase_v1beta1 { /** * firebase.projects.androidApps.list * @desc Lists each AndroidApp associated with the specified parent Project.

                          The elements are returned in no particular order, but will be a consistent view of the Apps when additional requests are made with a `pageToken`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebase.projects.androidApps.list({ + * // The maximum number of Apps to return in the response. + * //
                          + * //
                          The server may return fewer than this at its discretion. + * // If no value is specified (or too large a value is specified), then the + * // server will impose its own limit. + * pageSize: 'placeholder-value', + * // Token returned from a previous call to `ListAndroidApps` indicating where + * // in the set of Apps to resume listing. + * pageToken: 'placeholder-value', + * // The parent Project for which to list Apps, in the format: + * //
                          projects/projectId + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apps": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.androidApps.list * @memberOf! () * @@ -1987,6 +2806,70 @@ export namespace firebase_v1beta1 { /** * firebase.projects.androidApps.patch * @desc Updates the attributes of the AndroidApp identified by the specified resource name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebase.projects.androidApps.patch({ + * // The fully qualified resource name of the App, in the format: + * //
                          projects/projectId/androidApps/appId + * name: 'projects/my-project/androidApps/my-androidApp', + * // Specifies which fields to update. + * //
                          Note that the fields `name`, `appId`, `projectId`, and `packageName` + * // are all immutable. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appId": "my_appId", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "packageName": "my_packageName", + * // "projectId": "my_projectId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appId": "my_appId", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "packageName": "my_packageName", + * // "projectId": "my_projectId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.androidApps.patch * @memberOf! () * @@ -2150,6 +3033,65 @@ export namespace firebase_v1beta1 { /** * firebase.projects.androidApps.sha.create * @desc Adds a SHA certificate to the specified AndroidApp. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebase.projects.androidApps.sha.create({ + * // The parent App to which a SHA certificate will be added, in the format: + * //
                          projects/projectId/androidApps/appId + * //
                          As an appId is a unique identifier, the Unique Resource + * // from Sub-Collection access pattern may be used here, in the format: + * //
                          projects/-/androidApps/appId + * parent: 'projects/my-project/androidApps/my-androidApp', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "certType": "my_certType", + * // "name": "my_name", + * // "shaHash": "my_shaHash" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certType": "my_certType", + * // "name": "my_name", + * // "shaHash": "my_shaHash" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.androidApps.sha.create * @memberOf! () * @@ -2225,6 +3167,51 @@ export namespace firebase_v1beta1 { /** * firebase.projects.androidApps.sha.delete * @desc Removes a SHA certificate from the specified AndroidApp. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebase.projects.androidApps.sha.delete({ + * // The fully qualified resource name of the `sha-key`, in the format: + * //
                          projects/projectId/androidApps/appId/sha/shaId + * //
                          You can obtain the full name from the response of + * // [`ListShaCertificates`](../projects.androidApps.sha/list) or the original + * // [`CreateShaCertificate`](../projects.androidApps.sha/create). + * name: 'projects/my-project/androidApps/my-androidApp/sha/[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.androidApps.sha.delete * @memberOf! () * @@ -2294,6 +3281,55 @@ export namespace firebase_v1beta1 { /** * firebase.projects.androidApps.sha.list * @desc Returns the list of SHA-1 and SHA-256 certificates for the specified AndroidApp. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebase.projects.androidApps.sha.list({ + * // The parent App for which to list SHA certificates, in the format: + * //
                          projects/projectId/androidApps/appId + * //
                          As an appId is a unique identifier, the Unique Resource + * // from Sub-Collection access pattern may be used here, in the format: + * //
                          projects/-/androidApps/appId + * parent: 'projects/my-project/androidApps/my-androidApp', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "certificates": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.androidApps.sha.list * @memberOf! () * @@ -2424,6 +3460,67 @@ export namespace firebase_v1beta1 { /** * firebase.projects.availableLocations.list * @desc Returns a list of valid Google Cloud Platform (GCP) resource locations for the specified Project (including a FirebaseProject).

                          One of these locations can be selected as the Project's [_default_ GCP resource location](https://firebase.google.com/docs/projects/locations), which is the geographical location where project resources, such as Cloud Firestore, will be provisioned by default. However, if the default GCP resource location has already been set for the Project, then this setting cannot be changed.

                          This call checks for any possible [location restrictions](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations) for the specified Project and, thus, might return a subset of all possible GCP resource locations. To list all GCP resource locations (regardless of any restrictions), call the endpoint without specifying a `projectId` (that is, `/v1beta1/{parent=projects/-}/listAvailableLocations`).

                          To call `ListAvailableLocations` with a specified project, a member must be at minimum a Viewer of the project. Calls without a specified project do not require any specific project permissions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebase.projects.availableLocations.list({ + * // The maximum number of locations to return in the response. + * //
                          + * //
                          The server may return fewer than this value at its discretion. + * // If no value is specified (or too large a value is specified), then the + * // server will impose its own limit. + * //
                          + * //
                          This value cannot be negative. + * pageSize: 'placeholder-value', + * // Token returned from a previous call to `ListAvailableLocations` indicating + * // where in the list of locations to resume listing. + * pageToken: 'placeholder-value', + * // The Project for which to list GCP resource locations, in the format: + * //
                          projects/projectId + * //
                          If no project is specified (that is, `projects/-`), the returned list + * // does not take into account org-specific or project-specific location + * // restrictions. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.availableLocations.list * @memberOf! () * @@ -2537,6 +3634,63 @@ export namespace firebase_v1beta1 { /** * firebase.projects.defaultLocation.finalize * @desc Sets the default Google Cloud Platform (GCP) resource location for the specified FirebaseProject.

                          This method creates an App Engine application with a [default Cloud Storage bucket](https://cloud.google.com/appengine/docs/standard/python/googlecloudstorageclient/setting-up-cloud-storage#activating_a_cloud_storage_bucket), located in the specified [`location_id`](#body.request_body.FIELDS.location_id). This location must be one of the available [GCP resource locations](https://firebase.google.com/docs/projects/locations).

                          After the default GCP resource location is finalized, or if it was already set, it cannot be changed. The default GCP resource location for the specified FirebaseProject might already be set because either the GCP `Project` already has an App Engine application or `FinalizeDefaultLocation` was previously called with a specified `location_id`. Any new calls to `FinalizeDefaultLocation` with a different specified `location_id` will return a 409 error.

                          The result of this call is an [`Operation`](../../v1beta1/operations), which can be used to track the provisioning process. The [`response`](../../v1beta1/operations#Operation.FIELDS.response) type of the `Operation` is google.protobuf.Empty.

                          The `Operation` can be polled by its `name` using GetOperation until `done` is true. When `done` is true, the `Operation` has either succeeded or failed. If the `Operation` has succeeded, its [`response`](../../v1beta1/operations#Operation.FIELDS.response) will be set to a google.protobuf.Empty; if the `Operation` has failed, its `error` will be set to a google.rpc.Status. The `Operation` is automatically deleted after completion, so there is no need to call DeleteOperation.

                          All fields listed in the [request body](#request-body) are required.

                          To call `FinalizeDefaultLocation`, a member must be an Owner of the project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebase.projects.defaultLocation.finalize({ + * // The resource name of the Project for which the default GCP resource + * // location will be set, in the format: + * //
                          projects/projectId + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "locationId": "my_locationId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.defaultLocation.finalize * @memberOf! () * @@ -2636,6 +3790,67 @@ export namespace firebase_v1beta1 { /** * firebase.projects.iosApps.create * @desc Requests that a new IosApp be created.

                          The result of this call is an `Operation` which can be used to track the provisioning process. The `Operation` is automatically deleted after completion, so there is no need to call `DeleteOperation`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebase.projects.iosApps.create({ + * // The parent Project in which to create an App, in the format: + * //
                          projects/projectId + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appId": "my_appId", + * // "appStoreId": "my_appStoreId", + * // "bundleId": "my_bundleId", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "projectId": "my_projectId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.iosApps.create * @memberOf! () * @@ -2711,6 +3926,60 @@ export namespace firebase_v1beta1 { /** * firebase.projects.iosApps.get * @desc Gets the IosApp identified by the specified resource name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebase.projects.iosApps.get({ + * // The fully qualified resource name of the App, in the format: + * // projects/projectId/iosApps/appId + * //
                          As an appId is a unique identifier, the Unique Resource + * // from Sub-Collection access pattern may be used here, in the format: + * //
                          projects/-/iosApps/appId + * name: 'projects/my-project/iosApps/my-iosApp', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appId": "my_appId", + * // "appStoreId": "my_appStoreId", + * // "bundleId": "my_bundleId", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "projectId": "my_projectId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.iosApps.get * @memberOf! () * @@ -2780,6 +4049,56 @@ export namespace firebase_v1beta1 { /** * firebase.projects.iosApps.getConfig * @desc Gets the configuration artifact associated with the specified IosApp. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebase.projects.iosApps.getConfig({ + * // The resource name of the App configuration to download, in the format: + * //
                          projects/projectId/iosApps/appId/config + * //
                          As an appId is a unique identifier, the Unique Resource + * // from Sub-Collection access pattern may be used here, in the format: + * //
                          projects/-/iosApps/appId + * name: 'projects/my-project/iosApps/my-iosApp/config', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "configFileContents": "my_configFileContents", + * // "configFilename": "my_configFilename" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.iosApps.getConfig * @memberOf! () * @@ -2851,6 +4170,62 @@ export namespace firebase_v1beta1 { /** * firebase.projects.iosApps.list * @desc Lists each IosApp associated with the specified parent Project.

                          The elements are returned in no particular order, but will be a consistent view of the Apps when additional requests are made with a `pageToken`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebase.projects.iosApps.list({ + * // The maximum number of Apps to return in the response. + * //
                          + * //
                          The server may return fewer than this at its discretion. + * // If no value is specified (or too large a value is specified), the server + * // will impose its own limit. + * pageSize: 'placeholder-value', + * // Token returned from a previous call to `ListIosApps` indicating where in + * // the set of Apps to resume listing. + * pageToken: 'placeholder-value', + * // The parent Project for which to list Apps, in the format: + * //
                          projects/projectId + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apps": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.iosApps.list * @memberOf! () * @@ -2927,6 +4302,72 @@ export namespace firebase_v1beta1 { /** * firebase.projects.iosApps.patch * @desc Updates the attributes of the IosApp identified by the specified resource name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebase.projects.iosApps.patch({ + * // The fully qualified resource name of the App, in the format: + * //
                          projects/projectId/iosApps/appId + * name: 'projects/my-project/iosApps/my-iosApp', + * // Specifies which fields to update. + * //
                          Note that the fields `name`, `appId`, `projectId`, and `bundleId` + * // are all immutable. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appId": "my_appId", + * // "appStoreId": "my_appStoreId", + * // "bundleId": "my_bundleId", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "projectId": "my_projectId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appId": "my_appId", + * // "appStoreId": "my_appStoreId", + * // "bundleId": "my_bundleId", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "projectId": "my_projectId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.iosApps.patch * @memberOf! () * @@ -3088,6 +4529,66 @@ export namespace firebase_v1beta1 { /** * firebase.projects.webApps.create * @desc Requests that a new WebApp be created.

                          The result of this call is an `Operation` which can be used to track the provisioning process. The `Operation` is automatically deleted after completion, so there is no need to call `DeleteOperation`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebase.projects.webApps.create({ + * // The parent Project in which to create an App, in the format: + * //
                          projects/projectId + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appId": "my_appId", + * // "appUrls": [], + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "projectId": "my_projectId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.webApps.create * @memberOf! () * @@ -3163,6 +4664,59 @@ export namespace firebase_v1beta1 { /** * firebase.projects.webApps.get * @desc Gets the WebApp identified by the specified resource name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebase.projects.webApps.get({ + * // The fully qualified resource name of the App, in the format: + * //
                          projects/projectId/webApps/appId + * //
                          As an appId is a unique identifier, the Unique Resource + * // from Sub-Collection access pattern may be used here, in the format: + * //
                          projects/-/webApps/appId + * name: 'projects/my-project/webApps/my-webApp', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appId": "my_appId", + * // "appUrls": [], + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "projectId": "my_projectId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.webApps.get * @memberOf! () * @@ -3232,6 +4786,63 @@ export namespace firebase_v1beta1 { /** * firebase.projects.webApps.getConfig * @desc Gets the configuration artifact associated with the specified WebApp. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebase.projects.webApps.getConfig({ + * // The resource name of the App configuration to download, in the format: + * //
                          projects/projectId/webApps/appId/config + * //
                          As an appId is a unique identifier, the Unique Resource + * // from Sub-Collection access pattern may be used here, in the format: + * //
                          projects/-/webApps/appId + * name: 'projects/my-project/webApps/my-webApp/config', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiKey": "my_apiKey", + * // "appId": "my_appId", + * // "authDomain": "my_authDomain", + * // "databaseURL": "my_databaseURL", + * // "locationId": "my_locationId", + * // "measurementId": "my_measurementId", + * // "messagingSenderId": "my_messagingSenderId", + * // "projectId": "my_projectId", + * // "storageBucket": "my_storageBucket" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.webApps.getConfig * @memberOf! () * @@ -3303,6 +4914,62 @@ export namespace firebase_v1beta1 { /** * firebase.projects.webApps.list * @desc Lists each WebApp associated with the specified parent Project.

                          The elements are returned in no particular order, but will be a consistent view of the Apps when additional requests are made with a `pageToken`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebase.projects.webApps.list({ + * // The maximum number of Apps to return in the response. + * //
                          + * //
                          The server may return fewer than this value at its discretion. + * // If no value is specified (or too large a value is specified), then the + * // server will impose its own limit. + * pageSize: 'placeholder-value', + * // Token returned from a previous call to `ListWebApps` indicating where in + * // the set of Apps to resume listing. + * pageToken: 'placeholder-value', + * // The parent Project for which to list Apps, in the format: + * //
                          projects/projectId + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apps": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.webApps.list * @memberOf! () * @@ -3379,6 +5046,70 @@ export namespace firebase_v1beta1 { /** * firebase.projects.webApps.patch * @desc Updates the attributes of the WebApp identified by the specified resource name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebase.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 firebase = google.firebase('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebase.projects.webApps.patch({ + * // The fully qualified resource name of the App, for example: + * //
                          projects/projectId/webApps/appId + * name: 'projects/my-project/webApps/my-webApp', + * // Specifies which fields to update. + * //
                          Note that the fields `name`, `appId`, and `projectId` are all + * // immutable. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appId": "my_appId", + * // "appUrls": [], + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "projectId": "my_projectId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appId": "my_appId", + * // "appUrls": [], + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "projectId": "my_projectId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebase.projects.webApps.patch * @memberOf! () * diff --git a/src/apis/firebasedynamiclinks/v1.ts b/src/apis/firebasedynamiclinks/v1.ts index 7089c2e2ba1..5c44227936f 100644 --- a/src/apis/firebasedynamiclinks/v1.ts +++ b/src/apis/firebasedynamiclinks/v1.ts @@ -682,6 +682,57 @@ export namespace firebasedynamiclinks_v1 { /** * firebasedynamiclinks.managedShortLinks.create * @desc Creates a managed short Dynamic Link given either a valid long Dynamic Link or details such as Dynamic Link domain, Android and iOS app information. The created short Dynamic Link will not expire. This differs from CreateShortDynamicLink in the following ways: - The request will also contain a name for the link (non unique name for the front end). - The response must be authenticated with an auth token (generated with the admin service account). - The link will appear in the FDL list of links in the console front end. The Dynamic Link domain in the request must be owned by requester's Firebase project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasedynamiclinks.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 firebasedynamiclinks = google.firebasedynamiclinks('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/firebase'], + * }); + * + * // 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 firebasedynamiclinks.managedShortLinks.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dynamicLinkInfo": {}, + * // "longDynamicLink": "my_longDynamicLink", + * // "name": "my_name", + * // "sdkVersion": "my_sdkVersion", + * // "suffix": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "managedShortLink": {}, + * // "previewLink": "my_previewLink", + * // "warning": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasedynamiclinks.managedShortLinks.create * @memberOf! () * @@ -786,6 +837,56 @@ export namespace firebasedynamiclinks_v1 { /** * firebasedynamiclinks.shortLinks.create * @desc Creates a short Dynamic Link given either a valid long Dynamic Link or details such as Dynamic Link domain, Android and iOS app information. The created short Dynamic Link will not expire. Repeated calls with the same long Dynamic Link or Dynamic Link information will produce the same short Dynamic Link. The Dynamic Link domain in the request must be owned by requester's Firebase project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasedynamiclinks.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 firebasedynamiclinks = google.firebasedynamiclinks('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/firebase'], + * }); + * + * // 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 firebasedynamiclinks.shortLinks.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dynamicLinkInfo": {}, + * // "longDynamicLink": "my_longDynamicLink", + * // "sdkVersion": "my_sdkVersion", + * // "suffix": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "previewLink": "my_previewLink", + * // "shortLink": "my_shortLink", + * // "warning": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasedynamiclinks.shortLinks.create * @memberOf! () * @@ -887,6 +988,50 @@ export namespace firebasedynamiclinks_v1 { /** * firebasedynamiclinks.getLinkStats * @desc Fetches analytics stats of a short Dynamic Link for a given duration. Metrics include number of clicks, redirects, installs, app first opens, and app reopens. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasedynamiclinks.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 firebasedynamiclinks = google.firebasedynamiclinks('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/firebase'], + * }); + * + * // 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 firebasedynamiclinks.getLinkStats({ + * // The span of time requested in days. + * durationDays: 'placeholder-value', + * // Dynamic Link URL. e.g. https://abcd.app.goo.gl/wxyz + * dynamicLink: 'placeholder-value', + * // Google SDK version. Version takes the form "$major.$minor.$patch" + * sdkVersion: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "linkEventStats": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasedynamiclinks.getLinkStats * @memberOf! () * @@ -963,6 +1108,73 @@ export namespace firebasedynamiclinks_v1 { /** * firebasedynamiclinks.installAttribution * @desc Get iOS strong/weak-match info for post-install attribution. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasedynamiclinks.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 firebasedynamiclinks = google.firebasedynamiclinks('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/firebase'], + * }); + * + * // 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 firebasedynamiclinks.installAttribution({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appInstallationTime": "my_appInstallationTime", + * // "bundleId": "my_bundleId", + * // "device": {}, + * // "iosVersion": "my_iosVersion", + * // "retrievalMethod": "my_retrievalMethod", + * // "sdkVersion": "my_sdkVersion", + * // "uniqueMatchLinkToCheck": "my_uniqueMatchLinkToCheck", + * // "visualStyle": "my_visualStyle" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appMinimumVersion": "my_appMinimumVersion", + * // "attributionConfidence": "my_attributionConfidence", + * // "deepLink": "my_deepLink", + * // "externalBrowserDestinationLink": "my_externalBrowserDestinationLink", + * // "fallbackLink": "my_fallbackLink", + * // "invitationId": "my_invitationId", + * // "isStrongMatchExecutable": false, + * // "matchMessage": "my_matchMessage", + * // "requestIpVersion": "my_requestIpVersion", + * // "requestedLink": "my_requestedLink", + * // "resolvedLink": "my_resolvedLink", + * // "utmCampaign": "my_utmCampaign", + * // "utmContent": "my_utmContent", + * // "utmMedium": "my_utmMedium", + * // "utmSource": "my_utmSource", + * // "utmTerm": "my_utmTerm" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasedynamiclinks.installAttribution * @memberOf! () * @@ -1055,6 +1267,61 @@ export namespace firebasedynamiclinks_v1 { /** * firebasedynamiclinks.reopenAttribution * @desc Get iOS reopen attribution for app universal link open deeplinking. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasedynamiclinks.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 firebasedynamiclinks = google.firebasedynamiclinks('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/firebase'], + * }); + * + * // 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 firebasedynamiclinks.reopenAttribution({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bundleId": "my_bundleId", + * // "requestedLink": "my_requestedLink", + * // "sdkVersion": "my_sdkVersion" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deepLink": "my_deepLink", + * // "invitationId": "my_invitationId", + * // "iosMinAppVersion": "my_iosMinAppVersion", + * // "resolvedLink": "my_resolvedLink", + * // "utmCampaign": "my_utmCampaign", + * // "utmContent": "my_utmContent", + * // "utmMedium": "my_utmMedium", + * // "utmSource": "my_utmSource", + * // "utmTerm": "my_utmTerm" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasedynamiclinks.reopenAttribution * @memberOf! () * diff --git a/src/apis/firebasehosting/v1beta1.ts b/src/apis/firebasehosting/v1beta1.ts index c5a5f89a3d9..e6db56151cd 100644 --- a/src/apis/firebasehosting/v1beta1.ts +++ b/src/apis/firebasehosting/v1beta1.ts @@ -612,6 +612,55 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.projects.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebasehosting.projects.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.projects.operations.get * @memberOf! () * @@ -712,6 +761,53 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.projects.sites.getConfig * @desc Gets the Hosting metadata for a specific site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebasehosting.projects.sites.getConfig({ + * // Required. The site for which to get the SiteConfig, in the format: + * // sites/site-name/config + * name: 'projects/my-project/sites/my-site/config', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cloudLoggingEnabled": false, + * // "maxVersions": "my_maxVersions" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.projects.sites.getConfig * @memberOf! () * @@ -784,6 +880,66 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.projects.sites.updateConfig * @desc Sets the Hosting metadata for a specific site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebasehosting.projects.sites.updateConfig({ + * // Required. The site for which to update the SiteConfig, in the format: + * // sites/site-name/config + * name: 'projects/my-project/sites/my-site/config', + * // A set of field names from your [site configuration](../sites.SiteConfig) + * // that you want to update. + * //
                          A field will be overwritten if, and only if, it's in the mask. + * //
                          If a mask is not provided then a default mask of only + * // [`max_versions`](../sites.SiteConfig.max_versions) will be used. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "cloudLoggingEnabled": false, + * // "maxVersions": "my_maxVersions" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cloudLoggingEnabled": false, + * // "maxVersions": "my_maxVersions" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.projects.sites.updateConfig * @memberOf! () * @@ -910,6 +1066,76 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.projects.sites.channels.releases.create * @desc Creates a new release which makes the content of the specified version actively display on the appropriate URL(s). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebasehosting.projects.sites.channels.releases.create({ + * // Required. The site that the release belongs to, in the format: + * // sites/site-name + * parent: 'projects/my-project/sites/my-site/channels/my-channel', + * // The unique identifier for a version, in the format: + * // /sites/site-name/versions/versionID + * // The site-name in this version identifier must match the + * // site-name in the `parent` parameter. + * //
                          + * //
                          This query parameter must be empty if the `type` field in the + * // request body is `SITE_DISABLE`. + * versionName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "message": "my_message", + * // "name": "my_name", + * // "releaseTime": "my_releaseTime", + * // "releaseUser": {}, + * // "type": "my_type", + * // "version": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "message": "my_message", + * // "name": "my_name", + * // "releaseTime": "my_releaseTime", + * // "releaseUser": {}, + * // "type": "my_type", + * // "version": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.projects.sites.channels.releases.create * @memberOf! () * @@ -985,6 +1211,57 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.projects.sites.channels.releases.list * @desc Lists the releases that have been created on the specified site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebasehosting.projects.sites.channels.releases.list({ + * // The page size to return. Defaults to 100. + * pageSize: 'placeholder-value', + * // The next_page_token from a previous request, if provided. + * pageToken: 'placeholder-value', + * // Required. The parent for which to list files, in the format: + * // sites/site-name + * parent: 'projects/my-project/sites/my-site/channels/my-channel', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "releases": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.projects.sites.channels.releases.list * @memberOf! () * @@ -1113,6 +1390,68 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.projects.sites.domains.create * @desc Creates a domain mapping on the specified site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebasehosting.projects.sites.domains.create({ + * // Required. The parent to create the domain association for, in the format: + * // sites/site-name + * parent: 'projects/my-project/sites/my-site', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "domainName": "my_domainName", + * // "domainRedirect": {}, + * // "provisioning": {}, + * // "site": "my_site", + * // "status": "my_status", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domainName": "my_domainName", + * // "domainRedirect": {}, + * // "provisioning": {}, + * // "site": "my_site", + * // "status": "my_status", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.projects.sites.domains.create * @memberOf! () * @@ -1187,6 +1526,47 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.projects.sites.domains.delete * @desc Deletes the existing domain mapping on the specified site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebasehosting.projects.sites.domains.delete({ + * // Required. The name of the domain association to delete. + * name: 'projects/my-project/sites/my-site/domains/my-domain', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.projects.sites.domains.delete * @memberOf! () * @@ -1257,6 +1637,56 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.projects.sites.domains.get * @desc Gets a domain mapping on the specified site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebasehosting.projects.sites.domains.get({ + * // Required. The name of the domain configuration to get. + * name: 'projects/my-project/sites/my-site/domains/my-domain', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domainName": "my_domainName", + * // "domainRedirect": {}, + * // "provisioning": {}, + * // "site": "my_site", + * // "status": "my_status", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.projects.sites.domains.get * @memberOf! () * @@ -1327,6 +1757,57 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.projects.sites.domains.list * @desc Lists the domains for the specified site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebasehosting.projects.sites.domains.list({ + * // The page size to return. Defaults to 50. + * pageSize: 'placeholder-value', + * // The next_page_token from a previous request, if provided. + * pageToken: 'placeholder-value', + * // Required. The parent for which to list domains, in the format: + * // sites/site-name + * parent: 'projects/my-project/sites/my-site', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domains": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.projects.sites.domains.list * @memberOf! () * @@ -1404,6 +1885,68 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.projects.sites.domains.update * @desc Updates the specified domain mapping, creating the mapping as if it does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebasehosting.projects.sites.domains.update({ + * // Required. The name of the domain association to update or create, if an + * // association doesn't already exist. + * name: 'projects/my-project/sites/my-site/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "domainName": "my_domainName", + * // "domainRedirect": {}, + * // "provisioning": {}, + * // "site": "my_site", + * // "status": "my_status", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domainName": "my_domainName", + * // "domainRedirect": {}, + * // "provisioning": {}, + * // "site": "my_site", + * // "status": "my_status", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.projects.sites.domains.update * @memberOf! () * @@ -1561,6 +2104,76 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.projects.sites.releases.create * @desc Creates a new release which makes the content of the specified version actively display on the appropriate URL(s). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebasehosting.projects.sites.releases.create({ + * // Required. The site that the release belongs to, in the format: + * // sites/site-name + * parent: 'projects/my-project/sites/my-site', + * // The unique identifier for a version, in the format: + * // /sites/site-name/versions/versionID + * // The site-name in this version identifier must match the + * // site-name in the `parent` parameter. + * //
                          + * //
                          This query parameter must be empty if the `type` field in the + * // request body is `SITE_DISABLE`. + * versionName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "message": "my_message", + * // "name": "my_name", + * // "releaseTime": "my_releaseTime", + * // "releaseUser": {}, + * // "type": "my_type", + * // "version": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "message": "my_message", + * // "name": "my_name", + * // "releaseTime": "my_releaseTime", + * // "releaseUser": {}, + * // "type": "my_type", + * // "version": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.projects.sites.releases.create * @memberOf! () * @@ -1636,6 +2249,57 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.projects.sites.releases.list * @desc Lists the releases that have been created on the specified site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebasehosting.projects.sites.releases.list({ + * // The page size to return. Defaults to 100. + * pageSize: 'placeholder-value', + * // The next_page_token from a previous request, if provided. + * pageToken: 'placeholder-value', + * // Required. The parent for which to list files, in the format: + * // sites/site-name + * parent: 'projects/my-project/sites/my-site', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "releases": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.projects.sites.releases.list * @memberOf! () * @@ -1766,6 +2430,88 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.projects.sites.versions.create * @desc Creates a new version for a site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebasehosting.projects.sites.versions.create({ + * // Required. The parent to create the version for, in the format: + * // sites/site-name + * parent: 'projects/my-project/sites/my-site', + * // The self-reported size of the version. This value is used for a pre-emptive + * // quota check for legacy version uploads. + * sizeBytes: 'placeholder-value', + * // A unique id for the new version. This is only specified for legacy version + * // creations. + * versionId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "createTime": "my_createTime", + * // "createUser": {}, + * // "deleteTime": "my_deleteTime", + * // "deleteUser": {}, + * // "fileCount": "my_fileCount", + * // "finalizeTime": "my_finalizeTime", + * // "finalizeUser": {}, + * // "labels": {}, + * // "name": "my_name", + * // "preview": {}, + * // "status": "my_status", + * // "versionBytes": "my_versionBytes" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "config": {}, + * // "createTime": "my_createTime", + * // "createUser": {}, + * // "deleteTime": "my_deleteTime", + * // "deleteUser": {}, + * // "fileCount": "my_fileCount", + * // "finalizeTime": "my_finalizeTime", + * // "finalizeUser": {}, + * // "labels": {}, + * // "name": "my_name", + * // "preview": {}, + * // "status": "my_status", + * // "versionBytes": "my_versionBytes" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.projects.sites.versions.create * @memberOf! () * @@ -1842,6 +2588,48 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.projects.sites.versions.delete * @desc Deletes the specified version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebasehosting.projects.sites.versions.delete({ + * // Required. The name of the version to be deleted, in the format: + * // sites/site-name/versions/versionID + * name: 'projects/my-project/sites/my-site/versions/my-version', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.projects.sites.versions.delete * @memberOf! () * @@ -1912,6 +2700,65 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.projects.sites.versions.list * @desc Lists the versions that have been created on the specified site. Will include filtering in the future. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebasehosting.projects.sites.versions.list({ + * // The filter string used to return a subset of versions in the response. + * // Currently supported fields for filtering are: name, status, + * // and create_time. Filter processing will be implemented in accordance + * // with go/filtering. + * filter: 'placeholder-value', + * // The maximum number of versions to return. The service may return fewer than + * // this value. + * // If unspecified, at most 25 versions will be returned. + * // The maximum value is 100; values above 100 will be coerced to 100 + * pageSize: 'placeholder-value', + * // The next_page_token from a previous request, if provided. + * pageToken: 'placeholder-value', + * // Required. The parent for which to list files, in the format: + * // sites/site-name + * parent: 'projects/my-project/sites/my-site', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "versions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.projects.sites.versions.list * @memberOf! () * @@ -1992,6 +2839,90 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.projects.sites.versions.patch * @desc Updates the specified metadata for a version. Note that this method will fail with `FAILED_PRECONDITION` in the event of an invalid state transition. The only valid transition for a version is currently from a `CREATED` status to a `FINALIZED` status. Use [`DeleteVersion`](../sites.versions/delete) to set the status of a version to `DELETED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebasehosting.projects.sites.versions.patch({ + * // The unique identifier for a version, in the format: + * // sites/site-name/versions/versionID + * // This name is provided in the response body when you call the + * // [`CreateVersion`](../sites.versions/create) endpoint. + * name: 'projects/my-project/sites/my-site/versions/my-version', + * // A set of field names from your [version](../sites.versions) that you want + * // to update. + * //
                          A field will be overwritten if, and only if, it's in the mask. + * //
                          If a mask is not provided then a default mask of only + * // [`status`](../sites.versions#Version.FIELDS.status) will be used. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "createTime": "my_createTime", + * // "createUser": {}, + * // "deleteTime": "my_deleteTime", + * // "deleteUser": {}, + * // "fileCount": "my_fileCount", + * // "finalizeTime": "my_finalizeTime", + * // "finalizeUser": {}, + * // "labels": {}, + * // "name": "my_name", + * // "preview": {}, + * // "status": "my_status", + * // "versionBytes": "my_versionBytes" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "config": {}, + * // "createTime": "my_createTime", + * // "createUser": {}, + * // "deleteTime": "my_deleteTime", + * // "deleteUser": {}, + * // "fileCount": "my_fileCount", + * // "finalizeTime": "my_finalizeTime", + * // "finalizeUser": {}, + * // "labels": {}, + * // "name": "my_name", + * // "preview": {}, + * // "status": "my_status", + * // "versionBytes": "my_versionBytes" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.projects.sites.versions.patch * @memberOf! () * @@ -2064,6 +2995,59 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.projects.sites.versions.populateFiles * @desc Adds content files to a version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebasehosting.projects.sites.versions.populateFiles({ + * // Required. The version to add files to, in the format: + * // sites/site-name/versions/versionID + * parent: 'projects/my-project/sites/my-site/versions/my-version', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "files": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "uploadRequiredHashes": [], + * // "uploadUrl": "my_uploadUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.projects.sites.versions.populateFiles * @memberOf! () * @@ -2256,6 +3240,60 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.projects.sites.versions.files.list * @desc Lists the remaining files to be uploaded for the specified version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebasehosting.projects.sites.versions.files.list({ + * // The page size to return. Defaults to 1000. + * pageSize: 'placeholder-value', + * // The next_page_token from a previous request, if provided. This will be the + * // encoded version of a firebase.hosting.proto.metadata.ListFilesPageToken. + * pageToken: 'placeholder-value', + * // Required. The parent to list files for, in the format: + * // sites/site-name/versions/versionID + * parent: 'projects/my-project/sites/my-site/versions/my-version', + * // The type of files in the version that should be listed. + * status: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "files": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.projects.sites.versions.files.list * @memberOf! () * @@ -2376,6 +3414,53 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.sites.getConfig * @desc Gets the Hosting metadata for a specific site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebasehosting.sites.getConfig({ + * // Required. The site for which to get the SiteConfig, in the format: + * // sites/site-name/config + * name: 'sites/my-site/config', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cloudLoggingEnabled": false, + * // "maxVersions": "my_maxVersions" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.sites.getConfig * @memberOf! () * @@ -2447,6 +3532,66 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.sites.updateConfig * @desc Sets the Hosting metadata for a specific site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebasehosting.sites.updateConfig({ + * // Required. The site for which to update the SiteConfig, in the format: + * // sites/site-name/config + * name: 'sites/my-site/config', + * // A set of field names from your [site configuration](../sites.SiteConfig) + * // that you want to update. + * //
                          A field will be overwritten if, and only if, it's in the mask. + * //
                          If a mask is not provided then a default mask of only + * // [`max_versions`](../sites.SiteConfig.max_versions) will be used. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "cloudLoggingEnabled": false, + * // "maxVersions": "my_maxVersions" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cloudLoggingEnabled": false, + * // "maxVersions": "my_maxVersions" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.sites.updateConfig * @memberOf! () * @@ -2570,6 +3715,76 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.sites.channels.releases.create * @desc Creates a new release which makes the content of the specified version actively display on the appropriate URL(s). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebasehosting.sites.channels.releases.create({ + * // Required. The site that the release belongs to, in the format: + * // sites/site-name + * parent: 'sites/my-site/channels/my-channel', + * // The unique identifier for a version, in the format: + * // /sites/site-name/versions/versionID + * // The site-name in this version identifier must match the + * // site-name in the `parent` parameter. + * //
                          + * //
                          This query parameter must be empty if the `type` field in the + * // request body is `SITE_DISABLE`. + * versionName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "message": "my_message", + * // "name": "my_name", + * // "releaseTime": "my_releaseTime", + * // "releaseUser": {}, + * // "type": "my_type", + * // "version": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "message": "my_message", + * // "name": "my_name", + * // "releaseTime": "my_releaseTime", + * // "releaseUser": {}, + * // "type": "my_type", + * // "version": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.sites.channels.releases.create * @memberOf! () * @@ -2645,6 +3860,57 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.sites.channels.releases.list * @desc Lists the releases that have been created on the specified site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebasehosting.sites.channels.releases.list({ + * // The page size to return. Defaults to 100. + * pageSize: 'placeholder-value', + * // The next_page_token from a previous request, if provided. + * pageToken: 'placeholder-value', + * // Required. The parent for which to list files, in the format: + * // sites/site-name + * parent: 'sites/my-site/channels/my-channel', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "releases": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.sites.channels.releases.list * @memberOf! () * @@ -2773,6 +4039,68 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.sites.domains.create * @desc Creates a domain mapping on the specified site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebasehosting.sites.domains.create({ + * // Required. The parent to create the domain association for, in the format: + * // sites/site-name + * parent: 'sites/my-site', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "domainName": "my_domainName", + * // "domainRedirect": {}, + * // "provisioning": {}, + * // "site": "my_site", + * // "status": "my_status", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domainName": "my_domainName", + * // "domainRedirect": {}, + * // "provisioning": {}, + * // "site": "my_site", + * // "status": "my_status", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.sites.domains.create * @memberOf! () * @@ -2847,6 +4175,47 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.sites.domains.delete * @desc Deletes the existing domain mapping on the specified site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebasehosting.sites.domains.delete({ + * // Required. The name of the domain association to delete. + * name: 'sites/my-site/domains/my-domain', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.sites.domains.delete * @memberOf! () * @@ -2917,6 +4286,56 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.sites.domains.get * @desc Gets a domain mapping on the specified site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebasehosting.sites.domains.get({ + * // Required. The name of the domain configuration to get. + * name: 'sites/my-site/domains/my-domain', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domainName": "my_domainName", + * // "domainRedirect": {}, + * // "provisioning": {}, + * // "site": "my_site", + * // "status": "my_status", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.sites.domains.get * @memberOf! () * @@ -2987,6 +4406,57 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.sites.domains.list * @desc Lists the domains for the specified site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebasehosting.sites.domains.list({ + * // The page size to return. Defaults to 50. + * pageSize: 'placeholder-value', + * // The next_page_token from a previous request, if provided. + * pageToken: 'placeholder-value', + * // Required. The parent for which to list domains, in the format: + * // sites/site-name + * parent: 'sites/my-site', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domains": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.sites.domains.list * @memberOf! () * @@ -3064,6 +4534,68 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.sites.domains.update * @desc Updates the specified domain mapping, creating the mapping as if it does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebasehosting.sites.domains.update({ + * // Required. The name of the domain association to update or create, if an + * // association doesn't already exist. + * name: 'sites/my-site/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "domainName": "my_domainName", + * // "domainRedirect": {}, + * // "provisioning": {}, + * // "site": "my_site", + * // "status": "my_status", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domainName": "my_domainName", + * // "domainRedirect": {}, + * // "provisioning": {}, + * // "site": "my_site", + * // "status": "my_status", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.sites.domains.update * @memberOf! () * @@ -3221,6 +4753,76 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.sites.releases.create * @desc Creates a new release which makes the content of the specified version actively display on the appropriate URL(s). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebasehosting.sites.releases.create({ + * // Required. The site that the release belongs to, in the format: + * // sites/site-name + * parent: 'sites/my-site', + * // The unique identifier for a version, in the format: + * // /sites/site-name/versions/versionID + * // The site-name in this version identifier must match the + * // site-name in the `parent` parameter. + * //
                          + * //
                          This query parameter must be empty if the `type` field in the + * // request body is `SITE_DISABLE`. + * versionName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "message": "my_message", + * // "name": "my_name", + * // "releaseTime": "my_releaseTime", + * // "releaseUser": {}, + * // "type": "my_type", + * // "version": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "message": "my_message", + * // "name": "my_name", + * // "releaseTime": "my_releaseTime", + * // "releaseUser": {}, + * // "type": "my_type", + * // "version": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.sites.releases.create * @memberOf! () * @@ -3296,6 +4898,57 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.sites.releases.list * @desc Lists the releases that have been created on the specified site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebasehosting.sites.releases.list({ + * // The page size to return. Defaults to 100. + * pageSize: 'placeholder-value', + * // The next_page_token from a previous request, if provided. + * pageToken: 'placeholder-value', + * // Required. The parent for which to list files, in the format: + * // sites/site-name + * parent: 'sites/my-site', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "releases": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.sites.releases.list * @memberOf! () * @@ -3426,6 +5079,88 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.sites.versions.create * @desc Creates a new version for a site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebasehosting.sites.versions.create({ + * // Required. The parent to create the version for, in the format: + * // sites/site-name + * parent: 'sites/my-site', + * // The self-reported size of the version. This value is used for a pre-emptive + * // quota check for legacy version uploads. + * sizeBytes: 'placeholder-value', + * // A unique id for the new version. This is only specified for legacy version + * // creations. + * versionId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "createTime": "my_createTime", + * // "createUser": {}, + * // "deleteTime": "my_deleteTime", + * // "deleteUser": {}, + * // "fileCount": "my_fileCount", + * // "finalizeTime": "my_finalizeTime", + * // "finalizeUser": {}, + * // "labels": {}, + * // "name": "my_name", + * // "preview": {}, + * // "status": "my_status", + * // "versionBytes": "my_versionBytes" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "config": {}, + * // "createTime": "my_createTime", + * // "createUser": {}, + * // "deleteTime": "my_deleteTime", + * // "deleteUser": {}, + * // "fileCount": "my_fileCount", + * // "finalizeTime": "my_finalizeTime", + * // "finalizeUser": {}, + * // "labels": {}, + * // "name": "my_name", + * // "preview": {}, + * // "status": "my_status", + * // "versionBytes": "my_versionBytes" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.sites.versions.create * @memberOf! () * @@ -3502,6 +5237,48 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.sites.versions.delete * @desc Deletes the specified version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebasehosting.sites.versions.delete({ + * // Required. The name of the version to be deleted, in the format: + * // sites/site-name/versions/versionID + * name: 'sites/my-site/versions/my-version', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.sites.versions.delete * @memberOf! () * @@ -3572,6 +5349,65 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.sites.versions.list * @desc Lists the versions that have been created on the specified site. Will include filtering in the future. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebasehosting.sites.versions.list({ + * // The filter string used to return a subset of versions in the response. + * // Currently supported fields for filtering are: name, status, + * // and create_time. Filter processing will be implemented in accordance + * // with go/filtering. + * filter: 'placeholder-value', + * // The maximum number of versions to return. The service may return fewer than + * // this value. + * // If unspecified, at most 25 versions will be returned. + * // The maximum value is 100; values above 100 will be coerced to 100 + * pageSize: 'placeholder-value', + * // The next_page_token from a previous request, if provided. + * pageToken: 'placeholder-value', + * // Required. The parent for which to list files, in the format: + * // sites/site-name + * parent: 'sites/my-site', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "versions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.sites.versions.list * @memberOf! () * @@ -3652,6 +5488,90 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.sites.versions.patch * @desc Updates the specified metadata for a version. Note that this method will fail with `FAILED_PRECONDITION` in the event of an invalid state transition. The only valid transition for a version is currently from a `CREATED` status to a `FINALIZED` status. Use [`DeleteVersion`](../sites.versions/delete) to set the status of a version to `DELETED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebasehosting.sites.versions.patch({ + * // The unique identifier for a version, in the format: + * // sites/site-name/versions/versionID + * // This name is provided in the response body when you call the + * // [`CreateVersion`](../sites.versions/create) endpoint. + * name: 'sites/my-site/versions/my-version', + * // A set of field names from your [version](../sites.versions) that you want + * // to update. + * //
                          A field will be overwritten if, and only if, it's in the mask. + * //
                          If a mask is not provided then a default mask of only + * // [`status`](../sites.versions#Version.FIELDS.status) will be used. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "createTime": "my_createTime", + * // "createUser": {}, + * // "deleteTime": "my_deleteTime", + * // "deleteUser": {}, + * // "fileCount": "my_fileCount", + * // "finalizeTime": "my_finalizeTime", + * // "finalizeUser": {}, + * // "labels": {}, + * // "name": "my_name", + * // "preview": {}, + * // "status": "my_status", + * // "versionBytes": "my_versionBytes" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "config": {}, + * // "createTime": "my_createTime", + * // "createUser": {}, + * // "deleteTime": "my_deleteTime", + * // "deleteUser": {}, + * // "fileCount": "my_fileCount", + * // "finalizeTime": "my_finalizeTime", + * // "finalizeUser": {}, + * // "labels": {}, + * // "name": "my_name", + * // "preview": {}, + * // "status": "my_status", + * // "versionBytes": "my_versionBytes" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.sites.versions.patch * @memberOf! () * @@ -3724,6 +5644,59 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.sites.versions.populateFiles * @desc Adds content files to a version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebasehosting.sites.versions.populateFiles({ + * // Required. The version to add files to, in the format: + * // sites/site-name/versions/versionID + * parent: 'sites/my-site/versions/my-version', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "files": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "uploadRequiredHashes": [], + * // "uploadUrl": "my_uploadUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.sites.versions.populateFiles * @memberOf! () * @@ -3916,6 +5889,60 @@ export namespace firebasehosting_v1beta1 { /** * firebasehosting.sites.versions.files.list * @desc Lists the remaining files to be uploaded for the specified version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebasehosting.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 firebasehosting = google.firebasehosting('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebasehosting.sites.versions.files.list({ + * // The page size to return. Defaults to 1000. + * pageSize: 'placeholder-value', + * // The next_page_token from a previous request, if provided. This will be the + * // encoded version of a firebase.hosting.proto.metadata.ListFilesPageToken. + * pageToken: 'placeholder-value', + * // Required. The parent to list files for, in the format: + * // sites/site-name/versions/versionID + * parent: 'sites/my-site/versions/my-version', + * // The type of files in the version that should be listed. + * status: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "files": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebasehosting.sites.versions.files.list * @memberOf! () * diff --git a/src/apis/firebaseml/v1beta2.ts b/src/apis/firebaseml/v1beta2.ts index e3e1782b09c..495389651ac 100644 --- a/src/apis/firebaseml/v1beta2.ts +++ b/src/apis/firebaseml/v1beta2.ts @@ -274,6 +274,68 @@ export namespace firebaseml_v1beta2 { /** * firebaseml.projects.models.create * @desc Creates a model in Firebase ML. The longrunning operation will eventually return a Model + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebaseml.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 firebaseml = google.firebaseml('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 firebaseml.projects.models.create({ + * // Required. The parent project resource where the model is to be created. + * // The parent must have the form `projects/{project_id}` + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "activeOperations": [], + * // "createTime": "my_createTime", + * // "displayName": "my_displayName", + * // "etag": "my_etag", + * // "modelHash": "my_modelHash", + * // "name": "my_name", + * // "state": {}, + * // "tags": [], + * // "tfliteModel": {}, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebaseml.projects.models.create * @memberOf! () * @@ -349,6 +411,45 @@ export namespace firebaseml_v1beta2 { /** * firebaseml.projects.models.delete * @desc Deletes a model + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebaseml.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 firebaseml = google.firebaseml('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 firebaseml.projects.models.delete({ + * // Required. The name of the model to delete. + * // The name must have the form `projects/{project_id}/models/{model_id}` + * name: 'projects/my-project/models/my-model', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebaseml.projects.models.delete * @memberOf! () * @@ -418,6 +519,56 @@ export namespace firebaseml_v1beta2 { /** * firebaseml.projects.models.get * @desc Gets a model resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebaseml.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 firebaseml = google.firebaseml('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 firebaseml.projects.models.get({ + * // Required. The name of the model to get. + * // The name must have the form `projects/{project_id}/models/{model_id}` + * name: 'projects/my-project/models/my-model', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeOperations": [], + * // "createTime": "my_createTime", + * // "displayName": "my_displayName", + * // "etag": "my_etag", + * // "modelHash": "my_modelHash", + * // "name": "my_name", + * // "state": {}, + * // "tags": [], + * // "tfliteModel": {}, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebaseml.projects.models.get * @memberOf! () * @@ -487,6 +638,55 @@ export namespace firebaseml_v1beta2 { /** * firebaseml.projects.models.list * @desc Lists the models + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebaseml.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 firebaseml = google.firebaseml('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 firebaseml.projects.models.list({ + * // A filter for the list + * // e.g. 'tags: abc' to list models which are tagged with "abc" + * filter: 'placeholder-value', + * // The maximum number of items to return + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // Required. The name of the parent to list models for. + * // The parent must have the form `projects/{project_id}' + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "models": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebaseml.projects.models.list * @memberOf! () * @@ -564,6 +764,71 @@ export namespace firebaseml_v1beta2 { /** * firebaseml.projects.models.patch * @desc Updates a model. The longrunning operation will eventually return a Model. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebaseml.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 firebaseml = google.firebaseml('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 firebaseml.projects.models.patch({ + * // The resource name of the Model. + * // Model names have the form `projects/{project_id}/models/{model_id}` + * // The name is ignored when creating a model. + * name: 'projects/my-project/models/my-model', + * // The update mask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "activeOperations": [], + * // "createTime": "my_createTime", + * // "displayName": "my_displayName", + * // "etag": "my_etag", + * // "modelHash": "my_modelHash", + * // "name": "my_name", + * // "state": {}, + * // "tags": [], + * // "tfliteModel": {}, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebaseml.projects.models.patch * @memberOf! () * @@ -731,6 +996,50 @@ export namespace firebaseml_v1beta2 { /** * firebaseml.projects.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebaseml.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 firebaseml = google.firebaseml('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 firebaseml.projects.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebaseml.projects.operations.get * @memberOf! () * diff --git a/src/apis/firebaserules/v1.ts b/src/apis/firebaserules/v1.ts index 4aafaa1a03a..dc6d024ddf3 100644 --- a/src/apis/firebaserules/v1.ts +++ b/src/apis/firebaserules/v1.ts @@ -510,6 +510,66 @@ export namespace firebaserules_v1 { /** * firebaserules.projects.test * @desc Test `Source` for syntactic and semantic correctness. Issues present, if any, will be returned to the caller with a description, severity, and source location. The test method may be executed with `Source` or a `Ruleset` name. Passing `Source` is useful for unit testing new rules. Passing a `Ruleset` name is useful for regression testing an existing rule. The following is an example of `Source` that permits users to upload images to a bucket bearing their user id and matching the correct metadata: _*Example*_ // Users are allowed to subscribe and unsubscribe to the blog. service firebase.storage { match /users/{userId}/images/{imageName} { allow write: if userId == request.auth.uid && (imageName.matches('*.png$') || imageName.matches('*.jpg$')) && resource.mimeType.matches('^image/') } } + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebaserules.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 firebaserules = google.firebaserules('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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebaserules.projects.test({ + * // Tests may either provide `source` or a `Ruleset` resource name. + * // + * // For tests against `source`, the resource name must refer to the project: + * // Format: `projects/{project_id}` + * // + * // For tests against a `Ruleset`, this must be the `Ruleset` resource name: + * // Format: `projects/{project_id}/rulesets/{ruleset_id}` + * name: 'projects/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "source": {}, + * // "testSuite": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "issues": [], + * // "testResults": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebaserules.projects.test * @memberOf! () * @@ -606,6 +666,65 @@ export namespace firebaserules_v1 { /** * firebaserules.projects.releases.create * @desc Create a `Release`. Release names should reflect the developer's deployment practices. For example, the release name may include the environment name, application name, application version, or any other name meaningful to the developer. Once a `Release` refers to a `Ruleset`, the rules can be enforced by Firebase Rules-enabled services. More than one `Release` may be 'live' concurrently. Consider the following three `Release` names for `projects/foo` and the `Ruleset` to which they refer. Release Name | Ruleset Name --------------------------------|------------- projects/foo/releases/prod | projects/foo/rulesets/uuid123 projects/foo/releases/prod/beta | projects/foo/rulesets/uuid123 projects/foo/releases/prod/v23 | projects/foo/rulesets/uuid456 The table reflects the `Ruleset` rollout in progress. The `prod` and `prod/beta` releases refer to the same `Ruleset`. However, `prod/v23` refers to a new `Ruleset`. The `Ruleset` reference for a `Release` may be updated using the UpdateRelease method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebaserules.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 firebaserules = google.firebaserules('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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebaserules.projects.releases.create({ + * // Resource name for the project which owns this `Release`. + * // + * // Format: `projects/{project_id}` + * name: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "name": "my_name", + * // "rulesetName": "my_rulesetName", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "name": "my_name", + * // "rulesetName": "my_rulesetName", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebaserules.projects.releases.create * @memberOf! () * @@ -680,6 +799,49 @@ export namespace firebaserules_v1 { /** * firebaserules.projects.releases.delete * @desc Delete a `Release` by resource name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebaserules.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 firebaserules = google.firebaserules('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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebaserules.projects.releases.delete({ + * // Resource name for the `Release` to delete. + * // + * // Format: `projects/{project_id}/releases/{release_id}` + * name: 'projects/my-project/releases/.*', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebaserules.projects.releases.delete * @memberOf! () * @@ -750,6 +912,55 @@ export namespace firebaserules_v1 { /** * firebaserules.projects.releases.get * @desc Get a `Release` by name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebaserules.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 firebaserules = google.firebaserules('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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebaserules.projects.releases.get({ + * // Resource name of the `Release`. + * // + * // Format: `projects/{project_id}/releases/{release_id}` + * name: 'projects/my-project/releases/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "name": "my_name", + * // "rulesetName": "my_rulesetName", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebaserules.projects.releases.get * @memberOf! () * @@ -820,6 +1031,60 @@ export namespace firebaserules_v1 { /** * firebaserules.projects.releases.getExecutable * @desc Get the `Release` executable to use when enforcing rules. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebaserules.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 firebaserules = google.firebaserules('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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebaserules.projects.releases.getExecutable({ + * // The requested runtime executable version. + * // Defaults to FIREBASE_RULES_EXECUTABLE_V1. + * executableVersion: 'placeholder-value', + * // Resource name of the `Release`. + * // + * // Format: `projects/{project_id}/releases/{release_id}` + * name: 'projects/my-project/releases/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executable": "my_executable", + * // "executableVersion": "my_executableVersion", + * // "language": "my_language", + * // "rulesetName": "my_rulesetName", + * // "syncTime": "my_syncTime", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebaserules.projects.releases.getExecutable * @memberOf! () * @@ -905,6 +1170,86 @@ export namespace firebaserules_v1 { /** * firebaserules.projects.releases.list * @desc List the `Release` values for a project. This list may optionally be filtered by `Release` name, `Ruleset` name, `TestSuite` name, or any combination thereof. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebaserules.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 firebaserules = google.firebaserules('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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebaserules.projects.releases.list({ + * // `Release` filter. The list method supports filters with restrictions on the + * // `Release.name`, `Release.ruleset_name`, and `Release.test_suite_name`. + * // + * // Example 1: A filter of 'name=prod*' might return `Release`s with names + * // within 'projects/foo' prefixed with 'prod': + * // + * // Name | Ruleset Name + * // ------------------------------|------------- + * // projects/foo/releases/prod | projects/foo/rulesets/uuid1234 + * // projects/foo/releases/prod/v1 | projects/foo/rulesets/uuid1234 + * // projects/foo/releases/prod/v2 | projects/foo/rulesets/uuid8888 + * // + * // Example 2: A filter of `name=prod* ruleset_name=uuid1234` would return only + * // `Release` instances for 'projects/foo' with names prefixed with 'prod' + * // referring to the same `Ruleset` name of 'uuid1234': + * // + * // Name | Ruleset Name + * // ------------------------------|------------- + * // projects/foo/releases/prod | projects/foo/rulesets/1234 + * // projects/foo/releases/prod/v1 | projects/foo/rulesets/1234 + * // + * // In the examples, the filter parameters refer to the search filters are + * // relative to the project. Fully qualified prefixed may also be used. e.g. + * // `test_suite_name=projects/foo/testsuites/uuid1` + * filter: 'placeholder-value', + * // Resource name for the project. + * // + * // Format: `projects/{project_id}` + * name: 'projects/my-project', + * // Page size to load. Maximum of 100. Defaults to 10. + * // Note: `page_size` is just a hint and the service may choose to load fewer + * // than `page_size` results due to the size of the output. To traverse all of + * // the releases, the caller should iterate until the `page_token` on the + * // response is empty. + * pageSize: 'placeholder-value', + * // Next page token for the next batch of `Release` instances. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "releases": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebaserules.projects.releases.list * @memberOf! () * @@ -985,6 +1330,63 @@ export namespace firebaserules_v1 { /** * firebaserules.projects.releases.patch * @desc Update a `Release` via PATCH. Only updates to the `ruleset_name` and `test_suite_name` fields will be honored. `Release` rename is not supported. To create a `Release` use the CreateRelease method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebaserules.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 firebaserules = google.firebaserules('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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebaserules.projects.releases.patch({ + * // Resource name for the project which owns this `Release`. + * // + * // Format: `projects/{project_id}` + * name: 'projects/my-project/releases/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "release": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "name": "my_name", + * // "rulesetName": "my_rulesetName", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebaserules.projects.releases.patch * @memberOf! () * @@ -1162,6 +1564,65 @@ export namespace firebaserules_v1 { /** * firebaserules.projects.rulesets.create * @desc Create a `Ruleset` from `Source`. The `Ruleset` is given a unique generated name which is returned to the caller. `Source` containing syntactic or semantics errors will result in an error response indicating the first error encountered. For a detailed view of `Source` issues, use TestRuleset. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebaserules.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 firebaserules = google.firebaserules('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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebaserules.projects.rulesets.create({ + * // Resource name for Project which owns this `Ruleset`. + * // + * // Format: `projects/{project_id}` + * name: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "metadata": {}, + * // "name": "my_name", + * // "source": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "metadata": {}, + * // "name": "my_name", + * // "source": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebaserules.projects.rulesets.create * @memberOf! () * @@ -1236,6 +1697,49 @@ export namespace firebaserules_v1 { /** * firebaserules.projects.rulesets.delete * @desc Delete a `Ruleset` by resource name. If the `Ruleset` is referenced by a `Release` the operation will fail. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebaserules.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 firebaserules = google.firebaserules('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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 firebaserules.projects.rulesets.delete({ + * // Resource name for the ruleset to delete. + * // + * // Format: `projects/{project_id}/rulesets/{ruleset_id}` + * name: 'projects/my-project/rulesets/my-ruleset', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebaserules.projects.rulesets.delete * @memberOf! () * @@ -1306,6 +1810,55 @@ export namespace firebaserules_v1 { /** * firebaserules.projects.rulesets.get * @desc Get a `Ruleset` by name including the full `Source` contents. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebaserules.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 firebaserules = google.firebaserules('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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebaserules.projects.rulesets.get({ + * // Resource name for the ruleset to get. + * // + * // Format: `projects/{project_id}/rulesets/{ruleset_id}` + * name: 'projects/my-project/rulesets/my-ruleset', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "metadata": {}, + * // "name": "my_name", + * // "source": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebaserules.projects.rulesets.get * @memberOf! () * @@ -1376,6 +1929,68 @@ export namespace firebaserules_v1 { /** * firebaserules.projects.rulesets.list * @desc List `Ruleset` metadata only and optionally filter the results by `Ruleset` name. The full `Source` contents of a `Ruleset` may be retrieved with GetRuleset. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firebaserules.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 firebaserules = google.firebaserules('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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * 'https://www.googleapis.com/auth/firebase.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 firebaserules.projects.rulesets.list({ + * // `Ruleset` filter. The list method supports filters with restrictions on + * // `Ruleset.name`. + * // + * // Filters on `Ruleset.create_time` should use the `date` function which + * // parses strings that conform to the RFC 3339 date/time specifications. + * // + * // Example: `create_time > date("2017-01-01T00:00:00Z") AND name=UUID-*` + * filter: 'placeholder-value', + * // Resource name for the project. + * // + * // Format: `projects/{project_id}` + * name: 'projects/my-project', + * // Page size to load. Maximum of 100. Defaults to 10. + * // Note: `page_size` is just a hint and the service may choose to load less + * // than `page_size` due to the size of the output. To traverse all of the + * // releases, caller should iterate until the `page_token` is empty. + * pageSize: 'placeholder-value', + * // Next page token for loading the next batch of `Ruleset` instances. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "rulesets": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firebaserules.projects.rulesets.list * @memberOf! () * diff --git a/src/apis/firestore/v1.ts b/src/apis/firestore/v1.ts index 6ea4e108e57..531da2251d0 100644 --- a/src/apis/firestore/v1.ts +++ b/src/apis/firestore/v1.ts @@ -1333,6 +1333,63 @@ export namespace firestore_v1 { /** * firestore.projects.databases.exportDocuments * @desc Exports a copy of all or a subset of documents from Google Cloud Firestore to another storage system, such as Google Cloud Storage. Recent updates to documents may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.exportDocuments({ + * // Required. Database to export. Should be of the form: + * // `projects/{project_id}/databases/{database_id}`. + * name: 'projects/my-project/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "collectionIds": [], + * // "outputUriPrefix": "my_outputUriPrefix" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.exportDocuments * @memberOf! () * @@ -1415,6 +1472,63 @@ export namespace firestore_v1 { /** * firestore.projects.databases.importDocuments * @desc Imports documents into Google Cloud Firestore. Existing documents with the same name are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportDocuments operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Firestore. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.importDocuments({ + * // Required. Database to import into. Should be of the form: + * // `projects/{project_id}/databases/{database_id}`. + * name: 'projects/my-project/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "collectionIds": [], + * // "inputUriPrefix": "my_inputUriPrefix" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.importDocuments * @memberOf! () * @@ -1554,6 +1668,52 @@ export namespace firestore_v1 { /** * firestore.projects.databases.collectionGroups.fields.get * @desc Gets the metadata and configuration for a Field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.collectionGroups.fields.get({ + * // Required. A name of the form + * // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` + * name: + * 'projects/my-project/databases/my-database/collectionGroups/my-collectionGroup/fields/my-field', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "indexConfig": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.collectionGroups.fields.get * @memberOf! () * @@ -1632,6 +1792,64 @@ export namespace firestore_v1 { /** * firestore.projects.databases.collectionGroups.fields.list * @desc Lists the field configuration and metadata for this database. Currently, FirestoreAdmin.ListFields only supports listing fields that have been explicitly overridden. To issue this query, call FirestoreAdmin.ListFields with the filter set to `indexConfig.usesAncestorConfig:false`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.collectionGroups.fields.list({ + * // The filter to apply to list results. Currently, + * // FirestoreAdmin.ListFields only supports listing fields + * // that have been explicitly overridden. To issue this query, call + * // FirestoreAdmin.ListFields with the filter set to + * // `indexConfig.usesAncestorConfig:false`. + * filter: 'placeholder-value', + * // The number of results to return. + * pageSize: 'placeholder-value', + * // A page token, returned from a previous call to + * // FirestoreAdmin.ListFields, that may be used to get the next + * // page of results. + * pageToken: 'placeholder-value', + * // Required. A parent name of the form + * // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * parent: + * 'projects/my-project/databases/my-database/collectionGroups/my-collectionGroup', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "fields": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.collectionGroups.fields.list * @memberOf! () * @@ -1726,6 +1944,91 @@ export namespace firestore_v1 { /** * firestore.projects.databases.collectionGroups.fields.patch * @desc Updates a field configuration. Currently, field updates apply only to single field index configuration. However, calls to FirestoreAdmin.UpdateField should provide a field mask to avoid changing any configuration that the caller isn't aware of. The field mask should be specified as: `{ paths: "index_config" }`. This call returns a google.longrunning.Operation which may be used to track the status of the field update. The metadata for the operation will be the type FieldOperationMetadata. To configure the default field settings for the database, use the special `Field` with resource name: `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/x`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.collectionGroups.fields.patch({ + * // A field name of the form + * // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` + * // + * // A field path may be a simple field name, e.g. `address` or a path to fields + * // within map_value , e.g. `address.city`, + * // or a special field path. The only valid special field is `*`, which + * // represents any field. + * // + * // Field paths may be quoted using ` (backtick). The only character that needs + * // to be escaped within a quoted field path is the backtick character itself, + * // escaped using a backslash. Special characters in field paths that + * // must be quoted include: `*`, `.`, + * // ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. + * // + * // Examples: + * // (Note: Comments here are written in markdown syntax, so there is an + * // additional layer of backticks to represent a code block) + * // `\`address.city\`` represents a field named `address.city`, not the map key + * // `city` in the field `address`. + * // `\`*\`` represents a field named `*`, not any field. + * // + * // A special `Field` contains the default indexing settings for all fields. + * // This field's resource name is: + * // `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/x` + * // Indexes defined on this `Field` will be applied to all fields which do not + * // have their own `Field` index configuration. + * name: + * 'projects/my-project/databases/my-database/collectionGroups/my-collectionGroup/fields/my-field', + * // A mask, relative to the field. If specified, only configuration specified + * // by this field_mask will be updated in the field. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "indexConfig": {}, + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.collectionGroups.fields.patch * @memberOf! () * @@ -1871,6 +2174,68 @@ export namespace firestore_v1 { /** * firestore.projects.databases.collectionGroups.indexes.create * @desc Creates a composite index. This returns a google.longrunning.Operation which may be used to track the status of the creation. The metadata for the operation will be the type IndexOperationMetadata. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.collectionGroups.indexes.create( + * { + * // Required. A parent name of the form + * // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * parent: + * 'projects/my-project/databases/my-database/collectionGroups/my-collectionGroup', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fields": [], + * // "name": "my_name", + * // "queryScope": "my_queryScope", + * // "state": "my_state" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.collectionGroups.indexes.create * @memberOf! () * @@ -1953,6 +2318,51 @@ export namespace firestore_v1 { /** * firestore.projects.databases.collectionGroups.indexes.delete * @desc Deletes a composite index. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.collectionGroups.indexes.delete( + * { + * // Required. A name of the form + * // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * name: + * 'projects/my-project/databases/my-database/collectionGroups/my-collectionGroup/indexes/my-indexe', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.collectionGroups.indexes.delete * @memberOf! () * @@ -2022,6 +2432,54 @@ export namespace firestore_v1 { /** * firestore.projects.databases.collectionGroups.indexes.get * @desc Gets a composite index. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.collectionGroups.indexes.get({ + * // Required. A name of the form + * // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * name: + * 'projects/my-project/databases/my-database/collectionGroups/my-collectionGroup/indexes/my-indexe', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "fields": [], + * // "name": "my_name", + * // "queryScope": "my_queryScope", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.collectionGroups.indexes.get * @memberOf! () * @@ -2100,6 +2558,60 @@ export namespace firestore_v1 { /** * firestore.projects.databases.collectionGroups.indexes.list * @desc Lists composite indexes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.collectionGroups.indexes.list({ + * // The filter to apply to list results. + * filter: 'placeholder-value', + * // The number of results to return. + * pageSize: 'placeholder-value', + * // A page token, returned from a previous call to + * // FirestoreAdmin.ListIndexes, that may be used to get the next + * // page of results. + * pageToken: 'placeholder-value', + * // Required. A parent name of the form + * // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * parent: + * 'projects/my-project/databases/my-database/collectionGroups/my-collectionGroup', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "indexes": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.collectionGroups.indexes.list * @memberOf! () * @@ -2273,6 +2785,65 @@ export namespace firestore_v1 { /** * firestore.projects.databases.documents.batchGet * @desc Gets multiple documents. Documents returned by this method are not guaranteed to be returned in the same order that they were requested. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.batchGet({ + * // Required. The database name. In the format: + * // `projects/{project_id}/databases/{database_id}`. + * database: 'projects/my-project/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "documents": [], + * // "mask": {}, + * // "newTransaction": {}, + * // "readTime": "my_readTime", + * // "transaction": "my_transaction" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "found": {}, + * // "missing": "my_missing", + * // "readTime": "my_readTime", + * // "transaction": "my_transaction" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.batchGet * @memberOf! () * @@ -2355,6 +2926,58 @@ export namespace firestore_v1 { /** * firestore.projects.databases.documents.beginTransaction * @desc Starts a new transaction. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.beginTransaction({ + * // Required. The database name. In the format: + * // `projects/{project_id}/databases/{database_id}`. + * database: 'projects/my-project/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "transaction": "my_transaction" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.beginTransaction * @memberOf! () * @@ -2433,6 +3056,60 @@ export namespace firestore_v1 { /** * firestore.projects.databases.documents.commit * @desc Commits a transaction, while optionally updating documents. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.commit({ + * // Required. The database name. In the format: + * // `projects/{project_id}/databases/{database_id}`. + * database: 'projects/my-project/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "transaction": "my_transaction", + * // "writes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "commitTime": "my_commitTime", + * // "writeResults": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.commit * @memberOf! () * @@ -2508,6 +3185,74 @@ export namespace firestore_v1 { /** * firestore.projects.databases.documents.createDocument * @desc Creates a new document. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.createDocument({ + * // Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`. + * collectionId: 'placeholder-value', + * // The client-assigned document ID to use for this document. + * // + * // Optional. If not specified, an ID will be assigned by the service. + * documentId: 'placeholder-value', + * // The list of field paths in the mask. See Document.fields for a field + * // path syntax reference. + * 'mask.fieldPaths': 'placeholder-value', + * // Required. The parent resource. For example: + * // `projects/{project_id}/databases/{database_id}/documents` or + * // `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` + * parent: 'projects/my-project/databases/my-database/documents/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "fields": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "fields": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.createDocument * @memberOf! () * @@ -2584,6 +3329,54 @@ export namespace firestore_v1 { /** * firestore.projects.databases.documents.delete * @desc Deletes a document. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.delete({ + * // When set to `true`, the target document must exist. + * // When set to `false`, the target document must not exist. + * 'currentDocument.exists': 'placeholder-value', + * // When set, the target document must exist and have been last updated at + * // that time. + * 'currentDocument.updateTime': 'placeholder-value', + * // Required. The resource name of the Document to delete. In the format: + * // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * name: 'projects/my-project/databases/my-database/documents/my-document/.*', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.delete * @memberOf! () * @@ -2655,6 +3448,61 @@ export namespace firestore_v1 { /** * firestore.projects.databases.documents.get * @desc Gets a single document. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.get({ + * // The list of field paths in the mask. See Document.fields for a field + * // path syntax reference. + * 'mask.fieldPaths': 'placeholder-value', + * // Required. The resource name of the Document to get. In the format: + * // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * name: 'projects/my-project/databases/my-database/documents/my-document/.*', + * // Reads the version of the document at the given time. + * // This may not be older than 270 seconds. + * readTime: 'placeholder-value', + * // Reads the document in a transaction. + * transaction: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "fields": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.get * @memberOf! () * @@ -2727,6 +3575,81 @@ export namespace firestore_v1 { /** * firestore.projects.databases.documents.list * @desc Lists documents. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.list({ + * // Required. The collection ID, relative to `parent`, to list. For example: `chatrooms` + * // or `messages`. + * collectionId: 'placeholder-value', + * // The list of field paths in the mask. See Document.fields for a field + * // path syntax reference. + * 'mask.fieldPaths': 'placeholder-value', + * // The order to sort results by. For example: `priority desc, name`. + * orderBy: 'placeholder-value', + * // The maximum number of documents to return. + * pageSize: 'placeholder-value', + * // The `next_page_token` value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // Required. The parent resource name. In the format: + * // `projects/{project_id}/databases/{database_id}/documents` or + * // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * // For example: + * // `projects/my-project/databases/my-database/documents` or + * // `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * parent: + * 'projects/my-project/databases/my-database/documents/my-document/.*', + * // Reads documents as they were at the given time. + * // This may not be older than 270 seconds. + * readTime: 'placeholder-value', + * // If the list should show missing documents. A missing document is a + * // document that does not exist but has sub-documents. These documents will + * // be returned with a key but will not have fields, Document.create_time, + * // or Document.update_time set. + * // + * // Requests with `show_missing` may not specify `where` or + * // `order_by`. + * showMissing: 'placeholder-value', + * // Reads documents in a transaction. + * transaction: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "documents": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.list * @memberOf! () * @@ -2811,6 +3734,63 @@ export namespace firestore_v1 { /** * firestore.projects.databases.documents.listCollectionIds * @desc Lists all the collection IDs underneath a document. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.listCollectionIds({ + * // Required. The parent document. In the format: + * // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * // For example: + * // `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * parent: + * 'projects/my-project/databases/my-database/documents/my-document/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "pageSize": 0, + * // "pageToken": "my_pageToken" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "collectionIds": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.listCollectionIds * @memberOf! () * @@ -2893,6 +3873,64 @@ export namespace firestore_v1 { /** * firestore.projects.databases.documents.listen * @desc Listens to changes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.listen({ + * // Required. The database name. In the format: + * // `projects/{project_id}/databases/{database_id}`. + * database: 'projects/my-project/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "addTarget": {}, + * // "labels": {}, + * // "removeTarget": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "documentChange": {}, + * // "documentDelete": {}, + * // "documentRemove": {}, + * // "filter": {}, + * // "targetChange": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.listen * @memberOf! () * @@ -2968,6 +4006,76 @@ export namespace firestore_v1 { /** * firestore.projects.databases.documents.patch * @desc Updates or inserts a document. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.patch({ + * // When set to `true`, the target document must exist. + * // When set to `false`, the target document must not exist. + * 'currentDocument.exists': 'placeholder-value', + * // When set, the target document must exist and have been last updated at + * // that time. + * 'currentDocument.updateTime': 'placeholder-value', + * // The list of field paths in the mask. See Document.fields for a field + * // path syntax reference. + * 'mask.fieldPaths': 'placeholder-value', + * // The resource name of the document, for example + * // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * name: 'projects/my-project/databases/my-database/documents/my-document/.*', + * // The list of field paths in the mask. See Document.fields for a field + * // path syntax reference. + * 'updateMask.fieldPaths': 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "fields": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "fields": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.patch * @memberOf! () * @@ -3042,6 +4150,56 @@ export namespace firestore_v1 { /** * firestore.projects.databases.documents.rollback * @desc Rolls back a transaction. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.rollback({ + * // Required. The database name. In the format: + * // `projects/{project_id}/databases/{database_id}`. + * database: 'projects/my-project/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "transaction": "my_transaction" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.rollback * @memberOf! () * @@ -3115,6 +4273,69 @@ export namespace firestore_v1 { /** * firestore.projects.databases.documents.runQuery * @desc Runs a query. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.runQuery({ + * // Required. The parent resource name. In the format: + * // `projects/{project_id}/databases/{database_id}/documents` or + * // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * // For example: + * // `projects/my-project/databases/my-database/documents` or + * // `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * parent: + * 'projects/my-project/databases/my-database/documents/my-document/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "newTransaction": {}, + * // "readTime": "my_readTime", + * // "structuredQuery": {}, + * // "transaction": "my_transaction" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "document": {}, + * // "readTime": "my_readTime", + * // "skippedResults": 0, + * // "transaction": "my_transaction" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.runQuery * @memberOf! () * @@ -3190,6 +4411,65 @@ export namespace firestore_v1 { /** * firestore.projects.databases.documents.write * @desc Streams batches of document updates and deletes, in order. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.write({ + * // Required. The database name. In the format: + * // `projects/{project_id}/databases/{database_id}`. + * // This is only required in the first message. + * database: 'projects/my-project/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labels": {}, + * // "streamId": "my_streamId", + * // "streamToken": "my_streamToken", + * // "writes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "commitTime": "my_commitTime", + * // "streamId": "my_streamId", + * // "streamToken": "my_streamToken", + * // "writeResults": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.write * @memberOf! () * @@ -3559,6 +4839,53 @@ export namespace firestore_v1 { /** * firestore.projects.databases.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/databases/my-database/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.operations.cancel * @memberOf! () * @@ -3629,6 +4956,47 @@ export namespace firestore_v1 { /** * firestore.projects.databases.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/databases/my-database/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.operations.delete * @memberOf! () * @@ -3698,6 +5066,53 @@ export namespace firestore_v1 { /** * firestore.projects.databases.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/databases/my-database/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.operations.get * @memberOf! () * @@ -3776,6 +5191,56 @@ export namespace firestore_v1 { /** * firestore.projects.databases.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/databases/my-database', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.operations.list * @memberOf! () * @@ -3943,6 +5408,53 @@ export namespace firestore_v1 { /** * firestore.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.locations.get * @memberOf! () * @@ -4012,6 +5524,56 @@ export namespace firestore_v1 { /** * firestore.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.locations.list * @memberOf! () * diff --git a/src/apis/firestore/v1beta1.ts b/src/apis/firestore/v1beta1.ts index e769a396c60..9b90d4ac3d1 100644 --- a/src/apis/firestore/v1beta1.ts +++ b/src/apis/firestore/v1beta1.ts @@ -1173,6 +1173,63 @@ export namespace firestore_v1beta1 { /** * firestore.projects.databases.exportDocuments * @desc Exports a copy of all or a subset of documents from Google Cloud Firestore to another storage system, such as Google Cloud Storage. Recent updates to documents may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.exportDocuments({ + * // Database to export. Should be of the form: + * // `projects/{project_id}/databases/{database_id}`. + * name: 'projects/my-project/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "collectionIds": [], + * // "outputUriPrefix": "my_outputUriPrefix" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.exportDocuments * @memberOf! () * @@ -1255,6 +1312,63 @@ export namespace firestore_v1beta1 { /** * firestore.projects.databases.importDocuments * @desc Imports documents into Google Cloud Firestore. Existing documents with the same name are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportDocuments operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Firestore. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.importDocuments({ + * // Database to import into. Should be of the form: + * // `projects/{project_id}/databases/{database_id}`. + * name: 'projects/my-project/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "collectionIds": [], + * // "inputUriPrefix": "my_inputUriPrefix" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.importDocuments * @memberOf! () * @@ -1379,6 +1493,65 @@ export namespace firestore_v1beta1 { /** * firestore.projects.databases.documents.batchGet * @desc Gets multiple documents. Documents returned by this method are not guaranteed to be returned in the same order that they were requested. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.batchGet({ + * // Required. The database name. In the format: + * // `projects/{project_id}/databases/{database_id}`. + * database: 'projects/my-project/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "documents": [], + * // "mask": {}, + * // "newTransaction": {}, + * // "readTime": "my_readTime", + * // "transaction": "my_transaction" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "found": {}, + * // "missing": "my_missing", + * // "readTime": "my_readTime", + * // "transaction": "my_transaction" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.batchGet * @memberOf! () * @@ -1461,6 +1634,58 @@ export namespace firestore_v1beta1 { /** * firestore.projects.databases.documents.beginTransaction * @desc Starts a new transaction. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.beginTransaction({ + * // Required. The database name. In the format: + * // `projects/{project_id}/databases/{database_id}`. + * database: 'projects/my-project/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "transaction": "my_transaction" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.beginTransaction * @memberOf! () * @@ -1539,6 +1764,60 @@ export namespace firestore_v1beta1 { /** * firestore.projects.databases.documents.commit * @desc Commits a transaction, while optionally updating documents. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.commit({ + * // Required. The database name. In the format: + * // `projects/{project_id}/databases/{database_id}`. + * database: 'projects/my-project/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "transaction": "my_transaction", + * // "writes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "commitTime": "my_commitTime", + * // "writeResults": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.commit * @memberOf! () * @@ -1614,6 +1893,74 @@ export namespace firestore_v1beta1 { /** * firestore.projects.databases.documents.createDocument * @desc Creates a new document. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.createDocument({ + * // Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`. + * collectionId: 'placeholder-value', + * // The client-assigned document ID to use for this document. + * // + * // Optional. If not specified, an ID will be assigned by the service. + * documentId: 'placeholder-value', + * // The list of field paths in the mask. See Document.fields for a field + * // path syntax reference. + * 'mask.fieldPaths': 'placeholder-value', + * // Required. The parent resource. For example: + * // `projects/{project_id}/databases/{database_id}/documents` or + * // `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` + * parent: 'projects/my-project/databases/my-database/documents/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "fields": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "fields": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.createDocument * @memberOf! () * @@ -1690,6 +2037,54 @@ export namespace firestore_v1beta1 { /** * firestore.projects.databases.documents.delete * @desc Deletes a document. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.delete({ + * // When set to `true`, the target document must exist. + * // When set to `false`, the target document must not exist. + * 'currentDocument.exists': 'placeholder-value', + * // When set, the target document must exist and have been last updated at + * // that time. + * 'currentDocument.updateTime': 'placeholder-value', + * // Required. The resource name of the Document to delete. In the format: + * // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * name: 'projects/my-project/databases/my-database/documents/my-document/.*', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.delete * @memberOf! () * @@ -1761,6 +2156,61 @@ export namespace firestore_v1beta1 { /** * firestore.projects.databases.documents.get * @desc Gets a single document. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.get({ + * // The list of field paths in the mask. See Document.fields for a field + * // path syntax reference. + * 'mask.fieldPaths': 'placeholder-value', + * // Required. The resource name of the Document to get. In the format: + * // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * name: 'projects/my-project/databases/my-database/documents/my-document/.*', + * // Reads the version of the document at the given time. + * // This may not be older than 270 seconds. + * readTime: 'placeholder-value', + * // Reads the document in a transaction. + * transaction: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "fields": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.get * @memberOf! () * @@ -1833,6 +2283,81 @@ export namespace firestore_v1beta1 { /** * firestore.projects.databases.documents.list * @desc Lists documents. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.list({ + * // Required. The collection ID, relative to `parent`, to list. For example: `chatrooms` + * // or `messages`. + * collectionId: 'placeholder-value', + * // The list of field paths in the mask. See Document.fields for a field + * // path syntax reference. + * 'mask.fieldPaths': 'placeholder-value', + * // The order to sort results by. For example: `priority desc, name`. + * orderBy: 'placeholder-value', + * // The maximum number of documents to return. + * pageSize: 'placeholder-value', + * // The `next_page_token` value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // Required. The parent resource name. In the format: + * // `projects/{project_id}/databases/{database_id}/documents` or + * // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * // For example: + * // `projects/my-project/databases/my-database/documents` or + * // `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * parent: + * 'projects/my-project/databases/my-database/documents/my-document/.*', + * // Reads documents as they were at the given time. + * // This may not be older than 270 seconds. + * readTime: 'placeholder-value', + * // If the list should show missing documents. A missing document is a + * // document that does not exist but has sub-documents. These documents will + * // be returned with a key but will not have fields, Document.create_time, + * // or Document.update_time set. + * // + * // Requests with `show_missing` may not specify `where` or + * // `order_by`. + * showMissing: 'placeholder-value', + * // Reads documents in a transaction. + * transaction: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "documents": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.list * @memberOf! () * @@ -1917,6 +2442,63 @@ export namespace firestore_v1beta1 { /** * firestore.projects.databases.documents.listCollectionIds * @desc Lists all the collection IDs underneath a document. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.listCollectionIds({ + * // Required. The parent document. In the format: + * // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * // For example: + * // `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * parent: + * 'projects/my-project/databases/my-database/documents/my-document/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "pageSize": 0, + * // "pageToken": "my_pageToken" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "collectionIds": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.listCollectionIds * @memberOf! () * @@ -1999,6 +2581,64 @@ export namespace firestore_v1beta1 { /** * firestore.projects.databases.documents.listen * @desc Listens to changes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.listen({ + * // Required. The database name. In the format: + * // `projects/{project_id}/databases/{database_id}`. + * database: 'projects/my-project/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "addTarget": {}, + * // "labels": {}, + * // "removeTarget": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "documentChange": {}, + * // "documentDelete": {}, + * // "documentRemove": {}, + * // "filter": {}, + * // "targetChange": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.listen * @memberOf! () * @@ -2074,6 +2714,76 @@ export namespace firestore_v1beta1 { /** * firestore.projects.databases.documents.patch * @desc Updates or inserts a document. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.patch({ + * // When set to `true`, the target document must exist. + * // When set to `false`, the target document must not exist. + * 'currentDocument.exists': 'placeholder-value', + * // When set, the target document must exist and have been last updated at + * // that time. + * 'currentDocument.updateTime': 'placeholder-value', + * // The list of field paths in the mask. See Document.fields for a field + * // path syntax reference. + * 'mask.fieldPaths': 'placeholder-value', + * // The resource name of the document, for example + * // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * name: 'projects/my-project/databases/my-database/documents/my-document/.*', + * // The list of field paths in the mask. See Document.fields for a field + * // path syntax reference. + * 'updateMask.fieldPaths': 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "fields": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "fields": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.patch * @memberOf! () * @@ -2148,6 +2858,56 @@ export namespace firestore_v1beta1 { /** * firestore.projects.databases.documents.rollback * @desc Rolls back a transaction. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.rollback({ + * // Required. The database name. In the format: + * // `projects/{project_id}/databases/{database_id}`. + * database: 'projects/my-project/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "transaction": "my_transaction" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.rollback * @memberOf! () * @@ -2221,6 +2981,69 @@ export namespace firestore_v1beta1 { /** * firestore.projects.databases.documents.runQuery * @desc Runs a query. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.runQuery({ + * // Required. The parent resource name. In the format: + * // `projects/{project_id}/databases/{database_id}/documents` or + * // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * // For example: + * // `projects/my-project/databases/my-database/documents` or + * // `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * parent: + * 'projects/my-project/databases/my-database/documents/my-document/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "newTransaction": {}, + * // "readTime": "my_readTime", + * // "structuredQuery": {}, + * // "transaction": "my_transaction" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "document": {}, + * // "readTime": "my_readTime", + * // "skippedResults": 0, + * // "transaction": "my_transaction" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.runQuery * @memberOf! () * @@ -2296,6 +3119,65 @@ export namespace firestore_v1beta1 { /** * firestore.projects.databases.documents.write * @desc Streams batches of document updates and deletes, in order. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.documents.write({ + * // Required. The database name. In the format: + * // `projects/{project_id}/databases/{database_id}`. + * // This is only required in the first message. + * database: 'projects/my-project/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labels": {}, + * // "streamId": "my_streamId", + * // "streamToken": "my_streamToken", + * // "writes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "commitTime": "my_commitTime", + * // "streamId": "my_streamId", + * // "streamToken": "my_streamToken", + * // "writeResults": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.documents.write * @memberOf! () * @@ -2665,6 +3547,65 @@ export namespace firestore_v1beta1 { /** * firestore.projects.databases.indexes.create * @desc Creates the specified index. A newly created index's initial state is `CREATING`. On completion of the returned google.longrunning.Operation, the state will be `READY`. If the index already exists, the call will return an `ALREADY_EXISTS` status. During creation, the process could result in an error, in which case the index will move to the `ERROR` state. The process can be recovered by fixing the data that caused the error, removing the index with delete, then re-creating the index with create. Indexes with a single field cannot be created. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.indexes.create({ + * // The name of the database this index will apply to. For example: + * // `projects/{project_id}/databases/{database_id}` + * parent: 'projects/my-project/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "collectionId": "my_collectionId", + * // "fields": [], + * // "name": "my_name", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.indexes.create * @memberOf! () * @@ -2747,6 +3688,48 @@ export namespace firestore_v1beta1 { /** * firestore.projects.databases.indexes.delete * @desc Deletes an index. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.indexes.delete({ + * // The index name. For example: + * // `projects/{project_id}/databases/{database_id}/indexes/{index_id}` + * name: 'projects/my-project/databases/my-database/indexes/my-indexe', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.indexes.delete * @memberOf! () * @@ -2816,6 +3799,53 @@ export namespace firestore_v1beta1 { /** * firestore.projects.databases.indexes.get * @desc Gets an index. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.indexes.get({ + * // The name of the index. For example: + * // `projects/{project_id}/databases/{database_id}/indexes/{index_id}` + * name: 'projects/my-project/databases/my-database/indexes/my-indexe', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "collectionId": "my_collectionId", + * // "fields": [], + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.indexes.get * @memberOf! () * @@ -2896,6 +3926,56 @@ export namespace firestore_v1beta1 { /** * firestore.projects.databases.indexes.list * @desc Lists the indexes that match the specified filters. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.indexes.list({ + * filter: 'placeholder-value', + * // The standard List page size. + * pageSize: 'placeholder-value', + * // The standard List page token. + * pageToken: 'placeholder-value', + * // The database name. For example: + * // `projects/{project_id}/databases/{database_id}` + * parent: 'projects/my-project/databases/my-database', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "indexes": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.indexes.list * @memberOf! () * diff --git a/src/apis/firestore/v1beta2.ts b/src/apis/firestore/v1beta2.ts index 3d8140c5a56..8d0d452e7ac 100644 --- a/src/apis/firestore/v1beta2.ts +++ b/src/apis/firestore/v1beta2.ts @@ -469,6 +469,63 @@ export namespace firestore_v1beta2 { /** * firestore.projects.databases.exportDocuments * @desc Exports a copy of all or a subset of documents from Google Cloud Firestore to another storage system, such as Google Cloud Storage. Recent updates to documents may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.exportDocuments({ + * // Database to export. Should be of the form: + * // `projects/{project_id}/databases/{database_id}`. + * name: 'projects/my-project/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "collectionIds": [], + * // "outputUriPrefix": "my_outputUriPrefix" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.exportDocuments * @memberOf! () * @@ -551,6 +608,63 @@ export namespace firestore_v1beta2 { /** * firestore.projects.databases.importDocuments * @desc Imports documents into Google Cloud Firestore. Existing documents with the same name are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportDocuments operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Firestore. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.importDocuments({ + * // Database to import into. Should be of the form: + * // `projects/{project_id}/databases/{database_id}`. + * name: 'projects/my-project/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "collectionIds": [], + * // "inputUriPrefix": "my_inputUriPrefix" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.importDocuments * @memberOf! () * @@ -690,6 +804,52 @@ export namespace firestore_v1beta2 { /** * firestore.projects.databases.collectionGroups.fields.get * @desc Gets the metadata and configuration for a Field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.collectionGroups.fields.get({ + * // A name of the form + * // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` + * name: + * 'projects/my-project/databases/my-database/collectionGroups/my-collectionGroup/fields/my-field', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "indexConfig": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.collectionGroups.fields.get * @memberOf! () * @@ -770,6 +930,64 @@ export namespace firestore_v1beta2 { /** * firestore.projects.databases.collectionGroups.fields.list * @desc Lists the field configuration and metadata for this database. Currently, FirestoreAdmin.ListFields only supports listing fields that have been explicitly overridden. To issue this query, call FirestoreAdmin.ListFields with the filter set to `indexConfig.usesAncestorConfig:false`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.collectionGroups.fields.list({ + * // The filter to apply to list results. Currently, + * // FirestoreAdmin.ListFields only supports listing fields + * // that have been explicitly overridden. To issue this query, call + * // FirestoreAdmin.ListFields with the filter set to + * // `indexConfig.usesAncestorConfig:false`. + * filter: 'placeholder-value', + * // The number of results to return. + * pageSize: 'placeholder-value', + * // A page token, returned from a previous call to + * // FirestoreAdmin.ListFields, that may be used to get the next + * // page of results. + * pageToken: 'placeholder-value', + * // A parent name of the form + * // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * parent: + * 'projects/my-project/databases/my-database/collectionGroups/my-collectionGroup', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "fields": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.collectionGroups.fields.list * @memberOf! () * @@ -872,6 +1090,91 @@ export namespace firestore_v1beta2 { /** * firestore.projects.databases.collectionGroups.fields.patch * @desc Updates a field configuration. Currently, field updates apply only to single field index configuration. However, calls to FirestoreAdmin.UpdateField should provide a field mask to avoid changing any configuration that the caller isn't aware of. The field mask should be specified as: `{ paths: "index_config" }`. This call returns a google.longrunning.Operation which may be used to track the status of the field update. The metadata for the operation will be the type FieldOperationMetadata. To configure the default field settings for the database, use the special `Field` with resource name: `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/x`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.collectionGroups.fields.patch({ + * // A field name of the form + * // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` + * // + * // A field path may be a simple field name, e.g. `address` or a path to fields + * // within map_value , e.g. `address.city`, + * // or a special field path. The only valid special field is `*`, which + * // represents any field. + * // + * // Field paths may be quoted using ` (backtick). The only character that needs + * // to be escaped within a quoted field path is the backtick character itself, + * // escaped using a backslash. Special characters in field paths that + * // must be quoted include: `*`, `.`, + * // ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. + * // + * // Examples: + * // (Note: Comments here are written in markdown syntax, so there is an + * // additional layer of backticks to represent a code block) + * // `\`address.city\`` represents a field named `address.city`, not the map key + * // `city` in the field `address`. + * // `\`*\`` represents a field named `*`, not any field. + * // + * // A special `Field` contains the default indexing settings for all fields. + * // This field's resource name is: + * // `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/x` + * // Indexes defined on this `Field` will be applied to all fields which do not + * // have their own `Field` index configuration. + * name: + * 'projects/my-project/databases/my-database/collectionGroups/my-collectionGroup/fields/my-field', + * // A mask, relative to the field. If specified, only configuration specified + * // by this field_mask will be updated in the field. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "indexConfig": {}, + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.collectionGroups.fields.patch * @memberOf! () * @@ -1017,6 +1320,68 @@ export namespace firestore_v1beta2 { /** * firestore.projects.databases.collectionGroups.indexes.create * @desc Creates a composite index. This returns a google.longrunning.Operation which may be used to track the status of the creation. The metadata for the operation will be the type IndexOperationMetadata. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.collectionGroups.indexes.create( + * { + * // A parent name of the form + * // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * parent: + * 'projects/my-project/databases/my-database/collectionGroups/my-collectionGroup', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fields": [], + * // "name": "my_name", + * // "queryScope": "my_queryScope", + * // "state": "my_state" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.collectionGroups.indexes.create * @memberOf! () * @@ -1099,6 +1464,51 @@ export namespace firestore_v1beta2 { /** * firestore.projects.databases.collectionGroups.indexes.delete * @desc Deletes a composite index. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.collectionGroups.indexes.delete( + * { + * // A name of the form + * // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * name: + * 'projects/my-project/databases/my-database/collectionGroups/my-collectionGroup/indexes/my-indexe', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.collectionGroups.indexes.delete * @memberOf! () * @@ -1168,6 +1578,54 @@ export namespace firestore_v1beta2 { /** * firestore.projects.databases.collectionGroups.indexes.get * @desc Gets a composite index. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.collectionGroups.indexes.get({ + * // A name of the form + * // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * name: + * 'projects/my-project/databases/my-database/collectionGroups/my-collectionGroup/indexes/my-indexe', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "fields": [], + * // "name": "my_name", + * // "queryScope": "my_queryScope", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.collectionGroups.indexes.get * @memberOf! () * @@ -1248,6 +1706,60 @@ export namespace firestore_v1beta2 { /** * firestore.projects.databases.collectionGroups.indexes.list * @desc Lists composite indexes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/firestore.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 firestore = google.firestore('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/datastore', + * ], + * }); + * + * // 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 firestore.projects.databases.collectionGroups.indexes.list({ + * // The filter to apply to list results. + * filter: 'placeholder-value', + * // The number of results to return. + * pageSize: 'placeholder-value', + * // A page token, returned from a previous call to + * // FirestoreAdmin.ListIndexes, that may be used to get the next + * // page of results. + * pageToken: 'placeholder-value', + * // A parent name of the form + * // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * parent: + * 'projects/my-project/databases/my-database/collectionGroups/my-collectionGroup', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "indexes": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias firestore.projects.databases.collectionGroups.indexes.list * @memberOf! () * diff --git a/src/apis/fitness/v1.ts b/src/apis/fitness/v1.ts index 9a3a587f9f0..8dc8b80a117 100644 --- a/src/apis/fitness/v1.ts +++ b/src/apis/fitness/v1.ts @@ -516,6 +516,80 @@ export namespace fitness_v1 { /** * fitness.users.dataset.aggregate * @desc Aggregates data of a certain type or stream into buckets divided by a given type of boundary. Multiple data sets of multiple types and from multiple sources can be aggregated into exactly one bucket type per request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/fitness.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 fitness = google.fitness('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/fitness.activity.read', + * 'https://www.googleapis.com/auth/fitness.activity.write', + * 'https://www.googleapis.com/auth/fitness.blood_glucose.read', + * 'https://www.googleapis.com/auth/fitness.blood_glucose.write', + * 'https://www.googleapis.com/auth/fitness.blood_pressure.read', + * 'https://www.googleapis.com/auth/fitness.blood_pressure.write', + * 'https://www.googleapis.com/auth/fitness.body.read', + * 'https://www.googleapis.com/auth/fitness.body.write', + * 'https://www.googleapis.com/auth/fitness.body_temperature.read', + * 'https://www.googleapis.com/auth/fitness.body_temperature.write', + * 'https://www.googleapis.com/auth/fitness.location.read', + * 'https://www.googleapis.com/auth/fitness.location.write', + * 'https://www.googleapis.com/auth/fitness.nutrition.read', + * 'https://www.googleapis.com/auth/fitness.nutrition.write', + * 'https://www.googleapis.com/auth/fitness.oxygen_saturation.read', + * 'https://www.googleapis.com/auth/fitness.oxygen_saturation.write', + * 'https://www.googleapis.com/auth/fitness.reproductive_health.read', + * 'https://www.googleapis.com/auth/fitness.reproductive_health.write', + * ], + * }); + * + * // 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 fitness.users.dataset.aggregate({ + * // Aggregate data for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "aggregateBy": [], + * // "bucketByActivitySegment": {}, + * // "bucketByActivityType": {}, + * // "bucketBySession": {}, + * // "bucketByTime": {}, + * // "endTimeMillis": "my_endTimeMillis", + * // "filteredDataQualityStandard": [], + * // "startTimeMillis": "my_startTimeMillis" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias fitness.users.dataset.aggregate * @memberOf! () * @@ -621,6 +695,78 @@ export namespace fitness_v1 { /** * fitness.users.dataSources.create * @desc Creates a new data source that is unique across all data sources belonging to this user. A data source is a unique source of sensor data. Data sources can expose raw data coming from hardware sensors on local or companion devices. They can also expose derived data, created by transforming or merging other data sources. Multiple data sources can exist for the same data type. Every data point in every dataset inserted into or read from the Fitness API has an associated data source. Each data source produces a unique stream of dataset updates, with a unique data source identifier. Not all changes to data source affect the data stream ID, so that data collected by updated versions of the same application/device can still be considered to belong to the same data source. Data sources are identified using a string generated by the server, based on the contents of the source being created. The dataStreamId field should not be set when invoking this method. It will be automatically generated by the server with the correct format. If a dataStreamId is set, it must match the format that the server would generate. This format is a combination of some fields from the data source, and has a specific order. If it doesn't match, the request will fail with an error. Specifying a DataType which is not a known type (beginning with "com.google.") will create a DataSource with a custom data type. Custom data types are only readable by the application that created them. Custom data types are deprecated; use standard data types instead. In addition to the data source fields included in the data source ID, the developer project number that is authenticated when creating the data source is included. This developer project number is obfuscated when read by any other developer reading public data types. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/fitness.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 fitness = google.fitness('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/fitness.activity.write', + * 'https://www.googleapis.com/auth/fitness.blood_glucose.write', + * 'https://www.googleapis.com/auth/fitness.blood_pressure.write', + * 'https://www.googleapis.com/auth/fitness.body.write', + * 'https://www.googleapis.com/auth/fitness.body_temperature.write', + * 'https://www.googleapis.com/auth/fitness.location.write', + * 'https://www.googleapis.com/auth/fitness.nutrition.write', + * 'https://www.googleapis.com/auth/fitness.oxygen_saturation.write', + * 'https://www.googleapis.com/auth/fitness.reproductive_health.write', + * ], + * }); + * + * // 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 fitness.users.dataSources.create({ + * // Create the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "application": {}, + * // "dataQualityStandard": [], + * // "dataStreamId": "my_dataStreamId", + * // "dataStreamName": "my_dataStreamName", + * // "dataType": {}, + * // "device": {}, + * // "name": "my_name", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "application": {}, + * // "dataQualityStandard": [], + * // "dataStreamId": "my_dataStreamId", + * // "dataStreamName": "my_dataStreamName", + * // "dataType": {}, + * // "device": {}, + * // "name": "my_name", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias fitness.users.dataSources.create * @memberOf! () * @@ -696,6 +842,65 @@ export namespace fitness_v1 { /** * fitness.users.dataSources.delete * @desc Deletes the specified data source. The request will fail if the data source contains any data points. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/fitness.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 fitness = google.fitness('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/fitness.activity.write', + * 'https://www.googleapis.com/auth/fitness.blood_glucose.write', + * 'https://www.googleapis.com/auth/fitness.blood_pressure.write', + * 'https://www.googleapis.com/auth/fitness.body.write', + * 'https://www.googleapis.com/auth/fitness.body_temperature.write', + * 'https://www.googleapis.com/auth/fitness.location.write', + * 'https://www.googleapis.com/auth/fitness.nutrition.write', + * 'https://www.googleapis.com/auth/fitness.oxygen_saturation.write', + * 'https://www.googleapis.com/auth/fitness.reproductive_health.write', + * ], + * }); + * + * // 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 fitness.users.dataSources.delete({ + * // The data stream ID of the data source to delete. + * dataSourceId: 'placeholder-value', + * // Retrieve a data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "application": {}, + * // "dataQualityStandard": [], + * // "dataStreamId": "my_dataStreamId", + * // "dataStreamName": "my_dataStreamName", + * // "dataType": {}, + * // "device": {}, + * // "name": "my_name", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias fitness.users.dataSources.delete * @memberOf! () * @@ -770,6 +975,74 @@ export namespace fitness_v1 { /** * fitness.users.dataSources.get * @desc Returns the specified data source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/fitness.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 fitness = google.fitness('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/fitness.activity.read', + * 'https://www.googleapis.com/auth/fitness.activity.write', + * 'https://www.googleapis.com/auth/fitness.blood_glucose.read', + * 'https://www.googleapis.com/auth/fitness.blood_glucose.write', + * 'https://www.googleapis.com/auth/fitness.blood_pressure.read', + * 'https://www.googleapis.com/auth/fitness.blood_pressure.write', + * 'https://www.googleapis.com/auth/fitness.body.read', + * 'https://www.googleapis.com/auth/fitness.body.write', + * 'https://www.googleapis.com/auth/fitness.body_temperature.read', + * 'https://www.googleapis.com/auth/fitness.body_temperature.write', + * 'https://www.googleapis.com/auth/fitness.location.read', + * 'https://www.googleapis.com/auth/fitness.location.write', + * 'https://www.googleapis.com/auth/fitness.nutrition.read', + * 'https://www.googleapis.com/auth/fitness.nutrition.write', + * 'https://www.googleapis.com/auth/fitness.oxygen_saturation.read', + * 'https://www.googleapis.com/auth/fitness.oxygen_saturation.write', + * 'https://www.googleapis.com/auth/fitness.reproductive_health.read', + * 'https://www.googleapis.com/auth/fitness.reproductive_health.write', + * ], + * }); + * + * // 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 fitness.users.dataSources.get({ + * // The data stream ID of the data source to retrieve. + * dataSourceId: 'placeholder-value', + * // Retrieve a data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "application": {}, + * // "dataQualityStandard": [], + * // "dataStreamId": "my_dataStreamId", + * // "dataStreamName": "my_dataStreamName", + * // "dataType": {}, + * // "device": {}, + * // "name": "my_name", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias fitness.users.dataSources.get * @memberOf! () * @@ -844,6 +1117,67 @@ export namespace fitness_v1 { /** * fitness.users.dataSources.list * @desc Lists all data sources that are visible to the developer, using the OAuth scopes provided. The list is not exhaustive; the user may have private data sources that are only visible to other developers, or calls using other scopes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/fitness.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 fitness = google.fitness('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/fitness.activity.read', + * 'https://www.googleapis.com/auth/fitness.activity.write', + * 'https://www.googleapis.com/auth/fitness.blood_glucose.read', + * 'https://www.googleapis.com/auth/fitness.blood_glucose.write', + * 'https://www.googleapis.com/auth/fitness.blood_pressure.read', + * 'https://www.googleapis.com/auth/fitness.blood_pressure.write', + * 'https://www.googleapis.com/auth/fitness.body.read', + * 'https://www.googleapis.com/auth/fitness.body.write', + * 'https://www.googleapis.com/auth/fitness.body_temperature.read', + * 'https://www.googleapis.com/auth/fitness.body_temperature.write', + * 'https://www.googleapis.com/auth/fitness.location.read', + * 'https://www.googleapis.com/auth/fitness.location.write', + * 'https://www.googleapis.com/auth/fitness.nutrition.read', + * 'https://www.googleapis.com/auth/fitness.nutrition.write', + * 'https://www.googleapis.com/auth/fitness.oxygen_saturation.read', + * 'https://www.googleapis.com/auth/fitness.oxygen_saturation.write', + * 'https://www.googleapis.com/auth/fitness.reproductive_health.read', + * 'https://www.googleapis.com/auth/fitness.reproductive_health.write', + * ], + * }); + * + * // 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 fitness.users.dataSources.list({ + * // The names of data types to include in the list. If not specified, all data sources will be returned. + * dataTypeName: 'placeholder-value', + * // List data sources for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dataSource": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias fitness.users.dataSources.list * @memberOf! () * @@ -921,6 +1255,80 @@ export namespace fitness_v1 { /** * fitness.users.dataSources.update * @desc Updates the specified data source. The dataStreamId, dataType, type, dataStreamName, and device properties with the exception of version, cannot be modified. Data sources are identified by their dataStreamId. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/fitness.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 fitness = google.fitness('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/fitness.activity.write', + * 'https://www.googleapis.com/auth/fitness.blood_glucose.write', + * 'https://www.googleapis.com/auth/fitness.blood_pressure.write', + * 'https://www.googleapis.com/auth/fitness.body.write', + * 'https://www.googleapis.com/auth/fitness.body_temperature.write', + * 'https://www.googleapis.com/auth/fitness.location.write', + * 'https://www.googleapis.com/auth/fitness.nutrition.write', + * 'https://www.googleapis.com/auth/fitness.oxygen_saturation.write', + * 'https://www.googleapis.com/auth/fitness.reproductive_health.write', + * ], + * }); + * + * // 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 fitness.users.dataSources.update({ + * // The data stream ID of the data source to update. + * dataSourceId: 'placeholder-value', + * // Update the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "application": {}, + * // "dataQualityStandard": [], + * // "dataStreamId": "my_dataStreamId", + * // "dataStreamName": "my_dataStreamName", + * // "dataType": {}, + * // "device": {}, + * // "name": "my_name", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "application": {}, + * // "dataQualityStandard": [], + * // "dataStreamId": "my_dataStreamId", + * // "dataStreamName": "my_dataStreamName", + * // "dataType": {}, + * // "device": {}, + * // "name": "my_name", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias fitness.users.dataSources.update * @memberOf! () * @@ -1090,6 +1498,74 @@ export namespace fitness_v1 { /** * fitness.users.dataSources.dataPointChanges.list * @desc Queries for user's data point changes for a particular data source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/fitness.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 fitness = google.fitness('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/fitness.activity.read', + * 'https://www.googleapis.com/auth/fitness.activity.write', + * 'https://www.googleapis.com/auth/fitness.blood_glucose.read', + * 'https://www.googleapis.com/auth/fitness.blood_glucose.write', + * 'https://www.googleapis.com/auth/fitness.blood_pressure.read', + * 'https://www.googleapis.com/auth/fitness.blood_pressure.write', + * 'https://www.googleapis.com/auth/fitness.body.read', + * 'https://www.googleapis.com/auth/fitness.body.write', + * 'https://www.googleapis.com/auth/fitness.body_temperature.read', + * 'https://www.googleapis.com/auth/fitness.body_temperature.write', + * 'https://www.googleapis.com/auth/fitness.location.read', + * 'https://www.googleapis.com/auth/fitness.location.write', + * 'https://www.googleapis.com/auth/fitness.nutrition.read', + * 'https://www.googleapis.com/auth/fitness.nutrition.write', + * 'https://www.googleapis.com/auth/fitness.oxygen_saturation.read', + * 'https://www.googleapis.com/auth/fitness.oxygen_saturation.write', + * 'https://www.googleapis.com/auth/fitness.reproductive_health.read', + * 'https://www.googleapis.com/auth/fitness.reproductive_health.write', + * ], + * }); + * + * // 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 fitness.users.dataSources.dataPointChanges.list({ + * // The data stream ID of the data source that created the dataset. + * dataSourceId: 'placeholder-value', + * // If specified, no more than this many data point changes will be included in the response. + * limit: 'placeholder-value', + * // The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response. + * pageToken: 'placeholder-value', + * // List data points for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dataSourceId": "my_dataSourceId", + * // "deletedDataPoint": [], + * // "insertedDataPoint": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias fitness.users.dataSources.dataPointChanges.list * @memberOf! () * @@ -1208,6 +1684,59 @@ export namespace fitness_v1 { /** * fitness.users.dataSources.datasets.delete * @desc Performs an inclusive delete of all data points whose start and end times have any overlap with the time range specified by the dataset ID. For most data types, the entire data point will be deleted. For data types where the time span represents a consistent value (such as com.google.activity.segment), and a data point straddles either end point of the dataset, only the overlapping portion of the data point will be deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/fitness.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 fitness = google.fitness('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/fitness.activity.write', + * 'https://www.googleapis.com/auth/fitness.blood_glucose.write', + * 'https://www.googleapis.com/auth/fitness.blood_pressure.write', + * 'https://www.googleapis.com/auth/fitness.body.write', + * 'https://www.googleapis.com/auth/fitness.body_temperature.write', + * 'https://www.googleapis.com/auth/fitness.location.write', + * 'https://www.googleapis.com/auth/fitness.nutrition.write', + * 'https://www.googleapis.com/auth/fitness.oxygen_saturation.write', + * 'https://www.googleapis.com/auth/fitness.reproductive_health.write', + * ], + * }); + * + * // 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 fitness.users.dataSources.datasets.delete({ + * // The client's current time in milliseconds since epoch. + * currentTimeMillis: 'placeholder-value', + * // Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. The ID is formatted like: "startTime-endTime" where startTime and endTime are 64 bit integers. + * datasetId: 'placeholder-value', + * // The data stream ID of the data source that created the dataset. + * dataSourceId: 'placeholder-value', + * // When the operation was performed on the client. + * modifiedTimeMillis: 'placeholder-value', + * // Delete a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias fitness.users.dataSources.datasets.delete * @memberOf! () * @@ -1284,6 +1813,77 @@ export namespace fitness_v1 { /** * fitness.users.dataSources.datasets.get * @desc Returns a dataset containing all data points whose start and end times overlap with the specified range of the dataset minimum start time and maximum end time. Specifically, any data point whose start time is less than or equal to the dataset end time and whose end time is greater than or equal to the dataset start time. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/fitness.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 fitness = google.fitness('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/fitness.activity.read', + * 'https://www.googleapis.com/auth/fitness.activity.write', + * 'https://www.googleapis.com/auth/fitness.blood_glucose.read', + * 'https://www.googleapis.com/auth/fitness.blood_glucose.write', + * 'https://www.googleapis.com/auth/fitness.blood_pressure.read', + * 'https://www.googleapis.com/auth/fitness.blood_pressure.write', + * 'https://www.googleapis.com/auth/fitness.body.read', + * 'https://www.googleapis.com/auth/fitness.body.write', + * 'https://www.googleapis.com/auth/fitness.body_temperature.read', + * 'https://www.googleapis.com/auth/fitness.body_temperature.write', + * 'https://www.googleapis.com/auth/fitness.location.read', + * 'https://www.googleapis.com/auth/fitness.location.write', + * 'https://www.googleapis.com/auth/fitness.nutrition.read', + * 'https://www.googleapis.com/auth/fitness.nutrition.write', + * 'https://www.googleapis.com/auth/fitness.oxygen_saturation.read', + * 'https://www.googleapis.com/auth/fitness.oxygen_saturation.write', + * 'https://www.googleapis.com/auth/fitness.reproductive_health.read', + * 'https://www.googleapis.com/auth/fitness.reproductive_health.write', + * ], + * }); + * + * // 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 fitness.users.dataSources.datasets.get({ + * // Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. The ID is formatted like: "startTime-endTime" where startTime and endTime are 64 bit integers. + * datasetId: 'placeholder-value', + * // The data stream ID of the data source that created the dataset. + * dataSourceId: 'placeholder-value', + * // If specified, no more than this many data points will be included in the dataset. If there are more data points in the dataset, nextPageToken will be set in the dataset response. + * limit: 'placeholder-value', + * // The continuation token, which is used to page through large datasets. To get the next page of a dataset, set this parameter to the value of nextPageToken from the previous response. Each subsequent call will yield a partial dataset with data point end timestamps that are strictly smaller than those in the previous partial response. + * pageToken: 'placeholder-value', + * // Retrieve a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dataSourceId": "my_dataSourceId", + * // "maxEndTimeNs": "my_maxEndTimeNs", + * // "minStartTimeNs": "my_minStartTimeNs", + * // "nextPageToken": "my_nextPageToken", + * // "point": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias fitness.users.dataSources.datasets.get * @memberOf! () * @@ -1360,6 +1960,78 @@ export namespace fitness_v1 { /** * fitness.users.dataSources.datasets.patch * @desc Adds data points to a dataset. The dataset need not be previously created. All points within the given dataset will be returned with subsquent calls to retrieve this dataset. Data points can belong to more than one dataset. This method does not use patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/fitness.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 fitness = google.fitness('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/fitness.activity.write', + * 'https://www.googleapis.com/auth/fitness.blood_glucose.write', + * 'https://www.googleapis.com/auth/fitness.blood_pressure.write', + * 'https://www.googleapis.com/auth/fitness.body.write', + * 'https://www.googleapis.com/auth/fitness.body_temperature.write', + * 'https://www.googleapis.com/auth/fitness.location.write', + * 'https://www.googleapis.com/auth/fitness.nutrition.write', + * 'https://www.googleapis.com/auth/fitness.oxygen_saturation.write', + * 'https://www.googleapis.com/auth/fitness.reproductive_health.write', + * ], + * }); + * + * // 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 fitness.users.dataSources.datasets.patch({ + * // The client's current time in milliseconds since epoch. Note that the minStartTimeNs and maxEndTimeNs properties in the request body are in nanoseconds instead of milliseconds. + * currentTimeMillis: 'placeholder-value', + * // Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. The ID is formatted like: "startTime-endTime" where startTime and endTime are 64 bit integers. + * datasetId: 'placeholder-value', + * // The data stream ID of the data source that created the dataset. + * dataSourceId: 'placeholder-value', + * // Patch a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dataSourceId": "my_dataSourceId", + * // "maxEndTimeNs": "my_maxEndTimeNs", + * // "minStartTimeNs": "my_minStartTimeNs", + * // "nextPageToken": "my_nextPageToken", + * // "point": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dataSourceId": "my_dataSourceId", + * // "maxEndTimeNs": "my_maxEndTimeNs", + * // "minStartTimeNs": "my_minStartTimeNs", + * // "nextPageToken": "my_nextPageToken", + * // "point": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias fitness.users.dataSources.datasets.patch * @memberOf! () * @@ -1529,6 +2201,45 @@ export namespace fitness_v1 { /** * fitness.users.sessions.delete * @desc Deletes a session specified by the given session ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/fitness.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 fitness = google.fitness('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/fitness.activity.write'], + * }); + * + * // 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 fitness.users.sessions.delete({ + * // The client's current time in milliseconds since epoch. + * currentTimeMillis: 'placeholder-value', + * // The ID of the session to be deleted. + * sessionId: 'placeholder-value', + * // Delete a session for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias fitness.users.sessions.delete * @memberOf! () * @@ -1602,6 +2313,78 @@ export namespace fitness_v1 { /** * fitness.users.sessions.list * @desc Lists sessions previously created. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/fitness.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 fitness = google.fitness('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/fitness.activity.read', + * 'https://www.googleapis.com/auth/fitness.activity.write', + * 'https://www.googleapis.com/auth/fitness.blood_glucose.read', + * 'https://www.googleapis.com/auth/fitness.blood_glucose.write', + * 'https://www.googleapis.com/auth/fitness.blood_pressure.read', + * 'https://www.googleapis.com/auth/fitness.blood_pressure.write', + * 'https://www.googleapis.com/auth/fitness.body.read', + * 'https://www.googleapis.com/auth/fitness.body.write', + * 'https://www.googleapis.com/auth/fitness.body_temperature.read', + * 'https://www.googleapis.com/auth/fitness.body_temperature.write', + * 'https://www.googleapis.com/auth/fitness.location.read', + * 'https://www.googleapis.com/auth/fitness.location.write', + * 'https://www.googleapis.com/auth/fitness.nutrition.read', + * 'https://www.googleapis.com/auth/fitness.nutrition.write', + * 'https://www.googleapis.com/auth/fitness.oxygen_saturation.read', + * 'https://www.googleapis.com/auth/fitness.oxygen_saturation.write', + * 'https://www.googleapis.com/auth/fitness.reproductive_health.read', + * 'https://www.googleapis.com/auth/fitness.reproductive_health.write', + * ], + * }); + * + * // 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 fitness.users.sessions.list({ + * // If non-empty, only sessions with these activity types should be returned. + * activityType: 'placeholder-value', + * // An RFC3339 timestamp. Only sessions ending between the start and end times will be included in the response. + * endTime: 'placeholder-value', + * // If true, deleted sessions will be returned. When set to true, sessions returned in this response will only have an ID and will not have any other fields. + * includeDeleted: 'placeholder-value', + * // The continuation token, which is used for incremental syncing. To get the next batch of changes, set this parameter to the value of nextPageToken from the previous response. This token is treated as a timestamp (in millis since epoch). If specified, the API returns sessions modified since this time. The page token is ignored if either start or end time is specified. If none of start time, end time, and the page token is specified, sessions modified in the last 30 days are returned. + * pageToken: 'placeholder-value', + * // An RFC3339 timestamp. Only sessions ending between the start and end times will be included in the response. + * startTime: 'placeholder-value', + * // List sessions for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deletedSession": [], + * // "hasMoreData": false, + * // "nextPageToken": "my_nextPageToken", + * // "session": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias fitness.users.sessions.list * @memberOf! () * @@ -1683,6 +2466,74 @@ export namespace fitness_v1 { /** * fitness.users.sessions.update * @desc Updates or insert a given session. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/fitness.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 fitness = google.fitness('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/fitness.activity.write'], + * }); + * + * // 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 fitness.users.sessions.update({ + * // The client's current time in milliseconds since epoch. + * currentTimeMillis: 'placeholder-value', + * // The ID of the session to be created. + * sessionId: 'placeholder-value', + * // Create sessions for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "activeTimeMillis": "my_activeTimeMillis", + * // "activityType": 0, + * // "application": {}, + * // "description": "my_description", + * // "endTimeMillis": "my_endTimeMillis", + * // "id": "my_id", + * // "modifiedTimeMillis": "my_modifiedTimeMillis", + * // "name": "my_name", + * // "startTimeMillis": "my_startTimeMillis" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeTimeMillis": "my_activeTimeMillis", + * // "activityType": 0, + * // "application": {}, + * // "description": "my_description", + * // "endTimeMillis": "my_endTimeMillis", + * // "id": "my_id", + * // "modifiedTimeMillis": "my_modifiedTimeMillis", + * // "name": "my_name", + * // "startTimeMillis": "my_startTimeMillis" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias fitness.users.sessions.update * @memberOf! () * diff --git a/src/apis/games/v1.ts b/src/apis/games/v1.ts index bc166663a4c..bccf818f98c 100644 --- a/src/apis/games/v1.ts +++ b/src/apis/games/v1.ts @@ -2379,6 +2379,52 @@ export namespace games_v1 { /** * games.achievementDefinitions.list * @desc Lists all the achievement definitions for your application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.achievementDefinitions.list({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.achievementDefinitions.list * @memberOf! () * @@ -2492,6 +2538,52 @@ export namespace games_v1 { /** * games.achievements.increment * @desc Increments the steps of the achievement with the given ID for the currently authenticated player. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.achievements.increment({ + * // The ID of the achievement used by this method. + * achievementId: 'placeholder-value', + * // A randomly generated numeric ID for each request specified by the caller. This number is used at the server to ensure that the request is handled correctly across retries. + * requestId: 'placeholder-value', + * // The number of steps to increment. + * stepsToIncrement: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "currentSteps": 0, + * // "kind": "my_kind", + * // "newlyUnlocked": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.achievements.increment * @memberOf! () * @@ -2576,6 +2668,56 @@ export namespace games_v1 { /** * games.achievements.list * @desc Lists the progress for all your application's achievements for the currently authenticated player. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.achievements.list({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * // A player ID. A value of me may be used in place of the authenticated player's ID. + * playerId: 'placeholder-value', + * // Tells the server to return only achievements with the specified state. If this parameter isn't specified, all achievements are returned. + * state: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.achievements.list * @memberOf! () * @@ -2662,6 +2804,47 @@ export namespace games_v1 { /** * games.achievements.reveal * @desc Sets the state of the achievement with the given ID to REVEALED for the currently authenticated player. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.achievements.reveal({ + * // The ID of the achievement used by this method. + * achievementId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "currentState": "my_currentState", + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.achievements.reveal * @memberOf! () * @@ -2742,6 +2925,50 @@ export namespace games_v1 { /** * games.achievements.setStepsAtLeast * @desc Sets the steps for the currently authenticated player towards unlocking an achievement. If the steps parameter is less than the current number of steps that the player already gained for the achievement, the achievement is not modified. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.achievements.setStepsAtLeast({ + * // The ID of the achievement used by this method. + * achievementId: 'placeholder-value', + * // The minimum value to set the steps to. + * steps: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "currentSteps": 0, + * // "kind": "my_kind", + * // "newlyUnlocked": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.achievements.setStepsAtLeast * @memberOf! () * @@ -2825,6 +3052,47 @@ export namespace games_v1 { /** * games.achievements.unlock * @desc Unlocks this achievement for the currently authenticated player. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.achievements.unlock({ + * // The ID of the achievement used by this method. + * achievementId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "newlyUnlocked": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.achievements.unlock * @memberOf! () * @@ -2905,6 +3173,53 @@ export namespace games_v1 { /** * games.achievements.updateMultiple * @desc Updates multiple achievements for the currently authenticated player. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.achievements.updateMultiple({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "updates": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "updatedAchievements": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.achievements.updateMultiple * @memberOf! () * @@ -3096,6 +3411,62 @@ export namespace games_v1 { /** * games.applications.get * @desc Retrieves the metadata of the application with the given ID. If the requested application is not available for the specified platformType, the returned response will not include any instance data. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.applications.get({ + * // The application ID from the Google Play developer console. + * applicationId: 'placeholder-value', + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // Restrict application details returned to the specific platform. + * platformType: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "achievement_count": 0, + * // "assets": [], + * // "author": "my_author", + * // "category": {}, + * // "description": "my_description", + * // "enabledFeatures": [], + * // "id": "my_id", + * // "instances": [], + * // "kind": "my_kind", + * // "lastUpdatedTimestamp": "my_lastUpdatedTimestamp", + * // "leaderboard_count": 0, + * // "name": "my_name", + * // "themeColor": "my_themeColor" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.applications.get * @memberOf! () * @@ -3171,6 +3542,38 @@ export namespace games_v1 { /** * games.applications.played * @desc Indicate that the the currently authenticated user is playing your application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.applications.played({}); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.applications.played * @memberOf! () * @@ -3242,6 +3645,48 @@ export namespace games_v1 { /** * games.applications.verify * @desc Verifies the auth token provided with this request is for the application with the specified ID, and returns the ID of the player it was granted for. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.applications.verify({ + * // The application ID from the Google Play developer console. + * applicationId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternate_player_id": "my_alternate_player_id", + * // "kind": "my_kind", + * // "player_id": "my_player_id" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.applications.verify * @memberOf! () * @@ -3368,6 +3813,52 @@ export namespace games_v1 { /** * games.events.listByPlayer * @desc Returns a list showing the current progress on events in this application for the currently authenticated user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.events.listByPlayer({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The maximum number of events to return in the response, used for paging. For any response, the actual number of events to return may be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.events.listByPlayer * @memberOf! () * @@ -3445,6 +3936,52 @@ export namespace games_v1 { /** * games.events.listDefinitions * @desc Returns a list of the event definitions in this application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.events.listDefinitions({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The maximum number of event definitions to return in the response, used for paging. For any response, the actual number of event definitions to return may be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.events.listDefinitions * @memberOf! () * @@ -3528,6 +4065,60 @@ export namespace games_v1 { /** * games.events.record * @desc Records a batch of changes to the number of times events have occurred for the currently authenticated user of this application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.events.record({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "currentTimeMillis": "my_currentTimeMillis", + * // "kind": "my_kind", + * // "requestId": "my_requestId", + * // "timePeriods": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "batchFailures": [], + * // "eventFailures": [], + * // "kind": "my_kind", + * // "playerEvents": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.events.record * @memberOf! () * @@ -3663,6 +4254,53 @@ export namespace games_v1 { /** * games.leaderboards.get * @desc Retrieves the metadata of the leaderboard with the given ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.leaderboards.get({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The ID of the leaderboard. + * leaderboardId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "iconUrl": "my_iconUrl", + * // "id": "my_id", + * // "isIconUrlDefault": false, + * // "kind": "my_kind", + * // "name": "my_name", + * // "order": "my_order" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.leaderboards.get * @memberOf! () * @@ -3737,6 +4375,52 @@ export namespace games_v1 { /** * games.leaderboards.list * @desc Lists all the leaderboard metadata for your application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.leaderboards.list({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The maximum number of leaderboards to return in the response. For any response, the actual number of leaderboards returned may be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.leaderboards.list * @memberOf! () * @@ -3858,6 +4542,45 @@ export namespace games_v1 { /** * games.metagame.getMetagameConfig * @desc Return the metagame configuration data for the calling application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.metagame.getMetagameConfig({}); + * console.log(res.data); + * + * // Example response + * // { + * // "currentVersion": 0, + * // "kind": "my_kind", + * // "playerLevels": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.metagame.getMetagameConfig * @memberOf! () * @@ -3933,6 +4656,56 @@ export namespace games_v1 { /** * games.metagame.listCategoriesByPlayer * @desc List play data aggregated per category for the player corresponding to playerId. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.metagame.listCategoriesByPlayer({ + * // The collection of categories for which data will be returned. + * collection: 'placeholder-value', + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The maximum number of category resources to return in the response, used for paging. For any response, the actual number of category resources returned may be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * // A player ID. A value of me may be used in place of the authenticated player's ID. + * playerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.metagame.listCategoriesByPlayer * @memberOf! () * @@ -4057,6 +4830,60 @@ export namespace games_v1 { /** * games.players.get * @desc Retrieves the Player resource with the given ID. To retrieve the player for the currently authenticated user, set playerId to me. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.players.get({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // A player ID. A value of me may be used in place of the authenticated player's ID. + * playerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "avatarImageUrl": "my_avatarImageUrl", + * // "bannerUrlLandscape": "my_bannerUrlLandscape", + * // "bannerUrlPortrait": "my_bannerUrlPortrait", + * // "displayName": "my_displayName", + * // "experienceInfo": {}, + * // "friendStatus": "my_friendStatus", + * // "kind": "my_kind", + * // "lastPlayedWith": {}, + * // "name": {}, + * // "originalPlayerId": "my_originalPlayerId", + * // "playerId": "my_playerId", + * // "profileSettings": {}, + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.players.get * @memberOf! () * @@ -4129,6 +4956,54 @@ export namespace games_v1 { /** * games.players.list * @desc Get the collection of players for the currently authenticated user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.players.list({ + * // Collection of players being retrieved + * collection: 'placeholder-value', + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The maximum number of player resources to return in the response, used for paging. For any response, the actual number of player resources returned may be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.players.list * @memberOf! () * @@ -4250,6 +5125,47 @@ export namespace games_v1 { /** * games.pushtokens.remove * @desc Removes a push token for the current user and application. Removing a non-existent push token will report success. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.pushtokens.remove({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ios": {}, + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.pushtokens.remove * @memberOf! () * @@ -4322,6 +5238,49 @@ export namespace games_v1 { /** * games.pushtokens.update * @desc Registers a push token for the current user and application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.pushtokens.update({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clientRevision": "my_clientRevision", + * // "id": {}, + * // "kind": "my_kind", + * // "language": "my_language" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.pushtokens.update * @memberOf! () * @@ -4426,6 +5385,53 @@ export namespace games_v1 { /** * games.revisions.check * @desc Checks whether the games client is out of date. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.revisions.check({ + * // The revision of the client SDK used by your application. Format: + * // [PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE are: + * // + * // - "ANDROID" - Client is running the Android SDK. + * // - "IOS" - Client is running the iOS SDK. + * // - "WEB_APP" - Client is running as a Web App. + * clientRevision: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "revisionStatus": "my_revisionStatus" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.revisions.check * @memberOf! () * @@ -4520,6 +5526,73 @@ export namespace games_v1 { /** * games.rooms.create * @desc Create a room. For internal use by the Games SDK only. Calling this method directly is unsupported. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.rooms.create({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoMatchingCriteria": {}, + * // "capabilities": [], + * // "clientAddress": {}, + * // "invitedPlayerIds": [], + * // "kind": "my_kind", + * // "networkDiagnostics": {}, + * // "requestId": "my_requestId", + * // "variant": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applicationId": "my_applicationId", + * // "autoMatchingCriteria": {}, + * // "autoMatchingStatus": {}, + * // "creationDetails": {}, + * // "description": "my_description", + * // "inviterId": "my_inviterId", + * // "kind": "my_kind", + * // "lastUpdateDetails": {}, + * // "participants": [], + * // "roomId": "my_roomId", + * // "roomStatusVersion": 0, + * // "status": "my_status", + * // "variant": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.rooms.create * @memberOf! () * @@ -4592,6 +5665,60 @@ export namespace games_v1 { /** * games.rooms.decline * @desc Decline an invitation to join a room. For internal use by the Games SDK only. Calling this method directly is unsupported. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.rooms.decline({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The ID of the room. + * roomId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applicationId": "my_applicationId", + * // "autoMatchingCriteria": {}, + * // "autoMatchingStatus": {}, + * // "creationDetails": {}, + * // "description": "my_description", + * // "inviterId": "my_inviterId", + * // "kind": "my_kind", + * // "lastUpdateDetails": {}, + * // "participants": [], + * // "roomId": "my_roomId", + * // "roomStatusVersion": 0, + * // "status": "my_status", + * // "variant": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.rooms.decline * @memberOf! () * @@ -4664,6 +5791,41 @@ export namespace games_v1 { /** * games.rooms.dismiss * @desc Dismiss an invitation to join a room. For internal use by the Games SDK only. Calling this method directly is unsupported. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.rooms.dismiss({ + * // The ID of the room. + * roomId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.rooms.dismiss * @memberOf! () * @@ -4735,6 +5897,60 @@ export namespace games_v1 { /** * games.rooms.get * @desc Get the data for a room. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.rooms.get({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The ID of the room. + * roomId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applicationId": "my_applicationId", + * // "autoMatchingCriteria": {}, + * // "autoMatchingStatus": {}, + * // "creationDetails": {}, + * // "description": "my_description", + * // "inviterId": "my_inviterId", + * // "kind": "my_kind", + * // "lastUpdateDetails": {}, + * // "participants": [], + * // "roomId": "my_roomId", + * // "roomStatusVersion": 0, + * // "status": "my_status", + * // "variant": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.rooms.get * @memberOf! () * @@ -4807,6 +6023,71 @@ export namespace games_v1 { /** * games.rooms.join * @desc Join a room. For internal use by the Games SDK only. Calling this method directly is unsupported. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.rooms.join({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The ID of the room. + * roomId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "capabilities": [], + * // "clientAddress": {}, + * // "kind": "my_kind", + * // "networkDiagnostics": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applicationId": "my_applicationId", + * // "autoMatchingCriteria": {}, + * // "autoMatchingStatus": {}, + * // "creationDetails": {}, + * // "description": "my_description", + * // "inviterId": "my_inviterId", + * // "kind": "my_kind", + * // "lastUpdateDetails": {}, + * // "participants": [], + * // "roomId": "my_roomId", + * // "roomStatusVersion": 0, + * // "status": "my_status", + * // "variant": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.rooms.join * @memberOf! () * @@ -4880,6 +6161,70 @@ export namespace games_v1 { /** * games.rooms.leave * @desc Leave a room. For internal use by the Games SDK only. Calling this method directly is unsupported. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.rooms.leave({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The ID of the room. + * roomId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "leaveDiagnostics": {}, + * // "reason": "my_reason" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applicationId": "my_applicationId", + * // "autoMatchingCriteria": {}, + * // "autoMatchingStatus": {}, + * // "creationDetails": {}, + * // "description": "my_description", + * // "inviterId": "my_inviterId", + * // "kind": "my_kind", + * // "lastUpdateDetails": {}, + * // "participants": [], + * // "roomId": "my_roomId", + * // "roomStatusVersion": 0, + * // "status": "my_status", + * // "variant": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.rooms.leave * @memberOf! () * @@ -4953,6 +6298,52 @@ export namespace games_v1 { /** * games.rooms.list * @desc Returns invitations to join rooms. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.rooms.list({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The maximum number of rooms to return in the response, used for paging. For any response, the actual number of rooms to return may be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.rooms.list * @memberOf! () * @@ -5023,6 +6414,62 @@ export namespace games_v1 { /** * games.rooms.reportStatus * @desc Updates sent by a client reporting the status of peers in a room. For internal use by the Games SDK only. Calling this method directly is unsupported. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.rooms.reportStatus({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The ID of the room. + * roomId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "updates": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoMatchingStatus": {}, + * // "kind": "my_kind", + * // "participants": [], + * // "roomId": "my_roomId", + * // "status": "my_status", + * // "statusVersion": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.rooms.reportStatus * @memberOf! () * @@ -5244,6 +6691,61 @@ export namespace games_v1 { /** * games.scores.get * @desc Get high scores, and optionally ranks, in leaderboards for the currently authenticated player. For a specific time span, leaderboardId can be set to ALL to retrieve data for all leaderboards in a given time span. NOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in the same request; only one parameter may be set to 'ALL'. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.scores.get({ + * // The types of ranks to return. If the parameter is omitted, no ranks will be returned. + * includeRankType: 'placeholder-value', + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The ID of the leaderboard. Can be set to 'ALL' to retrieve data for all leaderboards for this application. + * leaderboardId: 'placeholder-value', + * // The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * // A player ID. A value of me may be used in place of the authenticated player's ID. + * playerId: 'placeholder-value', + * // The time span for the scores and ranks you're requesting. + * timeSpan: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "player": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.scores.get * @memberOf! () * @@ -5332,6 +6834,61 @@ export namespace games_v1 { /** * games.scores.list * @desc Lists the scores in a leaderboard, starting from the top. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.scores.list({ + * // The collection of scores you're requesting. + * collection: 'placeholder-value', + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The ID of the leaderboard. + * leaderboardId: 'placeholder-value', + * // The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * // The time span for the scores and ranks you're requesting. + * timeSpan: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "numScores": "my_numScores", + * // "playerScore": {}, + * // "prevPageToken": "my_prevPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.scores.list * @memberOf! () * @@ -5410,6 +6967,65 @@ export namespace games_v1 { /** * games.scores.listWindow * @desc Lists the scores in a leaderboard around (and including) a player's score. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.scores.listWindow({ + * // The collection of scores you're requesting. + * collection: 'placeholder-value', + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The ID of the leaderboard. + * leaderboardId: 'placeholder-value', + * // The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * // The preferred number of scores to return above the player's score. More scores may be returned if the player is at the bottom of the leaderboard; fewer may be returned if the player is at the top. Must be less than or equal to maxResults. + * resultsAbove: 'placeholder-value', + * // True if the top scores should be returned when the player is not in the leaderboard. Defaults to true. + * returnTopIfAbsent: 'placeholder-value', + * // The time span for the scores and ranks you're requesting. + * timeSpan: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "numScores": "my_numScores", + * // "playerScore": {}, + * // "prevPageToken": "my_prevPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.scores.listWindow * @memberOf! () * @@ -5491,6 +7107,57 @@ export namespace games_v1 { /** * games.scores.submit * @desc Submits a score to the specified leaderboard. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.scores.submit({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The ID of the leaderboard. + * leaderboardId: 'placeholder-value', + * // The score you're submitting. The submitted score is ignored if it is worse than a previously submitted score, where worse depends on the leaderboard sort order. The meaning of the score value depends on the leaderboard format type. For fixed-point, the score represents the raw value. For time, the score represents elapsed time in milliseconds. For currency, the score represents a value in micro units. + * score: 'placeholder-value', + * // Additional information about the score you're submitting. Values must contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986. + * scoreTag: '[a-zA-Z0-9-._~]{0,64}', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "beatenScoreTimeSpans": [], + * // "formattedScore": "my_formattedScore", + * // "kind": "my_kind", + * // "leaderboardId": "my_leaderboardId", + * // "scoreTag": "my_scoreTag", + * // "unbeatenScores": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.scores.submit * @memberOf! () * @@ -5566,6 +7233,56 @@ export namespace games_v1 { /** * games.scores.submitMultiple * @desc Submits multiple scores to leaderboards. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.scores.submitMultiple({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "scores": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "submittedScores": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.scores.submitMultiple * @memberOf! () * @@ -5799,6 +7516,61 @@ export namespace games_v1 { /** * games.snapshots.get * @desc Retrieves the metadata for a given snapshot ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/drive.appdata', + * 'https://www.googleapis.com/auth/games', + * ], + * }); + * + * // 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 games.snapshots.get({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The ID of the snapshot. + * snapshotId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "coverImage": {}, + * // "description": "my_description", + * // "driveId": "my_driveId", + * // "durationMillis": "my_durationMillis", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lastModifiedMillis": "my_lastModifiedMillis", + * // "progressValue": "my_progressValue", + * // "title": "my_title", + * // "type": "my_type", + * // "uniqueName": "my_uniqueName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.snapshots.get * @memberOf! () * @@ -5871,6 +7643,57 @@ export namespace games_v1 { /** * games.snapshots.list * @desc Retrieves a list of snapshots created by your application for the player corresponding to the player ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/drive.appdata', + * 'https://www.googleapis.com/auth/games', + * ], + * }); + * + * // 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 games.snapshots.list({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The maximum number of snapshot resources to return in the response, used for paging. For any response, the actual number of snapshot resources returned may be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * // A player ID. A value of me may be used in place of the authenticated player's ID. + * playerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.snapshots.list * @memberOf! () * @@ -5995,6 +7818,41 @@ export namespace games_v1 { /** * games.turnBasedMatches.cancel * @desc Cancel a turn-based match. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.turnBasedMatches.cancel({ + * // The ID of the match. + * matchId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.turnBasedMatches.cancel * @memberOf! () * @@ -6066,6 +7924,77 @@ export namespace games_v1 { /** * games.turnBasedMatches.create * @desc Create a turn-based match. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.turnBasedMatches.create({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoMatchingCriteria": {}, + * // "invitedPlayerIds": [], + * // "kind": "my_kind", + * // "requestId": "my_requestId", + * // "variant": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applicationId": "my_applicationId", + * // "autoMatchingCriteria": {}, + * // "creationDetails": {}, + * // "data": {}, + * // "description": "my_description", + * // "inviterId": "my_inviterId", + * // "kind": "my_kind", + * // "lastUpdateDetails": {}, + * // "matchId": "my_matchId", + * // "matchNumber": 0, + * // "matchVersion": 0, + * // "participants": [], + * // "pendingParticipantId": "my_pendingParticipantId", + * // "previousMatchData": {}, + * // "rematchId": "my_rematchId", + * // "results": [], + * // "status": "my_status", + * // "userMatchStatus": "my_userMatchStatus", + * // "variant": 0, + * // "withParticipantId": "my_withParticipantId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.turnBasedMatches.create * @memberOf! () * @@ -6141,6 +8070,67 @@ export namespace games_v1 { /** * games.turnBasedMatches.decline * @desc Decline an invitation to play a turn-based match. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.turnBasedMatches.decline({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The ID of the match. + * matchId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applicationId": "my_applicationId", + * // "autoMatchingCriteria": {}, + * // "creationDetails": {}, + * // "data": {}, + * // "description": "my_description", + * // "inviterId": "my_inviterId", + * // "kind": "my_kind", + * // "lastUpdateDetails": {}, + * // "matchId": "my_matchId", + * // "matchNumber": 0, + * // "matchVersion": 0, + * // "participants": [], + * // "pendingParticipantId": "my_pendingParticipantId", + * // "previousMatchData": {}, + * // "rematchId": "my_rematchId", + * // "results": [], + * // "status": "my_status", + * // "userMatchStatus": "my_userMatchStatus", + * // "variant": 0, + * // "withParticipantId": "my_withParticipantId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.turnBasedMatches.decline * @memberOf! () * @@ -6215,6 +8205,41 @@ export namespace games_v1 { /** * games.turnBasedMatches.dismiss * @desc Dismiss a turn-based match from the match list. The match will no longer show up in the list and will not generate notifications. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.turnBasedMatches.dismiss({ + * // The ID of the match. + * matchId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.turnBasedMatches.dismiss * @memberOf! () * @@ -6286,6 +8311,78 @@ export namespace games_v1 { /** * games.turnBasedMatches.finish * @desc Finish a turn-based match. Each player should make this call once, after all results are in. Only the player whose turn it is may make the first call to Finish, and can pass in the final match state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.turnBasedMatches.finish({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The ID of the match. + * matchId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "data": {}, + * // "kind": "my_kind", + * // "matchVersion": 0, + * // "results": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applicationId": "my_applicationId", + * // "autoMatchingCriteria": {}, + * // "creationDetails": {}, + * // "data": {}, + * // "description": "my_description", + * // "inviterId": "my_inviterId", + * // "kind": "my_kind", + * // "lastUpdateDetails": {}, + * // "matchId": "my_matchId", + * // "matchNumber": 0, + * // "matchVersion": 0, + * // "participants": [], + * // "pendingParticipantId": "my_pendingParticipantId", + * // "previousMatchData": {}, + * // "rematchId": "my_rematchId", + * // "results": [], + * // "status": "my_status", + * // "userMatchStatus": "my_userMatchStatus", + * // "variant": 0, + * // "withParticipantId": "my_withParticipantId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.turnBasedMatches.finish * @memberOf! () * @@ -6361,6 +8458,69 @@ export namespace games_v1 { /** * games.turnBasedMatches.get * @desc Get the data for a turn-based match. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.turnBasedMatches.get({ + * // Get match data along with metadata. + * includeMatchData: 'placeholder-value', + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The ID of the match. + * matchId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applicationId": "my_applicationId", + * // "autoMatchingCriteria": {}, + * // "creationDetails": {}, + * // "data": {}, + * // "description": "my_description", + * // "inviterId": "my_inviterId", + * // "kind": "my_kind", + * // "lastUpdateDetails": {}, + * // "matchId": "my_matchId", + * // "matchNumber": 0, + * // "matchVersion": 0, + * // "participants": [], + * // "pendingParticipantId": "my_pendingParticipantId", + * // "previousMatchData": {}, + * // "rematchId": "my_rematchId", + * // "results": [], + * // "status": "my_status", + * // "userMatchStatus": "my_userMatchStatus", + * // "variant": 0, + * // "withParticipantId": "my_withParticipantId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.turnBasedMatches.get * @memberOf! () * @@ -6437,6 +8597,67 @@ export namespace games_v1 { /** * games.turnBasedMatches.join * @desc Join a turn-based match. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.turnBasedMatches.join({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The ID of the match. + * matchId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applicationId": "my_applicationId", + * // "autoMatchingCriteria": {}, + * // "creationDetails": {}, + * // "data": {}, + * // "description": "my_description", + * // "inviterId": "my_inviterId", + * // "kind": "my_kind", + * // "lastUpdateDetails": {}, + * // "matchId": "my_matchId", + * // "matchNumber": 0, + * // "matchVersion": 0, + * // "participants": [], + * // "pendingParticipantId": "my_pendingParticipantId", + * // "previousMatchData": {}, + * // "rematchId": "my_rematchId", + * // "results": [], + * // "status": "my_status", + * // "userMatchStatus": "my_userMatchStatus", + * // "variant": 0, + * // "withParticipantId": "my_withParticipantId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.turnBasedMatches.join * @memberOf! () * @@ -6511,6 +8732,67 @@ export namespace games_v1 { /** * games.turnBasedMatches.leave * @desc Leave a turn-based match when it is not the current player's turn, without canceling the match. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.turnBasedMatches.leave({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The ID of the match. + * matchId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applicationId": "my_applicationId", + * // "autoMatchingCriteria": {}, + * // "creationDetails": {}, + * // "data": {}, + * // "description": "my_description", + * // "inviterId": "my_inviterId", + * // "kind": "my_kind", + * // "lastUpdateDetails": {}, + * // "matchId": "my_matchId", + * // "matchNumber": 0, + * // "matchVersion": 0, + * // "participants": [], + * // "pendingParticipantId": "my_pendingParticipantId", + * // "previousMatchData": {}, + * // "rematchId": "my_rematchId", + * // "results": [], + * // "status": "my_status", + * // "userMatchStatus": "my_userMatchStatus", + * // "variant": 0, + * // "withParticipantId": "my_withParticipantId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.turnBasedMatches.leave * @memberOf! () * @@ -6585,6 +8867,71 @@ export namespace games_v1 { /** * games.turnBasedMatches.leaveTurn * @desc Leave a turn-based match during the current player's turn, without canceling the match. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.turnBasedMatches.leaveTurn({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The ID of the match. + * matchId: 'placeholder-value', + * // The version of the match being updated. + * matchVersion: 'placeholder-value', + * // The ID of another participant who should take their turn next. If not set, the match will wait for other player(s) to join via automatching; this is only valid if automatch criteria is set on the match with remaining slots for automatched players. + * pendingParticipantId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applicationId": "my_applicationId", + * // "autoMatchingCriteria": {}, + * // "creationDetails": {}, + * // "data": {}, + * // "description": "my_description", + * // "inviterId": "my_inviterId", + * // "kind": "my_kind", + * // "lastUpdateDetails": {}, + * // "matchId": "my_matchId", + * // "matchNumber": 0, + * // "matchVersion": 0, + * // "participants": [], + * // "pendingParticipantId": "my_pendingParticipantId", + * // "previousMatchData": {}, + * // "rematchId": "my_rematchId", + * // "results": [], + * // "status": "my_status", + * // "userMatchStatus": "my_userMatchStatus", + * // "variant": 0, + * // "withParticipantId": "my_withParticipantId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.turnBasedMatches.leaveTurn * @memberOf! () * @@ -6661,6 +9008,56 @@ export namespace games_v1 { /** * games.turnBasedMatches.list * @desc Returns turn-based matches the player is or was involved in. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.turnBasedMatches.list({ + * // True if match data should be returned in the response. Note that not all data will necessarily be returned if include_match_data is true; the server may decide to only return data for some of the matches to limit download size for the client. The remainder of the data for these matches will be retrievable on request. + * includeMatchData: 'placeholder-value', + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The maximum number of completed or canceled matches to return in the response. If not set, all matches returned could be completed or canceled. + * maxCompletedMatches: 'placeholder-value', + * // The maximum number of matches to return in the response, used for paging. For any response, the actual number of matches to return may be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.turnBasedMatches.list * @memberOf! () * @@ -6739,6 +9136,52 @@ export namespace games_v1 { /** * games.turnBasedMatches.rematch * @desc Create a rematch of a match that was previously completed, with the same participants. This can be called by only one player on a match still in their list; the player must have called Finish first. Returns the newly created match; it will be the caller's turn. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.turnBasedMatches.rematch({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The ID of the match. + * matchId: 'placeholder-value', + * // A randomly generated numeric ID for each request specified by the caller. This number is used at the server to ensure that the request is handled correctly across retries. + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "previousMatch": {}, + * // "rematch": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.turnBasedMatches.rematch * @memberOf! () * @@ -6816,6 +9259,57 @@ export namespace games_v1 { /** * games.turnBasedMatches.sync * @desc Returns turn-based matches the player is or was involved in that changed since the last sync call, with the least recent changes coming first. Matches that should be removed from the local cache will have a status of MATCH_DELETED. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.turnBasedMatches.sync({ + * // True if match data should be returned in the response. Note that not all data will necessarily be returned if include_match_data is true; the server may decide to only return data for some of the matches to limit download size for the client. The remainder of the data for these matches will be retrievable on request. + * includeMatchData: 'placeholder-value', + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The maximum number of completed or canceled matches to return in the response. If not set, all matches returned could be completed or canceled. + * maxCompletedMatches: 'placeholder-value', + * // The maximum number of matches to return in the response, used for paging. For any response, the actual number of matches to return may be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "moreAvailable": false, + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.turnBasedMatches.sync * @memberOf! () * @@ -6894,6 +9388,79 @@ export namespace games_v1 { /** * games.turnBasedMatches.takeTurn * @desc Commit the results of a player turn. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/games.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 games = google.games('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/games'], + * }); + * + * // 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 games.turnBasedMatches.takeTurn({ + * // The preferred language to use for strings returned by this method. + * language: 'placeholder-value', + * // The ID of the match. + * matchId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "data": {}, + * // "kind": "my_kind", + * // "matchVersion": 0, + * // "pendingParticipantId": "my_pendingParticipantId", + * // "results": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applicationId": "my_applicationId", + * // "autoMatchingCriteria": {}, + * // "creationDetails": {}, + * // "data": {}, + * // "description": "my_description", + * // "inviterId": "my_inviterId", + * // "kind": "my_kind", + * // "lastUpdateDetails": {}, + * // "matchId": "my_matchId", + * // "matchNumber": 0, + * // "matchVersion": 0, + * // "participants": [], + * // "pendingParticipantId": "my_pendingParticipantId", + * // "previousMatchData": {}, + * // "rematchId": "my_rematchId", + * // "results": [], + * // "status": "my_status", + * // "userMatchStatus": "my_userMatchStatus", + * // "variant": 0, + * // "withParticipantId": "my_withParticipantId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias games.turnBasedMatches.takeTurn * @memberOf! () * diff --git a/src/apis/gamesConfiguration/v1configuration.ts b/src/apis/gamesConfiguration/v1configuration.ts index 8509be8f9a6..1be28e33522 100644 --- a/src/apis/gamesConfiguration/v1configuration.ts +++ b/src/apis/gamesConfiguration/v1configuration.ts @@ -391,6 +391,41 @@ export namespace gamesConfiguration_v1configuration { /** * gamesConfiguration.achievementConfigurations.delete * @desc Delete the achievement configuration with the given ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesConfiguration.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 gamesConfiguration = google.gamesConfiguration('v1configuration'); + * + * 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/androidpublisher'], + * }); + * + * // 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 gamesConfiguration.achievementConfigurations.delete({ + * // The ID of the achievement used by this method. + * achievementId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesConfiguration.achievementConfigurations.delete * @memberOf! () * @@ -462,6 +497,53 @@ export namespace gamesConfiguration_v1configuration { /** * gamesConfiguration.achievementConfigurations.get * @desc Retrieves the metadata of the achievement configuration with the given ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesConfiguration.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 gamesConfiguration = google.gamesConfiguration('v1configuration'); + * + * 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/androidpublisher'], + * }); + * + * // 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 gamesConfiguration.achievementConfigurations.get({ + * // The ID of the achievement used by this method. + * achievementId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "achievementType": "my_achievementType", + * // "draft": {}, + * // "id": "my_id", + * // "initialState": "my_initialState", + * // "kind": "my_kind", + * // "published": {}, + * // "stepsToUnlock": 0, + * // "token": "my_token" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesConfiguration.achievementConfigurations.get * @memberOf! () * @@ -537,6 +619,68 @@ export namespace gamesConfiguration_v1configuration { /** * gamesConfiguration.achievementConfigurations.insert * @desc Insert a new achievement configuration in this application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesConfiguration.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 gamesConfiguration = google.gamesConfiguration('v1configuration'); + * + * 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/androidpublisher'], + * }); + * + * // 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 gamesConfiguration.achievementConfigurations.insert({ + * // The application ID from the Google Play developer console. + * applicationId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "achievementType": "my_achievementType", + * // "draft": {}, + * // "id": "my_id", + * // "initialState": "my_initialState", + * // "kind": "my_kind", + * // "published": {}, + * // "stepsToUnlock": 0, + * // "token": "my_token" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "achievementType": "my_achievementType", + * // "draft": {}, + * // "id": "my_id", + * // "initialState": "my_initialState", + * // "kind": "my_kind", + * // "published": {}, + * // "stepsToUnlock": 0, + * // "token": "my_token" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesConfiguration.achievementConfigurations.insert * @memberOf! () * @@ -616,6 +760,54 @@ export namespace gamesConfiguration_v1configuration { /** * gamesConfiguration.achievementConfigurations.list * @desc Returns a list of the achievement configurations in this application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesConfiguration.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 gamesConfiguration = google.gamesConfiguration('v1configuration'); + * + * 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/androidpublisher'], + * }); + * + * // 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 gamesConfiguration.achievementConfigurations.list({ + * // The application ID from the Google Play developer console. + * applicationId: 'placeholder-value', + * // The maximum number of resource configurations to return in the response, + * // used for paging. For any response, the actual number of resources returned + * // may be less than the specified `maxResults`. + * maxResults: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesConfiguration.achievementConfigurations.list * @memberOf! () * @@ -709,6 +901,68 @@ export namespace gamesConfiguration_v1configuration { /** * gamesConfiguration.achievementConfigurations.update * @desc Update the metadata of the achievement configuration with the given ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesConfiguration.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 gamesConfiguration = google.gamesConfiguration('v1configuration'); + * + * 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/androidpublisher'], + * }); + * + * // 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 gamesConfiguration.achievementConfigurations.update({ + * // The ID of the achievement used by this method. + * achievementId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "achievementType": "my_achievementType", + * // "draft": {}, + * // "id": "my_id", + * // "initialState": "my_initialState", + * // "kind": "my_kind", + * // "published": {}, + * // "stepsToUnlock": 0, + * // "token": "my_token" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "achievementType": "my_achievementType", + * // "draft": {}, + * // "id": "my_id", + * // "initialState": "my_initialState", + * // "kind": "my_kind", + * // "published": {}, + * // "stepsToUnlock": 0, + * // "token": "my_token" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesConfiguration.achievementConfigurations.update * @memberOf! () * @@ -873,6 +1127,59 @@ export namespace gamesConfiguration_v1configuration { /** * gamesConfiguration.imageConfigurations.upload * @desc Uploads an image for a resource with the given ID and image type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesConfiguration.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 gamesConfiguration = google.gamesConfiguration('v1configuration'); + * + * 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/androidpublisher'], + * }); + * + * // 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 gamesConfiguration.imageConfigurations.upload({ + * // Selects which image in a resource for this method. + * imageType: 'placeholder-value', + * // The ID of the resource used by this method. + * resourceId: 'placeholder-value', + * + * requestBody: { + * // request body parameters + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "imageType": "my_imageType", + * // "kind": "my_kind", + * // "resourceId": "my_resourceId", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesConfiguration.imageConfigurations.upload * @memberOf! () * @@ -999,6 +1306,41 @@ export namespace gamesConfiguration_v1configuration { /** * gamesConfiguration.leaderboardConfigurations.delete * @desc Delete the leaderboard configuration with the given ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesConfiguration.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 gamesConfiguration = google.gamesConfiguration('v1configuration'); + * + * 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/androidpublisher'], + * }); + * + * // 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 gamesConfiguration.leaderboardConfigurations.delete({ + * // The ID of the leaderboard. + * leaderboardId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesConfiguration.leaderboardConfigurations.delete * @memberOf! () * @@ -1070,6 +1412,53 @@ export namespace gamesConfiguration_v1configuration { /** * gamesConfiguration.leaderboardConfigurations.get * @desc Retrieves the metadata of the leaderboard configuration with the given ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesConfiguration.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 gamesConfiguration = google.gamesConfiguration('v1configuration'); + * + * 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/androidpublisher'], + * }); + * + * // 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 gamesConfiguration.leaderboardConfigurations.get({ + * // The ID of the leaderboard. + * leaderboardId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "draft": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "published": {}, + * // "scoreMax": "my_scoreMax", + * // "scoreMin": "my_scoreMin", + * // "scoreOrder": "my_scoreOrder", + * // "token": "my_token" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesConfiguration.leaderboardConfigurations.get * @memberOf! () * @@ -1145,6 +1534,68 @@ export namespace gamesConfiguration_v1configuration { /** * gamesConfiguration.leaderboardConfigurations.insert * @desc Insert a new leaderboard configuration in this application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesConfiguration.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 gamesConfiguration = google.gamesConfiguration('v1configuration'); + * + * 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/androidpublisher'], + * }); + * + * // 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 gamesConfiguration.leaderboardConfigurations.insert({ + * // The application ID from the Google Play developer console. + * applicationId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "draft": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "published": {}, + * // "scoreMax": "my_scoreMax", + * // "scoreMin": "my_scoreMin", + * // "scoreOrder": "my_scoreOrder", + * // "token": "my_token" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "draft": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "published": {}, + * // "scoreMax": "my_scoreMax", + * // "scoreMin": "my_scoreMin", + * // "scoreOrder": "my_scoreOrder", + * // "token": "my_token" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesConfiguration.leaderboardConfigurations.insert * @memberOf! () * @@ -1224,6 +1675,54 @@ export namespace gamesConfiguration_v1configuration { /** * gamesConfiguration.leaderboardConfigurations.list * @desc Returns a list of the leaderboard configurations in this application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesConfiguration.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 gamesConfiguration = google.gamesConfiguration('v1configuration'); + * + * 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/androidpublisher'], + * }); + * + * // 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 gamesConfiguration.leaderboardConfigurations.list({ + * // The application ID from the Google Play developer console. + * applicationId: 'placeholder-value', + * // The maximum number of resource configurations to return in the response, + * // used for paging. For any response, the actual number of resources returned + * // may be less than the specified `maxResults`. + * maxResults: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesConfiguration.leaderboardConfigurations.list * @memberOf! () * @@ -1317,6 +1816,68 @@ export namespace gamesConfiguration_v1configuration { /** * gamesConfiguration.leaderboardConfigurations.update * @desc Update the metadata of the leaderboard configuration with the given ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesConfiguration.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 gamesConfiguration = google.gamesConfiguration('v1configuration'); + * + * 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/androidpublisher'], + * }); + * + * // 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 gamesConfiguration.leaderboardConfigurations.update({ + * // The ID of the leaderboard. + * leaderboardId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "draft": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "published": {}, + * // "scoreMax": "my_scoreMax", + * // "scoreMin": "my_scoreMin", + * // "scoreOrder": "my_scoreOrder", + * // "token": "my_token" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "draft": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "published": {}, + * // "scoreMax": "my_scoreMax", + * // "scoreMin": "my_scoreMin", + * // "scoreOrder": "my_scoreOrder", + * // "token": "my_token" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesConfiguration.leaderboardConfigurations.update * @memberOf! () * diff --git a/src/apis/gamesManagement/v1management.ts b/src/apis/gamesManagement/v1management.ts index 6cf318affe2..49ecdea2aad 100644 --- a/src/apis/gamesManagement/v1management.ts +++ b/src/apis/gamesManagement/v1management.ts @@ -374,6 +374,49 @@ export namespace gamesManagement_v1management { /** * gamesManagement.achievements.reset * @desc Resets the achievement with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.achievements.reset({ + * // The ID of the achievement used by this method. + * achievementId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "currentState": "my_currentState", + * // "definitionId": "my_definitionId", + * // "kind": "my_kind", + * // "updateOccurred": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.achievements.reset * @memberOf! () * @@ -451,6 +494,44 @@ export namespace gamesManagement_v1management { /** * gamesManagement.achievements.resetAll * @desc Resets all achievements for the currently authenticated player for your application. This method is only accessible to whitelisted tester accounts for your application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.achievements.resetAll({}); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "results": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.achievements.resetAll * @memberOf! () * @@ -531,6 +612,38 @@ export namespace gamesManagement_v1management { /** * gamesManagement.achievements.resetAllForAllPlayers * @desc Resets all draft achievements for all players. This method is only available to user accounts for your developer console. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.achievements.resetAllForAllPlayers({}); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.achievements.resetAllForAllPlayers * @memberOf! () * @@ -601,6 +714,41 @@ export namespace gamesManagement_v1management { /** * gamesManagement.achievements.resetForAllPlayers * @desc Resets the achievement with the given ID for all players. This method is only available to user accounts for your developer console. Only draft achievements can be reset. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.achievements.resetForAllPlayers({ + * // The ID of the achievement used by this method. + * achievementId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.achievements.resetForAllPlayers * @memberOf! () * @@ -673,6 +821,47 @@ export namespace gamesManagement_v1management { /** * gamesManagement.achievements.resetMultipleForAllPlayers * @desc Resets achievements with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft achievements may be reset. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.achievements.resetMultipleForAllPlayers({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "achievement_ids": [], + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.achievements.resetMultipleForAllPlayers * @memberOf! () * @@ -803,6 +992,52 @@ export namespace gamesManagement_v1management { /** * gamesManagement.applications.listHidden * @desc Get the list of players hidden from the given application. This method is only available to user accounts for your developer console. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.applications.listHidden({ + * // The application ID from the Google Play developer console. + * applicationId: 'placeholder-value', + * // The maximum number of player resources to return in the response, used for paging. For any response, the actual number of player resources returned may be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.applications.listHidden * @memberOf! () * @@ -907,6 +1142,41 @@ export namespace gamesManagement_v1management { /** * gamesManagement.events.reset * @desc Resets all player progress on the event with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.events.reset({ + * // The ID of the event. + * eventId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.events.reset * @memberOf! () * @@ -977,6 +1247,38 @@ export namespace gamesManagement_v1management { /** * gamesManagement.events.resetAll * @desc Resets all player progress on all events for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.events.resetAll({}); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.events.resetAll * @memberOf! () * @@ -1047,6 +1349,38 @@ export namespace gamesManagement_v1management { /** * gamesManagement.events.resetAllForAllPlayers * @desc Resets all draft events for all players. This method is only available to user accounts for your developer console. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.events.resetAllForAllPlayers({}); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.events.resetAllForAllPlayers * @memberOf! () * @@ -1117,6 +1451,41 @@ export namespace gamesManagement_v1management { /** * gamesManagement.events.resetForAllPlayers * @desc Resets the event with the given ID for all players. This method is only available to user accounts for your developer console. Only draft events can be reset. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.events.resetForAllPlayers({ + * // The ID of the event. + * eventId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.events.resetForAllPlayers * @memberOf! () * @@ -1189,6 +1558,47 @@ export namespace gamesManagement_v1management { /** * gamesManagement.events.resetMultipleForAllPlayers * @desc Resets events with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft events may be reset. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.events.resetMultipleForAllPlayers({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "event_ids": [], + * // "kind": "my_kind" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.events.resetMultipleForAllPlayers * @memberOf! () * @@ -1316,6 +1726,43 @@ export namespace gamesManagement_v1management { /** * gamesManagement.players.hide * @desc Hide the given player's leaderboard scores from the given application. This method is only available to user accounts for your developer console. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.players.hide({ + * // The application ID from the Google Play developer console. + * applicationId: 'placeholder-value', + * // A player ID. A value of me may be used in place of the authenticated player's ID. + * playerId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.players.hide * @memberOf! () * @@ -1388,6 +1835,43 @@ export namespace gamesManagement_v1management { /** * gamesManagement.players.unhide * @desc Unhide the given player's leaderboard scores from the given application. This method is only available to user accounts for your developer console. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.players.unhide({ + * // The application ID from the Google Play developer console. + * applicationId: 'placeholder-value', + * // A player ID. A value of me may be used in place of the authenticated player's ID. + * playerId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.players.unhide * @memberOf! () * @@ -1498,6 +1982,38 @@ export namespace gamesManagement_v1management { /** * gamesManagement.rooms.reset * @desc Reset all rooms for the currently authenticated player for your application. This method is only accessible to whitelisted tester accounts for your application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.rooms.reset({}); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.rooms.reset * @memberOf! () * @@ -1568,6 +2084,38 @@ export namespace gamesManagement_v1management { /** * gamesManagement.rooms.resetForAllPlayers * @desc Deletes rooms where the only room participants are from whitelisted tester accounts for your application. This method is only available to user accounts for your developer console. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.rooms.resetForAllPlayers({}); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.rooms.resetForAllPlayers * @memberOf! () * @@ -1659,6 +2207,48 @@ export namespace gamesManagement_v1management { /** * gamesManagement.scores.reset * @desc Resets scores for the leaderboard with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.scores.reset({ + * // The ID of the leaderboard. + * leaderboardId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "definitionId": "my_definitionId", + * // "kind": "my_kind", + * // "resetScoreTimeSpans": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.scores.reset * @memberOf! () * @@ -1736,6 +2326,44 @@ export namespace gamesManagement_v1management { /** * gamesManagement.scores.resetAll * @desc Resets all scores for all leaderboards for the currently authenticated players. This method is only accessible to whitelisted tester accounts for your application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.scores.resetAll({}); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "results": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.scores.resetAll * @memberOf! () * @@ -1815,6 +2443,38 @@ export namespace gamesManagement_v1management { /** * gamesManagement.scores.resetAllForAllPlayers * @desc Resets scores for all draft leaderboards for all players. This method is only available to user accounts for your developer console. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.scores.resetAllForAllPlayers({}); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.scores.resetAllForAllPlayers * @memberOf! () * @@ -1885,6 +2545,41 @@ export namespace gamesManagement_v1management { /** * gamesManagement.scores.resetForAllPlayers * @desc Resets scores for the leaderboard with the given ID for all players. This method is only available to user accounts for your developer console. Only draft leaderboards can be reset. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.scores.resetForAllPlayers({ + * // The ID of the leaderboard. + * leaderboardId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.scores.resetForAllPlayers * @memberOf! () * @@ -1957,6 +2652,47 @@ export namespace gamesManagement_v1management { /** * gamesManagement.scores.resetMultipleForAllPlayers * @desc Resets scores for the leaderboards with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft leaderboards may be reset. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.scores.resetMultipleForAllPlayers({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "leaderboard_ids": [] + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.scores.resetMultipleForAllPlayers * @memberOf! () * @@ -2084,6 +2820,38 @@ export namespace gamesManagement_v1management { /** * gamesManagement.turnBasedMatches.reset * @desc Reset all turn-based match data for a user. This method is only accessible to whitelisted tester accounts for your application. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.turnBasedMatches.reset({}); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.turnBasedMatches.reset * @memberOf! () * @@ -2154,6 +2922,38 @@ export namespace gamesManagement_v1management { /** * gamesManagement.turnBasedMatches.resetForAllPlayers * @desc Deletes turn-based matches where the only match participants are from whitelisted tester accounts for your application. This method is only available to user accounts for your developer console. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gamesManagement.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 gamesManagement = google.gamesManagement('v1management'); + * + * 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/games'], + * }); + * + * // 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 gamesManagement.turnBasedMatches.resetForAllPlayers({}); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gamesManagement.turnBasedMatches.resetForAllPlayers * @memberOf! () * diff --git a/src/apis/gameservices/v1beta.ts b/src/apis/gameservices/v1beta.ts index b8b4cf87eea..33392a1e7c3 100644 --- a/src/apis/gameservices/v1beta.ts +++ b/src/apis/gameservices/v1beta.ts @@ -1136,6 +1136,50 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.get * @memberOf! () * @@ -1205,6 +1249,56 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // If true, the returned list will include locations which are not yet + * // revealed. + * includeUnrevealedLocations: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.list * @memberOf! () * @@ -1337,6 +1431,68 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.gameServerDeployments.create * @desc Creates a new Game Server Deployment in a given project and Location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.gameServerDeployments.create( + * { + * // Required. The ID of the Game Server Deployment resource to be created. + * deploymentId: 'placeholder-value', + * // Required. The parent resource name. Uses the form: + * // `projects/{project}/locations/{location}`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "labels": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.gameServerDeployments.create * @memberOf! () * @@ -1413,6 +1569,55 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.gameServerDeployments.delete * @desc Deletes a single Game Server Deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.gameServerDeployments.delete( + * { + * // Required. The name of the Game Server Deployment to delete. Uses the form: + * // + * // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + * name: + * 'projects/my-project/locations/my-location/gameServerDeployments/my-gameServerDeployment', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.gameServerDeployments.delete * @memberOf! () * @@ -1484,6 +1689,58 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.gameServerDeployments.fetchDeploymentState * @desc Retrieves information about the current state of the Game Server Ddeployment. Gathers all the Agones fleets and Agones autoscalers, including fleets running an older version of the Game Server Deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.gameServerDeployments.fetchDeploymentState( + * { + * // Required. The name of the Game Server Deployment. Uses the form: + * // + * // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + * name: + * 'projects/my-project/locations/my-location/gameServerDeployments/my-gameServerDeployment', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "clusterState": [], + * // "unavailable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.gameServerDeployments.fetchDeploymentState * @memberOf! () * @@ -1568,6 +1825,54 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.gameServerDeployments.get * @desc Gets details of a single Game Server Deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.gameServerDeployments.get({ + * // Required. The name of the Game Server Deployment to retrieve. Uses the form: + * // + * // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + * name: + * 'projects/my-project/locations/my-location/gameServerDeployments/my-gameServerDeployment', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "labels": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.gameServerDeployments.get * @memberOf! () * @@ -1641,6 +1946,64 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.gameServerDeployments.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.gameServerDeployments.getIamPolicy( + * { + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/gameServerDeployments/my-gameServerDeployment', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.gameServerDeployments.getIamPolicy * @memberOf! () * @@ -1714,6 +2077,56 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.gameServerDeployments.getRollout * @desc Gets details a single Game Server Deployment Rollout. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.gameServerDeployments.getRollout( + * { + * // Required. The name of the Game Server Deployment to retrieve. Uses the form: + * // + * // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. + * name: + * 'projects/my-project/locations/my-location/gameServerDeployments/my-gameServerDeployment', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "defaultGameServerConfig": "my_defaultGameServerConfig", + * // "etag": "my_etag", + * // "gameServerConfigOverrides": [], + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.gameServerDeployments.getRollout * @memberOf! () * @@ -1795,6 +2208,63 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.gameServerDeployments.list * @desc Lists Game Server Deployments in a given project and Location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.gameServerDeployments.list({ + * // Optional. The filter to apply to list results. + * filter: 'placeholder-value', + * // Optional. Specifies the ordering of results following syntax at + * // https://cloud.google.com/apis/design/design_patterns#sorting_order. + * orderBy: 'placeholder-value', + * // Optional. The maximum number of items to return. If unspecified, server + * // will pick an appropriate default. Server may return fewer items than + * // requested. A caller should only rely on response's + * // next_page_token to + * // determine if there are more GameServerDeployments left to be queried. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous List request, + * // if any. + * pageToken: 'placeholder-value', + * // Required. The parent resource name. Uses the form: + * // `projects/{project}/locations/{location}`. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "gameServerDeployments": [], + * // "nextPageToken": "my_nextPageToken", + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.gameServerDeployments.list * @memberOf! () * @@ -1882,6 +2352,78 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.gameServerDeployments.patch * @desc Patches a Game Server Deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.gameServerDeployments.patch( + * { + * // The resource name of the Game Server Deployment. Uses the form: + * // + * // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + * // For example, + * // + * // `projects/my-project/locations/{location}/gameServerDeployments/my-deployment`. + * name: + * 'projects/my-project/locations/my-location/gameServerDeployments/my-gameServerDeployment', + * // Required. Mask of fields to update. At least one path must be supplied in + * // this field. For the `FieldMask` definition, see + * // + * // https: + * // //developers.google.com/protocol-buffers + * // // /docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "labels": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.gameServerDeployments.patch * @memberOf! () * @@ -1955,6 +2497,79 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.gameServerDeployments.previewRollout * @desc Previews the Game Server Deployment Rollout. This API does not mutate the Rollout resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.gameServerDeployments.previewRollout( + * { + * // The resource name of the Game Server Deployment Rollout. Uses the form: + * // + * // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. + * // For example, + * // + * // `projects/my-project/locations/{location}/gameServerDeployments/my-deployment/rollout`. + * name: + * 'projects/my-project/locations/my-location/gameServerDeployments/my-gameServerDeployment', + * // Optional. The target timestamp to compute the preview. Defaults to the immediately + * // after the proposed Rollout completes. + * previewTime: 'placeholder-value', + * // Optional. Mask of fields to update. At least one path must be supplied in + * // this field. For the `FieldMask` definition, see + * // + * // https: + * // //developers.google.com/protocol-buffers + * // // /docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "defaultGameServerConfig": "my_defaultGameServerConfig", + * // "etag": "my_etag", + * // "gameServerConfigOverrides": [], + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "targetState": {}, + * // "unavailable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.gameServerDeployments.previewRollout * @memberOf! () * @@ -2055,6 +2670,64 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.gameServerDeployments.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.gameServerDeployments.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/gameServerDeployments/my-gameServerDeployment', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "iamOwned": false, + * // "rules": [], + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.gameServerDeployments.setIamPolicy * @memberOf! () * @@ -2128,6 +2801,58 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.gameServerDeployments.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.gameServerDeployments.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/gameServerDeployments/my-gameServerDeployment', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.gameServerDeployments.testIamPermissions * @memberOf! () * @@ -2210,6 +2935,78 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.gameServerDeployments.updateRollout * @desc Patches a single Game Server Deployment Rollout. The method will not return an error if the update does not affect any existing realms. For example - if the default_game_server_config is changed but all existing realms use the override, that is valid. Similarly, if a non existing realm is explicitly called out in game_server_config_overrides field, that will also not result in an error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.gameServerDeployments.updateRollout( + * { + * // The resource name of the Game Server Deployment Rollout. Uses the form: + * // + * // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. + * // For example, + * // + * // `projects/my-project/locations/{location}/gameServerDeployments/my-deployment/rollout`. + * name: + * 'projects/my-project/locations/my-location/gameServerDeployments/my-gameServerDeployment', + * // Required. Mask of fields to update. At least one path must be supplied in + * // this field. For the `FieldMask` definition, see + * // + * // https: + * // //developers.google.com/protocol-buffers + * // // /docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "defaultGameServerConfig": "my_defaultGameServerConfig", + * // "etag": "my_etag", + * // "gameServerConfigOverrides": [], + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.gameServerDeployments.updateRollout * @memberOf! () * @@ -2513,6 +3310,71 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.gameServerDeployments.configs.create * @desc Creates a new Game Server Config in a given project, Location, and Game Server Deployment. Game Server Configs are immutable, and are not applied until referenced in the Game Server Deployment Rollout resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.gameServerDeployments.configs.create( + * { + * // Required. The ID of the Game Server Config resource to be created. + * configId: 'placeholder-value', + * // Required. The parent resource name. Uses the form: + * // + * // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`. + * parent: + * 'projects/my-project/locations/my-location/gameServerDeployments/my-gameServerDeployment', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "fleetConfigs": [], + * // "labels": {}, + * // "name": "my_name", + * // "scalingConfigs": [], + * // "updateTime": "my_updateTime" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.gameServerDeployments.configs.create * @memberOf! () * @@ -2589,6 +3451,55 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.gameServerDeployments.configs.delete * @desc Deletes a single Game Server Config. The deletion will fail if the Game Server Config is referenced in a Game Server Deployment Rollout. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.gameServerDeployments.configs.delete( + * { + * // Required. The name of the Game Server Config to delete. Uses the form: + * // + * // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. + * name: + * 'projects/my-project/locations/my-location/gameServerDeployments/my-gameServerDeployment/configs/my-config', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.gameServerDeployments.configs.delete * @memberOf! () * @@ -2660,6 +3571,57 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.gameServerDeployments.configs.get * @desc Gets details of a single Game Server Config. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.gameServerDeployments.configs.get( + * { + * // Required. The name of the Game Server Config to retrieve. Uses the form: + * // + * // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. + * name: + * 'projects/my-project/locations/my-location/gameServerDeployments/my-gameServerDeployment/configs/my-config', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "fleetConfigs": [], + * // "labels": {}, + * // "name": "my_name", + * // "scalingConfigs": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.gameServerDeployments.configs.get * @memberOf! () * @@ -2731,6 +3693,66 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.gameServerDeployments.configs.list * @desc Lists Game Server Configs in a given project, Location, and Game Server Deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.gameServerDeployments.configs.list( + * { + * // Optional. The filter to apply to list results. + * filter: 'placeholder-value', + * // Optional. Specifies the ordering of results following syntax at + * // https://cloud.google.com/apis/design/design_patterns#sorting_order. + * orderBy: 'placeholder-value', + * // Optional. The maximum number of items to return. If unspecified, server + * // will pick an appropriate default. Server may return fewer items than + * // requested. A caller should only rely on response's + * // next_page_token to + * // determine if there are more GameServerConfigs left to be queried. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // Required. The parent resource name. Uses the form: + * // + * // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/x`. + * parent: + * 'projects/my-project/locations/my-location/gameServerDeployments/my-gameServerDeployment', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "gameServerConfigs": [], + * // "nextPageToken": "my_nextPageToken", + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.gameServerDeployments.configs.list * @memberOf! () * @@ -2899,6 +3921,50 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.operations.cancel * @memberOf! () * @@ -2972,6 +4038,44 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.operations.delete * @memberOf! () * @@ -3041,6 +4145,50 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.operations.get * @memberOf! () * @@ -3112,6 +4260,53 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.operations.list * @memberOf! () * @@ -3268,6 +4463,67 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.realms.create * @desc Creates a new Realm in a given project and Location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.realms.create({ + * // Required. The parent resource name. Uses the form: + * // `projects/{project}/locations/{location}`. + * parent: 'projects/my-project/locations/my-location', + * // Required. The ID of the Realm resource to be created. + * realmId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "labels": {}, + * // "name": "my_name", + * // "timeZone": "my_timeZone", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.realms.create * @memberOf! () * @@ -3344,6 +4600,51 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.realms.delete * @desc Deletes a single Realm. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.realms.delete({ + * // Required. The name of the Realm to delete. Uses the form: + * // `projects/{project}/locations/{location}/realms/{realm}`. + * name: 'projects/my-project/locations/my-location/realms/my-realm', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.realms.delete * @memberOf! () * @@ -3415,6 +4716,53 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.realms.get * @desc Gets details of a single Realm. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.realms.get({ + * // Required. The name of the Realm to retrieve. Uses the form: + * // `projects/{project}/locations/{location}/realms/{realm}`. + * name: 'projects/my-project/locations/my-location/realms/my-realm', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "labels": {}, + * // "name": "my_name", + * // "timeZone": "my_timeZone", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.realms.get * @memberOf! () * @@ -3484,6 +4832,63 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.realms.list * @desc Lists Realms in a given project and Location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.realms.list({ + * // Optional. The filter to apply to list results. + * filter: 'placeholder-value', + * // Optional. Specifies the ordering of results following syntax at + * // https://cloud.google.com/apis/design/design_patterns#sorting_order. + * orderBy: 'placeholder-value', + * // Optional. The maximum number of items to return. If unspecified, server + * // will pick an appropriate default. Server may return fewer items than + * // requested. A caller should only rely on response's + * // next_page_token to + * // determine if there are more Realms left to be queried. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous List request, + * // if any. + * pageToken: 'placeholder-value', + * // Required. The parent resource name. Uses the form: + * // `projects/{project}/locations/{location}`. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "realms": [], + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.realms.list * @memberOf! () * @@ -3562,6 +4967,73 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.realms.patch * @desc Patches a single Realm. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.realms.patch({ + * // The resource name of the Realm. Uses the form: + * // `projects/{project}/locations/{location}/realms/{realm}`. For + * // example, `projects/my-project/locations/{location}/realms/my-realm`. + * name: 'projects/my-project/locations/my-location/realms/my-realm', + * // Required. The update mask applies to the resource. For the `FieldMask` + * // definition, see + * // + * // https: + * // //developers.google.com/protocol-buffers + * // // /docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "labels": {}, + * // "name": "my_name", + * // "timeZone": "my_timeZone", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.realms.patch * @memberOf! () * @@ -3635,6 +5107,72 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.realms.previewUpdate * @desc Previews patches to a single Realm. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.realms.previewUpdate({ + * // The resource name of the Realm. Uses the form: + * // `projects/{project}/locations/{location}/realms/{realm}`. For + * // example, `projects/my-project/locations/{location}/realms/my-realm`. + * name: 'projects/my-project/locations/my-location/realms/my-realm', + * // Optional. The target timestamp to compute the preview. + * previewTime: 'placeholder-value', + * // Required. The update mask applies to the resource. For the `FieldMask` + * // definition, see + * // + * // https: + * // //developers.google.com/protocol-buffers + * // // /docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "labels": {}, + * // "name": "my_name", + * // "timeZone": "my_timeZone", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "targetState": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.realms.previewUpdate * @memberOf! () * @@ -3846,6 +5384,69 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.realms.gameServerClusters.create * @desc Creates a new game server cluster in a given project and location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.realms.gameServerClusters.create( + * { + * // Required. The ID of the Game Server Cluster resource to be created. + * gameServerClusterId: 'placeholder-value', + * // Required. The parent resource name. Uses the form: + * // `projects/{project}/locations/{location}/realms/{realm-id}`. + * parent: 'projects/my-project/locations/my-location/realms/my-realm', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "connectionInfo": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "labels": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.realms.gameServerClusters.create * @memberOf! () * @@ -3922,6 +5523,54 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.realms.gameServerClusters.delete * @desc Deletes a single game server cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.realms.gameServerClusters.delete( + * { + * // Required. The name of the Game Server Cluster to delete. Uses the form: + * // `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. + * name: + * 'projects/my-project/locations/my-location/realms/my-realm/gameServerClusters/my-gameServerCluster', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.realms.gameServerClusters.delete * @memberOf! () * @@ -3993,6 +5642,57 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.realms.gameServerClusters.get * @desc Gets details of a single game server cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.realms.gameServerClusters.get( + * { + * // Required. The name of the Game Server Cluster to retrieve. Uses the form: + * // + * // `projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`. + * name: + * 'projects/my-project/locations/my-location/realms/my-realm/gameServerClusters/my-gameServerCluster', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "connectionInfo": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "labels": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.realms.gameServerClusters.get * @memberOf! () * @@ -4064,6 +5764,64 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.realms.gameServerClusters.list * @desc Lists Game Server Clusters in a given project and location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.realms.gameServerClusters.list( + * { + * // Optional. The filter to apply to list results. + * filter: 'placeholder-value', + * // Optional. Specifies the ordering of results following syntax at + * // https://cloud.google.com/apis/design/design_patterns#sorting_order. + * orderBy: 'placeholder-value', + * // Optional. The maximum number of items to return. If unspecified, server + * // will pick an appropriate default. Server may return fewer items than + * // requested. A caller should only rely on response's + * // next_page_token to + * // determine if there are more GameServerClusters left to be queried. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // Required. The parent resource name. Uses the form: + * // "projects/{project}/locations/{location}/realms/{realm}". + * parent: 'projects/my-project/locations/my-location/realms/my-realm', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "gameServerClusters": [], + * // "nextPageToken": "my_nextPageToken", + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.realms.gameServerClusters.list * @memberOf! () * @@ -4151,6 +5909,79 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.realms.gameServerClusters.patch * @desc Patches a single game server cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.realms.gameServerClusters.patch( + * { + * // Required. The resource name of the Game Server Cluster. Uses the form: + * // + * // `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`. + * // For example, + * // + * // `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`. + * name: + * 'projects/my-project/locations/my-location/realms/my-realm/gameServerClusters/my-gameServerCluster', + * // Required. Mask of fields to update. At least one path must be supplied in + * // this field. For the `FieldMask` definition, see + * // + * // https: + * // //developers.google.com/protocol-buffers + * // // /docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "connectionInfo": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "labels": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.realms.gameServerClusters.patch * @memberOf! () * @@ -4224,6 +6055,68 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.realms.gameServerClusters.previewCreate * @desc Previews creation of a new game server cluster in a given project and location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.realms.gameServerClusters.previewCreate( + * { + * // Required. The ID of the Game Server Cluster resource to be created. + * gameServerClusterId: 'placeholder-value', + * // Required. The parent resource name. Uses the form: + * // `projects/{project}/locations/{location}/realms/{realm}`. + * parent: 'projects/my-project/locations/my-location/realms/my-realm', + * // Optional. The target timestamp to compute the preview. + * previewTime: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "connectionInfo": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "labels": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "targetState": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.realms.gameServerClusters.previewCreate * @memberOf! () * @@ -4317,6 +6210,53 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.realms.gameServerClusters.previewDelete * @desc Previews deletion of a single game server cluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.realms.gameServerClusters.previewDelete( + * { + * // Required. The name of the Game Server Cluster to delete. Uses the form: + * // `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. + * name: + * 'projects/my-project/locations/my-location/realms/my-realm/gameServerClusters/my-gameServerCluster', + * // Optional. The target timestamp to compute the preview. + * previewTime: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "targetState": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.realms.gameServerClusters.previewDelete * @memberOf! () * @@ -4409,6 +6349,78 @@ export namespace gameservices_v1beta { /** * gameservices.projects.locations.realms.gameServerClusters.previewUpdate * @desc Previews updating a GameServerCluster. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gameservices.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 gameservices = google.gameservices('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 gameservices.projects.locations.realms.gameServerClusters.previewUpdate( + * { + * // Required. The resource name of the Game Server Cluster. Uses the form: + * // + * // `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`. + * // For example, + * // + * // `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`. + * name: + * 'projects/my-project/locations/my-location/realms/my-realm/gameServerClusters/my-gameServerCluster', + * // Optional. The target timestamp to compute the preview. + * previewTime: 'placeholder-value', + * // Required. Mask of fields to update. At least one path must be supplied in + * // this field. For the `FieldMask` definition, see + * // + * // https: + * // //developers.google.com/protocol-buffers + * // // /docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "connectionInfo": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "labels": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "targetState": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gameservices.projects.locations.realms.gameServerClusters.previewUpdate * @memberOf! () * diff --git a/src/apis/genomics/v1.ts b/src/apis/genomics/v1.ts index 01a9c534933..794b6dd3be3 100644 --- a/src/apis/genomics/v1.ts +++ b/src/apis/genomics/v1.ts @@ -426,52 +426,52 @@ export namespace genomics_v1 { * genomics.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients may use Operations.GetOperation or Operations.ListOperations to check whether the cancellation succeeded or the operation completed despite cancellation. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission: * `genomics.operations.cancel` * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/genomics.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'); - * var genomics = google.genomics('v1'); + * const genomics = google.genomics('v1'); * - * authorize(function(authClient) { - * var request = { + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/genomics', + * ], + * }); + * + * // 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 genomics.operations.cancel({ * // The name of the operation resource to be cancelled. - * name: 'operations/my-operation', // TODO: Update placeholder value. + * name: 'operations/.*', * - * resource: { - * // TODO: Add desired properties to the request body. + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * genomics.operations.cancel(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias genomics.operations.cancel * @memberOf! () * @@ -543,51 +543,52 @@ export namespace genomics_v1 { * genomics.operations.get * @desc 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. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission: * `genomics.operations.get` * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/genomics.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'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource. - * name: 'operations/my-operation', // TODO: Update placeholder value. + * const genomics = google.genomics('v1'); * - * auth: authClient, - * }; + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/genomics', + * ], + * }); * - * genomics.operations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await genomics.operations.get({ + * // The name of the operation resource. + * name: 'operations/.*', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias genomics.operations.get * @memberOf! () * @@ -659,64 +660,84 @@ export namespace genomics_v1 { * genomics.operations.list * @desc Lists operations that match the specified filter in the request. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission: * `genomics.operations.list` * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/genomics.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'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation's parent resource. - * name: 'operations', // TODO: Update placeholder value. + * const genomics = google.genomics('v1'); * - * auth: authClient, - * }; + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/genomics', + * ], + * }); * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * var operationsPage = response['operations']; - * if (!operationsPage) { - * return; - * } - * for (var i = 0; i < operationsPage.length; i++) { - * // TODO: Change code below to process each resource in `operationsPage`: - * console.log(JSON.stringify(operationsPage[i], null, 2)); - * } + * // Do the magic + * const res = await genomics.operations.list({ + * // A string for filtering Operations. + * // In v2alpha1, the following filter fields are supported: + * // + * // * createTime: The time this job was created + * // * events: The set of event (names) that have occurred while running + * // the pipeline. The : operator can be used to determine if a + * // particular event has occurred. + * // * error: If the pipeline is running, this value is NULL. Once the + * // pipeline finishes, the value is the standard Google error code. + * // * labels.key or labels."key with space" where key is a label key. + * // * done: If the pipeline is running, this value is false. Once the + * // pipeline finishes, the value is true. + * // + * // In v1 and v1alpha2, the following filter fields are supported: + * // + * // * projectId: Required. Corresponds to + * // OperationMetadata.projectId. + * // * createTime: The time this job was created, in seconds from the + * // [epoch](http://en.wikipedia.org/wiki/Unix_time). Can use `>=` and/or `<=` + * // operators. + * // * status: Can be `RUNNING`, `SUCCESS`, `FAILURE`, or `CANCELED`. Only + * // one status may be specified. + * // * labels.key where key is a label key. + * // + * // Examples: + * // + * // * `projectId = my-project AND createTime >= 1432140000` + * // * `projectId = my-project AND createTime >= 1432140000 AND createTime <= 1432150000 AND status = RUNNING` + * // * `projectId = my-project AND labels.color = *` + * // * `projectId = my-project AND labels.color = red` + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'operations', + * // The maximum number of results to return. The maximum value is 256. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * genomics.operations.list(request, handlePage); - * } - * }; + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } * - * genomics.operations.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias genomics.operations.list * @memberOf! () * diff --git a/src/apis/genomics/v1alpha2.ts b/src/apis/genomics/v1alpha2.ts index c74c948747f..12629a4bd5f 100644 --- a/src/apis/genomics/v1alpha2.ts +++ b/src/apis/genomics/v1alpha2.ts @@ -718,52 +718,52 @@ export namespace genomics_v1alpha2 { * genomics.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients may use Operations.GetOperation or Operations.ListOperations to check whether the cancellation succeeded or the operation completed despite cancellation. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission: * `genomics.operations.cancel` * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/genomics.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'); - * var genomics = google.genomics('v1alpha2'); + * const genomics = google.genomics('v1alpha2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/genomics', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await genomics.operations.cancel({ * // The name of the operation resource to be cancelled. - * name: 'operations/my-operation', // TODO: Update placeholder value. + * name: 'operations/.*', * - * resource: { - * // TODO: Add desired properties to the request body. + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * genomics.operations.cancel(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias genomics.operations.cancel * @memberOf! () * @@ -838,51 +838,52 @@ export namespace genomics_v1alpha2 { * genomics.operations.get * @desc 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. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission: * `genomics.operations.get` * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/genomics.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'); - * var genomics = google.genomics('v1alpha2'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource. - * name: 'operations/my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * const genomics = google.genomics('v1alpha2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/genomics', + * ], + * }); * - * genomics.operations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await genomics.operations.get({ + * // The name of the operation resource. + * name: 'operations/.*', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias genomics.operations.get * @memberOf! () * @@ -954,64 +955,84 @@ export namespace genomics_v1alpha2 { * genomics.operations.list * @desc Lists operations that match the specified filter in the request. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission: * `genomics.operations.list` * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/genomics.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'); - * var genomics = google.genomics('v1alpha2'); + * const genomics = google.genomics('v1alpha2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/genomics', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 genomics.operations.list({ + * // A string for filtering Operations. + * // In v2alpha1, the following filter fields are supported: + * // + * // * createTime: The time this job was created + * // * events: The set of event (names) that have occurred while running + * // the pipeline. The : operator can be used to determine if a + * // particular event has occurred. + * // * error: If the pipeline is running, this value is NULL. Once the + * // pipeline finishes, the value is the standard Google error code. + * // * labels.key or labels."key with space" where key is a label key. + * // * done: If the pipeline is running, this value is false. Once the + * // pipeline finishes, the value is true. + * // + * // In v1 and v1alpha2, the following filter fields are supported: + * // + * // * projectId: Required. Corresponds to + * // OperationMetadata.projectId. + * // * createTime: The time this job was created, in seconds from the + * // [epoch](http://en.wikipedia.org/wiki/Unix_time). Can use `>=` and/or `<=` + * // operators. + * // * status: Can be `RUNNING`, `SUCCESS`, `FAILURE`, or `CANCELED`. Only + * // one status may be specified. + * // * labels.key where key is a label key. + * // + * // Examples: + * // + * // * `projectId = my-project AND createTime >= 1432140000` + * // * `projectId = my-project AND createTime >= 1432140000 AND createTime <= 1432150000 AND status = RUNNING` + * // * `projectId = my-project AND labels.color = *` + * // * `projectId = my-project AND labels.color = red` + * filter: 'placeholder-value', * // The name of the operation's parent resource. - * name: 'operations', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var operationsPage = response['operations']; - * if (!operationsPage) { - * return; - * } - * for (var i = 0; i < operationsPage.length; i++) { - * // TODO: Change code below to process each resource in `operationsPage`: - * console.log(JSON.stringify(operationsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * genomics.operations.list(request, handlePage); - * } - * }; - * - * genomics.operations.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * name: 'operations', + * // The maximum number of results to return. The maximum value is 256. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias genomics.operations.list * @memberOf! () * @@ -1147,52 +1168,67 @@ export namespace genomics_v1alpha2 { * genomics.pipelines.create * @desc Creates a pipeline that can be run later. Create takes a Pipeline that has all fields other than `pipelineId` populated, and then returns the same pipeline with `pipelineId` populated. This id can be used to run the pipeline. Caller must have WRITE permission to the project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/genomics.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'); - * var genomics = google.genomics('v1alpha2'); + * const genomics = google.genomics('v1alpha2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/genomics', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 genomics.pipelines.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "docker": {}, + * // "inputParameters": [], + * // "name": "my_name", + * // "outputParameters": [], + * // "pipelineId": "my_pipelineId", + * // "projectId": "my_projectId", + * // "resources": {} + * // } * }, - * - * auth: authClient, - * }; - * - * genomics.pipelines.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "docker": {}, + * // "inputParameters": [], + * // "name": "my_name", + * // "outputParameters": [], + * // "pipelineId": "my_pipelineId", + * // "projectId": "my_projectId", + * // "resources": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias genomics.pipelines.create * @memberOf! () * @@ -1265,49 +1301,47 @@ export namespace genomics_v1alpha2 { * genomics.pipelines.delete * @desc Deletes a pipeline based on ID. Caller must have WRITE permission to the project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/genomics.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'); - * var genomics = google.genomics('v1alpha2'); + * const genomics = google.genomics('v1alpha2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/genomics', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 genomics.pipelines.delete({ * // Caller must have WRITE access to the project in which this pipeline * // is defined. - * pipelineId: 'my-pipeline-id', // TODO: Update placeholder value. + * pipelineId: 'placeholder-value', + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * genomics.pipelines.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias genomics.pipelines.delete * @memberOf! () * @@ -1380,52 +1414,56 @@ export namespace genomics_v1alpha2 { * genomics.pipelines.get * @desc Retrieves a pipeline based on ID. Caller must have READ permission to the project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/genomics.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'); - * var genomics = google.genomics('v1alpha2'); + * const genomics = google.genomics('v1alpha2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/genomics', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 genomics.pipelines.get({ * // Caller must have READ access to the project in which this pipeline * // is defined. - * pipelineId: 'my-pipeline-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * genomics.pipelines.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * pipelineId: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "docker": {}, + * // "inputParameters": [], + * // "name": "my_name", + * // "outputParameters": [], + * // "pipelineId": "my_pipelineId", + * // "projectId": "my_projectId", + * // "resources": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias genomics.pipelines.get * @memberOf! () * @@ -1498,48 +1536,57 @@ export namespace genomics_v1alpha2 { * genomics.pipelines.getControllerConfig * @desc Gets controller configuration information. Should only be called by VMs created by the Pipelines Service and not by end users. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/genomics.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'); - * var genomics = google.genomics('v1alpha2'); + * const genomics = google.genomics('v1alpha2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/genomics', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * genomics.pipelines.getControllerConfig(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await genomics.pipelines.getControllerConfig({ + * // The operation to retrieve controller configuration for. + * operationId: 'placeholder-value', * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * validationToken: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cmd": "my_cmd", + * // "disks": {}, + * // "gcsLogPath": "my_gcsLogPath", + * // "gcsSinks": {}, + * // "gcsSources": {}, + * // "image": "my_image", + * // "machineType": "my_machineType", + * // "vars": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias genomics.pipelines.getControllerConfig * @memberOf! () * @@ -1618,61 +1665,60 @@ export namespace genomics_v1alpha2 { * genomics.pipelines.list * @desc Lists pipelines. Caller must have READ permission to the project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/genomics.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'); - * var genomics = google.genomics('v1alpha2'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var pipelinesPage = response['pipelines']; - * if (!pipelinesPage) { - * return; - * } - * for (var i = 0; i < pipelinesPage.length; i++) { - * // TODO: Change code below to process each resource in `pipelinesPage`: - * console.log(JSON.stringify(pipelinesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * genomics.pipelines.list(request, handlePage); - * } - * }; - * - * genomics.pipelines.list(request, handlePage); - * }); + * const genomics = google.genomics('v1alpha2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/genomics', + * ], + * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 genomics.pipelines.list({ + * // Pipelines with names that match this prefix should be + * // returned. If unspecified, all pipelines in the project, up to + * // `pageSize`, will be returned. + * namePrefix: 'placeholder-value', + * // Number of pipelines to return at once. Defaults to 256, and max + * // is 2048. + * pageSize: 'placeholder-value', + * // Token to use to indicate where to start getting results. + * // If unspecified, returns the first page of results. + * pageToken: 'placeholder-value', + * // Required. The name of the project to search for pipelines. Caller + * // must have READ access to this project. + * projectId: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "pipelines": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias genomics.pipelines.list * @memberOf! () * @@ -1752,52 +1798,60 @@ export namespace genomics_v1alpha2 { * genomics.pipelines.run * @desc Runs a pipeline. If `pipelineId` is specified in the request, then run a saved pipeline. If `ephemeralPipeline` is specified, then run that pipeline once without saving a copy. The caller must have READ permission to the project where the pipeline is stored and WRITE permission to the project where the pipeline will be run, as VMs will be created and storage will be used. If a pipeline operation is still running after 6 days, it will be canceled. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/genomics.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'); - * var genomics = google.genomics('v1alpha2'); + * const genomics = google.genomics('v1alpha2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/genomics', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 genomics.pipelines.run({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ephemeralPipeline": {}, + * // "pipelineArgs": {}, + * // "pipelineId": "my_pipelineId" + * // } * }, - * - * auth: authClient, - * }; - * - * genomics.pipelines.run(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias genomics.pipelines.run * @memberOf! () * @@ -1872,50 +1926,55 @@ export namespace genomics_v1alpha2 { * genomics.pipelines.setOperationStatus * @desc Sets status of a given operation. Any new timestamps (as determined by description) are appended to TimestampEvents. Should only be called by VMs created by the Pipelines Service and not by end users. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/genomics.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'); - * var genomics = google.genomics('v1alpha2'); + * const genomics = google.genomics('v1alpha2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/genomics', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * // 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 genomics.pipelines.setOperationStatus({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "errorCode": "my_errorCode", + * // "errorMessage": "my_errorMessage", + * // "operationId": "my_operationId", + * // "timestampEvents": [], + * // "validationToken": "my_validationToken" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * genomics.pipelines.setOperationStatus(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias genomics.pipelines.setOperationStatus * @memberOf! () * diff --git a/src/apis/genomics/v2alpha1.ts b/src/apis/genomics/v2alpha1.ts index 4b9f9f9b1a5..f2c206cd668 100644 --- a/src/apis/genomics/v2alpha1.ts +++ b/src/apis/genomics/v2alpha1.ts @@ -803,52 +803,58 @@ export namespace genomics_v2alpha1 { * genomics.pipelines.run * @desc Runs a pipeline. The returned Operation's metadata field will contain a google.genomics.v2alpha1.Metadata object describing the status of the pipeline execution. The [response] field will contain a google.genomics.v2alpha1.RunPipelineResponse object if the pipeline completes successfully. **Note:** Before you can use this method, the Genomics Service Agent must have access to your project. This is done automatically when the Cloud Genomics API is first enabled, but if you delete this permission, or if you enabled the Cloud Genomics API before the v2alpha1 API launch, you must disable and re-enable the API to grant the Genomics Service Agent the required permissions. Authorization requires the following [Google IAM](https://cloud.google.com/iam/) permission: * `genomics.operations.create` [1]: /genomics/gsa * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/genomics.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'); - * var genomics = google.genomics('v2alpha1'); + * const genomics = google.genomics('v2alpha1'); * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/genomics', + * ], + * }); * - * genomics.pipelines.run(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await genomics.pipelines.run({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labels": {}, + * // "pipeline": {} + * // } + * }, * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias genomics.pipelines.run * @memberOf! () * @@ -953,52 +959,52 @@ export namespace genomics_v2alpha1 { * genomics.projects.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients may use Operations.GetOperation or Operations.ListOperations to check whether the cancellation succeeded or the operation completed despite cancellation. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission: * `genomics.operations.cancel` * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/genomics.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'); - * var genomics = google.genomics('v2alpha1'); + * const genomics = google.genomics('v2alpha1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/genomics', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await genomics.projects.operations.cancel({ * // The name of the operation resource to be cancelled. - * name: 'projects/my-project/operations/my-operation', // TODO: Update placeholder value. + * name: 'projects/my-project/operations/my-operation', * - * resource: { - * // TODO: Add desired properties to the request body. + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * genomics.projects.operations.cancel(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias genomics.projects.operations.cancel * @memberOf! () * @@ -1073,51 +1079,52 @@ export namespace genomics_v2alpha1 { * genomics.projects.operations.get * @desc 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. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission: * `genomics.operations.get` * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/genomics.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'); - * var genomics = google.genomics('v2alpha1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource. - * name: 'projects/my-project/operations/my-operation', // TODO: Update placeholder value. + * const genomics = google.genomics('v2alpha1'); * - * auth: authClient, - * }; + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/genomics', + * ], + * }); * - * genomics.projects.operations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await genomics.projects.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/operations/my-operation', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias genomics.projects.operations.get * @memberOf! () * @@ -1190,64 +1197,84 @@ export namespace genomics_v2alpha1 { * genomics.projects.operations.list * @desc Lists operations that match the specified filter in the request. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission: * `genomics.operations.list` * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/genomics.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'); - * var genomics = google.genomics('v2alpha1'); + * const genomics = google.genomics('v2alpha1'); * - * authorize(function(authClient) { - * var request = { - * // The name of the operation's parent resource. - * name: 'projects/my-project/operations', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/genomics', + * ], + * }); * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * var operationsPage = response['operations']; - * if (!operationsPage) { - * return; - * } - * for (var i = 0; i < operationsPage.length; i++) { - * // TODO: Change code below to process each resource in `operationsPage`: - * console.log(JSON.stringify(operationsPage[i], null, 2)); - * } + * // Do the magic + * const res = await genomics.projects.operations.list({ + * // A string for filtering Operations. + * // In v2alpha1, the following filter fields are supported: + * // + * // * createTime: The time this job was created + * // * events: The set of event (names) that have occurred while running + * // the pipeline. The : operator can be used to determine if a + * // particular event has occurred. + * // * error: If the pipeline is running, this value is NULL. Once the + * // pipeline finishes, the value is the standard Google error code. + * // * labels.key or labels."key with space" where key is a label key. + * // * done: If the pipeline is running, this value is false. Once the + * // pipeline finishes, the value is true. + * // + * // In v1 and v1alpha2, the following filter fields are supported: + * // + * // * projectId: Required. Corresponds to + * // OperationMetadata.projectId. + * // * createTime: The time this job was created, in seconds from the + * // [epoch](http://en.wikipedia.org/wiki/Unix_time). Can use `>=` and/or `<=` + * // operators. + * // * status: Can be `RUNNING`, `SUCCESS`, `FAILURE`, or `CANCELED`. Only + * // one status may be specified. + * // * labels.key where key is a label key. + * // + * // Examples: + * // + * // * `projectId = my-project AND createTime >= 1432140000` + * // * `projectId = my-project AND createTime >= 1432140000 AND createTime <= 1432150000 AND status = RUNNING` + * // * `projectId = my-project AND labels.color = *` + * // * `projectId = my-project AND labels.color = red` + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/operations', + * // The maximum number of results to return. The maximum value is 256. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * genomics.projects.operations.list(request, handlePage); - * } - * }; + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } * - * genomics.projects.operations.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias genomics.projects.operations.list * @memberOf! () * @@ -1385,6 +1412,62 @@ export namespace genomics_v2alpha1 { /** * genomics.projects.workers.checkIn * @desc The worker uses this method to retrieve the assigned operation and provide periodic status updates. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/genomics.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 genomics = google.genomics('v2alpha1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/genomics', + * ], + * }); + * + * // 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 genomics.projects.workers.checkIn({ + * // The worker id, assigned when it was created. + * id: 'projects/my-project/workers/my-worker', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deadlineExpired": {}, + * // "event": {}, + * // "events": [], + * // "result": {}, + * // "workerStatus": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deadline": "my_deadline", + * // "metadata": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias genomics.projects.workers.checkIn * @memberOf! () * @@ -1486,55 +1569,61 @@ export namespace genomics_v2alpha1 { * genomics.workers.checkIn * @desc The worker uses this method to retrieve the assigned operation and provide periodic status updates. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/genomics.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'); - * var genomics = google.genomics('v2alpha1'); + * const genomics = google.genomics('v2alpha1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/genomics', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 genomics.workers.checkIn({ * // The worker id, assigned when it was created. - * id: 'my-id', // TODO: Update placeholder value. + * id: 'placeholder-value', * - * resource: { - * // TODO: Add desired properties to the request body. + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deadlineExpired": {}, + * // "event": {}, + * // "events": [], + * // "result": {}, + * // "workerStatus": {} + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * genomics.workers.checkIn(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "deadline": "my_deadline", + * // "metadata": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias genomics.workers.checkIn * @memberOf! () * diff --git a/src/apis/gmail/v1.ts b/src/apis/gmail/v1.ts index e2f17bd6609..1df43c1d494 100644 --- a/src/apis/gmail/v1.ts +++ b/src/apis/gmail/v1.ts @@ -846,6 +846,55 @@ export namespace gmail_v1 { /** * gmail.users.getProfile * @desc Gets the current user's Gmail profile. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.compose', + * 'https://www.googleapis.com/auth/gmail.metadata', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.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 gmail.users.getProfile({ + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "emailAddress": "my_emailAddress", + * // "historyId": "my_historyId", + * // "messagesTotal": 0, + * // "threadsTotal": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.getProfile * @memberOf! () * @@ -917,6 +966,46 @@ export namespace gmail_v1 { /** * gmail.users.stop * @desc Stop receiving push notifications for the given user mailbox. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.metadata', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.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 gmail.users.stop({ + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.stop * @memberOf! () * @@ -988,6 +1077,62 @@ export namespace gmail_v1 { /** * gmail.users.watch * @desc Set up or update a push notification watch on the given user mailbox. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.metadata', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.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 gmail.users.watch({ + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labelFilterAction": "my_labelFilterAction", + * // "labelIds": [], + * // "topicName": "my_topicName" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "expiration": "my_expiration", + * // "historyId": "my_historyId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.watch * @memberOf! () * @@ -1108,6 +1253,65 @@ export namespace gmail_v1 { /** * gmail.users.drafts.create * @desc Creates a new draft with the DRAFT label. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.addons.current.action.compose', + * 'https://www.googleapis.com/auth/gmail.compose', + * 'https://www.googleapis.com/auth/gmail.modify', + * ], + * }); + * + * // 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 gmail.users.drafts.create({ + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "message": {} + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "message": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.drafts.create * @memberOf! () * @@ -1188,6 +1392,47 @@ export namespace gmail_v1 { /** * gmail.users.drafts.delete * @desc Immediately and permanently deletes the specified draft. Does not simply trash it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.compose', + * 'https://www.googleapis.com/auth/gmail.modify', + * ], + * }); + * + * // 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 gmail.users.drafts.delete({ + * // The ID of the draft to delete. + * id: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.drafts.delete * @memberOf! () * @@ -1261,6 +1506,56 @@ export namespace gmail_v1 { /** * gmail.users.drafts.get * @desc Gets the specified draft. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.compose', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.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 gmail.users.drafts.get({ + * // The format to return the draft in. + * format: 'placeholder-value', + * // The ID of the draft to retrieve. + * id: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "message": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.drafts.get * @memberOf! () * @@ -1334,6 +1629,61 @@ export namespace gmail_v1 { /** * gmail.users.drafts.list * @desc Lists the drafts in the user's mailbox. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.compose', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.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 gmail.users.drafts.list({ + * // Include drafts from SPAM and TRASH in the results. + * includeSpamTrash: 'placeholder-value', + * // Maximum number of drafts to return. + * maxResults: 'placeholder-value', + * // Page token to retrieve a specific page of results in the list. + * pageToken: 'placeholder-value', + * // Only return draft messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". + * q: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "drafts": [], + * // "nextPageToken": "my_nextPageToken", + * // "resultSizeEstimate": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.drafts.list * @memberOf! () * @@ -1412,6 +1762,71 @@ export namespace gmail_v1 { /** * gmail.users.drafts.send * @desc Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.compose', + * 'https://www.googleapis.com/auth/gmail.modify', + * ], + * }); + * + * // 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 gmail.users.drafts.send({ + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "message": {} + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "historyId": "my_historyId", + * // "id": "my_id", + * // "internalDate": "my_internalDate", + * // "labelIds": [], + * // "payload": {}, + * // "raw": "my_raw", + * // "sizeEstimate": 0, + * // "snippet": "my_snippet", + * // "threadId": "my_threadId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.drafts.send * @memberOf! () * @@ -1491,6 +1906,66 @@ export namespace gmail_v1 { /** * gmail.users.drafts.update * @desc Replaces a draft's content. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.compose', + * 'https://www.googleapis.com/auth/gmail.modify', + * ], + * }); + * + * // 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 gmail.users.drafts.update({ + * // The ID of the draft to update. + * id: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "message": {} + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "message": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.drafts.update * @memberOf! () * @@ -1742,6 +2217,63 @@ export namespace gmail_v1 { /** * gmail.users.history.list * @desc Lists the history of all changes to the given mailbox. History results are returned in chronological order (increasing historyId). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.metadata', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.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 gmail.users.history.list({ + * // History types to be returned by the function + * historyTypes: 'placeholder-value', + * // Only return messages with a label matching the ID. + * labelId: 'placeholder-value', + * // The maximum number of history records to return. + * maxResults: 'placeholder-value', + * // Page token to retrieve a specific page of results in the list. + * pageToken: 'placeholder-value', + * // Required. Returns history records after the specified startHistoryId. The supplied startHistoryId should be obtained from the historyId of a message, thread, or previous list response. History IDs increase chronologically but are not contiguous with random gaps in between valid IDs. Supplying an invalid or out of date startHistoryId typically returns an HTTP 404 error code. A historyId is typically valid for at least a week, but in some rare circumstances may be valid for only a few hours. If you receive an HTTP 404 error response, your application should perform a full sync. If you receive no nextPageToken in the response, there are no updates to retrieve and you can store the returned historyId for a future request. + * startHistoryId: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "history": [], + * // "historyId": "my_historyId", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.history.list * @memberOf! () * @@ -1861,6 +2393,76 @@ export namespace gmail_v1 { /** * gmail.users.labels.create * @desc Creates a new label. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.labels', + * 'https://www.googleapis.com/auth/gmail.modify', + * ], + * }); + * + * // 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 gmail.users.labels.create({ + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "color": {}, + * // "id": "my_id", + * // "labelListVisibility": "my_labelListVisibility", + * // "messageListVisibility": "my_messageListVisibility", + * // "messagesTotal": 0, + * // "messagesUnread": 0, + * // "name": "my_name", + * // "threadsTotal": 0, + * // "threadsUnread": 0, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "color": {}, + * // "id": "my_id", + * // "labelListVisibility": "my_labelListVisibility", + * // "messageListVisibility": "my_messageListVisibility", + * // "messagesTotal": 0, + * // "messagesUnread": 0, + * // "name": "my_name", + * // "threadsTotal": 0, + * // "threadsUnread": 0, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.labels.create * @memberOf! () * @@ -1934,6 +2536,47 @@ export namespace gmail_v1 { /** * gmail.users.labels.delete * @desc Immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.labels', + * 'https://www.googleapis.com/auth/gmail.modify', + * ], + * }); + * + * // 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 gmail.users.labels.delete({ + * // The ID of the label to delete. + * id: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.labels.delete * @memberOf! () * @@ -2007,6 +2650,63 @@ export namespace gmail_v1 { /** * gmail.users.labels.get * @desc Gets the specified label. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.labels', + * 'https://www.googleapis.com/auth/gmail.metadata', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.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 gmail.users.labels.get({ + * // The ID of the label to retrieve. + * id: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "color": {}, + * // "id": "my_id", + * // "labelListVisibility": "my_labelListVisibility", + * // "messageListVisibility": "my_messageListVisibility", + * // "messagesTotal": 0, + * // "messagesUnread": 0, + * // "name": "my_name", + * // "threadsTotal": 0, + * // "threadsUnread": 0, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.labels.get * @memberOf! () * @@ -2079,6 +2779,52 @@ export namespace gmail_v1 { /** * gmail.users.labels.list * @desc Lists all labels in the user's mailbox. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.labels', + * 'https://www.googleapis.com/auth/gmail.metadata', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.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 gmail.users.labels.list({ + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "labels": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.labels.list * @memberOf! () * @@ -2153,6 +2899,78 @@ export namespace gmail_v1 { /** * gmail.users.labels.patch * @desc Updates the specified label. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.labels', + * 'https://www.googleapis.com/auth/gmail.modify', + * ], + * }); + * + * // 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 gmail.users.labels.patch({ + * // The ID of the label to update. + * id: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "color": {}, + * // "id": "my_id", + * // "labelListVisibility": "my_labelListVisibility", + * // "messageListVisibility": "my_messageListVisibility", + * // "messagesTotal": 0, + * // "messagesUnread": 0, + * // "name": "my_name", + * // "threadsTotal": 0, + * // "threadsUnread": 0, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "color": {}, + * // "id": "my_id", + * // "labelListVisibility": "my_labelListVisibility", + * // "messageListVisibility": "my_messageListVisibility", + * // "messagesTotal": 0, + * // "messagesUnread": 0, + * // "name": "my_name", + * // "threadsTotal": 0, + * // "threadsUnread": 0, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.labels.patch * @memberOf! () * @@ -2227,6 +3045,78 @@ export namespace gmail_v1 { /** * gmail.users.labels.update * @desc Updates the specified label. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.labels', + * 'https://www.googleapis.com/auth/gmail.modify', + * ], + * }); + * + * // 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 gmail.users.labels.update({ + * // The ID of the label to update. + * id: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "color": {}, + * // "id": "my_id", + * // "labelListVisibility": "my_labelListVisibility", + * // "messageListVisibility": "my_messageListVisibility", + * // "messagesTotal": 0, + * // "messagesUnread": 0, + * // "name": "my_name", + * // "threadsTotal": 0, + * // "threadsUnread": 0, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "color": {}, + * // "id": "my_id", + * // "labelListVisibility": "my_labelListVisibility", + * // "messageListVisibility": "my_messageListVisibility", + * // "messagesTotal": 0, + * // "messagesUnread": 0, + * // "name": "my_name", + * // "threadsTotal": 0, + * // "threadsUnread": 0, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.labels.update * @memberOf! () * @@ -2413,6 +3303,49 @@ export namespace gmail_v1 { /** * gmail.users.messages.batchDelete * @desc Deletes many messages by message ID. Provides no guarantees that messages were not already deleted or even existed at all. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/'], + * }); + * + * // 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 gmail.users.messages.batchDelete({ + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ids": [] + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.messages.batchDelete * @memberOf! () * @@ -2485,6 +3418,54 @@ export namespace gmail_v1 { /** * gmail.users.messages.batchModify * @desc Modifies the labels on the specified messages. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * ], + * }); + * + * // 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 gmail.users.messages.batchModify({ + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "addLabelIds": [], + * // "ids": [], + * // "removeLabelIds": [] + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.messages.batchModify * @memberOf! () * @@ -2557,6 +3538,43 @@ export namespace gmail_v1 { /** * gmail.users.messages.delete * @desc Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer messages.trash instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/'], + * }); + * + * // 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 gmail.users.messages.delete({ + * // The ID of the message to delete. + * id: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.messages.delete * @memberOf! () * @@ -2630,6 +3648,68 @@ export namespace gmail_v1 { /** * gmail.users.messages.get * @desc Gets the specified message. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.addons.current.message.action', + * 'https://www.googleapis.com/auth/gmail.addons.current.message.metadata', + * 'https://www.googleapis.com/auth/gmail.addons.current.message.readonly', + * 'https://www.googleapis.com/auth/gmail.metadata', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.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 gmail.users.messages.get({ + * // The format to return the message in. + * format: 'placeholder-value', + * // The ID of the message to retrieve. + * id: 'placeholder-value', + * // When given and format is METADATA, only include headers specified. + * metadataHeaders: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "historyId": "my_historyId", + * // "id": "my_id", + * // "internalDate": "my_internalDate", + * // "labelIds": [], + * // "payload": {}, + * // "raw": "my_raw", + * // "sizeEstimate": 0, + * // "snippet": "my_snippet", + * // "threadId": "my_threadId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.messages.get * @memberOf! () * @@ -2705,6 +3785,86 @@ export namespace gmail_v1 { /** * gmail.users.messages.import * @desc Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. Does not send a message. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.insert', + * 'https://www.googleapis.com/auth/gmail.modify', + * ], + * }); + * + * // 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 gmail.users.messages.import({ + * // Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for G Suite accounts. + * deleted: 'placeholder-value', + * // Source for Gmail's internal date of the message. + * internalDateSource: 'placeholder-value', + * // Ignore the Gmail spam classifier decision and never mark this email as SPAM in the mailbox. + * neverMarkSpam: 'placeholder-value', + * // Process calendar invites in the email and add any extracted meetings to the Google Calendar for this user. + * processForCalendar: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "historyId": "my_historyId", + * // "id": "my_id", + * // "internalDate": "my_internalDate", + * // "labelIds": [], + * // "payload": {}, + * // "raw": "my_raw", + * // "sizeEstimate": 0, + * // "snippet": "my_snippet", + * // "threadId": "my_threadId" + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "historyId": "my_historyId", + * // "id": "my_id", + * // "internalDate": "my_internalDate", + * // "labelIds": [], + * // "payload": {}, + * // "raw": "my_raw", + * // "sizeEstimate": 0, + * // "snippet": "my_snippet", + * // "threadId": "my_threadId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.messages.import * @memberOf! () * @@ -2788,6 +3948,82 @@ export namespace gmail_v1 { /** * gmail.users.messages.insert * @desc Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.insert', + * 'https://www.googleapis.com/auth/gmail.modify', + * ], + * }); + * + * // 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 gmail.users.messages.insert({ + * // Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for G Suite accounts. + * deleted: 'placeholder-value', + * // Source for Gmail's internal date of the message. + * internalDateSource: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "historyId": "my_historyId", + * // "id": "my_id", + * // "internalDate": "my_internalDate", + * // "labelIds": [], + * // "payload": {}, + * // "raw": "my_raw", + * // "sizeEstimate": 0, + * // "snippet": "my_snippet", + * // "threadId": "my_threadId" + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "historyId": "my_historyId", + * // "id": "my_id", + * // "internalDate": "my_internalDate", + * // "labelIds": [], + * // "payload": {}, + * // "raw": "my_raw", + * // "sizeEstimate": 0, + * // "snippet": "my_snippet", + * // "threadId": "my_threadId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.messages.insert * @memberOf! () * @@ -2869,6 +4105,63 @@ export namespace gmail_v1 { /** * gmail.users.messages.list * @desc Lists the messages in the user's mailbox. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.metadata', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.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 gmail.users.messages.list({ + * // Include messages from SPAM and TRASH in the results. + * includeSpamTrash: 'placeholder-value', + * // Only return messages with labels that match all of the specified label IDs. + * labelIds: 'placeholder-value', + * // Maximum number of messages to return. + * maxResults: 'placeholder-value', + * // Page token to retrieve a specific page of results in the list. + * pageToken: 'placeholder-value', + * // Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used when accessing the api using the gmail.metadata scope. + * q: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "messages": [], + * // "nextPageToken": "my_nextPageToken", + * // "resultSizeEstimate": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.messages.list * @memberOf! () * @@ -2950,6 +4243,68 @@ export namespace gmail_v1 { /** * gmail.users.messages.modify * @desc Modifies the labels on the specified message. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * ], + * }); + * + * // 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 gmail.users.messages.modify({ + * // The ID of the message to modify. + * id: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "addLabelIds": [], + * // "removeLabelIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "historyId": "my_historyId", + * // "id": "my_id", + * // "internalDate": "my_internalDate", + * // "labelIds": [], + * // "payload": {}, + * // "raw": "my_raw", + * // "sizeEstimate": 0, + * // "snippet": "my_snippet", + * // "threadId": "my_threadId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.messages.modify * @memberOf! () * @@ -3023,6 +4378,80 @@ export namespace gmail_v1 { /** * gmail.users.messages.send * @desc Sends the specified message to the recipients in the To, Cc, and Bcc headers. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.addons.current.action.compose', + * 'https://www.googleapis.com/auth/gmail.compose', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.send', + * ], + * }); + * + * // 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 gmail.users.messages.send({ + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "historyId": "my_historyId", + * // "id": "my_id", + * // "internalDate": "my_internalDate", + * // "labelIds": [], + * // "payload": {}, + * // "raw": "my_raw", + * // "sizeEstimate": 0, + * // "snippet": "my_snippet", + * // "threadId": "my_threadId" + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "historyId": "my_historyId", + * // "id": "my_id", + * // "internalDate": "my_internalDate", + * // "labelIds": [], + * // "payload": {}, + * // "raw": "my_raw", + * // "sizeEstimate": 0, + * // "snippet": "my_snippet", + * // "threadId": "my_threadId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.messages.send * @memberOf! () * @@ -3102,6 +4531,59 @@ export namespace gmail_v1 { /** * gmail.users.messages.trash * @desc Moves the specified message to the trash. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * ], + * }); + * + * // 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 gmail.users.messages.trash({ + * // The ID of the message to Trash. + * id: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "historyId": "my_historyId", + * // "id": "my_id", + * // "internalDate": "my_internalDate", + * // "labelIds": [], + * // "payload": {}, + * // "raw": "my_raw", + * // "sizeEstimate": 0, + * // "snippet": "my_snippet", + * // "threadId": "my_threadId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.messages.trash * @memberOf! () * @@ -3174,6 +4656,59 @@ export namespace gmail_v1 { /** * gmail.users.messages.untrash * @desc Removes the specified message from the trash. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * ], + * }); + * + * // 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 gmail.users.messages.untrash({ + * // The ID of the message to remove from Trash. + * id: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "historyId": "my_historyId", + * // "id": "my_id", + * // "internalDate": "my_internalDate", + * // "labelIds": [], + * // "payload": {}, + * // "raw": "my_raw", + * // "sizeEstimate": 0, + * // "snippet": "my_snippet", + * // "threadId": "my_threadId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.messages.untrash * @memberOf! () * @@ -3533,6 +5068,58 @@ export namespace gmail_v1 { /** * gmail.users.messages.attachments.get * @desc Gets the specified message attachment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.addons.current.message.action', + * 'https://www.googleapis.com/auth/gmail.addons.current.message.readonly', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.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 gmail.users.messages.attachments.get({ + * // The ID of the attachment. + * id: 'placeholder-value', + * // The ID of the message containing the attachment. + * messageId: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attachmentId": "my_attachmentId", + * // "data": "my_data", + * // "size": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.messages.attachments.get * @memberOf! () * @@ -3647,6 +5234,53 @@ export namespace gmail_v1 { /** * gmail.users.settings.getAutoForwarding * @desc Gets the auto-forwarding setting for the specified account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.readonly', + * 'https://www.googleapis.com/auth/gmail.settings.basic', + * ], + * }); + * + * // 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 gmail.users.settings.getAutoForwarding({ + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "disposition": "my_disposition", + * // "emailAddress": "my_emailAddress", + * // "enabled": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.getAutoForwarding * @memberOf! () * @@ -3722,6 +5356,54 @@ export namespace gmail_v1 { /** * gmail.users.settings.getImap * @desc Gets IMAP settings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.readonly', + * 'https://www.googleapis.com/auth/gmail.settings.basic', + * ], + * }); + * + * // 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 gmail.users.settings.getImap({ + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoExpunge": false, + * // "enabled": false, + * // "expungeBehavior": "my_expungeBehavior", + * // "maxFolderSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.getImap * @memberOf! () * @@ -3796,6 +5478,51 @@ export namespace gmail_v1 { /** * gmail.users.settings.getLanguage * @desc Gets language settings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.readonly', + * 'https://www.googleapis.com/auth/gmail.settings.basic', + * ], + * }); + * + * // 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 gmail.users.settings.getLanguage({ + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayLanguage": "my_displayLanguage" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.getLanguage * @memberOf! () * @@ -3869,6 +5596,52 @@ export namespace gmail_v1 { /** * gmail.users.settings.getPop * @desc Gets POP settings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.readonly', + * 'https://www.googleapis.com/auth/gmail.settings.basic', + * ], + * }); + * + * // 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 gmail.users.settings.getPop({ + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accessWindow": "my_accessWindow", + * // "disposition": "my_disposition" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.getPop * @memberOf! () * @@ -3943,6 +5716,58 @@ export namespace gmail_v1 { /** * gmail.users.settings.getVacation * @desc Gets vacation responder settings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.readonly', + * 'https://www.googleapis.com/auth/gmail.settings.basic', + * ], + * }); + * + * // 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 gmail.users.settings.getVacation({ + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "enableAutoReply": false, + * // "endTime": "my_endTime", + * // "responseBodyHtml": "my_responseBodyHtml", + * // "responseBodyPlainText": "my_responseBodyPlainText", + * // "responseSubject": "my_responseSubject", + * // "restrictToContacts": false, + * // "restrictToDomain": false, + * // "startTime": "my_startTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.getVacation * @memberOf! () * @@ -4016,6 +5841,58 @@ export namespace gmail_v1 { /** * gmail.users.settings.updateAutoForwarding * @desc Updates the auto-forwarding setting for the specified account. A verified forwarding address must be specified when auto-forwarding is enabled. This method is only available to service account clients that have been delegated domain-wide authority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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/gmail.settings.sharing'], + * }); + * + * // 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 gmail.users.settings.updateAutoForwarding({ + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "disposition": "my_disposition", + * // "emailAddress": "my_emailAddress", + * // "enabled": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "disposition": "my_disposition", + * // "emailAddress": "my_emailAddress", + * // "enabled": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.updateAutoForwarding * @memberOf! () * @@ -4092,6 +5969,60 @@ export namespace gmail_v1 { /** * gmail.users.settings.updateImap * @desc Updates IMAP settings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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/gmail.settings.basic'], + * }); + * + * // 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 gmail.users.settings.updateImap({ + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoExpunge": false, + * // "enabled": false, + * // "expungeBehavior": "my_expungeBehavior", + * // "maxFolderSize": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoExpunge": false, + * // "enabled": false, + * // "expungeBehavior": "my_expungeBehavior", + * // "maxFolderSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.updateImap * @memberOf! () * @@ -4167,6 +6098,54 @@ export namespace gmail_v1 { /** * gmail.users.settings.updateLanguage * @desc Updates language settings. If successful, the return object contains the displayLanguage that was saved for the user, which may differ from the value passed into the request. This is because the requested displayLanguage may not be directly supported by Gmail but have a close variant that is, and so the variant may be chosen and saved instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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/gmail.settings.basic'], + * }); + * + * // 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 gmail.users.settings.updateLanguage({ + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayLanguage": "my_displayLanguage" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayLanguage": "my_displayLanguage" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.updateLanguage * @memberOf! () * @@ -4243,6 +6222,56 @@ export namespace gmail_v1 { /** * gmail.users.settings.updatePop * @desc Updates POP settings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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/gmail.settings.basic'], + * }); + * + * // 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 gmail.users.settings.updatePop({ + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accessWindow": "my_accessWindow", + * // "disposition": "my_disposition" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accessWindow": "my_accessWindow", + * // "disposition": "my_disposition" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.updatePop * @memberOf! () * @@ -4318,6 +6347,68 @@ export namespace gmail_v1 { /** * gmail.users.settings.updateVacation * @desc Updates vacation responder settings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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/gmail.settings.basic'], + * }); + * + * // 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 gmail.users.settings.updateVacation({ + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "enableAutoReply": false, + * // "endTime": "my_endTime", + * // "responseBodyHtml": "my_responseBodyHtml", + * // "responseBodyPlainText": "my_responseBodyPlainText", + * // "responseSubject": "my_responseSubject", + * // "restrictToContacts": false, + * // "restrictToDomain": false, + * // "startTime": "my_startTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "enableAutoReply": false, + * // "endTime": "my_endTime", + * // "responseBodyHtml": "my_responseBodyHtml", + * // "responseBodyPlainText": "my_responseBodyPlainText", + * // "responseSubject": "my_responseSubject", + * // "restrictToContacts": false, + * // "restrictToDomain": false, + * // "startTime": "my_startTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.updateVacation * @memberOf! () * @@ -4547,6 +6638,56 @@ export namespace gmail_v1 { /** * gmail.users.settings.delegates.create * @desc Adds a delegate with its verification status set directly to accepted, without sending any verification email. The delegate user must be a member of the same G Suite organization as the delegator user. Gmail imposes limitations on the number of delegates and delegators each user in a G Suite organization can have. These limits depend on your organization, but in general each user can have up to 25 delegates and up to 10 delegators. Note that a delegate user must be referred to by their primary email address, and not an email alias. Also note that when a new delegate is created, there may be up to a one minute delay before the new delegate is available for use. This method is only available to service account clients that have been delegated domain-wide authority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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/gmail.settings.sharing'], + * }); + * + * // 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 gmail.users.settings.delegates.create({ + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "delegateEmail": "my_delegateEmail", + * // "verificationStatus": "my_verificationStatus" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "delegateEmail": "my_delegateEmail", + * // "verificationStatus": "my_verificationStatus" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.delegates.create * @memberOf! () * @@ -4619,6 +6760,43 @@ export namespace gmail_v1 { /** * gmail.users.settings.delegates.delete * @desc Removes the specified delegate (which can be of any verification status), and revokes any verification that may have been required for using it. Note that a delegate user must be referred to by their primary email address, and not an email alias. This method is only available to service account clients that have been delegated domain-wide authority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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/gmail.settings.sharing'], + * }); + * + * // 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 gmail.users.settings.delegates.delete({ + * // The email address of the user to be removed as a delegate. + * delegateEmail: 'placeholder-value', + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.delegates.delete * @memberOf! () * @@ -4692,6 +6870,54 @@ export namespace gmail_v1 { /** * gmail.users.settings.delegates.get * @desc Gets the specified delegate. Note that a delegate user must be referred to by their primary email address, and not an email alias. This method is only available to service account clients that have been delegated domain-wide authority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.readonly', + * 'https://www.googleapis.com/auth/gmail.settings.basic', + * ], + * }); + * + * // 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 gmail.users.settings.delegates.get({ + * // The email address of the user whose delegate relationship is to be retrieved. + * delegateEmail: 'placeholder-value', + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "delegateEmail": "my_delegateEmail", + * // "verificationStatus": "my_verificationStatus" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.delegates.get * @memberOf! () * @@ -4765,6 +6991,51 @@ export namespace gmail_v1 { /** * gmail.users.settings.delegates.list * @desc Lists the delegates for the specified account. This method is only available to service account clients that have been delegated domain-wide authority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.readonly', + * 'https://www.googleapis.com/auth/gmail.settings.basic', + * ], + * }); + * + * // 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 gmail.users.settings.delegates.list({ + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "delegates": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.delegates.list * @memberOf! () * @@ -4909,6 +7180,58 @@ export namespace gmail_v1 { /** * gmail.users.settings.filters.create * @desc Creates a filter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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/gmail.settings.basic'], + * }); + * + * // 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 gmail.users.settings.filters.create({ + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "action": {}, + * // "criteria": {}, + * // "id": "my_id" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": {}, + * // "criteria": {}, + * // "id": "my_id" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.filters.create * @memberOf! () * @@ -4981,6 +7304,43 @@ export namespace gmail_v1 { /** * gmail.users.settings.filters.delete * @desc Deletes a filter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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/gmail.settings.basic'], + * }); + * + * // 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 gmail.users.settings.filters.delete({ + * // The ID of the filter to be deleted. + * id: 'placeholder-value', + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.filters.delete * @memberOf! () * @@ -5053,6 +7413,55 @@ export namespace gmail_v1 { /** * gmail.users.settings.filters.get * @desc Gets a filter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.readonly', + * 'https://www.googleapis.com/auth/gmail.settings.basic', + * ], + * }); + * + * // 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 gmail.users.settings.filters.get({ + * // The ID of the filter to be fetched. + * id: 'placeholder-value', + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": {}, + * // "criteria": {}, + * // "id": "my_id" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.filters.get * @memberOf! () * @@ -5125,6 +7534,51 @@ export namespace gmail_v1 { /** * gmail.users.settings.filters.list * @desc Lists the message filters of a Gmail user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.readonly', + * 'https://www.googleapis.com/auth/gmail.settings.basic', + * ], + * }); + * + * // 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 gmail.users.settings.filters.list({ + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "filter": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.filters.list * @memberOf! () * @@ -5267,6 +7721,56 @@ export namespace gmail_v1 { /** * gmail.users.settings.forwardingAddresses.create * @desc Creates a forwarding address. If ownership verification is required, a message will be sent to the recipient and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted. This method is only available to service account clients that have been delegated domain-wide authority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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/gmail.settings.sharing'], + * }); + * + * // 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 gmail.users.settings.forwardingAddresses.create({ + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "forwardingEmail": "my_forwardingEmail", + * // "verificationStatus": "my_verificationStatus" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "forwardingEmail": "my_forwardingEmail", + * // "verificationStatus": "my_verificationStatus" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.forwardingAddresses.create * @memberOf! () * @@ -5341,6 +7845,43 @@ export namespace gmail_v1 { /** * gmail.users.settings.forwardingAddresses.delete * @desc Deletes the specified forwarding address and revokes any verification that may have been required. This method is only available to service account clients that have been delegated domain-wide authority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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/gmail.settings.sharing'], + * }); + * + * // 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 gmail.users.settings.forwardingAddresses.delete({ + * // The forwarding address to be deleted. + * forwardingEmail: 'placeholder-value', + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.forwardingAddresses.delete * @memberOf! () * @@ -5414,6 +7955,54 @@ export namespace gmail_v1 { /** * gmail.users.settings.forwardingAddresses.get * @desc Gets the specified forwarding address. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.readonly', + * 'https://www.googleapis.com/auth/gmail.settings.basic', + * ], + * }); + * + * // 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 gmail.users.settings.forwardingAddresses.get({ + * // The forwarding address to be retrieved. + * forwardingEmail: 'placeholder-value', + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "forwardingEmail": "my_forwardingEmail", + * // "verificationStatus": "my_verificationStatus" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.forwardingAddresses.get * @memberOf! () * @@ -5489,6 +8078,51 @@ export namespace gmail_v1 { /** * gmail.users.settings.forwardingAddresses.list * @desc Lists the forwarding addresses for the specified account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.readonly', + * 'https://www.googleapis.com/auth/gmail.settings.basic', + * ], + * }); + * + * // 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 gmail.users.settings.forwardingAddresses.list({ + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "forwardingAddresses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.forwardingAddresses.list * @memberOf! () * @@ -5644,6 +8278,70 @@ export namespace gmail_v1 { /** * gmail.users.settings.sendAs.create * @desc Creates a custom "from" send-as alias. If an SMTP MSA is specified, Gmail will attempt to connect to the SMTP service to validate the configuration before creating the alias. If ownership verification is required for the alias, a message will be sent to the email address and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. This method is only available to service account clients that have been delegated domain-wide authority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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/gmail.settings.sharing'], + * }); + * + * // 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 gmail.users.settings.sendAs.create({ + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "isDefault": false, + * // "isPrimary": false, + * // "replyToAddress": "my_replyToAddress", + * // "sendAsEmail": "my_sendAsEmail", + * // "signature": "my_signature", + * // "smtpMsa": {}, + * // "treatAsAlias": false, + * // "verificationStatus": "my_verificationStatus" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "isDefault": false, + * // "isPrimary": false, + * // "replyToAddress": "my_replyToAddress", + * // "sendAsEmail": "my_sendAsEmail", + * // "signature": "my_signature", + * // "smtpMsa": {}, + * // "treatAsAlias": false, + * // "verificationStatus": "my_verificationStatus" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.sendAs.create * @memberOf! () * @@ -5717,6 +8415,43 @@ export namespace gmail_v1 { /** * gmail.users.settings.sendAs.delete * @desc Deletes the specified send-as alias. Revokes any verification that may have been required for using it. This method is only available to service account clients that have been delegated domain-wide authority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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/gmail.settings.sharing'], + * }); + * + * // 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 gmail.users.settings.sendAs.delete({ + * // The send-as alias to be deleted. + * sendAsEmail: 'placeholder-value', + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.sendAs.delete * @memberOf! () * @@ -5789,6 +8524,61 @@ export namespace gmail_v1 { /** * gmail.users.settings.sendAs.get * @desc Gets the specified send-as alias. Fails with an HTTP 404 error if the specified address is not a member of the collection. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.readonly', + * 'https://www.googleapis.com/auth/gmail.settings.basic', + * ], + * }); + * + * // 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 gmail.users.settings.sendAs.get({ + * // The send-as alias to be retrieved. + * sendAsEmail: 'placeholder-value', + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "isDefault": false, + * // "isPrimary": false, + * // "replyToAddress": "my_replyToAddress", + * // "sendAsEmail": "my_sendAsEmail", + * // "signature": "my_signature", + * // "smtpMsa": {}, + * // "treatAsAlias": false, + * // "verificationStatus": "my_verificationStatus" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.sendAs.get * @memberOf! () * @@ -5861,6 +8651,51 @@ export namespace gmail_v1 { /** * gmail.users.settings.sendAs.list * @desc Lists the send-as aliases for the specified account. The result includes the primary send-as address associated with the account as well as any custom "from" aliases. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.readonly', + * 'https://www.googleapis.com/auth/gmail.settings.basic', + * ], + * }); + * + * // 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 gmail.users.settings.sendAs.list({ + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "sendAs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.sendAs.list * @memberOf! () * @@ -5935,6 +8770,75 @@ export namespace gmail_v1 { /** * gmail.users.settings.sendAs.patch * @desc Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. Addresses other than the primary address for the account can only be updated by service account clients that have been delegated domain-wide authority. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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/gmail.settings.basic', + * 'https://www.googleapis.com/auth/gmail.settings.sharing', + * ], + * }); + * + * // 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 gmail.users.settings.sendAs.patch({ + * // The send-as alias to be updated. + * sendAsEmail: 'placeholder-value', + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "isDefault": false, + * // "isPrimary": false, + * // "replyToAddress": "my_replyToAddress", + * // "sendAsEmail": "my_sendAsEmail", + * // "signature": "my_signature", + * // "smtpMsa": {}, + * // "treatAsAlias": false, + * // "verificationStatus": "my_verificationStatus" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "isDefault": false, + * // "isPrimary": false, + * // "replyToAddress": "my_replyToAddress", + * // "sendAsEmail": "my_sendAsEmail", + * // "signature": "my_signature", + * // "smtpMsa": {}, + * // "treatAsAlias": false, + * // "verificationStatus": "my_verificationStatus" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.sendAs.patch * @memberOf! () * @@ -6008,6 +8912,75 @@ export namespace gmail_v1 { /** * gmail.users.settings.sendAs.update * @desc Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. Addresses other than the primary address for the account can only be updated by service account clients that have been delegated domain-wide authority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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/gmail.settings.basic', + * 'https://www.googleapis.com/auth/gmail.settings.sharing', + * ], + * }); + * + * // 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 gmail.users.settings.sendAs.update({ + * // The send-as alias to be updated. + * sendAsEmail: 'placeholder-value', + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "isDefault": false, + * // "isPrimary": false, + * // "replyToAddress": "my_replyToAddress", + * // "sendAsEmail": "my_sendAsEmail", + * // "signature": "my_signature", + * // "smtpMsa": {}, + * // "treatAsAlias": false, + * // "verificationStatus": "my_verificationStatus" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "isDefault": false, + * // "isPrimary": false, + * // "replyToAddress": "my_replyToAddress", + * // "sendAsEmail": "my_sendAsEmail", + * // "signature": "my_signature", + * // "smtpMsa": {}, + * // "treatAsAlias": false, + * // "verificationStatus": "my_verificationStatus" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.sendAs.update * @memberOf! () * @@ -6081,6 +9054,43 @@ export namespace gmail_v1 { /** * gmail.users.settings.sendAs.verify * @desc Sends a verification email to the specified send-as alias address. The verification status must be pending. This method is only available to service account clients that have been delegated domain-wide authority. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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/gmail.settings.sharing'], + * }); + * + * // 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 gmail.users.settings.sendAs.verify({ + * // The send-as alias to be verified. + * sendAsEmail: 'placeholder-value', + * // User's email address. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.sendAs.verify * @memberOf! () * @@ -6281,6 +9291,48 @@ export namespace gmail_v1 { /** * gmail.users.settings.sendAs.smimeInfo.delete * @desc Deletes the specified S/MIME config for the specified send-as alias. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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/gmail.settings.basic', + * 'https://www.googleapis.com/auth/gmail.settings.sharing', + * ], + * }); + * + * // 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 gmail.users.settings.sendAs.smimeInfo.delete({ + * // The immutable ID for the SmimeInfo. + * id: 'placeholder-value', + * // The email address that appears in the "From:" header for mail sent using this alias. + * sendAsEmail: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.sendAs.smimeInfo.delete * @memberOf! () * @@ -6355,6 +9407,62 @@ export namespace gmail_v1 { /** * gmail.users.settings.sendAs.smimeInfo.get * @desc Gets the specified S/MIME config for the specified send-as alias. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.readonly', + * 'https://www.googleapis.com/auth/gmail.settings.basic', + * 'https://www.googleapis.com/auth/gmail.settings.sharing', + * ], + * }); + * + * // 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 gmail.users.settings.sendAs.smimeInfo.get({ + * // The immutable ID for the SmimeInfo. + * id: 'placeholder-value', + * // The email address that appears in the "From:" header for mail sent using this alias. + * sendAsEmail: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "encryptedKeyPassword": "my_encryptedKeyPassword", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "isDefault": false, + * // "issuerCn": "my_issuerCn", + * // "pem": "my_pem", + * // "pkcs12": "my_pkcs12" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.sendAs.smimeInfo.get * @memberOf! () * @@ -6431,6 +9539,71 @@ export namespace gmail_v1 { /** * gmail.users.settings.sendAs.smimeInfo.insert * @desc Insert (upload) the given S/MIME config for the specified send-as alias. Note that pkcs12 format is required for the key. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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/gmail.settings.basic', + * 'https://www.googleapis.com/auth/gmail.settings.sharing', + * ], + * }); + * + * // 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 gmail.users.settings.sendAs.smimeInfo.insert({ + * // The email address that appears in the "From:" header for mail sent using this alias. + * sendAsEmail: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "encryptedKeyPassword": "my_encryptedKeyPassword", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "isDefault": false, + * // "issuerCn": "my_issuerCn", + * // "pem": "my_pem", + * // "pkcs12": "my_pkcs12" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "encryptedKeyPassword": "my_encryptedKeyPassword", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "isDefault": false, + * // "issuerCn": "my_issuerCn", + * // "pem": "my_pem", + * // "pkcs12": "my_pkcs12" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.sendAs.smimeInfo.insert * @memberOf! () * @@ -6507,6 +9680,54 @@ export namespace gmail_v1 { /** * gmail.users.settings.sendAs.smimeInfo.list * @desc Lists S/MIME configs for the specified send-as alias. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.readonly', + * 'https://www.googleapis.com/auth/gmail.settings.basic', + * 'https://www.googleapis.com/auth/gmail.settings.sharing', + * ], + * }); + * + * // 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 gmail.users.settings.sendAs.smimeInfo.list({ + * // The email address that appears in the "From:" header for mail sent using this alias. + * sendAsEmail: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "smimeInfo": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.sendAs.smimeInfo.list * @memberOf! () * @@ -6584,6 +9805,48 @@ export namespace gmail_v1 { /** * gmail.users.settings.sendAs.smimeInfo.setDefault * @desc Sets the default S/MIME config for the specified send-as alias. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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/gmail.settings.basic', + * 'https://www.googleapis.com/auth/gmail.settings.sharing', + * ], + * }); + * + * // 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 gmail.users.settings.sendAs.smimeInfo.setDefault({ + * // The immutable ID for the SmimeInfo. + * id: 'placeholder-value', + * // The email address that appears in the "From:" header for mail sent using this alias. + * sendAsEmail: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.settings.sendAs.smimeInfo.setDefault * @memberOf! () * @@ -6763,6 +10026,43 @@ export namespace gmail_v1 { /** * gmail.users.threads.delete * @desc Immediately and permanently deletes the specified thread. This operation cannot be undone. Prefer threads.trash instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/'], + * }); + * + * // 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 gmail.users.threads.delete({ + * // ID of the Thread to delete. + * id: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.threads.delete * @memberOf! () * @@ -6836,6 +10136,63 @@ export namespace gmail_v1 { /** * gmail.users.threads.get * @desc Gets the specified thread. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.addons.current.message.action', + * 'https://www.googleapis.com/auth/gmail.addons.current.message.metadata', + * 'https://www.googleapis.com/auth/gmail.addons.current.message.readonly', + * 'https://www.googleapis.com/auth/gmail.metadata', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.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 gmail.users.threads.get({ + * // The format to return the messages in. + * format: 'placeholder-value', + * // The ID of the thread to retrieve. + * id: 'placeholder-value', + * // When given and format is METADATA, only include headers specified. + * metadataHeaders: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "historyId": "my_historyId", + * // "id": "my_id", + * // "messages": [], + * // "snippet": "my_snippet" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.threads.get * @memberOf! () * @@ -6911,6 +10268,63 @@ export namespace gmail_v1 { /** * gmail.users.threads.list * @desc Lists the threads in the user's mailbox. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.metadata', + * 'https://www.googleapis.com/auth/gmail.modify', + * 'https://www.googleapis.com/auth/gmail.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 gmail.users.threads.list({ + * // Include threads from SPAM and TRASH in the results. + * includeSpamTrash: 'placeholder-value', + * // Only return threads with labels that match all of the specified label IDs. + * labelIds: 'placeholder-value', + * // Maximum number of threads to return. + * maxResults: 'placeholder-value', + * // Page token to retrieve a specific page of results in the list. + * pageToken: 'placeholder-value', + * // Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used when accessing the api using the gmail.metadata scope. + * q: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "resultSizeEstimate": 0, + * // "threads": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.threads.list * @memberOf! () * @@ -6990,6 +10404,63 @@ export namespace gmail_v1 { /** * gmail.users.threads.modify * @desc Modifies the labels applied to the thread. This applies to all messages in the thread. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * ], + * }); + * + * // 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 gmail.users.threads.modify({ + * // The ID of the thread to modify. + * id: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "addLabelIds": [], + * // "removeLabelIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "historyId": "my_historyId", + * // "id": "my_id", + * // "messages": [], + * // "snippet": "my_snippet" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.threads.modify * @memberOf! () * @@ -7063,6 +10534,54 @@ export namespace gmail_v1 { /** * gmail.users.threads.trash * @desc Moves the specified thread to the trash. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * ], + * }); + * + * // 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 gmail.users.threads.trash({ + * // The ID of the thread to Trash. + * id: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "historyId": "my_historyId", + * // "id": "my_id", + * // "messages": [], + * // "snippet": "my_snippet" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.threads.trash * @memberOf! () * @@ -7135,6 +10654,54 @@ export namespace gmail_v1 { /** * gmail.users.threads.untrash * @desc Removes the specified thread from the trash. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/gmail.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 gmail = google.gmail('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://mail.google.com/', + * 'https://www.googleapis.com/auth/gmail.modify', + * ], + * }); + * + * // 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 gmail.users.threads.untrash({ + * // The ID of the thread to remove from Trash. + * id: 'placeholder-value', + * // The user's email address. The special value me can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "historyId": "my_historyId", + * // "id": "my_id", + * // "messages": [], + * // "snippet": "my_snippet" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias gmail.users.threads.untrash * @memberOf! () * diff --git a/src/apis/groupsmigration/v1.ts b/src/apis/groupsmigration/v1.ts index f2fb4e4ecfd..75f4cfef134 100644 --- a/src/apis/groupsmigration/v1.ts +++ b/src/apis/groupsmigration/v1.ts @@ -120,6 +120,55 @@ export namespace groupsmigration_v1 { /** * groupsmigration.archive.insert * @desc Inserts a new mail into the archive of the Google group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/groupsmigration.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 groupsmigration = google.groupsmigration('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/apps.groups.migration'], + * }); + * + * // 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 groupsmigration.archive.insert({ + * // The group ID + * groupId: 'placeholder-value', + * + * requestBody: { + * // request body parameters + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "responseCode": "my_responseCode" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias groupsmigration.archive.insert * @memberOf! () * diff --git a/src/apis/groupssettings/v1.ts b/src/apis/groupssettings/v1.ts index 0731f4444fa..8f03d82ac07 100644 --- a/src/apis/groupssettings/v1.ts +++ b/src/apis/groupssettings/v1.ts @@ -356,6 +356,106 @@ export namespace groupssettings_v1 { /** * groupsSettings.groups.get * @desc Gets one resource by id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/groupssettings.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 groupssettings = google.groupssettings('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/apps.groups.settings'], + * }); + * + * // 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 groupsSettings.groups.get({ + * // The group's email address. + * groupUniqueId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "allowExternalMembers": "my_allowExternalMembers", + * // "allowGoogleCommunication": "my_allowGoogleCommunication", + * // "allowWebPosting": "my_allowWebPosting", + * // "archiveOnly": "my_archiveOnly", + * // "customFooterText": "my_customFooterText", + * // "customReplyTo": "my_customReplyTo", + * // "customRolesEnabledForSettingsToBeMerged": "my_customRolesEnabledForSettingsToBeMerged", + * // "defaultMessageDenyNotificationText": "my_defaultMessageDenyNotificationText", + * // "description": "my_description", + * // "email": "my_email", + * // "enableCollaborativeInbox": "my_enableCollaborativeInbox", + * // "favoriteRepliesOnTop": "my_favoriteRepliesOnTop", + * // "includeCustomFooter": "my_includeCustomFooter", + * // "includeInGlobalAddressList": "my_includeInGlobalAddressList", + * // "isArchived": "my_isArchived", + * // "kind": "my_kind", + * // "maxMessageBytes": 0, + * // "membersCanPostAsTheGroup": "my_membersCanPostAsTheGroup", + * // "messageDisplayFont": "my_messageDisplayFont", + * // "messageModerationLevel": "my_messageModerationLevel", + * // "name": "my_name", + * // "primaryLanguage": "my_primaryLanguage", + * // "replyTo": "my_replyTo", + * // "sendMessageDenyNotification": "my_sendMessageDenyNotification", + * // "showInGroupDirectory": "my_showInGroupDirectory", + * // "spamModerationLevel": "my_spamModerationLevel", + * // "whoCanAdd": "my_whoCanAdd", + * // "whoCanAddReferences": "my_whoCanAddReferences", + * // "whoCanApproveMembers": "my_whoCanApproveMembers", + * // "whoCanApproveMessages": "my_whoCanApproveMessages", + * // "whoCanAssignTopics": "my_whoCanAssignTopics", + * // "whoCanAssistContent": "my_whoCanAssistContent", + * // "whoCanBanUsers": "my_whoCanBanUsers", + * // "whoCanContactOwner": "my_whoCanContactOwner", + * // "whoCanDeleteAnyPost": "my_whoCanDeleteAnyPost", + * // "whoCanDeleteTopics": "my_whoCanDeleteTopics", + * // "whoCanDiscoverGroup": "my_whoCanDiscoverGroup", + * // "whoCanEnterFreeFormTags": "my_whoCanEnterFreeFormTags", + * // "whoCanHideAbuse": "my_whoCanHideAbuse", + * // "whoCanInvite": "my_whoCanInvite", + * // "whoCanJoin": "my_whoCanJoin", + * // "whoCanLeaveGroup": "my_whoCanLeaveGroup", + * // "whoCanLockTopics": "my_whoCanLockTopics", + * // "whoCanMakeTopicsSticky": "my_whoCanMakeTopicsSticky", + * // "whoCanMarkDuplicate": "my_whoCanMarkDuplicate", + * // "whoCanMarkFavoriteReplyOnAnyTopic": "my_whoCanMarkFavoriteReplyOnAnyTopic", + * // "whoCanMarkFavoriteReplyOnOwnTopic": "my_whoCanMarkFavoriteReplyOnOwnTopic", + * // "whoCanMarkNoResponseNeeded": "my_whoCanMarkNoResponseNeeded", + * // "whoCanModerateContent": "my_whoCanModerateContent", + * // "whoCanModerateMembers": "my_whoCanModerateMembers", + * // "whoCanModifyMembers": "my_whoCanModifyMembers", + * // "whoCanModifyTagsAndCategories": "my_whoCanModifyTagsAndCategories", + * // "whoCanMoveTopicsIn": "my_whoCanMoveTopicsIn", + * // "whoCanMoveTopicsOut": "my_whoCanMoveTopicsOut", + * // "whoCanPostAnnouncements": "my_whoCanPostAnnouncements", + * // "whoCanPostMessage": "my_whoCanPostMessage", + * // "whoCanTakeTopics": "my_whoCanTakeTopics", + * // "whoCanUnassignTopic": "my_whoCanUnassignTopic", + * // "whoCanUnmarkFavoriteReplyOnAnyTopic": "my_whoCanUnmarkFavoriteReplyOnAnyTopic", + * // "whoCanViewGroup": "my_whoCanViewGroup", + * // "whoCanViewMembership": "my_whoCanViewMembership" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias groupsSettings.groups.get * @memberOf! () * @@ -427,6 +527,174 @@ export namespace groupssettings_v1 { /** * groupsSettings.groups.patch * @desc Updates an existing resource. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/groupssettings.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 groupssettings = google.groupssettings('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/apps.groups.settings'], + * }); + * + * // 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 groupsSettings.groups.patch({ + * // The group's email address. + * groupUniqueId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "allowExternalMembers": "my_allowExternalMembers", + * // "allowGoogleCommunication": "my_allowGoogleCommunication", + * // "allowWebPosting": "my_allowWebPosting", + * // "archiveOnly": "my_archiveOnly", + * // "customFooterText": "my_customFooterText", + * // "customReplyTo": "my_customReplyTo", + * // "customRolesEnabledForSettingsToBeMerged": "my_customRolesEnabledForSettingsToBeMerged", + * // "defaultMessageDenyNotificationText": "my_defaultMessageDenyNotificationText", + * // "description": "my_description", + * // "email": "my_email", + * // "enableCollaborativeInbox": "my_enableCollaborativeInbox", + * // "favoriteRepliesOnTop": "my_favoriteRepliesOnTop", + * // "includeCustomFooter": "my_includeCustomFooter", + * // "includeInGlobalAddressList": "my_includeInGlobalAddressList", + * // "isArchived": "my_isArchived", + * // "kind": "my_kind", + * // "maxMessageBytes": 0, + * // "membersCanPostAsTheGroup": "my_membersCanPostAsTheGroup", + * // "messageDisplayFont": "my_messageDisplayFont", + * // "messageModerationLevel": "my_messageModerationLevel", + * // "name": "my_name", + * // "primaryLanguage": "my_primaryLanguage", + * // "replyTo": "my_replyTo", + * // "sendMessageDenyNotification": "my_sendMessageDenyNotification", + * // "showInGroupDirectory": "my_showInGroupDirectory", + * // "spamModerationLevel": "my_spamModerationLevel", + * // "whoCanAdd": "my_whoCanAdd", + * // "whoCanAddReferences": "my_whoCanAddReferences", + * // "whoCanApproveMembers": "my_whoCanApproveMembers", + * // "whoCanApproveMessages": "my_whoCanApproveMessages", + * // "whoCanAssignTopics": "my_whoCanAssignTopics", + * // "whoCanAssistContent": "my_whoCanAssistContent", + * // "whoCanBanUsers": "my_whoCanBanUsers", + * // "whoCanContactOwner": "my_whoCanContactOwner", + * // "whoCanDeleteAnyPost": "my_whoCanDeleteAnyPost", + * // "whoCanDeleteTopics": "my_whoCanDeleteTopics", + * // "whoCanDiscoverGroup": "my_whoCanDiscoverGroup", + * // "whoCanEnterFreeFormTags": "my_whoCanEnterFreeFormTags", + * // "whoCanHideAbuse": "my_whoCanHideAbuse", + * // "whoCanInvite": "my_whoCanInvite", + * // "whoCanJoin": "my_whoCanJoin", + * // "whoCanLeaveGroup": "my_whoCanLeaveGroup", + * // "whoCanLockTopics": "my_whoCanLockTopics", + * // "whoCanMakeTopicsSticky": "my_whoCanMakeTopicsSticky", + * // "whoCanMarkDuplicate": "my_whoCanMarkDuplicate", + * // "whoCanMarkFavoriteReplyOnAnyTopic": "my_whoCanMarkFavoriteReplyOnAnyTopic", + * // "whoCanMarkFavoriteReplyOnOwnTopic": "my_whoCanMarkFavoriteReplyOnOwnTopic", + * // "whoCanMarkNoResponseNeeded": "my_whoCanMarkNoResponseNeeded", + * // "whoCanModerateContent": "my_whoCanModerateContent", + * // "whoCanModerateMembers": "my_whoCanModerateMembers", + * // "whoCanModifyMembers": "my_whoCanModifyMembers", + * // "whoCanModifyTagsAndCategories": "my_whoCanModifyTagsAndCategories", + * // "whoCanMoveTopicsIn": "my_whoCanMoveTopicsIn", + * // "whoCanMoveTopicsOut": "my_whoCanMoveTopicsOut", + * // "whoCanPostAnnouncements": "my_whoCanPostAnnouncements", + * // "whoCanPostMessage": "my_whoCanPostMessage", + * // "whoCanTakeTopics": "my_whoCanTakeTopics", + * // "whoCanUnassignTopic": "my_whoCanUnassignTopic", + * // "whoCanUnmarkFavoriteReplyOnAnyTopic": "my_whoCanUnmarkFavoriteReplyOnAnyTopic", + * // "whoCanViewGroup": "my_whoCanViewGroup", + * // "whoCanViewMembership": "my_whoCanViewMembership" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "allowExternalMembers": "my_allowExternalMembers", + * // "allowGoogleCommunication": "my_allowGoogleCommunication", + * // "allowWebPosting": "my_allowWebPosting", + * // "archiveOnly": "my_archiveOnly", + * // "customFooterText": "my_customFooterText", + * // "customReplyTo": "my_customReplyTo", + * // "customRolesEnabledForSettingsToBeMerged": "my_customRolesEnabledForSettingsToBeMerged", + * // "defaultMessageDenyNotificationText": "my_defaultMessageDenyNotificationText", + * // "description": "my_description", + * // "email": "my_email", + * // "enableCollaborativeInbox": "my_enableCollaborativeInbox", + * // "favoriteRepliesOnTop": "my_favoriteRepliesOnTop", + * // "includeCustomFooter": "my_includeCustomFooter", + * // "includeInGlobalAddressList": "my_includeInGlobalAddressList", + * // "isArchived": "my_isArchived", + * // "kind": "my_kind", + * // "maxMessageBytes": 0, + * // "membersCanPostAsTheGroup": "my_membersCanPostAsTheGroup", + * // "messageDisplayFont": "my_messageDisplayFont", + * // "messageModerationLevel": "my_messageModerationLevel", + * // "name": "my_name", + * // "primaryLanguage": "my_primaryLanguage", + * // "replyTo": "my_replyTo", + * // "sendMessageDenyNotification": "my_sendMessageDenyNotification", + * // "showInGroupDirectory": "my_showInGroupDirectory", + * // "spamModerationLevel": "my_spamModerationLevel", + * // "whoCanAdd": "my_whoCanAdd", + * // "whoCanAddReferences": "my_whoCanAddReferences", + * // "whoCanApproveMembers": "my_whoCanApproveMembers", + * // "whoCanApproveMessages": "my_whoCanApproveMessages", + * // "whoCanAssignTopics": "my_whoCanAssignTopics", + * // "whoCanAssistContent": "my_whoCanAssistContent", + * // "whoCanBanUsers": "my_whoCanBanUsers", + * // "whoCanContactOwner": "my_whoCanContactOwner", + * // "whoCanDeleteAnyPost": "my_whoCanDeleteAnyPost", + * // "whoCanDeleteTopics": "my_whoCanDeleteTopics", + * // "whoCanDiscoverGroup": "my_whoCanDiscoverGroup", + * // "whoCanEnterFreeFormTags": "my_whoCanEnterFreeFormTags", + * // "whoCanHideAbuse": "my_whoCanHideAbuse", + * // "whoCanInvite": "my_whoCanInvite", + * // "whoCanJoin": "my_whoCanJoin", + * // "whoCanLeaveGroup": "my_whoCanLeaveGroup", + * // "whoCanLockTopics": "my_whoCanLockTopics", + * // "whoCanMakeTopicsSticky": "my_whoCanMakeTopicsSticky", + * // "whoCanMarkDuplicate": "my_whoCanMarkDuplicate", + * // "whoCanMarkFavoriteReplyOnAnyTopic": "my_whoCanMarkFavoriteReplyOnAnyTopic", + * // "whoCanMarkFavoriteReplyOnOwnTopic": "my_whoCanMarkFavoriteReplyOnOwnTopic", + * // "whoCanMarkNoResponseNeeded": "my_whoCanMarkNoResponseNeeded", + * // "whoCanModerateContent": "my_whoCanModerateContent", + * // "whoCanModerateMembers": "my_whoCanModerateMembers", + * // "whoCanModifyMembers": "my_whoCanModifyMembers", + * // "whoCanModifyTagsAndCategories": "my_whoCanModifyTagsAndCategories", + * // "whoCanMoveTopicsIn": "my_whoCanMoveTopicsIn", + * // "whoCanMoveTopicsOut": "my_whoCanMoveTopicsOut", + * // "whoCanPostAnnouncements": "my_whoCanPostAnnouncements", + * // "whoCanPostMessage": "my_whoCanPostMessage", + * // "whoCanTakeTopics": "my_whoCanTakeTopics", + * // "whoCanUnassignTopic": "my_whoCanUnassignTopic", + * // "whoCanUnmarkFavoriteReplyOnAnyTopic": "my_whoCanUnmarkFavoriteReplyOnAnyTopic", + * // "whoCanViewGroup": "my_whoCanViewGroup", + * // "whoCanViewMembership": "my_whoCanViewMembership" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias groupsSettings.groups.patch * @memberOf! () * @@ -499,6 +767,174 @@ export namespace groupssettings_v1 { /** * groupsSettings.groups.update * @desc Updates an existing resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/groupssettings.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 groupssettings = google.groupssettings('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/apps.groups.settings'], + * }); + * + * // 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 groupsSettings.groups.update({ + * // The group's email address. + * groupUniqueId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "allowExternalMembers": "my_allowExternalMembers", + * // "allowGoogleCommunication": "my_allowGoogleCommunication", + * // "allowWebPosting": "my_allowWebPosting", + * // "archiveOnly": "my_archiveOnly", + * // "customFooterText": "my_customFooterText", + * // "customReplyTo": "my_customReplyTo", + * // "customRolesEnabledForSettingsToBeMerged": "my_customRolesEnabledForSettingsToBeMerged", + * // "defaultMessageDenyNotificationText": "my_defaultMessageDenyNotificationText", + * // "description": "my_description", + * // "email": "my_email", + * // "enableCollaborativeInbox": "my_enableCollaborativeInbox", + * // "favoriteRepliesOnTop": "my_favoriteRepliesOnTop", + * // "includeCustomFooter": "my_includeCustomFooter", + * // "includeInGlobalAddressList": "my_includeInGlobalAddressList", + * // "isArchived": "my_isArchived", + * // "kind": "my_kind", + * // "maxMessageBytes": 0, + * // "membersCanPostAsTheGroup": "my_membersCanPostAsTheGroup", + * // "messageDisplayFont": "my_messageDisplayFont", + * // "messageModerationLevel": "my_messageModerationLevel", + * // "name": "my_name", + * // "primaryLanguage": "my_primaryLanguage", + * // "replyTo": "my_replyTo", + * // "sendMessageDenyNotification": "my_sendMessageDenyNotification", + * // "showInGroupDirectory": "my_showInGroupDirectory", + * // "spamModerationLevel": "my_spamModerationLevel", + * // "whoCanAdd": "my_whoCanAdd", + * // "whoCanAddReferences": "my_whoCanAddReferences", + * // "whoCanApproveMembers": "my_whoCanApproveMembers", + * // "whoCanApproveMessages": "my_whoCanApproveMessages", + * // "whoCanAssignTopics": "my_whoCanAssignTopics", + * // "whoCanAssistContent": "my_whoCanAssistContent", + * // "whoCanBanUsers": "my_whoCanBanUsers", + * // "whoCanContactOwner": "my_whoCanContactOwner", + * // "whoCanDeleteAnyPost": "my_whoCanDeleteAnyPost", + * // "whoCanDeleteTopics": "my_whoCanDeleteTopics", + * // "whoCanDiscoverGroup": "my_whoCanDiscoverGroup", + * // "whoCanEnterFreeFormTags": "my_whoCanEnterFreeFormTags", + * // "whoCanHideAbuse": "my_whoCanHideAbuse", + * // "whoCanInvite": "my_whoCanInvite", + * // "whoCanJoin": "my_whoCanJoin", + * // "whoCanLeaveGroup": "my_whoCanLeaveGroup", + * // "whoCanLockTopics": "my_whoCanLockTopics", + * // "whoCanMakeTopicsSticky": "my_whoCanMakeTopicsSticky", + * // "whoCanMarkDuplicate": "my_whoCanMarkDuplicate", + * // "whoCanMarkFavoriteReplyOnAnyTopic": "my_whoCanMarkFavoriteReplyOnAnyTopic", + * // "whoCanMarkFavoriteReplyOnOwnTopic": "my_whoCanMarkFavoriteReplyOnOwnTopic", + * // "whoCanMarkNoResponseNeeded": "my_whoCanMarkNoResponseNeeded", + * // "whoCanModerateContent": "my_whoCanModerateContent", + * // "whoCanModerateMembers": "my_whoCanModerateMembers", + * // "whoCanModifyMembers": "my_whoCanModifyMembers", + * // "whoCanModifyTagsAndCategories": "my_whoCanModifyTagsAndCategories", + * // "whoCanMoveTopicsIn": "my_whoCanMoveTopicsIn", + * // "whoCanMoveTopicsOut": "my_whoCanMoveTopicsOut", + * // "whoCanPostAnnouncements": "my_whoCanPostAnnouncements", + * // "whoCanPostMessage": "my_whoCanPostMessage", + * // "whoCanTakeTopics": "my_whoCanTakeTopics", + * // "whoCanUnassignTopic": "my_whoCanUnassignTopic", + * // "whoCanUnmarkFavoriteReplyOnAnyTopic": "my_whoCanUnmarkFavoriteReplyOnAnyTopic", + * // "whoCanViewGroup": "my_whoCanViewGroup", + * // "whoCanViewMembership": "my_whoCanViewMembership" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "allowExternalMembers": "my_allowExternalMembers", + * // "allowGoogleCommunication": "my_allowGoogleCommunication", + * // "allowWebPosting": "my_allowWebPosting", + * // "archiveOnly": "my_archiveOnly", + * // "customFooterText": "my_customFooterText", + * // "customReplyTo": "my_customReplyTo", + * // "customRolesEnabledForSettingsToBeMerged": "my_customRolesEnabledForSettingsToBeMerged", + * // "defaultMessageDenyNotificationText": "my_defaultMessageDenyNotificationText", + * // "description": "my_description", + * // "email": "my_email", + * // "enableCollaborativeInbox": "my_enableCollaborativeInbox", + * // "favoriteRepliesOnTop": "my_favoriteRepliesOnTop", + * // "includeCustomFooter": "my_includeCustomFooter", + * // "includeInGlobalAddressList": "my_includeInGlobalAddressList", + * // "isArchived": "my_isArchived", + * // "kind": "my_kind", + * // "maxMessageBytes": 0, + * // "membersCanPostAsTheGroup": "my_membersCanPostAsTheGroup", + * // "messageDisplayFont": "my_messageDisplayFont", + * // "messageModerationLevel": "my_messageModerationLevel", + * // "name": "my_name", + * // "primaryLanguage": "my_primaryLanguage", + * // "replyTo": "my_replyTo", + * // "sendMessageDenyNotification": "my_sendMessageDenyNotification", + * // "showInGroupDirectory": "my_showInGroupDirectory", + * // "spamModerationLevel": "my_spamModerationLevel", + * // "whoCanAdd": "my_whoCanAdd", + * // "whoCanAddReferences": "my_whoCanAddReferences", + * // "whoCanApproveMembers": "my_whoCanApproveMembers", + * // "whoCanApproveMessages": "my_whoCanApproveMessages", + * // "whoCanAssignTopics": "my_whoCanAssignTopics", + * // "whoCanAssistContent": "my_whoCanAssistContent", + * // "whoCanBanUsers": "my_whoCanBanUsers", + * // "whoCanContactOwner": "my_whoCanContactOwner", + * // "whoCanDeleteAnyPost": "my_whoCanDeleteAnyPost", + * // "whoCanDeleteTopics": "my_whoCanDeleteTopics", + * // "whoCanDiscoverGroup": "my_whoCanDiscoverGroup", + * // "whoCanEnterFreeFormTags": "my_whoCanEnterFreeFormTags", + * // "whoCanHideAbuse": "my_whoCanHideAbuse", + * // "whoCanInvite": "my_whoCanInvite", + * // "whoCanJoin": "my_whoCanJoin", + * // "whoCanLeaveGroup": "my_whoCanLeaveGroup", + * // "whoCanLockTopics": "my_whoCanLockTopics", + * // "whoCanMakeTopicsSticky": "my_whoCanMakeTopicsSticky", + * // "whoCanMarkDuplicate": "my_whoCanMarkDuplicate", + * // "whoCanMarkFavoriteReplyOnAnyTopic": "my_whoCanMarkFavoriteReplyOnAnyTopic", + * // "whoCanMarkFavoriteReplyOnOwnTopic": "my_whoCanMarkFavoriteReplyOnOwnTopic", + * // "whoCanMarkNoResponseNeeded": "my_whoCanMarkNoResponseNeeded", + * // "whoCanModerateContent": "my_whoCanModerateContent", + * // "whoCanModerateMembers": "my_whoCanModerateMembers", + * // "whoCanModifyMembers": "my_whoCanModifyMembers", + * // "whoCanModifyTagsAndCategories": "my_whoCanModifyTagsAndCategories", + * // "whoCanMoveTopicsIn": "my_whoCanMoveTopicsIn", + * // "whoCanMoveTopicsOut": "my_whoCanMoveTopicsOut", + * // "whoCanPostAnnouncements": "my_whoCanPostAnnouncements", + * // "whoCanPostMessage": "my_whoCanPostMessage", + * // "whoCanTakeTopics": "my_whoCanTakeTopics", + * // "whoCanUnassignTopic": "my_whoCanUnassignTopic", + * // "whoCanUnmarkFavoriteReplyOnAnyTopic": "my_whoCanUnmarkFavoriteReplyOnAnyTopic", + * // "whoCanViewGroup": "my_whoCanViewGroup", + * // "whoCanViewMembership": "my_whoCanViewMembership" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias groupsSettings.groups.update * @memberOf! () * diff --git a/src/apis/healthcare/v1.ts b/src/apis/healthcare/v1.ts index 9c0de364daa..74e854fe477 100644 --- a/src/apis/healthcare/v1.ts +++ b/src/apis/healthcare/v1.ts @@ -1103,6 +1103,63 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.create * @desc Creates a new health dataset. Results are returned through the Operation interface which returns either an `Operation.response` which contains a Dataset or `Operation.error`. The metadata field type is OperationMetadata. A Google Cloud Platform project can contain up to 500 datasets across all regions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.create({ + * // The ID of the dataset that is being created. + * // The string must match the following regex: `[\p{L}\p{N}_\-\.]{1,256}`. + * datasetId: 'placeholder-value', + * // The name of the project where the server creates the dataset. For + * // example, `projects/{project_id}/locations/{location_id}`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name", + * // "timeZone": "my_timeZone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.create * @memberOf! () * @@ -1179,6 +1236,61 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.deidentify * @desc Creates a new dataset containing de-identified data from the source dataset. The metadata field type is OperationMetadata. If the request is successful, the response field type is DeidentifySummary. If errors occur, error is set. The LRO result may still be successful if de-identification fails for some DICOM instances. The new de-identified dataset will not contain these failed resources. Failed resource totals are tracked in Operation.metadata. Error details are also logged to Stackdriver Logging. For more information, see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.deidentify({ + * // Source dataset resource name. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`. + * sourceDataset: + * 'projects/my-project/locations/my-location/datasets/my-dataset', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "destinationDataset": "my_destinationDataset" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.deidentify * @memberOf! () * @@ -1254,6 +1366,45 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.delete * @desc Deletes the specified health dataset and all data contained in the dataset. Deleting a dataset does not affect the sources from which the dataset was imported (if any). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.delete({ + * // The name of the dataset to delete. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`. + * name: 'projects/my-project/locations/my-location/datasets/my-dataset', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.delete * @memberOf! () * @@ -1323,6 +1474,48 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.get * @desc Gets any metadata associated with a dataset. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.get({ + * // The name of the dataset to read. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`. + * name: 'projects/my-project/locations/my-location/datasets/my-dataset', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "timeZone": "my_timeZone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.get * @memberOf! () * @@ -1392,6 +1585,59 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/my-location/datasets/my-dataset', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.getIamPolicy * @memberOf! () * @@ -1465,6 +1711,53 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.list * @desc Lists the health datasets in the current project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.list({ + * // The maximum number of items to return. Capped to 100 if not specified. + * // May not be larger than 1000. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // The name of the project whose datasets should be listed. + * // For example, `projects/{project_id}/locations/{location_id}`. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "datasets": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.list * @memberOf! () * @@ -1543,6 +1836,61 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.patch * @desc Updates dataset metadata. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.patch({ + * // Output only. Resource name of the dataset, of the form + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`. + * name: 'projects/my-project/locations/my-location/datasets/my-dataset', + * // The update mask applies to the resource. For the `FieldMask` definition, + * // see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name", + * // "timeZone": "my_timeZone" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "timeZone": "my_timeZone" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.patch * @memberOf! () * @@ -1614,6 +1962,59 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/my-location/datasets/my-dataset', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.setIamPolicy * @memberOf! () * @@ -1687,6 +2088,55 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/my-location/datasets/my-dataset', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.testIamPermissions * @memberOf! () * @@ -1934,6 +2384,61 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.create * @desc Creates a new DICOM store within the parent dataset. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.create({ + * // The ID of the DICOM store that is being created. + * // Any string value up to 256 characters in length. + * dicomStoreId: 'placeholder-value', + * // The name of the dataset this DICOM store belongs to. + * parent: 'projects/my-project/locations/my-location/datasets/my-dataset', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.create * @memberOf! () * @@ -2010,6 +2515,64 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.deidentify * @desc De-identifies data from the source store and writes it to the destination store. The metadata field type is OperationMetadata. If the request is successful, the response field type is DeidentifyDicomStoreSummary. If errors occur, error is set. The LRO result may still be successful if de-identification fails for some DICOM instances. The output DICOM store will not contain these failed resources. Failed resource totals are tracked in Operation.metadata. Error details are also logged to Stackdriver (see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging)). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.deidentify( + * { + * // Source DICOM store resource name. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * sourceStore: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "destinationStore": "my_destinationStore", + * // "filterConfig": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.deidentify * @memberOf! () * @@ -2085,6 +2648,45 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.delete * @desc Deletes the specified DICOM store and removes all images that are contained within it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.delete({ + * // The resource name of the DICOM store to delete. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.delete * @memberOf! () * @@ -2154,6 +2756,62 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.export * @desc Exports data to the specified destination by copying it from the DICOM store. Errors are also logged to Stackdriver Logging. For more information, see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging). The metadata field type is OperationMetadata. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.export({ + * // The DICOM store resource name from which to export the data. For + * // example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bigqueryDestination": {}, + * // "gcsDestination": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.export * @memberOf! () * @@ -2226,6 +2884,49 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.get * @desc Gets the specified DICOM store. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.get({ + * // The resource name of the DICOM store to get. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.get * @memberOf! () * @@ -2297,6 +2998,62 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.getIamPolicy( + * { + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.getIamPolicy * @memberOf! () * @@ -2370,6 +3127,61 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.import * @desc Imports data into the DICOM store by copying it from the specified source. Errors are logged to Stackdriver Logging. For more information, see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging). The metadata field type is OperationMetadata. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.import({ + * // The name of the DICOM store resource into which the data is imported. + * // For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "gcsSource": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.import * @memberOf! () * @@ -2442,6 +3254,56 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.list * @desc Lists the DICOM stores in the given dataset. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.list({ + * // Restricts stores returned to those matching a filter. Syntax: + * // https://cloud.google.com/appengine/docs/standard/python/search/query_strings + * // Only filtering on labels is supported. For example, `labels.key=value`. + * filter: 'placeholder-value', + * // Limit on the number of DICOM stores to return in a single response. + * // If zero the default page size of 100 is used. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from the previous List request, if any. + * pageToken: 'placeholder-value', + * // Name of the dataset. + * parent: 'projects/my-project/locations/my-location/datasets/my-dataset', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dicomStores": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.list * @memberOf! () * @@ -2521,6 +3383,64 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.patch * @desc Updates the specified DICOM store. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.patch({ + * // Output only. Resource name of the DICOM store, of the form + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * // The update mask applies to the resource. For the `FieldMask` definition, + * // see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.patch * @memberOf! () * @@ -2594,6 +3514,56 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.searchForInstances * @desc SearchForInstances returns a list of matching instances. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.searchForInstances( + * { + * // The path of the SearchForInstancesRequest DICOMweb request. For example, + * // `instances`, `series/{series_uid}/instances`, or + * // `studies/{study_uid}/instances`. + * dicomWebPath: 'instances', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.searchForInstances * @memberOf! () * @@ -2667,6 +3637,55 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.searchForSeries * @desc SearchForSeries returns a list of matching series. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.searchForSeries( + * { + * // The path of the SearchForSeries DICOMweb request. For example, `series` or + * // `studies/{study_uid}/series`. + * dicomWebPath: 'series', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.searchForSeries * @memberOf! () * @@ -2740,6 +3759,54 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.searchForStudies * @desc SearchForStudies returns a list of matching studies. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.searchForStudies( + * { + * // The path of the SearchForStudies DICOMweb request. For example, `studies`. + * dicomWebPath: 'studies', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.searchForStudies * @memberOf! () * @@ -2813,6 +3880,62 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.setIamPolicy * @memberOf! () * @@ -2886,6 +4009,65 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.storeInstances * @desc StoreInstances stores DICOM instances associated with study instance unique identifiers (SUID). See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.5. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.storeInstances( + * { + * // The path of the StoreInstances DICOMweb request. For example, + * // `studies/[{study_uid}]`. Note that the `study_uid` is optional. + * dicomWebPath: 'studies', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.storeInstances * @memberOf! () * @@ -2960,6 +4142,58 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.testIamPermissions * @memberOf! () * @@ -3314,6 +4548,55 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.studies.delete * @desc DeleteStudy deletes all instances within the given study. Delete requests are equivalent to the GET requests specified in the Retrieve transaction. The method returns an Operation which will be marked successful when the deletion is complete. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.delete( + * { + * // The path of the DeleteStudy request. For example, `studies/{study_uid}`. + * dicomWebPath: 'studies/my-studie', + * + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.studies.delete * @memberOf! () * @@ -3389,6 +4672,55 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.studies.retrieveMetadata * @desc RetrieveStudyMetadata returns instance associated with the given study presented as metadata with the bulk data removed. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.retrieveMetadata( + * { + * // The path of the RetrieveStudyMetadata DICOMweb request. For example, + * // `studies/{study_uid}/metadata`. + * dicomWebPath: 'studies/my-studie/metadata', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.studies.retrieveMetadata * @memberOf! () * @@ -3462,6 +4794,55 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.studies.retrieveStudy * @desc RetrieveStudy returns all instances within the given study. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.retrieveStudy( + * { + * // The path of the RetrieveStudy DICOMweb request. For example, + * // `studies/{study_uid}`. + * dicomWebPath: 'studies/my-studie', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.studies.retrieveStudy * @memberOf! () * @@ -3535,6 +4916,56 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.studies.searchForInstances * @desc SearchForInstances returns a list of matching instances. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.searchForInstances( + * { + * // The path of the SearchForInstancesRequest DICOMweb request. For example, + * // `instances`, `series/{series_uid}/instances`, or + * // `studies/{study_uid}/instances`. + * dicomWebPath: 'studies/my-studie/instances', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.studies.searchForInstances * @memberOf! () * @@ -3608,6 +5039,55 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.studies.searchForSeries * @desc SearchForSeries returns a list of matching series. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.searchForSeries( + * { + * // The path of the SearchForSeries DICOMweb request. For example, `series` or + * // `studies/{study_uid}/series`. + * dicomWebPath: 'studies/my-studie/series', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.studies.searchForSeries * @memberOf! () * @@ -3681,6 +5161,65 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.studies.storeInstances * @desc StoreInstances stores DICOM instances associated with study instance unique identifiers (SUID). See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.5. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.storeInstances( + * { + * // The path of the StoreInstances DICOMweb request. For example, + * // `studies/[{study_uid}]`. Note that the `study_uid` is optional. + * dicomWebPath: 'studies/my-studie', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.studies.storeInstances * @memberOf! () * @@ -3868,6 +5407,57 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.studies.series.delete * @desc DeleteSeries deletes all instances within the given study and series. Delete requests are equivalent to the GET requests specified in the Retrieve transaction. The method returns an Operation which will be marked successful when the deletion is complete. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.series.delete( + * { + * // The path of the DeleteSeries request. For example, + * // `studies/{study_uid}/series/{series_uid}`. + * dicomWebPath: 'studies/my-studie/series/my-serie', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.studies.series.delete * @memberOf! () * @@ -3943,6 +5533,55 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.studies.series.retrieveMetadata * @desc RetrieveSeriesMetadata returns instance associated with the given study and series, presented as metadata with the bulk data removed. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.series.retrieveMetadata( + * { + * // The path of the RetrieveSeriesMetadata DICOMweb request. For example, + * // `studies/{study_uid}/series/{series_uid}/metadata`. + * dicomWebPath: 'studies/my-studie/series/my-serie/metadata', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.studies.series.retrieveMetadata * @memberOf! () * @@ -4016,6 +5655,55 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.studies.series.retrieveSeries * @desc RetrieveSeries returns all instances within the given study and series. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.series.retrieveSeries( + * { + * // The path of the RetrieveSeries DICOMweb request. For example, + * // `studies/{study_uid}/series/{series_uid}`. + * dicomWebPath: 'studies/my-studie/series/my-serie', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.studies.series.retrieveSeries * @memberOf! () * @@ -4089,6 +5777,56 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.studies.series.searchForInstances * @desc SearchForInstances returns a list of matching instances. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.series.searchForInstances( + * { + * // The path of the SearchForInstancesRequest DICOMweb request. For example, + * // `instances`, `series/{series_uid}/instances`, or + * // `studies/{study_uid}/instances`. + * dicomWebPath: 'studies/my-studie/series/my-serie/instances', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.studies.series.searchForInstances * @memberOf! () * @@ -4238,6 +5976,51 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.studies.series.instances.delete * @desc DeleteInstance deletes an instance associated with the given study, series, and SOP Instance UID. Delete requests are equivalent to the GET requests specified in the Retrieve transaction. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.series.instances.delete( + * { + * // The path of the DeleteInstance request. For example, + * // `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}`. + * dicomWebPath: 'studies/my-studie/series/my-serie/instances/my-instance', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.studies.series.instances.delete * @memberOf! () * @@ -4311,6 +6094,55 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveInstance * @desc RetrieveInstance returns instance associated with the given study, series, and SOP Instance UID. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveInstance( + * { + * // The path of the RetrieveInstance DICOMweb request. For example, + * // `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}`. + * dicomWebPath: 'studies/my-studie/series/my-serie/instances/my-instance', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveInstance * @memberOf! () * @@ -4384,6 +6216,56 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveMetadata * @desc RetrieveInstanceMetadata returns instance associated with the given study, series, and SOP Instance UID presented as metadata with the bulk data removed. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveMetadata( + * { + * // The path of the RetrieveInstanceMetadata DICOMweb request. For example, + * // `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/metadata`. + * dicomWebPath: + * 'studies/my-studie/series/my-serie/instances/my-instance/metadata', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveMetadata * @memberOf! () * @@ -4457,6 +6339,56 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveRendered * @desc RetrieveRenderedInstance returns instance associated with the given study, series, and SOP Instance UID in an acceptable Rendered Media Type. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveRendered( + * { + * // The path of the RetrieveRenderedInstance DICOMweb request. For example, + * // `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/rendered`. + * dicomWebPath: + * 'studies/my-studie/series/my-serie/instances/my-instance/rendered', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveRendered * @memberOf! () * @@ -4602,6 +6534,56 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.studies.series.instances.frames.retrieveFrames * @desc RetrieveFrames returns instances associated with the given study, series, SOP Instance UID and frame numbers. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.series.instances.frames.retrieveFrames( + * { + * // The path of the RetrieveFrames DICOMweb request. For example, + * // `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/frames/{frame_list}`. + * dicomWebPath: + * 'studies/my-studie/series/my-serie/instances/my-instance/frames/my-frame', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.studies.series.instances.frames.retrieveFrames * @memberOf! () * @@ -4675,6 +6657,56 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.dicomStores.studies.series.instances.frames.retrieveRendered * @desc RetrieveRenderedFrames returns instances associated with the given study, series, SOP Instance UID and frame numbers in an acceptable Rendered Media Type. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.series.instances.frames.retrieveRendered( + * { + * // The path of the RetrieveRenderedFrames DICOMweb request. For example, + * // `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/frames/{frame_list}/rendered`. + * dicomWebPath: + * 'studies/my-studie/series/my-serie/instances/my-instance/frames/my-frame/rendered', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.studies.series.instances.frames.retrieveRendered * @memberOf! () * @@ -4792,6 +6824,71 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.create * @desc Creates a new FHIR store within the parent dataset. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.create({ + * // The ID of the FHIR store that is being created. + * // The string must match the following regex: `[\p{L}\p{N}_\-\.]{1,256}`. + * fhirStoreId: 'placeholder-value', + * // The name of the dataset this FHIR store belongs to. + * parent: 'projects/my-project/locations/my-location/datasets/my-dataset', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "disableReferentialIntegrity": false, + * // "disableResourceVersioning": false, + * // "enableUpdateCreate": false, + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {}, + * // "streamConfigs": [], + * // "version": "my_version" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "disableReferentialIntegrity": false, + * // "disableResourceVersioning": false, + * // "enableUpdateCreate": false, + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {}, + * // "streamConfigs": [], + * // "version": "my_version" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.create * @memberOf! () * @@ -4868,6 +6965,64 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.deidentify * @desc De-identifies data from the source store and writes it to the destination store. The metadata field type is OperationMetadata. If the request is successful, the response field type is DeidentifyFhirStoreSummary. If errors occur, error is set. Error details are also logged to Stackdriver (see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging)). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.deidentify( + * { + * // Source FHIR store resource name. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. + * sourceStore: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "destinationStore": "my_destinationStore", + * // "resourceFilter": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.deidentify * @memberOf! () * @@ -4943,6 +7098,45 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.delete * @desc Deletes the specified FHIR store and removes all resources within it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.delete({ + * // The resource name of the FHIR store to delete. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.delete * @memberOf! () * @@ -5012,6 +7206,62 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.export * @desc Export resources from the FHIR store to the specified destination. This method returns an Operation that can be used to track the status of the export by calling GetOperation. Immediate fatal errors appear in the error field, errors are also logged to Stackdriver (see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging)). Otherwise, when the operation finishes, a detailed response of type ExportResourcesResponse is returned in the response field. The metadata field type for this operation is OperationMetadata. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.export({ + * // The name of the FHIR store to export resource from. The name should be in + * // the format of + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bigqueryDestination": {}, + * // "gcsDestination": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.export * @memberOf! () * @@ -5084,6 +7334,54 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.get * @desc Gets the configuration of the specified FHIR store. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.get({ + * // The resource name of the FHIR store to get. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "disableReferentialIntegrity": false, + * // "disableResourceVersioning": false, + * // "enableUpdateCreate": false, + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {}, + * // "streamConfigs": [], + * // "version": "my_version" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.get * @memberOf! () * @@ -5155,6 +7453,62 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.getIamPolicy( + * { + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.getIamPolicy * @memberOf! () * @@ -5228,6 +7582,62 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.import * @desc Import resources to the FHIR store by loading data from the specified sources. This method is optimized to load large quantities of data using import semantics that ignore some FHIR store configuration options and are not suitable for all use cases. It is primarily intended to load data into an empty FHIR store that is not being used by other clients. In cases where this method is not appropriate, consider using ExecuteBundle to load data. Every resource in the input must contain a client-supplied ID, and will be stored using that ID regardless of the enable_update_create setting on the FHIR store. The import process does not enforce referential integrity, regardless of the disable_referential_integrity setting on the FHIR store. This allows the import of resources with arbitrary interdependencies without considering grouping or ordering, but if the input data contains invalid references or if some resources fail to be imported, the FHIR store might be left in a state that violates referential integrity. The import process does not trigger PubSub notification or BigQuery streaming update, regardless of how those are configured on the FHIR store. If a resource with the specified ID already exists, the most recent version of the resource is overwritten without creating a new historical version, regardless of the disable_resource_versioning setting on the FHIR store. If transient failures occur during the import, it is possible that successfully imported resources will be overwritten more than once. The import operation is idempotent unless the input data contains multiple valid resources with the same ID but different contents. In that case, after the import completes, the store will contain exactly one resource with that ID but there is no ordering guarantee on which version of the contents it will have. The operation result counters do not count duplicate IDs as an error and will count one success for each resource in the input, which might result in a success count larger than the number of resources in the FHIR store. This often occurs when importing data organized in bundles produced by Patient-everything where each bundle contains its own copy of a resource such as Practitioner that might be referred to by many patients. If some resources fail to import, for example due to parsing errors, successfully imported resources are not rolled back. The location and format of the input data is specified by the parameters below. Note that if no format is specified, this method assumes the `BUNDLE` format. When using the `BUNDLE` format this method ignores the `Bundle.type` field, except that `history` bundles are rejected, and does not apply any of the bundle processing semantics for batch or transaction bundles. Unlike in ExecuteBundle, transaction bundles are not executed as a single transaction and bundle-internal references are not rewritten. The bundle is treated as a collection of resources to be written as provided in `Bundle.entry.resource`, ignoring `Bundle.entry.request`. As an example, this allows the import of `searchset` bundles produced by a FHIR search or Patient-everything operation. This method returns an Operation that can be used to track the status of the import by calling GetOperation. Immediate fatal errors appear in the error field, errors are also logged to Stackdriver (see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging)). Otherwise, when the operation finishes, a detailed response of type ImportResourcesResponse is returned in the response field. The metadata field type for this operation is OperationMetadata. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.import({ + * // The name of the FHIR store to import FHIR resources to. The name should be + * // in the format of + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentStructure": "my_contentStructure", + * // "gcsSource": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.import * @memberOf! () * @@ -5300,6 +7710,56 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.list * @desc Lists the FHIR stores in the given dataset. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.list({ + * // Restricts stores returned to those matching a filter. Syntax: + * // https://cloud.google.com/appengine/docs/standard/python/search/query_strings + * // Only filtering on labels is supported, for example `labels.key=value`. + * filter: 'placeholder-value', + * // Limit on the number of FHIR stores to return in a single response. If zero + * // the default page size of 100 is used. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from the previous List request, if any. + * pageToken: 'placeholder-value', + * // Name of the dataset. + * parent: 'projects/my-project/locations/my-location/datasets/my-dataset', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "fhirStores": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.list * @memberOf! () * @@ -5379,6 +7839,74 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.patch * @desc Updates the configuration of the specified FHIR store. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.patch({ + * // Output only. Resource name of the FHIR store, of the form + * // `projects/{project_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * // The update mask applies to the resource. For the `FieldMask` definition, + * // see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "disableReferentialIntegrity": false, + * // "disableResourceVersioning": false, + * // "enableUpdateCreate": false, + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {}, + * // "streamConfigs": [], + * // "version": "my_version" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "disableReferentialIntegrity": false, + * // "disableResourceVersioning": false, + * // "enableUpdateCreate": false, + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {}, + * // "streamConfigs": [], + * // "version": "my_version" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.patch * @memberOf! () * @@ -5452,6 +7980,55 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.search * @desc Searches for resources in the given FHIR store according to criteria specified as query parameters. Implements the FHIR standard search interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#search), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#search), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#search)) using the search semantics described in the FHIR Search specification ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/search.html), [STU3](http://hl7.org/implement/standards/fhir/STU3/search.html), [R4](http://hl7.org/implement/standards/fhir/R4/search.html)). Supports three methods of search defined by the specification: * `GET [base]?[parameters]` to search across all resources. * `GET [base]/[type]?[parameters]` to search resources of a specified type. * `POST [base]/[type]/_search?[parameters]` as an alternate form having the same semantics as the `GET` method. The `GET` methods do not support compartment searches. The `POST` method does not support `application/x-www-form-urlencoded` search parameters. On success, the response body will contain a JSON-encoded representation of a `Bundle` resource of type `searchset`, containing the results of the search. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. The server's capability statement, retrieved through capabilities, indicates what search parameters are supported on each FHIR resource. A list of all search parameters defined by the specification can be found in the FHIR Search Parameter Registry ([STU3](http://hl7.org/implement/standards/fhir/STU3/searchparameter-registry.html), [R4](http://hl7.org/implement/standards/fhir/R4/searchparameter-registry.html)). FHIR search parameters for DSTU2 can be found on each resource's definition page. Supported search modifiers: `:missing`, `:exact`, `:contains`, `:text`, `:in`, `:not-in`, `:above`, `:below`, `:[type]`, `:not`, and `:recurse`. Supported search result parameters: `_sort`, `_count`, `_include`, `_revinclude`, `_summary=text`, `_summary=data`, and `_elements`. The maximum number of search results returned defaults to 100, which can be overridden by the `_count` parameter up to a maximum limit of 1000. If there are additional results, the returned `Bundle` will contain pagination links. Resources with a total size larger than 5MB or a field count larger than 50,000 might not be fully searchable as the server might trim its generated search index in those cases. Note: FHIR resources are indexed asynchronously, so there might be a slight delay between the time a resource is created or changes and when the change is reflected in search results. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.search({ + * // Name of the FHIR store to retrieve resources from. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * // The FHIR resource type to search, such as Patient or Observation. For a + * // complete list, see the FHIR Resource Index + * // ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + * // [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + * // [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). + * resourceType: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.search * @memberOf! () * @@ -5522,6 +8099,62 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.setIamPolicy * @memberOf! () * @@ -5595,6 +8228,58 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.testIamPermissions * @memberOf! () * @@ -5892,6 +8577,51 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.fhir.capabilities * @desc Gets the FHIR capability statement ([STU3](http://hl7.org/implement/standards/fhir/STU3/capabilitystatement.html), [R4](http://hl7.org/implement/standards/fhir/R4/capabilitystatement.html)), or the [conformance statement](http://hl7.org/implement/standards/fhir/DSTU2/conformance.html) in the DSTU2 case for the store, which contains a description of functionality supported by the server. Implements the FHIR standard capabilities interaction ([STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#capabilities), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#capabilities)), or the [conformance interaction](http://hl7.org/implement/standards/fhir/DSTU2/http.html#conformance) in the DSTU2 case. On success, the response body will contain a JSON-encoded representation of a `CapabilityStatement` resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.capabilities( + * { + * // Name of the FHIR store to retrieve the capabilities for. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.fhir.capabilities * @memberOf! () * @@ -5964,6 +8694,68 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.fhir.create * @desc Creates a FHIR resource. Implements the FHIR standard create interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#create), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#create), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#create)), which creates a new resource with a server-assigned resource ID. The request body must contain a JSON-encoded FHIR resource, and the request headers must contain `Content-Type: application/fhir+json`. On success, the response body will contain a JSON-encoded representation of the resource as it was created on the server, including the server-assigned resource ID and version ID. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.create( + * { + * // The name of the FHIR store this resource belongs to. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * // The FHIR resource type to create, such as Patient or Observation. For a + * // complete list, see the FHIR Resource Index + * // ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + * // [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + * // [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). + * // Must match the resource type in the provided content. + * type: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.fhir.create * @memberOf! () * @@ -6038,6 +8830,51 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.fhir.delete * @desc Deletes a FHIR resource. Implements the FHIR standard delete interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#delete), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#delete), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#delete)). Note: Unless resource versioning is disabled by setting the disable_resource_versioning flag on the FHIR store, the deleted resources will be moved to a history repository that can still be retrieved through vread and related methods, unless they are removed by the purge method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.delete( + * { + * // The name of the resource to delete. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore/fhir/[^/]+/[^/]+', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.fhir.delete * @memberOf! () * @@ -6107,6 +8944,61 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.fhir.executeBundle * @desc Executes all the requests in the given Bundle. Implements the FHIR standard batch/transaction interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#transaction), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#transaction), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#transaction)). Supports all interactions within a bundle, except search. This method accepts Bundles of type `batch` and `transaction`, processing them according to the batch processing rules ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.16.1), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.1), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#brules)) and transaction processing rules ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.16.2), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.2), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#trules)). The request body must contain a JSON-encoded FHIR `Bundle` resource, and the request headers must contain `Content-Type: application/fhir+json`. For a batch bundle or a successful transaction the response body will contain a JSON-encoded representation of a `Bundle` resource of type `batch-response` or `transaction-response` containing one entry for each entry in the request, with the outcome of processing the entry. In the case of an error for a transaction bundle, the response body will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.executeBundle( + * { + * // Name of the FHIR store in which this bundle will be executed. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.fhir.executeBundle * @memberOf! () * @@ -6177,6 +9069,78 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.fhir.history * @desc Lists all the versions of a resource (including the current version and deleted versions) from the FHIR store. Implements the per-resource form of the FHIR standard history interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#history), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#history), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#history)). On success, the response body will contain a JSON-encoded representation of a `Bundle` resource of type `history`, containing the version history sorted from most recent to oldest versions. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.history( + * { + * // The name of the resource to retrieve. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore/fhir/[^/]+/[^/]+', + * // Only include resource versions that were current at some point during the + * // time period specified in the date time value. The date parameter format is + * // yyyy-mm-ddThh:mm:ss[Z|(+|-)hh:mm] + * // + * // Clients may specify any of the following: + * // + * // * An entire year: `_at=2019` + * // * An entire month: `_at=2019-01` + * // * A specific day: `_at=2019-01-20` + * // * A specific second: `_at=2018-12-31T23:59:58Z` + * _at: 'placeholder-value', + * // The maximum number of search results on a page. Defaults to 1000. + * _count: 'placeholder-value', + * // Used to retrieve the first, previous, next, or last page of resource + * // versions when using pagination. Value should be set to the value of + * // `_page_token` set in next or previous page links' URLs. Next and previous + * // page are returned in the response bundle's links field, where + * // `link.relation` is "previous" or "next". + * // + * // Omit `_page_token` if no previous request has been made. + * _page_token: 'placeholder-value', + * // Only include resource versions that were created at or after the given + * // instant in time. The instant in time uses the format + * // YYYY-MM-DDThh:mm:ss.sss+zz:zz (for example 2015-02-07T13:28:17.239+02:00 or + * // 2017-01-01T00:00:00Z). The time must be specified to the second and + * // include a time zone. + * _since: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.fhir.history * @memberOf! () * @@ -6253,6 +9217,61 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.fhir.patch * @desc Updates part of an existing resource by applying the operations specified in a [JSON Patch](http://jsonpatch.com/) document. Implements the FHIR standard patch interaction ([STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#patch), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#patch)). DSTU2 doesn't define a patch method, but the server supports it in the same way it supports STU3. The request body must contain a JSON Patch document, and the request headers must contain `Content-Type: application/json-patch+json`. On success, the response body will contain a JSON-encoded representation of the updated resource, including the server-assigned version ID. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.patch( + * { + * // The name of the resource to update. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore/fhir/[^/]+/[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.fhir.patch * @memberOf! () * @@ -6323,6 +9342,67 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.fhir.Patient-everything * @desc Retrieves all the resources directly referenced by a patient, as well as all of the resources in the patient compartment. Implements the FHIR extended operation Patient-everything ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/patient-operations.html#everything), [STU3](http://hl7.org/implement/standards/fhir/STU3/patient-operations.html#everything), [R4](http://hl7.org/implement/standards/fhir/R4/patient-operations.html#everything)). On success, the response body will contain a JSON-encoded representation of a `Bundle` resource of type `searchset`, containing the results of the operation. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.Patient) - + * everything({ + * // The response includes records prior to the end date. If no end date is + * // provided, all records subsequent to the start date are in scope. + * end: 'placeholder-value', + * // Name of the `Patient` resource for which the information is required. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore/fhir/Patient/[^/]+', + * // The response includes records subsequent to the start date. If no start + * // date is provided, all records prior to the end date are in scope. + * start: 'placeholder-value', + * // Maximum number of resources in a page. Defaults to 100. + * _count: 'placeholder-value', + * // Used to retrieve the next or previous page of results + * // when using pagination. Value should be set to the value of page_token set + * // in next or previous page links' urls. Next and previous page are returned + * // in the response bundle's links field, where `link.relation` is "previous" + * // or "next". + * // + * // Omit `page_token` if no previous request has been made. + * _page_token: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.fhir.Patient-everything * @memberOf! () * @@ -6399,6 +9479,51 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.fhir.read * @desc Gets the contents of a FHIR resource. Implements the FHIR standard read interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#read), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#read), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#read)). Also supports the FHIR standard conditional read interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#cread), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#cread), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#cread)) specified by supplying an `If-Modified-Since` header with a date/time value or an `If-None-Match` header with an ETag value. On success, the response body will contain a JSON-encoded representation of the resource. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.read( + * { + * // The name of the resource to retrieve. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore/fhir/[^/]+/[^/]+', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.fhir.read * @memberOf! () * @@ -6468,6 +9593,47 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.fhir.Resource-purge * @desc Deletes all the historical versions of a resource (excluding the current version) from the FHIR store. To remove all versions of a resource, first delete the current version and then call this method. This is not a FHIR standard operation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.Resource) - + * purge({ + * // The name of the resource to purge. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore/fhir/[^/]+/[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.fhir.Resource-purge * @memberOf! () * @@ -6537,6 +9703,59 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.fhir.search * @desc Searches for resources in the given FHIR store according to criteria specified as query parameters. Implements the FHIR standard search interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#search), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#search), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#search)) using the search semantics described in the FHIR Search specification ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/search.html), [STU3](http://hl7.org/implement/standards/fhir/STU3/search.html), [R4](http://hl7.org/implement/standards/fhir/R4/search.html)). Supports three methods of search defined by the specification: * `GET [base]?[parameters]` to search across all resources. * `GET [base]/[type]?[parameters]` to search resources of a specified type. * `POST [base]/[type]/_search?[parameters]` as an alternate form having the same semantics as the `GET` method. The `GET` methods do not support compartment searches. The `POST` method does not support `application/x-www-form-urlencoded` search parameters. On success, the response body will contain a JSON-encoded representation of a `Bundle` resource of type `searchset`, containing the results of the search. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. The server's capability statement, retrieved through capabilities, indicates what search parameters are supported on each FHIR resource. A list of all search parameters defined by the specification can be found in the FHIR Search Parameter Registry ([STU3](http://hl7.org/implement/standards/fhir/STU3/searchparameter-registry.html), [R4](http://hl7.org/implement/standards/fhir/R4/searchparameter-registry.html)). FHIR search parameters for DSTU2 can be found on each resource's definition page. Supported search modifiers: `:missing`, `:exact`, `:contains`, `:text`, `:in`, `:not-in`, `:above`, `:below`, `:[type]`, `:not`, and `:recurse`. Supported search result parameters: `_sort`, `_count`, `_include`, `_revinclude`, `_summary=text`, `_summary=data`, and `_elements`. The maximum number of search results returned defaults to 100, which can be overridden by the `_count` parameter up to a maximum limit of 1000. If there are additional results, the returned `Bundle` will contain pagination links. Resources with a total size larger than 5MB or a field count larger than 50,000 might not be fully searchable as the server might trim its generated search index in those cases. Note: FHIR resources are indexed asynchronously, so there might be a slight delay between the time a resource is created or changes and when the change is reflected in search results. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.search( + * { + * // Name of the FHIR store to retrieve resources from. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourceType": "my_resourceType" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.fhir.search * @memberOf! () * @@ -6610,6 +9829,61 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.fhir.update * @desc Updates the entire contents of a resource. Implements the FHIR standard update interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#update), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#update), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#update)). If the specified resource does not exist and the FHIR store has enable_update_create set, creates the resource with the client-specified ID. The request body must contain a JSON-encoded FHIR resource, and the request headers must contain `Content-Type: application/fhir+json`. The resource must contain an `id` element having an identical value to the ID in the REST path of the request. On success, the response body will contain a JSON-encoded representation of the updated resource, including the server-assigned version ID. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.update( + * { + * // The name of the resource to update. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore/fhir/[^/]+/[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.fhir.update * @memberOf! () * @@ -6680,6 +9954,51 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.fhirStores.fhir.vread * @desc Gets the contents of a version (current or historical) of a FHIR resource by version ID. Implements the FHIR standard vread interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#vread), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#vread), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#vread)). On success, the response body will contain a JSON-encoded representation of the resource. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.vread( + * { + * // The name of the resource version to retrieve. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore/fhir/[^/]+/[^/]+/_history/[^/]+', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.fhir.vread * @memberOf! () * @@ -6966,6 +10285,65 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.hl7V2Stores.create * @desc Creates a new HL7v2 store within the parent dataset. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.create({ + * // The ID of the HL7v2 store that is being created. + * // The string must match the following regex: `[\p{L}\p{N}_\-\.]{1,256}`. + * hl7V2StoreId: 'placeholder-value', + * // The name of the dataset this HL7v2 store belongs to. + * parent: 'projects/my-project/locations/my-location/datasets/my-dataset', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfigs": [], + * // "parserConfig": {}, + * // "rejectDuplicateMessage": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfigs": [], + * // "parserConfig": {}, + * // "rejectDuplicateMessage": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.hl7V2Stores.create * @memberOf! () * @@ -7042,6 +10420,45 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.hl7V2Stores.delete * @desc Deletes the specified HL7v2 store and removes all messages that are contained within it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.delete({ + * // The resource name of the HL7v2 store to delete. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.hl7V2Stores.delete * @memberOf! () * @@ -7111,6 +10528,51 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.hl7V2Stores.get * @desc Gets the specified HL7v2 store. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.get({ + * // The resource name of the HL7v2 store to get. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfigs": [], + * // "parserConfig": {}, + * // "rejectDuplicateMessage": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.hl7V2Stores.get * @memberOf! () * @@ -7182,6 +10644,62 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.hl7V2Stores.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.getIamPolicy( + * { + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.hl7V2Stores.getIamPolicy * @memberOf! () * @@ -7255,6 +10773,56 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.hl7V2Stores.list * @desc Lists the HL7v2 stores in the given dataset. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.list({ + * // Restricts stores returned to those matching a filter. Syntax: + * // https://cloud.google.com/appengine/docs/standard/python/search/query_strings + * // Only filtering on labels is supported. For example, `labels.key=value`. + * filter: 'placeholder-value', + * // Limit on the number of HL7v2 stores to return in a single response. + * // If zero the default page size of 100 is used. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from the previous List request, if any. + * pageToken: 'placeholder-value', + * // Name of the dataset. + * parent: 'projects/my-project/locations/my-location/datasets/my-dataset', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "hl7V2Stores": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.hl7V2Stores.list * @memberOf! () * @@ -7334,6 +10902,68 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.hl7V2Stores.patch * @desc Updates the HL7v2 store. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.patch({ + * // Output only. Resource name of the HL7v2 store, of the form + * // `projects/{project_id}/datasets/{dataset_id}/hl7V2Stores/{hl7v2_store_id}`. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store', + * // The update mask applies to the resource. For the `FieldMask` definition, + * // see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfigs": [], + * // "parserConfig": {}, + * // "rejectDuplicateMessage": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfigs": [], + * // "parserConfig": {}, + * // "rejectDuplicateMessage": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.hl7V2Stores.patch * @memberOf! () * @@ -7407,6 +11037,62 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.hl7V2Stores.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.hl7V2Stores.setIamPolicy * @memberOf! () * @@ -7480,6 +11166,58 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.hl7V2Stores.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.hl7V2Stores.testIamPermissions * @memberOf! () * @@ -7710,6 +11448,65 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.hl7V2Stores.messages.create * @desc Creates a message and sends a notification to the Cloud Pub/Sub topic. If configured, the MLLP adapter listens to messages created by this method and sends those back to the hospital. A successful response indicates the message has been persisted to storage and a Cloud Pub/Sub notification has been sent. Sending to the hospital by the MLLP adapter happens asynchronously. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.messages.create( + * { + * // The name of the dataset this message belongs to. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "message": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "data": "my_data", + * // "labels": {}, + * // "messageType": "my_messageType", + * // "name": "my_name", + * // "parsedData": {}, + * // "patientIds": [], + * // "sendFacility": "my_sendFacility", + * // "sendTime": "my_sendTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.hl7V2Stores.messages.create * @memberOf! () * @@ -7783,6 +11580,47 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.hl7V2Stores.messages.delete * @desc Deletes an HL7v2 message. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.messages.delete( + * { + * // The resource name of the HL7v2 message to delete. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store/messages/my-message', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.hl7V2Stores.messages.delete * @memberOf! () * @@ -7852,6 +11690,60 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.hl7V2Stores.messages.get * @desc Gets an HL7v2 message. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.messages.get( + * { + * // The resource name of the HL7v2 message to retrieve. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store/messages/my-message', + * // Specifies which parts of the Message resource to return in the response. + * // When unspecified, equivalent to FULL. + * view: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "data": "my_data", + * // "labels": {}, + * // "messageType": "my_messageType", + * // "name": "my_name", + * // "parsedData": {}, + * // "patientIds": [], + * // "sendFacility": "my_sendFacility", + * // "sendTime": "my_sendTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.hl7V2Stores.messages.get * @memberOf! () * @@ -7922,6 +11814,58 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.hl7V2Stores.messages.ingest * @desc Ingests a new HL7v2 message from the hospital and sends a notification to the Cloud Pub/Sub topic. Return is an HL7v2 ACK message if the message was successfully stored. Otherwise an error is returned. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.messages.ingest( + * { + * // The name of the HL7v2 store this message belongs to. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "message": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "hl7Ack": "my_hl7Ack", + * // "message": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.hl7V2Stores.messages.ingest * @memberOf! () * @@ -7999,6 +11943,90 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.hl7V2Stores.messages.list * @desc Lists all the messages in the given HL7v2 store with support for filtering. Note: HL7v2 messages are indexed asynchronously, so there might be a slight delay between the time a message is created and when it can be found through a filter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.messages.list( + * { + * // Restricts messages returned to those matching a filter. Syntax: + * // https://cloud.google.com/appengine/docs/standard/python/search/query_strings + * // + * // Fields/functions available for filtering are: + * // + * // * `message_type`, from the MSH-9.1 field. For example, + * // `NOT message_type = "ADT"`. + * // * `send_date` or `sendDate`, the YYYY-MM-DD date the message was sent in + * // the dataset's time_zone, from the MSH-7 segment. For example, + * // `send_date < "2017-01-02"`. + * // * `send_time`, the timestamp when the message was sent, using the + * // RFC3339 time format for comparisons, from the MSH-7 segment. For example, + * // `send_time < "2017-01-02T00:00:00-05:00"`. + * // * `send_facility`, the care center that the message came from, from the + * // MSH-4 segment. For example, `send_facility = "ABC"`. + * // * `PatientId(value, type)`, which matches if the message lists a patient + * // having an ID of the given value and type in the PID-2, PID-3, or PID-4 + * // segments. For example, `PatientId("123456", "MRN")`. + * // * `labels.x`, a string value of the label with key `x` as set using the + * // Message.labels + * // map. For example, `labels."priority"="high"`. The operator `:*` can be used + * // to assert the existence of a label. For example, `labels."priority":*`. + * filter: 'placeholder-value', + * // Orders messages returned by the specified order_by clause. + * // Syntax: https://cloud.google.com/apis/design/design_patterns#sorting_order + * // + * // Fields available for ordering are: + * // + * // * `send_time` + * orderBy: 'placeholder-value', + * // Limit on the number of messages to return in a single response. + * // If zero the default page size of 100 is used. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from the previous List request, if any. + * pageToken: 'placeholder-value', + * // Name of the HL7v2 store to retrieve messages from. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store', + * // Specifies the parts of the Message to return in the response. + * // When unspecified, equivalent to BASIC. Setting this to anything other than + * // BASIC with a `page_size` larger than the default can generate a large + * // response, which impacts the performance of this method. + * view: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "hl7V2Messages": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.hl7V2Stores.messages.list * @memberOf! () * @@ -8080,6 +12108,79 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.hl7V2Stores.messages.patch * @desc Update the message. The contents of the message in Message.data and data extracted from the contents such as Message.create_time cannot be altered. Only the Message.labels field is allowed to be updated. The labels in the request are merged with the existing set of labels. Existing labels with the same keys are updated. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.messages.patch( + * { + * // Resource name of the Message, of the form + * // `projects/{project_id}/datasets/{dataset_id}/hl7V2Stores/{hl7_v2_store_id}/messages/{message_id}`. + * // Assigned by the server. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store/messages/my-message', + * // The update mask applies to the resource. For the `FieldMask` definition, + * // see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "data": "my_data", + * // "labels": {}, + * // "messageType": "my_messageType", + * // "name": "my_name", + * // "parsedData": {}, + * // "patientIds": [], + * // "sendFacility": "my_sendFacility", + * // "sendTime": "my_sendTime" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "data": "my_data", + * // "labels": {}, + * // "messageType": "my_messageType", + * // "name": "my_name", + * // "parsedData": {}, + * // "patientIds": [], + * // "sendFacility": "my_sendFacility", + * // "sendTime": "my_sendTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.hl7V2Stores.messages.patch * @memberOf! () * @@ -8274,6 +12375,51 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.operations.cancel * @memberOf! () * @@ -8344,6 +12490,51 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.operations.get({ + * // The name of the operation resource. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.operations.get * @memberOf! () * @@ -8415,6 +12606,53 @@ export namespace healthcare_v1 { /** * healthcare.projects.locations.datasets.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location/datasets/my-dataset', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.operations.list * @memberOf! () * diff --git a/src/apis/healthcare/v1beta1.ts b/src/apis/healthcare/v1beta1.ts index b504c156fd9..355da609125 100644 --- a/src/apis/healthcare/v1beta1.ts +++ b/src/apis/healthcare/v1beta1.ts @@ -1429,51 +1429,49 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.get * @desc Gets information about a location. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // Resource name for the location. - * name: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudHealthcare.projects.locations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await healthcare.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.get * @memberOf! () * @@ -1544,64 +1542,52 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.list * @desc Lists information about the supported locations for this service. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource that owns the locations collection, if applicable. - * name: 'projects/my-project', // TODO: Update placeholder value. + * const healthcare = google.healthcare('v1beta1'); * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * 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/cloud-platform'], + * }); * - * var locationsPage = response['locations']; - * if (!locationsPage) { - * return; - * } - * for (var i = 0; i < locationsPage.length; i++) { - * // TODO: Change code below to process each resource in `locationsPage`: - * console.log(JSON.stringify(locationsPage[i], null, 2)); - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudHealthcare.projects.locations.list(request, handlePage); - * } - * }; + * // Do the magic + * const res = await healthcare.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } * - * cloudHealthcare.projects.locations.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.list * @memberOf! () * @@ -1746,56 +1732,62 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.create * @desc Creates a new health dataset. Results are returned through the Operation interface which returns either an `Operation.response` which contains a Dataset or `Operation.error`. The metadata field type is OperationMetadata. A Google Cloud Platform project can contain up to 500 datasets across all regions. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the project in which the dataset should be created (e.g., - * // `projects/{project_id}/locations/{location_id}`). - * parent: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.create({ + * // The ID of the dataset that is being created. + * // The string must match the following regex: `[\p{L}\p{N}_\-\.]{1,256}`. + * datasetId: 'placeholder-value', + * // The name of the project where the server creates the dataset. For + * // example, `projects/{project_id}/locations/{location_id}`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name", + * // "timeZone": "my_timeZone" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.create * @memberOf! () * @@ -1873,56 +1865,60 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.deidentify * @desc Creates a new dataset containing de-identified data from the source dataset. The metadata field type is OperationMetadata. If the request is successful, the response field type is DeidentifySummary. If errors occur, error details field type is DeidentifyErrorDetails. The LRO result may still be successful if de-identification fails for some DICOM instances. The new de-identified dataset will not contain these failed resources. Failed resource totals are tracked in DeidentifySummary.failure_resource_count. Error details are also logged to Stackdriver Logging. For more information, see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging). * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { - * // Source dataset resource name. (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`). - * sourceDataset: 'projects/my-project/locations/my-location/datasets/my-dataset', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await healthcare.projects.locations.datasets.deidentify({ + * // Source dataset resource name. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`. + * sourceDataset: + * 'projects/my-project/locations/my-location/datasets/my-dataset', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "destinationDataset": "my_destinationDataset" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.deidentify(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.deidentify * @memberOf! () * @@ -1999,49 +1995,44 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.delete * @desc Deletes the specified health dataset and all data contained in the dataset. Deleting a dataset does not affect the sources from which the dataset was imported (if any). * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // The name of the dataset to delete (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`). - * name: 'projects/my-project/locations/my-location/datasets/my-dataset', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudHealthcare.projects.locations.datasets.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await healthcare.projects.locations.datasets.delete({ + * // The name of the dataset to delete. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`. + * name: 'projects/my-project/locations/my-location/datasets/my-dataset', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.delete * @memberOf! () * @@ -2112,52 +2103,47 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.get * @desc Gets any metadata associated with a dataset. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the dataset to read (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`). - * name: 'projects/my-project/locations/my-location/datasets/my-dataset', // TODO: Update placeholder value. + * const healthcare = google.healthcare('v1beta1'); * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudHealthcare.projects.locations.datasets.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await healthcare.projects.locations.datasets.get({ + * // The name of the dataset to read. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`. + * name: 'projects/my-project/locations/my-location/datasets/my-dataset', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // { + * // "name": "my_name", + * // "timeZone": "my_timeZone" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.get * @memberOf! () * @@ -2228,52 +2214,58 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', * // REQUIRED: The resource for which the policy is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/datasets/my-dataset', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * resource: 'projects/my-project/locations/my-location/datasets/my-dataset', + * }); + * console.log(res.data); * - * cloudHealthcare.projects.locations.datasets.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.getIamPolicy * @memberOf! () * @@ -2348,65 +2340,52 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.list * @desc Lists the health datasets in the current project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the project whose datasets should be listed (e.g., - * // `projects/{project_id}/locations/{location_id}`). - * parent: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var datasetsPage = response['datasets']; - * if (!datasetsPage) { - * return; - * } - * for (var i = 0; i < datasetsPage.length; i++) { - * // TODO: Change code below to process each resource in `datasetsPage`: - * console.log(JSON.stringify(datasetsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudHealthcare.projects.locations.datasets.list(request, handlePage); - * } - * }; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.list({ + * // The maximum number of items to return. Capped to 100 if not specified. + * // May not be larger than 1000. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // The name of the project whose datasets should be listed. + * // For example, `projects/{project_id}/locations/{location_id}`. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "datasets": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } * - * cloudHealthcare.projects.locations.datasets.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.list * @memberOf! () * @@ -2486,57 +2465,60 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.patch * @desc Updates dataset metadata. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 healthcare.projects.locations.datasets.patch({ * // Output only. Resource name of the dataset, of the form * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`. - * name: 'projects/my-project/locations/my-location/datasets/my-dataset', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * name: 'projects/my-project/locations/my-location/datasets/my-dataset', + * // The update mask applies to the resource. For the `FieldMask` definition, + * // see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name", + * // "timeZone": "my_timeZone" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "name": "my_name", + * // "timeZone": "my_timeZone" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.patch * @memberOf! () * @@ -2609,56 +2591,58 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await healthcare.projects.locations.datasets.setIamPolicy({ * // REQUIRED: The resource for which the policy is being specified. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/datasets/my-dataset', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'projects/my-project/locations/my-location/datasets/my-dataset', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.setIamPolicy * @memberOf! () * @@ -2733,56 +2717,54 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 healthcare.projects.locations.datasets.testIamPermissions({ * // REQUIRED: The resource for which the policy detail is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/datasets/my-dataset', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'projects/my-project/locations/my-location/datasets/my-dataset', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.testIamPermissions * @memberOf! () * @@ -3026,6 +3008,62 @@ export namespace healthcare_v1beta1 { /** * healthcare.projects.locations.datasets.annotationStores.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.annotationStores.getIamPolicy( + * { + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/annotationStores/my-annotationStore', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.annotationStores.getIamPolicy * @memberOf! () * @@ -3099,6 +3137,62 @@ export namespace healthcare_v1beta1 { /** * healthcare.projects.locations.datasets.annotationStores.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.annotationStores.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/annotationStores/my-annotationStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.annotationStores.setIamPolicy * @memberOf! () * @@ -3172,6 +3266,58 @@ export namespace healthcare_v1beta1 { /** * healthcare.projects.locations.datasets.annotationStores.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.annotationStores.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/annotationStores/my-annotationStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.annotationStores.testIamPermissions * @memberOf! () * @@ -3317,55 +3463,60 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.create * @desc Creates a new DICOM store within the parent dataset. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // The name of the dataset this DICOM store belongs to. - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * auth: authClient, - * }; + * // Do the magic + * const res = await healthcare.projects.locations.datasets.dicomStores.create({ + * // The ID of the DICOM store that is being created. + * // Any string value up to 256 characters in length. + * dicomStoreId: 'placeholder-value', + * // The name of the dataset this DICOM store belongs to. + * parent: 'projects/my-project/locations/my-location/datasets/my-dataset', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {} + * // } + * }, + * }); + * console.log(res.data); * - * cloudHealthcare.projects.locations.datasets.dicomStores.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.create * @memberOf! () * @@ -3442,6 +3593,64 @@ export namespace healthcare_v1beta1 { /** * healthcare.projects.locations.datasets.dicomStores.deidentify * @desc De-identifies data from the source store and writes it to the destination store. The metadata field type is OperationMetadata. If the request is successful, the response field type is DeidentifyDicomStoreSummary. If errors occur, error details field type is DeidentifyErrorDetails. The LRO result may still be successful if de-identification fails for some DICOM instances. The output DICOM store will not contain these failed resources. Failed resource totals are tracked in DeidentifySummary.failure_resource_count. Error details are also logged to Stackdriver (see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging)). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.deidentify( + * { + * // Source DICOM store resource name. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * sourceStore: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "destinationStore": "my_destinationStore", + * // "filterConfig": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.deidentify * @memberOf! () * @@ -3518,48 +3727,44 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.delete * @desc Deletes the specified DICOM store and removes all images that are contained within it. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the DICOM store to delete. - * name: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudHealthcare.projects.locations.datasets.dicomStores.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await healthcare.projects.locations.datasets.dicomStores.delete({ + * // The resource name of the DICOM store to delete. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.delete * @memberOf! () * @@ -3630,56 +3835,61 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.export * @desc Exports data to the specified destination by copying it from the DICOM store. Errors are also logged to Stackdriver Logging. For more information, see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging). The metadata field type is OperationMetadata. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // The DICOM store resource name from which the data should be exported (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * name: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * auth: authClient, - * }; + * // Do the magic + * const res = await healthcare.projects.locations.datasets.dicomStores.export({ + * // The DICOM store resource name from which to export the data. For + * // example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bigqueryDestination": {}, + * // "gcsDestination": {} + * // } + * }, + * }); + * console.log(res.data); * - * cloudHealthcare.projects.locations.datasets.dicomStores.export(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.export * @memberOf! () * @@ -3756,51 +3966,48 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.get * @desc Gets the specified DICOM store. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the DICOM store to get. - * name: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudHealthcare.projects.locations.datasets.dicomStores.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await healthcare.projects.locations.datasets.dicomStores.get({ + * // The resource name of the DICOM store to get. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // { + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {} + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.get * @memberOf! () * @@ -3873,52 +4080,61 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being requested. - * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.getIamPolicy( + * { + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.getIamPolicy * @memberOf! () * @@ -3993,56 +4209,60 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.import * @desc Imports data into the DICOM store by copying it from the specified source. For errors, the Operation is populated with error details (in the form of ImportDicomDataErrorDetails in error.details), which hold finer-grained error information. Errors are also logged to Stackdriver Logging. For more information, see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging). The metadata field type is OperationMetadata. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store resource into which the data is imported (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * name: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * auth: authClient, - * }; + * // Do the magic + * const res = await healthcare.projects.locations.datasets.dicomStores.import({ + * // The name of the DICOM store resource into which the data is imported. + * // For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "gcsSource": {} + * // } + * }, + * }); + * console.log(res.data); * - * cloudHealthcare.projects.locations.datasets.dicomStores.import(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.import * @memberOf! () * @@ -4119,64 +4339,55 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.list * @desc Lists the DICOM stores in the given dataset. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.list({ + * // Restricts stores returned to those matching a filter. Syntax: + * // https://cloud.google.com/appengine/docs/standard/python/search/query_strings + * // Only filtering on labels is supported. For example, `labels.key=value`. + * filter: 'placeholder-value', + * // Limit on the number of DICOM stores to return in a single response. + * // If zero the default page size of 100 is used. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from the previous List request, if any. + * pageToken: 'placeholder-value', * // Name of the dataset. - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var dicomStoresPage = response['dicomStores']; - * if (!dicomStoresPage) { - * return; - * } - * for (var i = 0; i < dicomStoresPage.length; i++) { - * // TODO: Change code below to process each resource in `dicomStoresPage`: - * console.log(JSON.stringify(dicomStoresPage[i], null, 2)); - * } + * parent: 'projects/my-project/locations/my-location/datasets/my-dataset', + * }); + * console.log(res.data); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudHealthcare.projects.locations.datasets.dicomStores.list(request, handlePage); - * } - * }; + * // Example response + * // { + * // "dicomStores": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } * - * cloudHealthcare.projects.locations.datasets.dicomStores.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.list * @memberOf! () * @@ -4257,57 +4468,63 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.patch * @desc Updates the specified DICOM store. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 healthcare.projects.locations.datasets.dicomStores.patch({ * // Output only. Resource name of the DICOM store, of the form * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. - * name: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * // The update mask applies to the resource. For the `FieldMask` definition, + * // see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {} + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.patch * @memberOf! () * @@ -4382,57 +4599,55 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.searchForInstances * @desc SearchForInstances returns a list of matching instances. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store that is being accessed (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * // The path of the SearchForInstancesRequest DICOMweb request (e.g., - * // `instances` or `series/{series_uid}/instances` or - * // `studies/{study_uid}/instances`). - * dicomWebPath: 'instances', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.searchForInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.searchForInstances( + * { + * // The path of the SearchForInstancesRequest DICOMweb request. For example, + * // `instances`, `series/{series_uid}/instances`, or + * // `studies/{study_uid}/instances`. + * dicomWebPath: 'instances', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.searchForInstances * @memberOf! () * @@ -4506,56 +4721,54 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.searchForSeries * @desc SearchForSeries returns a list of matching series. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store that is being accessed (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * // The path of the SearchForSeries DICOMweb request(e.g., `series` or - * // `studies/{study_uid}/series`). - * dicomWebPath: 'series', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.searchForSeries(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.searchForSeries( + * { + * // The path of the SearchForSeries DICOMweb request. For example, `series` or + * // `studies/{study_uid}/series`. + * dicomWebPath: 'series', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.searchForSeries * @memberOf! () * @@ -4629,55 +4842,53 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.searchForStudies * @desc SearchForStudies returns a list of matching studies. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store that is being accessed (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * // The path of the SearchForStudies DICOMweb request (e.g., `studies`). - * dicomWebPath: 'studies', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.searchForStudies(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.searchForStudies( + * { + * // The path of the SearchForStudies DICOMweb request. For example, `studies`. + * dicomWebPath: 'studies', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.searchForStudies * @memberOf! () * @@ -4751,56 +4962,61 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being specified. - * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.setIamPolicy * @memberOf! () * @@ -4875,60 +5091,64 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.storeInstances * @desc StoreInstances stores DICOM instances associated with study instance unique identifiers (SUID). See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.5. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store that is being accessed (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * // The path of the StoreInstances DICOMweb request (e.g., - * // `studies/[{study_id}]`). Note that the `study_uid` is optional. - * dicomWebPath: 'studies', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.storeInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.storeInstances( + * { + * // The path of the StoreInstances DICOMweb request. For example, + * // `studies/[{study_uid}]`. Note that the `study_uid` is optional. + * dicomWebPath: 'studies', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * }, * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.storeInstances * @memberOf! () * @@ -5003,56 +5223,57 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy detail is being requested. - * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, * } + * ); + * console.log(res.data); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.testIamPermissions * @memberOf! () * @@ -5408,52 +5629,48 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.studies.delete * @desc DeleteStudy deletes all instances within the given study. Delete requests are equivalent to the GET requests specified in the Retrieve transaction. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store that is being accessed (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * // The path of the DeleteStudy request (e.g., `studies/{study_id}`). - * dicomWebPath: 'studies/my-study', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * auth: authClient, - * }; + * // Do the magic + * const res = await healthcare.projects.locations.datasets.dicomStores.studies.delete( + * { + * // The path of the DeleteStudy request. For example, `studies/{study_uid}`. + * dicomWebPath: 'studies/my-studie', * - * cloudHealthcare.projects.locations.datasets.dicomStores.studies.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', * } - * }); - * }); + * ); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.dicomStores.studies.delete * @memberOf! () * @@ -5527,56 +5744,54 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.studies.retrieveMetadata * @desc RetrieveStudyMetadata returns instance associated with the given study presented as metadata with the bulk data removed. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store that is being accessed (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * // The path of the RetrieveStudyMetadata DICOMweb request (e.g., - * // `studies/{study_id}/metadata`). - * dicomWebPath: 'studies/my-study/metadata', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.studies.retrieveMetadata(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.retrieveMetadata( + * { + * // The path of the RetrieveStudyMetadata DICOMweb request. For example, + * // `studies/{study_uid}/metadata`. + * dicomWebPath: 'studies/my-studie/metadata', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.studies.retrieveMetadata * @memberOf! () * @@ -5650,56 +5865,54 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.studies.retrieveStudy * @desc RetrieveStudy returns all instances within the given study. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store that is being accessed (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * // The path of the RetrieveStudy DICOMweb request (e.g., - * // `studies/{study_id}`). - * dicomWebPath: 'studies/my-study', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.studies.retrieveStudy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.retrieveStudy( + * { + * // The path of the RetrieveStudy DICOMweb request. For example, + * // `studies/{study_uid}`. + * dicomWebPath: 'studies/my-studie', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.studies.retrieveStudy * @memberOf! () * @@ -5773,57 +5986,55 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.studies.searchForInstances * @desc SearchForInstances returns a list of matching instances. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store that is being accessed (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * // The path of the SearchForInstancesRequest DICOMweb request (e.g., - * // `instances` or `series/{series_uid}/instances` or - * // `studies/{study_uid}/instances`). - * dicomWebPath: 'studies/my-study/instances', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.studies.searchForInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.searchForInstances( + * { + * // The path of the SearchForInstancesRequest DICOMweb request. For example, + * // `instances`, `series/{series_uid}/instances`, or + * // `studies/{study_uid}/instances`. + * dicomWebPath: 'studies/my-studie/instances', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.studies.searchForInstances * @memberOf! () * @@ -5897,56 +6108,54 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.studies.searchForSeries * @desc SearchForSeries returns a list of matching series. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store that is being accessed (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * // The path of the SearchForSeries DICOMweb request(e.g., `series` or - * // `studies/{study_uid}/series`). - * dicomWebPath: 'studies/my-study/series', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.studies.searchForSeries(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.searchForSeries( + * { + * // The path of the SearchForSeries DICOMweb request. For example, `series` or + * // `studies/{study_uid}/series`. + * dicomWebPath: 'studies/my-studie/series', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.studies.searchForSeries * @memberOf! () * @@ -6020,60 +6229,64 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.studies.storeInstances * @desc StoreInstances stores DICOM instances associated with study instance unique identifiers (SUID). See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.5. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store that is being accessed (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * // The path of the StoreInstances DICOMweb request (e.g., - * // `studies/[{study_id}]`). Note that the `study_uid` is optional. - * dicomWebPath: 'studies/my-study', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.studies.storeInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.storeInstances( + * { + * // The path of the StoreInstances DICOMweb request. For example, + * // `studies/[{study_uid}]`. Note that the `study_uid` is optional. + * dicomWebPath: 'studies/my-studie', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * }, * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.studies.storeInstances * @memberOf! () * @@ -6261,53 +6474,50 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.studies.series.delete * @desc DeleteSeries deletes all instances within the given study and series. Delete requests are equivalent to the GET requests specified in the Retrieve transaction. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store that is being accessed (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * // The path of the DeleteSeries request (e.g., - * // `studies/{study_id}/series/{series_id}`). - * dicomWebPath: 'studies/my-study/series/my-sery', // TODO: Update placeholder value. + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.series.delete( + * { + * // The path of the DeleteSeries request. For example, + * // `studies/{study_uid}/series/{series_uid}`. + * dicomWebPath: 'studies/my-studie/series/my-serie', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * cloudHealthcare.projects.locations.datasets.dicomStores.studies.series.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.studies.series.delete * @memberOf! () * @@ -6381,56 +6591,54 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.studies.series.retrieveMetadata * @desc RetrieveSeriesMetadata returns instance associated with the given study and series, presented as metadata with the bulk data removed. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store that is being accessed (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * // The path of the RetrieveSeriesMetadata DICOMweb request (e.g., - * // `studies/{study_id}/series/{series_id}/metadata`). - * dicomWebPath: 'studies/my-study/series/my-sery/metadata', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.studies.series.retrieveMetadata(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.series.retrieveMetadata( + * { + * // The path of the RetrieveSeriesMetadata DICOMweb request. For example, + * // `studies/{study_uid}/series/{series_uid}/metadata`. + * dicomWebPath: 'studies/my-studie/series/my-serie/metadata', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.studies.series.retrieveMetadata * @memberOf! () * @@ -6504,56 +6712,54 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.studies.series.retrieveSeries * @desc RetrieveSeries returns all instances within the given study and series. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store that is being accessed (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * // The path of the RetrieveSeries DICOMweb request (e.g., - * // `studies/{study_id}/series/{series_id}`). - * dicomWebPath: 'studies/my-study/series/my-sery', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.studies.series.retrieveSeries(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.series.retrieveSeries( + * { + * // The path of the RetrieveSeries DICOMweb request. For example, + * // `studies/{study_uid}/series/{series_uid}`. + * dicomWebPath: 'studies/my-studie/series/my-serie', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.studies.series.retrieveSeries * @memberOf! () * @@ -6627,57 +6833,55 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.studies.series.searchForInstances * @desc SearchForInstances returns a list of matching instances. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store that is being accessed (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * // The path of the SearchForInstancesRequest DICOMweb request (e.g., - * // `instances` or `series/{series_uid}/instances` or - * // `studies/{study_uid}/instances`). - * dicomWebPath: 'studies/my-study/series/my-sery/instances', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.studies.series.searchForInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.series.searchForInstances( + * { + * // The path of the SearchForInstancesRequest DICOMweb request. For example, + * // `instances`, `series/{series_uid}/instances`, or + * // `studies/{study_uid}/instances`. + * dicomWebPath: 'studies/my-studie/series/my-serie/instances', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.studies.series.searchForInstances * @memberOf! () * @@ -6827,53 +7031,50 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.studies.series.instances.delete * @desc DeleteInstance deletes an instance associated with the given study, series, and SOP Instance UID. Delete requests are equivalent to the GET requests specified in the Retrieve transaction. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store that is being accessed (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * // The path of the DeleteInstance request (e.g., - * // `studies/{study_id}/series/{series_id}/instances/{instance_id}`). - * dicomWebPath: 'studies/my-study/series/my-sery/instances/my-instance', // TODO: Update placeholder value. + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.series.instances.delete( + * { + * // The path of the DeleteInstance request. For example, + * // `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}`. + * dicomWebPath: 'studies/my-studie/series/my-serie/instances/my-instance', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', + * } + * ); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * cloudHealthcare.projects.locations.datasets.dicomStores.studies.series.instances.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.studies.series.instances.delete * @memberOf! () * @@ -6947,56 +7148,54 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveInstance * @desc RetrieveInstance returns instance associated with the given study, series, and SOP Instance UID. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store that is being accessed (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * // The path of the RetrieveInstance DICOMweb request (e.g., - * // `studies/{study_id}/series/{series_id}/instances/{instance_id}`). - * dicomWebPath: 'studies/my-study/series/my-sery/instances/my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveInstance(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveInstance( + * { + * // The path of the RetrieveInstance DICOMweb request. For example, + * // `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}`. + * dicomWebPath: 'studies/my-studie/series/my-serie/instances/my-instance', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveInstance * @memberOf! () * @@ -7070,56 +7269,55 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveMetadata * @desc RetrieveInstanceMetadata returns instance associated with the given study, series, and SOP Instance UID presented as metadata with the bulk data removed. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store that is being accessed (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * // The path of the RetrieveInstanceMetadata DICOMweb request (e.g., - * // `studies/{study_id}/series/{series_id}/instances/{instance_id}/metadata`). - * dicomWebPath: 'studies/my-study/series/my-sery/instances/my-instance/metadata', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveMetadata(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveMetadata( + * { + * // The path of the RetrieveInstanceMetadata DICOMweb request. For example, + * // `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/metadata`. + * dicomWebPath: + * 'studies/my-studie/series/my-serie/instances/my-instance/metadata', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveMetadata * @memberOf! () * @@ -7193,56 +7391,55 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveRendered * @desc RetrieveRenderedInstance returns instance associated with the given study, series, and SOP Instance UID in an acceptable Rendered Media Type. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store that is being accessed (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * // The path of the RetrieveRenderedInstance DICOMweb request (e.g., - * // `studies/{study_id}/series/{series_id}/instances/{instance_id}/rendered`). - * dicomWebPath: 'studies/my-study/series/my-sery/instances/my-instance/rendered', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveRendered(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveRendered( + * { + * // The path of the RetrieveRenderedInstance DICOMweb request. For example, + * // `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/rendered`. + * dicomWebPath: + * 'studies/my-studie/series/my-serie/instances/my-instance/rendered', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveRendered * @memberOf! () * @@ -7388,56 +7585,55 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.studies.series.instances.frames.retrieveFrames * @desc RetrieveFrames returns instances associated with the given study, series, SOP Instance UID and frame numbers. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store that is being accessed (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * // The path of the RetrieveFrames DICOMweb request (e.g., - * // `studies/{study_id}/series/{series_id}/instances/{instance_id}/frames/{frame_list}`). - * dicomWebPath: 'studies/my-study/series/my-sery/instances/my-instance/frames/my-frame', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.studies.series.instances.frames.retrieveFrames(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.series.instances.frames.retrieveFrames( + * { + * // The path of the RetrieveFrames DICOMweb request. For example, + * // `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/frames/{frame_list}`. + * dicomWebPath: + * 'studies/my-studie/series/my-serie/instances/my-instance/frames/my-frame', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.studies.series.instances.frames.retrieveFrames * @memberOf! () * @@ -7511,56 +7707,55 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.dicomStores.studies.series.instances.frames.retrieveRendered * @desc RetrieveRenderedFrames returns instances associated with the given study, series, SOP Instance UID and frame numbers in an acceptable Rendered Media Type. See http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the DICOM store that is being accessed (e.g., - * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicom-store', // TODO: Update placeholder value. - * - * // The path of the RetrieveRenderedFrames DICOMweb request (e.g., - * // `studies/{study_id}/series/{series_id}/instances/{instance_id}/frames/{frame_list}/rendered`). - * dicomWebPath: 'studies/my-study/series/my-sery/instances/my-instance/frames/my-frame/rendered', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.dicomStores.studies.series.instances.frames.retrieveRendered(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.dicomStores.studies.series.instances.frames.retrieveRendered( + * { + * // The path of the RetrieveRenderedFrames DICOMweb request. For example, + * // `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/frames/{frame_list}/rendered`. + * dicomWebPath: + * 'studies/my-studie/series/my-serie/instances/my-instance/frames/my-frame/rendered', + * // The name of the DICOM store that is being accessed. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/dicomStores/my-dicomStore', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.dicomStores.studies.series.instances.frames.retrieveRendered * @memberOf! () * @@ -7678,55 +7873,72 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.create * @desc Creates a new FHIR store within the parent dataset. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the dataset this FHIR store belongs to. - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset', // TODO: Update placeholder value. + * const healthcare = google.healthcare('v1beta1'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudHealthcare.projects.locations.datasets.fhirStores.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await healthcare.projects.locations.datasets.fhirStores.create({ + * // The ID of the FHIR store that is being created. + * // The string must match the following regex: `[\p{L}\p{N}_\-\.]{1,256}`. + * fhirStoreId: 'placeholder-value', + * // The name of the dataset this FHIR store belongs to. + * parent: 'projects/my-project/locations/my-location/datasets/my-dataset', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "defaultSearchHandlingStrict": false, + * // "disableReferentialIntegrity": false, + * // "disableResourceVersioning": false, + * // "enableUpdateCreate": false, + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {}, + * // "streamConfigs": [], + * // "version": "my_version" + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "defaultSearchHandlingStrict": false, + * // "disableReferentialIntegrity": false, + * // "disableResourceVersioning": false, + * // "enableUpdateCreate": false, + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {}, + * // "streamConfigs": [], + * // "version": "my_version" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.create * @memberOf! () * @@ -7803,6 +8015,64 @@ export namespace healthcare_v1beta1 { /** * healthcare.projects.locations.datasets.fhirStores.deidentify * @desc De-identifies data from the source store and writes it to the destination store. The metadata field type is OperationMetadata. If the request is successful, the response field type is DeidentifyFhirStoreSummary. If errors occur, error details field type is DeidentifyErrorDetails. Errors are also logged to Stackdriver (see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging)). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.deidentify( + * { + * // Source FHIR store resource name. For example, + * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. + * sourceStore: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "config": {}, + * // "destinationStore": "my_destinationStore", + * // "resourceFilter": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.deidentify * @memberOf! () * @@ -7879,48 +8149,44 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.delete * @desc Deletes the specified FHIR store and removes all resources within it. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the FHIR store to delete. - * name: 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhir-store', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudHealthcare.projects.locations.datasets.fhirStores.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await healthcare.projects.locations.datasets.fhirStores.delete({ + * // The resource name of the FHIR store to delete. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.delete * @memberOf! () * @@ -7991,57 +8257,61 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.export * @desc Export resources from the FHIR store to the specified destination. This method returns an Operation that can be used to track the status of the export by calling GetOperation. Immediate fatal errors appear in the error field, errors are also logged to Stackdriver (see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging)). Otherwise, when the operation finishes, a detailed response of type ExportResourcesResponse is returned in the response field. The metadata field type for this operation is OperationMetadata. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await healthcare.projects.locations.datasets.fhirStores.export({ * // The name of the FHIR store to export resource from. The name should be in * // the format of * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. - * name: 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhir-store', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bigqueryDestination": {}, + * // "gcsDestination": {} + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.fhirStores.export(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.export * @memberOf! () * @@ -8118,51 +8388,54 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.get * @desc Gets the configuration of the specified FHIR store. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the FHIR store to get. - * name: 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhir-store', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudHealthcare.projects.locations.datasets.fhirStores.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await healthcare.projects.locations.datasets.fhirStores.get({ + * // The resource name of the FHIR store to get. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "defaultSearchHandlingStrict": false, + * // "disableReferentialIntegrity": false, + * // "disableResourceVersioning": false, + * // "enableUpdateCreate": false, + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {}, + * // "streamConfigs": [], + * // "version": "my_version" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.get * @memberOf! () * @@ -8235,52 +8508,61 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being requested. - * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhir-store', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.fhirStores.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.getIamPolicy( + * { + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.getIamPolicy * @memberOf! () * @@ -8355,57 +8637,61 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.import * @desc Import resources to the FHIR store by loading data from the specified sources. This method is optimized to load large quantities of data using import semantics that ignore some FHIR store configuration options and are not suitable for all use cases. It is primarily intended to load data into an empty FHIR store that is not being used by other clients. In cases where this method is not appropriate, consider using ExecuteBundle to load data. Every resource in the input must contain a client-supplied ID, and will be stored using that ID regardless of the enable_update_create setting on the FHIR store. The import process does not enforce referential integrity, regardless of the disable_referential_integrity setting on the FHIR store. This allows the import of resources with arbitrary interdependencies without considering grouping or ordering, but if the input data contains invalid references or if some resources fail to be imported, the FHIR store might be left in a state that violates referential integrity. The import process does not trigger Cloud Pub/Sub notification or BigQuery streaming update, regardless of how those are configured on the FHIR store. If a resource with the specified ID already exists, the most recent version of the resource is overwritten without creating a new historical version, regardless of the disable_resource_versioning setting on the FHIR store. If transient failures occur during the import, it is possible that successfully imported resources will be overwritten more than once. The import operation is idempotent unless the input data contains multiple valid resources with the same ID but different contents. In that case, after the import completes, the store will contain exactly one resource with that ID but there is no ordering guarantee on which version of the contents it will have. The operation result counters do not count duplicate IDs as an error and will count one success for each resource in the input, which might result in a success count larger than the number of resources in the FHIR store. This often occurs when importing data organized in bundles produced by Patient-everything where each bundle contains its own copy of a resource such as Practitioner that might be referred to by many patients. If some resources fail to import, for example due to parsing errors, successfully imported resources are not rolled back. The location and format of the input data is specified by the parameters below. Note that if no format is specified, this method assumes the `BUNDLE` format. When using the `BUNDLE` format this method ignores the `Bundle.type` field, except that `history` bundles are rejected, and does not apply any of the bundle processing semantics for batch or transaction bundles. Unlike in ExecuteBundle, transaction bundles are not executed as a single transaction and bundle-internal references are not rewritten. The bundle is treated as a collection of resources to be written as provided in `Bundle.entry.resource`, ignoring `Bundle.entry.request`. As an example, this allows the import of `searchset` bundles produced by a FHIR search or Patient-everything operation. This method returns an Operation that can be used to track the status of the import by calling GetOperation. Immediate fatal errors appear in the error field, errors are also logged to Stackdriver (see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging)). Otherwise, when the operation finishes, a detailed response of type ImportResourcesResponse is returned in the response field. The metadata field type for this operation is OperationMetadata. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await healthcare.projects.locations.datasets.fhirStores.import({ * // The name of the FHIR store to import FHIR resources to. The name should be * // in the format of * // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. - * name: 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhir-store', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentStructure": "my_contentStructure", + * // "gcsSource": {} + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.fhirStores.import(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.import * @memberOf! () * @@ -8482,64 +8768,55 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.list * @desc Lists the FHIR stores in the given dataset. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.list({ + * // Restricts stores returned to those matching a filter. Syntax: + * // https://cloud.google.com/appengine/docs/standard/python/search/query_strings + * // Only filtering on labels is supported, for example `labels.key=value`. + * filter: 'placeholder-value', + * // Limit on the number of FHIR stores to return in a single response. If zero + * // the default page size of 100 is used. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from the previous List request, if any. + * pageToken: 'placeholder-value', * // Name of the dataset. - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var fhirStoresPage = response['fhirStores']; - * if (!fhirStoresPage) { - * return; - * } - * for (var i = 0; i < fhirStoresPage.length; i++) { - * // TODO: Change code below to process each resource in `fhirStoresPage`: - * console.log(JSON.stringify(fhirStoresPage[i], null, 2)); - * } + * parent: 'projects/my-project/locations/my-location/datasets/my-dataset', + * }); + * console.log(res.data); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudHealthcare.projects.locations.datasets.fhirStores.list(request, handlePage); - * } - * }; + * // Example response + * // { + * // "fhirStores": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } * - * cloudHealthcare.projects.locations.datasets.fhirStores.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.list * @memberOf! () * @@ -8620,57 +8897,75 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.patch * @desc Updates the configuration of the specified FHIR store. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 healthcare.projects.locations.datasets.fhirStores.patch({ * // Output only. Resource name of the FHIR store, of the form * // `projects/{project_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. - * name: 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhir-store', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * // The update mask applies to the resource. For the `FieldMask` definition, + * // see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "defaultSearchHandlingStrict": false, + * // "disableReferentialIntegrity": false, + * // "disableResourceVersioning": false, + * // "enableUpdateCreate": false, + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {}, + * // "streamConfigs": [], + * // "version": "my_version" + * // } * }, - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.fhirStores.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "defaultSearchHandlingStrict": false, + * // "disableReferentialIntegrity": false, + * // "disableResourceVersioning": false, + * // "enableUpdateCreate": false, + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {}, + * // "streamConfigs": [], + * // "version": "my_version" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.patch * @memberOf! () * @@ -8744,6 +9039,55 @@ export namespace healthcare_v1beta1 { /** * healthcare.projects.locations.datasets.fhirStores.search * @desc Searches for resources in the given FHIR store according to criteria specified as query parameters. Implements the FHIR standard search interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#search), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#search), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#search)) using the search semantics described in the FHIR Search specification ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/search.html), [STU3](http://hl7.org/implement/standards/fhir/STU3/search.html), [R4](http://hl7.org/implement/standards/fhir/R4/search.html)). Supports three methods of search defined by the specification: * `GET [base]?[parameters]` to search across all resources. * `GET [base]/[type]?[parameters]` to search resources of a specified type. * `POST [base]/[type]/_search?[parameters]` as an alternate form having the same semantics as the `GET` method. The `GET` methods do not support compartment searches. The `POST` method does not support `application/x-www-form-urlencoded` search parameters. On success, the response body will contain a JSON-encoded representation of a `Bundle` resource of type `searchset`, containing the results of the search. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. The server's capability statement, retrieved through capabilities, indicates what search parameters are supported on each FHIR resource. A list of all search parameters defined by the specification can be found in the FHIR Search Parameter Registry ([STU3](http://hl7.org/implement/standards/fhir/STU3/searchparameter-registry.html), [R4](http://hl7.org/implement/standards/fhir/R4/searchparameter-registry.html)). FHIR search parameters for DSTU2 can be found on each resource's definition page. Supported search modifiers: `:missing`, `:exact`, `:contains`, `:text`, `:in`, `:not-in`, `:above`, `:below`, `:[type]`, `:not`, and `:recurse`. Supported search result parameters: `_sort`, `_count`, `_include`, `_revinclude`, `_summary=text`, `_summary=data`, and `_elements`. The maximum number of search results returned defaults to 100, which can be overridden by the `_count` parameter up to a maximum limit of 1000. If there are additional results, the returned `Bundle` will contain pagination links. Resources with a total size larger than 5MB or a field count larger than 50,000 might not be fully searchable as the server might trim its generated search index in those cases. Note: FHIR resources are indexed asynchronously, so there might be a slight delay between the time a resource is created or changes and when the change is reflected in search results. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.search({ + * // Name of the FHIR store to retrieve resources from. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * // The FHIR resource type to search, such as Patient or Observation. For a + * // complete list, see the FHIR Resource Index + * // ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + * // [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + * // [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). + * resourceType: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.search * @memberOf! () * @@ -8818,56 +9162,61 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being specified. - * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhir-store', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.fhirStores.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.setIamPolicy * @memberOf! () * @@ -8942,56 +9291,57 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy detail is being requested. - * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhir-store', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.fhirStores.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, * } + * ); + * console.log(res.data); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.testIamPermissions * @memberOf! () * @@ -9290,51 +9640,50 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.fhir.capabilities * @desc Gets the FHIR capability statement ([STU3](http://hl7.org/implement/standards/fhir/STU3/capabilitystatement.html), [R4](http://hl7.org/implement/standards/fhir/R4/capabilitystatement.html)), or the [conformance statement](http://hl7.org/implement/standards/fhir/DSTU2/conformance.html) in the DSTU2 case for the store, which contains a description of functionality supported by the server. Implements the FHIR standard capabilities interaction ([STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#capabilities), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#capabilities)), or the [conformance interaction](http://hl7.org/implement/standards/fhir/DSTU2/http.html#conformance) in the DSTU2 case. On success, the response body will contain a JSON-encoded representation of a `CapabilityStatement` resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // Name of the FHIR store to retrieve the capabilities for. - * name: 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhir-store', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudHealthcare.projects.locations.datasets.fhirStores.fhir.capabilities(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * // Do the magic + * const res = await healthcare.projects.locations.datasets.fhirStores.fhir.capabilities( + * { + * // Name of the FHIR store to retrieve the capabilities for. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.fhir.capabilities * @memberOf! () * @@ -9407,6 +9756,69 @@ export namespace healthcare_v1beta1 { /** * healthcare.projects.locations.datasets.fhirStores.fhir.ConceptMap-search-translate * @desc Translates a code from one value set to another by searching for appropriate concept maps. Implements the FHIR standard $translate operation ([DSTU2](https://www.hl7.org/fhir/DSTU2/operation-conceptmap-translate.html), [STU3](https://www.hl7.org/fhir/STU3/operation-conceptmap-translate.html), [R4](https://www.hl7.org/fhir/R4/operation-conceptmap-translate.html)). On success, the response body contains a JSON-encoded representation of a FHIR Parameters resource, which includes the translation result. Errors generated by the FHIR store contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.ConceptMap) - + * search - + * translate({ + * // The code to translate. + * code: 'placeholder-value', + * // The version of the concept map to use. If unset, the most current version + * // is used. + * conceptMapVersion: 'placeholder-value', + * // The name for the FHIR store containing the concept map(s) to use for the + * // translation. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * // The source value set of the concept map to be used. If unset, target is + * // used to search for concept maps. + * source: 'placeholder-value', + * // The system for the code to be translated. + * system: 'placeholder-value', + * // The target value set of the concept map to be used. If unset, source is + * // used to search for concept maps. + * target: 'placeholder-value', + * // The canonical url of the concept map to use. If unset, the source and + * // target is used to search for concept maps. + * url: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.fhir.ConceptMap-search-translate * @memberOf! () * @@ -9486,6 +9898,58 @@ export namespace healthcare_v1beta1 { /** * healthcare.projects.locations.datasets.fhirStores.fhir.ConceptMap-translate * @desc Translates a code from one value set to another using a concept map. Implements the FHIR standard $translate operation ([DSTU2](https://www.hl7.org/fhir/DSTU2/operation-conceptmap-translate.html), [STU3](https://www.hl7.org/fhir/STU3/operation-conceptmap-translate.html), [R4](https://www.hl7.org/fhir/R4/operation-conceptmap-translate.html)). On success, the response body contains a JSON-encoded representation of a FHIR Parameters resource, which includes the translation result. Errors generated by the FHIR store contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.ConceptMap) - + * translate({ + * // The code to translate. + * code: 'placeholder-value', + * // The version of the concept map to use. If unset, the most current version + * // is used. + * conceptMapVersion: 'placeholder-value', + * // The URL for the concept map to use for the translation. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore/fhir/ConceptMap/[^/]+', + * // The system for the code to be translated. + * system: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.fhirStores.fhir.ConceptMap-translate * @memberOf! () * @@ -9562,53 +10026,52 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.fhir.conditionalDelete * @desc Deletes FHIR resources that match a search query. Implements the FHIR standard conditional delete interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.12.1), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.13.1), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#3.1.0.7.1)). If multiple resources match, all of them will be deleted. Search terms are provided as query parameters following the same pattern as the search method. Note: Unless resource versioning is disabled by setting the disable_resource_versioning flag on the FHIR store, the deleted resources will be moved to a history repository that can still be retrieved through vread and related methods, unless they are removed by the purge method. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the FHIR store this resource belongs to. - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhir-store', // TODO: Update placeholder value. - * - * // The FHIR resource type to delete, such as Patient or Observation. For a - * // complete list, see the [FHIR Resource - * // Index](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html). - * type: 'my-type', // TODO: Update placeholder value. + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.conditionalDelete( + * { + * // The name of the FHIR store this resource belongs to. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * // The FHIR resource type to delete, such as Patient or Observation. For a + * // complete list, see the FHIR Resource Index + * // ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + * // [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + * // [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). + * type: '[^/]+', + * } + * ); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * cloudHealthcare.projects.locations.datasets.fhirStores.fhir.conditionalDelete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.fhir.conditionalDelete * @memberOf! () * @@ -9683,61 +10146,66 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.fhir.conditionalPatch * @desc If a resource is found based on the search criteria specified in the query parameters, updates part of that resource by applying the operations specified in a [JSON Patch](http://jsonpatch.com/) document. Implements the FHIR standard conditional patch interaction ([STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#patch), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#patch)). DSTU2 doesn't define a conditional patch method, but the server supports it in the same way it supports STU3. Search terms are provided as query parameters following the same pattern as the search method. If the search criteria identify more than one match, the request will return a `412 Precondition Failed` error. The request body must contain a JSON Patch document, and the request headers must contain `Content-Type: application/json-patch+json`. On success, the response body will contain a JSON-encoded representation of the updated resource, including the server-assigned version ID. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the FHIR store this resource belongs to. - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhir-store', // TODO: Update placeholder value. - * - * // The FHIR resource type to update, such as Patient or Observation. For a - * // complete list, see the [FHIR Resource - * // Index](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html). - * type: 'my-type', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.fhirStores.fhir.conditionalPatch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.conditionalPatch( + * { + * // The name of the FHIR store this resource belongs to. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * // The FHIR resource type to update, such as Patient or Observation. For a + * // complete list, see the FHIR Resource Index + * // ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + * // [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + * // [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). + * type: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * }, * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.fhir.conditionalPatch * @memberOf! () * @@ -9813,62 +10281,67 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.fhir.conditionalUpdate * @desc If a resource is found based on the search criteria specified in the query parameters, updates the entire contents of that resource. Implements the FHIR standard conditional update interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.10.2), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#cond-update), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#cond-update)). Search terms are provided as query parameters following the same pattern as the search method. If the search criteria identify more than one match, the request will return a `412 Precondition Failed` error. If the search criteria identify zero matches, and the supplied resource body contains an `id`, and the FHIR store has enable_update_create set, creates the resource with the client-specified ID. If the search criteria identify zero matches, and the supplied resource body does not contain an `id`, the resource will be created with a server-assigned ID as per the create method. The request body must contain a JSON-encoded FHIR resource, and the request headers must contain `Content-Type: application/fhir+json`. On success, the response body will contain a JSON-encoded representation of the updated resource, including the server-assigned version ID. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the FHIR store this resource belongs to. - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhir-store', // TODO: Update placeholder value. - * - * // The FHIR resource type to update, such as Patient or Observation. For a - * // complete list, see the [FHIR Resource - * // Index](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html). - * // Must match the resource type in the provided content. - * type: 'my-type', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.fhirStores.fhir.conditionalUpdate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.conditionalUpdate( + * { + * // The name of the FHIR store this resource belongs to. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * // The FHIR resource type to update, such as Patient or Observation. For a + * // complete list, see the FHIR Resource Index + * // ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + * // [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + * // [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). + * // Must match the resource type in the provided content. + * type: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * }, * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.fhir.conditionalUpdate * @memberOf! () * @@ -9944,61 +10417,67 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.fhir.create * @desc Creates a FHIR resource. Implements the FHIR standard create interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#create), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#create), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#create)), which creates a new resource with a server-assigned resource ID. Also supports the FHIR standard conditional create interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#ccreate), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#ccreate), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#ccreate)), specified by supplying an `If-None-Exist` header containing a FHIR search query. If no resources match this search query, the server processes the create operation as normal. The request body must contain a JSON-encoded FHIR resource, and the request headers must contain `Content-Type: application/fhir+json`. On success, the response body will contain a JSON-encoded representation of the resource as it was created on the server, including the server-assigned resource ID and version ID. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the FHIR store this resource belongs to. - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhir-store', // TODO: Update placeholder value. - * - * // The FHIR resource type to create, such as Patient or Observation. For a - * // complete list, see the [FHIR Resource - * // Index](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html). - * // Must match the resource type in the provided content. - * type: 'my-type', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.fhirStores.fhir.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.create( + * { + * // The name of the FHIR store this resource belongs to. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * // The FHIR resource type to create, such as Patient or Observation. For a + * // complete list, see the FHIR Resource Index + * // ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + * // [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + * // [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). + * // Must match the resource type in the provided content. + * type: '[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * }, * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.fhir.create * @memberOf! () * @@ -10074,51 +10553,50 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.fhir.delete * @desc Deletes a FHIR resource. Implements the FHIR standard delete interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#delete), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#delete), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#delete)). Note: Unless resource versioning is disabled by setting the disable_resource_versioning flag on the FHIR store, the deleted resources will be moved to a history repository that can still be retrieved through vread and related methods, unless they are removed by the purge method. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // The name of the resource to delete. - * name: 'my-name', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudHealthcare.projects.locations.datasets.fhirStores.fhir.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * // Do the magic + * const res = await healthcare.projects.locations.datasets.fhirStores.fhir.delete( + * { + * // The name of the resource to delete. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore/fhir/[^/]+/[^/]+', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.fhir.delete * @memberOf! () * @@ -10189,55 +10667,60 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.fhir.executeBundle * @desc Executes all the requests in the given Bundle. Implements the FHIR standard batch/transaction interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#transaction), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#transaction), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#transaction)). Supports all interactions within a bundle, except search. This method accepts Bundles of type `batch` and `transaction`, processing them according to the batch processing rules ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.16.1), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.1), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#brules)) and transaction processing rules ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.16.2), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.2), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#trules)). The request body must contain a JSON-encoded FHIR `Bundle` resource, and the request headers must contain `Content-Type: application/fhir+json`. For a batch bundle or a successful transaction the response body will contain a JSON-encoded representation of a `Bundle` resource of type `batch-response` or `transaction-response` containing one entry for each entry in the request, with the outcome of processing the entry. In the case of an error for a transaction bundle, the response body will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the FHIR store in which this bundle will be executed. - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhir-store', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.fhirStores.fhir.executeBundle(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.executeBundle( + * { + * // Name of the FHIR store in which this bundle will be executed. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * }, * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.fhir.executeBundle * @memberOf! () * @@ -10312,51 +10795,77 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.fhir.history * @desc Lists all the versions of a resource (including the current version and deleted versions) from the FHIR store. Implements the per-resource form of the FHIR standard history interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#history), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#history), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#history)). On success, the response body will contain a JSON-encoded representation of a `Bundle` resource of type `history`, containing the version history sorted from most recent to oldest versions. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the resource to retrieve. - * name: 'my-name', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.fhirStores.fhir.history(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.history( + * { + * // The name of the resource to retrieve. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore/fhir/[^/]+/[^/]+', + * // Only include resource versions that were current at some point during the + * // time period specified in the date time value. The date parameter format is + * // yyyy-mm-ddThh:mm:ss[Z|(+|-)hh:mm] + * // + * // Clients may specify any of the following: + * // + * // * An entire year: `_at=2019` + * // * An entire month: `_at=2019-01` + * // * A specific day: `_at=2019-01-20` + * // * A specific second: `_at=2018-12-31T23:59:58Z` + * _at: 'placeholder-value', + * // The maximum number of search results on a page. Defaults to 1000. + * _count: 'placeholder-value', + * // Used to retrieve the first, previous, next, or last page of resource + * // versions when using pagination. Value should be set to the value of + * // `_page_token` set in next or previous page links' URLs. Next and previous + * // page are returned in the response bundle's links field, where + * // `link.relation` is "previous" or "next". + * // + * // Omit `_page_token` if no previous request has been made. + * _page_token: 'placeholder-value', + * // Only include resource versions that were created at or after the given + * // instant in time. The instant in time uses the format + * // YYYY-MM-DDThh:mm:ss.sss+zz:zz (for example 2015-02-07T13:28:17.239+02:00 or + * // 2017-01-01T00:00:00Z). The time must be specified to the second and + * // include a time zone. + * _since: 'placeholder-value', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.fhir.history * @memberOf! () * @@ -10434,51 +10943,50 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.fhir.Observation-lastn * @desc Retrieves the N most recent `Observation` resources for a subject matching search criteria specified as query parameters, grouped by `Observation.code`, sorted from most recent to oldest. Implements the FHIR extended operation Observation-lastn ([STU3](http://hl7.org/implement/standards/fhir/STU3/observation-operations.html#lastn), [R4](http://hl7.org/implement/standards/fhir/R4/observation-operations.html#lastn)). DSTU2 doesn't define the Observation-lastn method, but the server supports it the same way it supports STU3. Search terms are provided as query parameters following the same pattern as the search method. The following search parameters must be provided: - `subject` or `patient` to specify a subject for the Observation. - `code`, `category` or any of the composite parameters that include `code`. Any other valid Observation search parameters can also be provided. This operation accepts an additional query parameter `max`, which specifies N, the maximum number of Observations to return from each group, with a default of 1. Searches with over 1000 results are rejected. Results are counted before grouping and limiting the results with `max`. To stay within the limit, constrain these searches using Observation search parameters such as `_lastUpdated` or `date`. On success, the response body will contain a JSON-encoded representation of a `Bundle` resource of type `searchset`, containing the results of the operation. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the FHIR store to retrieve resources from. - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhir-store', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.fhirStores.fhir.observationLastn(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.Observation) - + * lastn({ + * // Name of the FHIR store to retrieve resources from. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.fhir.Observation-lastn * @memberOf! () * @@ -10551,56 +11059,60 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.fhir.patch * @desc Updates part of an existing resource by applying the operations specified in a [JSON Patch](http://jsonpatch.com/) document. Implements the FHIR standard patch interaction ([STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#patch), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#patch)). DSTU2 doesn't define a patch method, but the server supports it in the same way it supports STU3. The request body must contain a JSON Patch document, and the request headers must contain `Content-Type: application/json-patch+json`. On success, the response body will contain a JSON-encoded representation of the updated resource, including the server-assigned version ID. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the resource to update. - * name: 'my-name', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.fhirStores.fhir.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.patch( + * { + * // The name of the resource to update. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore/fhir/[^/]+/[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * }, * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.fhir.patch * @memberOf! () * @@ -10672,51 +11184,66 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.fhir.Patient-everything * @desc Retrieves all the resources directly referenced by a patient, as well as all of the resources in the patient compartment. Implements the FHIR extended operation Patient-everything ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/patient-operations.html#everything), [STU3](http://hl7.org/implement/standards/fhir/STU3/patient-operations.html#everything), [R4](http://hl7.org/implement/standards/fhir/R4/patient-operations.html#everything)). On success, the response body will contain a JSON-encoded representation of a `Bundle` resource of type `searchset`, containing the results of the operation. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the `Patient` resource for which the information is required. - * name: 'my-name', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.fhirStores.fhir.patientEverything(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.Patient) - + * everything({ + * // The response includes records prior to the end date. If no end date is + * // provided, all records subsequent to the start date are in scope. + * end: 'placeholder-value', + * // Name of the `Patient` resource for which the information is required. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore/fhir/Patient/[^/]+', + * // The response includes records subsequent to the start date. If no start + * // date is provided, all records prior to the end date are in scope. + * start: 'placeholder-value', + * // Maximum number of resources in a page. Defaults to 100. + * _count: 'placeholder-value', + * // Used to retrieve the next or previous page of results + * // when using pagination. Value should be set to the value of page_token set + * // in next or previous page links' urls. Next and previous page are returned + * // in the response bundle's links field, where `link.relation` is "previous" + * // or "next". + * // + * // Omit `page_token` if no previous request has been made. + * _page_token: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.fhir.Patient-everything * @memberOf! () * @@ -10794,51 +11321,50 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.fhir.read * @desc Gets the contents of a FHIR resource. Implements the FHIR standard read interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#read), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#read), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#read)). Also supports the FHIR standard conditional read interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#cread), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#cread), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#cread)) specified by supplying an `If-Modified-Since` header with a date/time value or an `If-None-Match` header with an ETag value. On success, the response body will contain a JSON-encoded representation of the resource. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // The name of the resource to retrieve. - * name: 'my-name', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudHealthcare.projects.locations.datasets.fhirStores.fhir.read(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * // Do the magic + * const res = await healthcare.projects.locations.datasets.fhirStores.fhir.read( + * { + * // The name of the resource to retrieve. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore/fhir/[^/]+/[^/]+', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.fhir.read * @memberOf! () * @@ -10909,48 +11435,46 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.fhir.Resource-purge * @desc Deletes all the historical versions of a resource (excluding the current version) from the FHIR store. To remove all versions of a resource, first delete the current version and then call this method. This is not a FHIR standard operation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the resource to purge. - * name: 'my-name', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.Resource) - + * purge({ + * // The name of the resource to purge. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore/fhir/[^/]+/[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } * - * cloudHealthcare.projects.locations.datasets.fhirStores.fhir.resourcePurge(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.fhir.Resource-purge * @memberOf! () * @@ -11024,55 +11548,58 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.fhir.search * @desc Searches for resources in the given FHIR store according to criteria specified as query parameters. Implements the FHIR standard search interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#search), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#search), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#search)) using the search semantics described in the FHIR Search specification ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/search.html), [STU3](http://hl7.org/implement/standards/fhir/STU3/search.html), [R4](http://hl7.org/implement/standards/fhir/R4/search.html)). Supports three methods of search defined by the specification: * `GET [base]?[parameters]` to search across all resources. * `GET [base]/[type]?[parameters]` to search resources of a specified type. * `POST [base]/[type]/_search?[parameters]` as an alternate form having the same semantics as the `GET` method. The `GET` methods do not support compartment searches. The `POST` method does not support `application/x-www-form-urlencoded` search parameters. On success, the response body will contain a JSON-encoded representation of a `Bundle` resource of type `searchset`, containing the results of the search. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. The server's capability statement, retrieved through capabilities, indicates what search parameters are supported on each FHIR resource. A list of all search parameters defined by the specification can be found in the FHIR Search Parameter Registry ([STU3](http://hl7.org/implement/standards/fhir/STU3/searchparameter-registry.html), [R4](http://hl7.org/implement/standards/fhir/R4/searchparameter-registry.html)). FHIR search parameters for DSTU2 can be found on each resource's definition page. Supported search modifiers: `:missing`, `:exact`, `:contains`, `:text`, `:in`, `:not-in`, `:above`, `:below`, `:[type]`, `:not`, and `:recurse`. Supported search result parameters: `_sort`, `_count`, `_include`, `_revinclude`, `_summary=text`, `_summary=data`, and `_elements`. The maximum number of search results returned defaults to 100, which can be overridden by the `_count` parameter up to a maximum limit of 1000. If there are additional results, the returned `Bundle` will contain pagination links. Resources with a total size larger than 5MB or a field count larger than 50,000 might not be fully searchable as the server might trim its generated search index in those cases. Note: FHIR resources are indexed asynchronously, so there might be a slight delay between the time a resource is created or changes and when the change is reflected in search results. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the FHIR store to retrieve resources from. - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhir-store', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.fhirStores.fhir.search(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.search( + * { + * // Name of the FHIR store to retrieve resources from. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourceType": "my_resourceType" + * // } + * }, * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.fhir.search * @memberOf! () * @@ -11147,56 +11674,60 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.fhir.update * @desc Updates the entire contents of a resource. Implements the FHIR standard update interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#update), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#update), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#update)). If the specified resource does not exist and the FHIR store has enable_update_create set, creates the resource with the client-specified ID. The request body must contain a JSON-encoded FHIR resource, and the request headers must contain `Content-Type: application/fhir+json`. The resource must contain an `id` element having an identical value to the ID in the REST path of the request. On success, the response body will contain a JSON-encoded representation of the updated resource, including the server-assigned version ID. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the resource to update. - * name: 'my-name', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.fhirStores.fhir.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.fhirStores.fhir.update( + * { + * // The name of the resource to update. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore/fhir/[^/]+/[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * }, * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.fhir.update * @memberOf! () * @@ -11268,51 +11799,50 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.fhirStores.fhir.vread * @desc Gets the contents of a version (current or historical) of a FHIR resource by version ID. Implements the FHIR standard vread interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#vread), [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#vread), [R4](http://hl7.org/implement/standards/fhir/R4/http.html#vread)). On success, the response body will contain a JSON-encoded representation of the resource. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // The name of the resource version to retrieve. - * name: 'my-name', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudHealthcare.projects.locations.datasets.fhirStores.fhir.vread(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * // Do the magic + * const res = await healthcare.projects.locations.datasets.fhirStores.fhir.vread( + * { + * // The name of the resource version to retrieve. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/fhirStores/my-fhirStore/fhir/[^/]+/[^/]+/_history/[^/]+', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.fhirStores.fhir.vread * @memberOf! () * @@ -11730,55 +12260,66 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.hl7V2Stores.create * @desc Creates a new HL7v2 store within the parent dataset. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the dataset this HL7v2 store belongs to. - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset', // TODO: Update placeholder value. + * const healthcare = google.healthcare('v1beta1'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * cloudHealthcare.projects.locations.datasets.hl7V2Stores.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await healthcare.projects.locations.datasets.hl7V2Stores.create({ + * // The ID of the HL7v2 store that is being created. + * // The string must match the following regex: `[\p{L}\p{N}_\-\.]{1,256}`. + * hl7V2StoreId: 'placeholder-value', + * // The name of the dataset this HL7v2 store belongs to. + * parent: 'projects/my-project/locations/my-location/datasets/my-dataset', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {}, + * // "notificationConfigs": [], + * // "parserConfig": {}, + * // "rejectDuplicateMessage": false + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {}, + * // "notificationConfigs": [], + * // "parserConfig": {}, + * // "rejectDuplicateMessage": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.hl7V2Stores.create * @memberOf! () * @@ -11856,48 +12397,44 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.hl7V2Stores.delete * @desc Deletes the specified HL7v2 store and removes all messages that are contained within it. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the HL7v2 store to delete. - * name: 'my-name', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudHealthcare.projects.locations.datasets.hl7V2Stores.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await healthcare.projects.locations.datasets.hl7V2Stores.delete({ + * // The resource name of the HL7v2 store to delete. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.hl7V2Stores.delete * @memberOf! () * @@ -11968,51 +12505,51 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.hl7V2Stores.get * @desc Gets the specified HL7v2 store. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the HL7v2 store to get. - * name: 'my-name', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudHealthcare.projects.locations.datasets.hl7V2Stores.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await healthcare.projects.locations.datasets.hl7V2Stores.get({ + * // The resource name of the HL7v2 store to get. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {}, + * // "notificationConfigs": [], + * // "parserConfig": {}, + * // "rejectDuplicateMessage": false + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.hl7V2Stores.get * @memberOf! () * @@ -12085,52 +12622,61 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.hl7V2Stores.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being requested. - * // See the operation documentation for the appropriate value for this field. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.hl7V2Stores.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.getIamPolicy( + * { + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.hl7V2Stores.getIamPolicy * @memberOf! () * @@ -12205,64 +12751,55 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.hl7V2Stores.list * @desc Lists the HL7v2 stores in the given dataset. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.list({ + * // Restricts stores returned to those matching a filter. Syntax: + * // https://cloud.google.com/appengine/docs/standard/python/search/query_strings + * // Only filtering on labels is supported. For example, `labels.key=value`. + * filter: 'placeholder-value', + * // Limit on the number of HL7v2 stores to return in a single response. + * // If zero the default page size of 100 is used. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from the previous List request, if any. + * pageToken: 'placeholder-value', * // Name of the dataset. - * parent: 'projects/my-project/locations/my-location/datasets/my-dataset', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var hl7V2StoresPage = response['hl7V2Stores']; - * if (!hl7V2StoresPage) { - * return; - * } - * for (var i = 0; i < hl7V2StoresPage.length; i++) { - * // TODO: Change code below to process each resource in `hl7V2StoresPage`: - * console.log(JSON.stringify(hl7V2StoresPage[i], null, 2)); - * } + * parent: 'projects/my-project/locations/my-location/datasets/my-dataset', + * }); + * console.log(res.data); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudHealthcare.projects.locations.datasets.hl7V2Stores.list(request, handlePage); - * } - * }; + * // Example response + * // { + * // "hl7V2Stores": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } * - * cloudHealthcare.projects.locations.datasets.hl7V2Stores.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.hl7V2Stores.list * @memberOf! () * @@ -12343,57 +12880,69 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.hl7V2Stores.patch * @desc Updates the HL7v2 store. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); * - * authorize(function(authClient) { - * var request = { + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.patch({ * // Output only. Resource name of the HL7v2 store, of the form * // `projects/{project_id}/datasets/{dataset_id}/hl7V2Stores/{hl7v2_store_id}`. - * name: 'my-name', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store', + * // The update mask applies to the resource. For the `FieldMask` definition, + * // see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {}, + * // "notificationConfigs": [], + * // "parserConfig": {}, + * // "rejectDuplicateMessage": false + * // } * }, - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.hl7V2Stores.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "labels": {}, + * // "name": "my_name", + * // "notificationConfig": {}, + * // "notificationConfigs": [], + * // "parserConfig": {}, + * // "rejectDuplicateMessage": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.hl7V2Stores.patch * @memberOf! () * @@ -12468,56 +13017,61 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.hl7V2Stores.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being specified. - * // See the operation documentation for the appropriate value for this field. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.hl7V2Stores.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.hl7V2Stores.setIamPolicy * @memberOf! () * @@ -12592,56 +13146,57 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.hl7V2Stores.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy detail is being requested. - * // See the operation documentation for the appropriate value for this field. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.hl7V2Stores.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, * } + * ); + * console.log(res.data); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.hl7V2Stores.testIamPermissions * @memberOf! () * @@ -12873,55 +13428,65 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.hl7V2Stores.messages.create * @desc Creates a message and sends a notification to the Cloud Pub/Sub topic. If configured, the MLLP adapter listens to messages created by this method and sends those back to the hospital. A successful response indicates the message has been persisted to storage and a Cloud Pub/Sub notification has been sent. Sending to the hospital by the MLLP adapter happens asynchronously. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the dataset this message belongs to. - * parent: 'my-parent', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.hl7V2Stores.messages.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.messages.create( + * { + * // The name of the dataset this message belongs to. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "message": {} + * // } + * }, * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "data": "my_data", + * // "labels": {}, + * // "messageType": "my_messageType", + * // "name": "my_name", + * // "parsedData": {}, + * // "patientIds": [], + * // "schematizedData": {}, + * // "sendFacility": "my_sendFacility", + * // "sendTime": "my_sendTime" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.hl7V2Stores.messages.create * @memberOf! () * @@ -12996,48 +13561,46 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.hl7V2Stores.messages.delete * @desc Deletes an HL7v2 message. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the HL7v2 message to delete. - * name: 'my-name', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudHealthcare.projects.locations.datasets.hl7V2Stores.messages.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; + * // Do the magic + * const res = await healthcare.projects.locations.datasets.hl7V2Stores.messages.delete( + * { + * // The resource name of the HL7v2 message to delete. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store/messages/my-message', * } - * }); - * }); + * ); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.hl7V2Stores.messages.delete * @memberOf! () * @@ -13108,51 +13671,60 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.hl7V2Stores.messages.get * @desc Gets an HL7v2 message. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the HL7v2 message to retrieve. - * name: 'my-name', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.hl7V2Stores.messages.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.messages.get( + * { + * // The resource name of the HL7v2 message to retrieve. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store/messages/my-message', + * // Specifies which parts of the Message resource to return in the response. + * // When unspecified, equivalent to FULL. + * view: 'placeholder-value', * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "data": "my_data", + * // "labels": {}, + * // "messageType": "my_messageType", + * // "name": "my_name", + * // "parsedData": {}, + * // "patientIds": [], + * // "schematizedData": {}, + * // "sendFacility": "my_sendFacility", + * // "sendTime": "my_sendTime" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.hl7V2Stores.messages.get * @memberOf! () * @@ -13224,55 +13796,57 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.hl7V2Stores.messages.ingest * @desc Ingests a new HL7v2 message from the hospital and sends a notification to the Cloud Pub/Sub topic. Return is an HL7v2 ACK message if the message was successfully stored. Otherwise an error is returned. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the HL7v2 store this message belongs to. - * parent: 'my-parent', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.hl7V2Stores.messages.ingest(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.messages.ingest( + * { + * // The name of the HL7v2 store this message belongs to. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "message": {} + * // } + * }, * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "hl7Ack": "my_hl7Ack", + * // "message": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.hl7V2Stores.messages.ingest * @memberOf! () * @@ -13351,64 +13925,89 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.hl7V2Stores.messages.list * @desc Lists all the messages in the given HL7v2 store with support for filtering. Note: HL7v2 messages are indexed asynchronously, so there might be a slight delay between the time a message is created and when it can be found through a filter. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the HL7v2 store to retrieve messages from. - * parent: 'my-parent', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var messagesPage = response['messages']; - * if (!messagesPage) { - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.messages.list( + * { + * // Restricts messages returned to those matching a filter. Syntax: + * // https://cloud.google.com/appengine/docs/standard/python/search/query_strings + * // + * // Fields/functions available for filtering are: + * // + * // * `message_type`, from the MSH-9.1 field. For example, + * // `NOT message_type = "ADT"`. + * // * `send_date` or `sendDate`, the YYYY-MM-DD date the message was sent in + * // the dataset's time_zone, from the MSH-7 segment. For example, + * // `send_date < "2017-01-02"`. + * // * `send_time`, the timestamp when the message was sent, using the + * // RFC3339 time format for comparisons, from the MSH-7 segment. For example, + * // `send_time < "2017-01-02T00:00:00-05:00"`. + * // * `send_facility`, the care center that the message came from, from the + * // MSH-4 segment. For example, `send_facility = "ABC"`. + * // * `PatientId(value, type)`, which matches if the message lists a patient + * // having an ID of the given value and type in the PID-2, PID-3, or PID-4 + * // segments. For example, `PatientId("123456", "MRN")`. + * // * `labels.x`, a string value of the label with key `x` as set using the + * // Message.labels + * // map. For example, `labels."priority"="high"`. The operator `:*` can be used + * // to assert the existence of a label. For example, `labels."priority":*`. + * filter: 'placeholder-value', + * // Orders messages returned by the specified order_by clause. + * // Syntax: https://cloud.google.com/apis/design/design_patterns#sorting_order + * // + * // Fields available for ordering are: + * // + * // * `send_time` + * orderBy: 'placeholder-value', + * // Limit on the number of messages to return in a single response. + * // If zero the default page size of 100 is used. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from the previous List request, if any. + * pageToken: 'placeholder-value', + * // Name of the HL7v2 store to retrieve messages from. + * parent: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store', + * // Specifies the parts of the Message to return in the response. + * // When unspecified, equivalent to BASIC. Setting this to anything other than + * // BASIC with a `page_size` larger than the default can generate a large + * // response, which impacts the performance of this method. + * view: 'placeholder-value', * } - * for (var i = 0; i < messagesPage.length; i++) { - * // TODO: Change code below to process each resource in `messagesPage`: - * console.log(JSON.stringify(messagesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudHealthcare.projects.locations.datasets.hl7V2Stores.messages.list(request, handlePage); - * } - * }; + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "hl7V2Messages": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } * - * cloudHealthcare.projects.locations.datasets.hl7V2Stores.messages.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.hl7V2Stores.messages.list * @memberOf! () * @@ -13491,58 +14090,80 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.hl7V2Stores.messages.patch * @desc Update the message. The contents of the message in Message.data and data extracted from the contents such as Message.create_time cannot be altered. Only the Message.labels field is allowed to be updated. The labels in the request are merged with the existing set of labels. Existing labels with the same keys are updated. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Resource name of the Message, of the form - * // `projects/{project_id}/datasets/{dataset_id}/hl7V2Stores/{hl7_v2_store_id}/messages/{message_id}`. - * // Assigned by the server. - * name: 'my-name', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * cloudHealthcare.projects.locations.datasets.hl7V2Stores.messages.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * const healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.hl7V2Stores.messages.patch( + * { + * // Resource name of the Message, of the form + * // `projects/{project_id}/datasets/{dataset_id}/hl7V2Stores/{hl7_v2_store_id}/messages/{message_id}`. + * // Assigned by the server. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/hl7V2Stores/my-hl7V2Store/messages/my-message', + * // The update mask applies to the resource. For the `FieldMask` definition, + * // see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "data": "my_data", + * // "labels": {}, + * // "messageType": "my_messageType", + * // "name": "my_name", + * // "parsedData": {}, + * // "patientIds": [], + * // "schematizedData": {}, + * // "sendFacility": "my_sendFacility", + * // "sendTime": "my_sendTime" + * // } + * }, * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "data": "my_data", + * // "labels": {}, + * // "messageType": "my_messageType", + * // "name": "my_name", + * // "parsedData": {}, + * // "patientIds": [], + * // "schematizedData": {}, + * // "sendFacility": "my_sendFacility", + * // "sendTime": "my_sendTime" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.hl7V2Stores.messages.patch * @memberOf! () * @@ -13737,6 +14358,51 @@ export namespace healthcare_v1beta1 { /** * healthcare.projects.locations.datasets.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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 healthcare = google.healthcare('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 healthcare.projects.locations.datasets.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias healthcare.projects.locations.datasets.operations.cancel * @memberOf! () * @@ -13811,51 +14477,50 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.operations.get * @desc 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. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource. - * name: 'projects/my-project/locations/my-location/datasets/my-dataset/operations/my-operation', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * cloudHealthcare.projects.locations.datasets.operations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await healthcare.projects.locations.datasets.operations.get({ + * // The name of the operation resource. + * name: + * 'projects/my-project/locations/my-location/datasets/my-dataset/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.operations.get * @memberOf! () * @@ -13928,64 +14593,52 @@ export namespace healthcare_v1beta1 { * healthcare.projects.locations.datasets.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Healthcare API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/healthcare - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/healthcare.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'); - * var cloudHealthcare = google.cloudhealthcare('v1beta1'); + * const healthcare = google.healthcare('v1beta1'); * - * authorize(function(authClient) { - * var request = { - * // The name of the operation's parent resource. - * name: 'projects/my-project/locations/my-location/datasets/my-dataset', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * 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/cloud-platform'], + * }); * - * var operationsPage = response['operations']; - * if (!operationsPage) { - * return; - * } - * for (var i = 0; i < operationsPage.length; i++) { - * // TODO: Change code below to process each resource in `operationsPage`: - * console.log(JSON.stringify(operationsPage[i], null, 2)); - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudHealthcare.projects.locations.datasets.operations.list(request, handlePage); - * } - * }; + * // Do the magic + * const res = await healthcare.projects.locations.datasets.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location/datasets/my-dataset', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } * - * cloudHealthcare.projects.locations.datasets.operations.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias healthcare.projects.locations.datasets.operations.list * @memberOf! () * diff --git a/src/apis/homegraph/v1.ts b/src/apis/homegraph/v1.ts index 3e820617439..b34e1d21363 100644 --- a/src/apis/homegraph/v1.ts +++ b/src/apis/homegraph/v1.ts @@ -411,6 +411,46 @@ export namespace homegraph_v1 { /** * homegraph.agentUsers.delete * @desc Unlinks the given third-party user from your smart home Action. All data related to this user will be deleted. For more details on how users link their accounts, see [fulfillment and authentication](https://developers.google.com/assistant/smarthome/concepts/fulfillment-authentication). The third-party user's identity is passed in via the `agent_user_id` (see DeleteAgentUserRequest). This request must be authorized using service account credentials from your Actions console project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/homegraph.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 homegraph = google.homegraph('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: [], + * }); + * + * // 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 homegraph.agentUsers.delete({ + * // Required. Third-party user ID. + * agentUserId: 'agentUsers/.*', + * // Request ID used for debugging. + * requestId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias homegraph.agentUsers.delete * @memberOf! () * @@ -505,6 +545,54 @@ export namespace homegraph_v1 { /** * homegraph.devices.query * @desc Gets the current states in Home Graph for the given set of the third-party user's devices. The third-party user's identity is passed in via the `agent_user_id` (see QueryRequest). This request must be authorized using service account credentials from your Actions console project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/homegraph.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 homegraph = google.homegraph('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: [], + * }); + * + * // 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 homegraph.devices.query({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "agentUserId": "my_agentUserId", + * // "inputs": [], + * // "requestId": "my_requestId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "payload": {}, + * // "requestId": "my_requestId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias homegraph.devices.query * @memberOf! () * @@ -575,6 +663,55 @@ export namespace homegraph_v1 { /** * homegraph.devices.reportStateAndNotification * @desc Reports device state and optionally sends device notifications. Called by your smart home Action when the state of a third-party device changes or you need to send a notification about the device. See [Implement Report State](https://developers.google.com/assistant/smarthome/develop/report-state) for more information. This method updates the device state according to its declared [traits](https://developers.google.com/assistant/smarthome/concepts/devices-traits). Publishing a new state value outside of these traits will result in an `INVALID_ARGUMENT` error response. The third-party user's identity is passed in via the `agent_user_id` (see ReportStateAndNotificationRequest). This request must be authorized using service account credentials from your Actions console project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/homegraph.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 homegraph = google.homegraph('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: [], + * }); + * + * // 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 homegraph.devices.reportStateAndNotification({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "agentUserId": "my_agentUserId", + * // "eventId": "my_eventId", + * // "followUpToken": "my_followUpToken", + * // "payload": {}, + * // "requestId": "my_requestId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "requestId": "my_requestId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias homegraph.devices.reportStateAndNotification * @memberOf! () * @@ -658,6 +795,50 @@ export namespace homegraph_v1 { /** * homegraph.devices.requestSync * @desc Requests Google to send an `action.devices.SYNC` [intent](https://developers.google.com/assistant/smarthome/reference/intent/sync) to your smart home Action to update device metadata for the given user. The third-party user's identity is passed via the `agent_user_id` (see RequestSyncDevicesRequest). This request must be authorized using service account credentials from your Actions console project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/homegraph.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 homegraph = google.homegraph('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: [], + * }); + * + * // 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 homegraph.devices.requestSync({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "agentUserId": "my_agentUserId", + * // "async": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias homegraph.devices.requestSync * @memberOf! () * @@ -739,6 +920,53 @@ export namespace homegraph_v1 { /** * homegraph.devices.sync * @desc Gets all the devices associated with the given third-party user. The third-party user's identity is passed in via the `agent_user_id` (see SyncRequest). This request must be authorized using service account credentials from your Actions console project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/homegraph.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 homegraph = google.homegraph('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: [], + * }); + * + * // 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 homegraph.devices.sync({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "agentUserId": "my_agentUserId", + * // "requestId": "my_requestId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "payload": {}, + * // "requestId": "my_requestId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias homegraph.devices.sync * @memberOf! () * diff --git a/src/apis/iam/v1.ts b/src/apis/iam/v1.ts index 9f6eb97a2cc..458cb45a9f7 100644 --- a/src/apis/iam/v1.ts +++ b/src/apis/iam/v1.ts @@ -762,52 +762,51 @@ export namespace iam_v1 { * iam.iamPolicies.lintPolicy * @desc Lints a Cloud IAM policy object or its sub fields. Currently supports google.iam.v1.Binding.condition. Each lint operation consists of multiple lint validation units. Each unit inspects the input object in regard to a particular linting aspect and issues a google.iam.admin.v1.LintResult disclosing the result. The set of applicable validation units is determined by the Cloud IAM server and is not configurable. Regardless of any lint issues or their severities, successful calls to `lintPolicy` return an HTTP 200 OK status code. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('v1'); * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // 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 iam.iamPolicies.lintPolicy({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "condition": {}, + * // "fullResourceName": "my_fullResourceName" + * // } + * }, + * }); + * console.log(res.data); * - * iam.iamPolicies.lintPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "lintResults": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.iamPolicies.lintPolicy * @memberOf! () * @@ -883,52 +882,50 @@ export namespace iam_v1 { * iam.iamPolicies.queryAuditableServices * @desc Returns a list of services that support service level audit logging configuration for the given resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('v1'); * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // 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 iam.iamPolicies.queryAuditableServices({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fullResourceName": "my_fullResourceName" + * // } + * }, + * }); + * console.log(res.data); * - * iam.iamPolicies.queryAuditableServices(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "services": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.iamPolicies.queryAuditableServices * @memberOf! () * @@ -1054,57 +1051,79 @@ export namespace iam_v1 { * iam.organizations.roles.create * @desc Creates a new Role. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('v1'); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the parent resource in one of the following formats: - * // `organizations/{ORGANIZATION_ID}` - * // `projects/{PROJECT_ID}` - * parent: 'organizations/my-organization', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 iam.organizations.roles.create({ + * // The `parent` parameter's value depends on the target resource for the + * // request, namely + * // [`projects`](/iam/reference/rest/v1/projects.roles) or + * // [`organizations`](/iam/reference/rest/v1/organizations.roles). Each + * // resource type's `parent` value format is described below: + * // + * // * [`projects.roles.create()`](/iam/reference/rest/v1/projects.roles/create): + * // `projects/{PROJECT_ID}`. This method creates project-level + * // [custom roles](/iam/docs/understanding-custom-roles). + * // Example request URL: + * // `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles` + * // + * // * [`organizations.roles.create()`](/iam/reference/rest/v1/organizations.roles/create): + * // `organizations/{ORGANIZATION_ID}`. This method creates organization-level + * // [custom roles](/iam/docs/understanding-custom-roles). Example request + * // URL: + * // `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles` + * // + * // Note: Wildcard (*) values are invalid; you must specify a complete project + * // ID or organization ID. + * parent: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "role": {}, + * // "roleId": "my_roleId" + * // } * }, - * - * auth: authClient, - * }; - * - * iam.organizations.roles.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deleted": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "includedPermissions": [], + * // "name": "my_name", + * // "stage": "my_stage", + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.organizations.roles.create * @memberOf! () * @@ -1179,53 +1198,72 @@ export namespace iam_v1 { * iam.organizations.roles.delete * @desc Soft deletes a role. The role is suspended and cannot be used to create new IAM Policy Bindings. The Role will not be included in `ListRoles()` unless `show_deleted` is set in the `ListRolesRequest`. The Role contains the deleted boolean set. Existing Bindings remains, but are inactive. The Role can be undeleted within 7 days. After 7 days the Role is deleted and all Bindings associated with the role are removed. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the role in one of the following formats: - * // `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` - * // `projects/{PROJECT_ID}/roles/{ROLE_NAME}` - * name: 'organizations/my-organization/roles/my-role', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * iam.organizations.roles.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * const iam = google.iam('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/cloud-platform'], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 iam.organizations.roles.delete({ + * // Used to perform a consistent read-modify-write. + * etag: 'placeholder-value', + * // The `name` parameter's value depends on the target resource for the + * // request, namely + * // [`projects`](/iam/reference/rest/v1/projects.roles) or + * // [`organizations`](/iam/reference/rest/v1/organizations.roles). Each + * // resource type's `name` value format is described below: + * // + * // * [`projects.roles.delete()`](/iam/reference/rest/v1/projects.roles/delete): + * // `projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method deletes only + * // [custom roles](/iam/docs/understanding-custom-roles) that have been + * // created at the project level. Example request URL: + * // `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}` + * // + * // * [`organizations.roles.delete()`](/iam/reference/rest/v1/organizations.roles/delete): + * // `organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method + * // deletes only [custom roles](/iam/docs/understanding-custom-roles) that + * // have been created at the organization level. Example request URL: + * // `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}` + * // + * // Note: Wildcard (*) values are invalid; you must specify a complete project + * // ID or organization ID. + * name: 'organizations/my-organization/roles/my-role', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deleted": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "includedPermissions": [], + * // "name": "my_name", + * // "stage": "my_stage", + * // "title": "my_title" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iam.organizations.roles.delete * @memberOf! () * @@ -1297,54 +1335,77 @@ export namespace iam_v1 { * iam.organizations.roles.get * @desc Gets a Role definition. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the role in one of the following formats: - * // `roles/{ROLE_NAME}` - * // `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` - * // `projects/{PROJECT_ID}/roles/{ROLE_NAME}` - * name: 'organizations/my-organization/roles/my-role', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * iam.organizations.roles.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * const iam = google.iam('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/cloud-platform'], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 iam.organizations.roles.get({ + * // The `name` parameter's value depends on the target resource for the + * // request, namely + * // [`roles`](/iam/reference/rest/v1/roles), + * // [`projects`](/iam/reference/rest/v1/projects.roles), or + * // [`organizations`](/iam/reference/rest/v1/organizations.roles). Each + * // resource type's `name` value format is described below: + * // + * // * [`roles.get()`](/iam/reference/rest/v1/roles/get): `roles/{ROLE_NAME}`. + * // This method returns results from all + * // [predefined roles](/iam/docs/understanding-roles#predefined_roles) in + * // Cloud IAM. Example request URL: + * // `https://iam.googleapis.com/v1/roles/{ROLE_NAME}` + * // + * // * [`projects.roles.get()`](/iam/reference/rest/v1/projects.roles/get): + * // `projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method returns only + * // [custom roles](/iam/docs/understanding-custom-roles) that have been + * // created at the project level. Example request URL: + * // `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}` + * // + * // * [`organizations.roles.get()`](/iam/reference/rest/v1/organizations.roles/get): + * // `organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method + * // returns only [custom roles](/iam/docs/understanding-custom-roles) that + * // have been created at the organization level. Example request URL: + * // `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}` + * // + * // Note: Wildcard (*) values are invalid; you must specify a complete project + * // ID or organization ID. + * name: 'organizations/my-organization/roles/my-role', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deleted": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "includedPermissions": [], + * // "name": "my_name", + * // "stage": "my_stage", + * // "title": "my_title" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iam.organizations.roles.get * @memberOf! () * @@ -1415,67 +1476,83 @@ export namespace iam_v1 { * iam.organizations.roles.list * @desc Lists the Roles defined on a resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the parent resource in one of the following formats: - * // `` (empty string) -- this refers to curated roles. - * // `organizations/{ORGANIZATION_ID}` - * // `projects/{PROJECT_ID}` - * parent: 'organizations/my-organization', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var rolesPage = response['roles']; - * if (!rolesPage) { - * return; - * } - * for (var i = 0; i < rolesPage.length; i++) { - * // TODO: Change code below to process each resource in `rolesPage`: - * console.log(JSON.stringify(rolesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * iam.organizations.roles.list(request, handlePage); - * } - * }; - * - * iam.organizations.roles.list(request, handlePage); - * }); + * const iam = google.iam('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/cloud-platform'], + * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 iam.organizations.roles.list({ + * // Optional limit on the number of roles to include in the response. + * pageSize: 'placeholder-value', + * // Optional pagination token returned in an earlier ListRolesResponse. + * pageToken: 'placeholder-value', + * // The `parent` parameter's value depends on the target resource for the + * // request, namely + * // [`roles`](/iam/reference/rest/v1/roles), + * // [`projects`](/iam/reference/rest/v1/projects.roles), or + * // [`organizations`](/iam/reference/rest/v1/organizations.roles). Each + * // resource type's `parent` value format is described below: + * // + * // * [`roles.list()`](/iam/reference/rest/v1/roles/list): An empty string. + * // This method doesn't require a resource; it simply returns all + * // [predefined roles](/iam/docs/understanding-roles#predefined_roles) in + * // Cloud IAM. Example request URL: + * // `https://iam.googleapis.com/v1/roles` + * // + * // * [`projects.roles.list()`](/iam/reference/rest/v1/projects.roles/list): + * // `projects/{PROJECT_ID}`. This method lists all project-level + * // [custom roles](/iam/docs/understanding-custom-roles). + * // Example request URL: + * // `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles` + * // + * // * [`organizations.roles.list()`](/iam/reference/rest/v1/organizations.roles/list): + * // `organizations/{ORGANIZATION_ID}`. This method lists all + * // organization-level [custom roles](/iam/docs/understanding-custom-roles). + * // Example request URL: + * // `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles` + * // + * // Note: Wildcard (*) values are invalid; you must specify a complete project + * // ID or organization ID. + * parent: 'organizations/my-organization', + * // Include Roles that have been deleted. + * showDeleted: 'placeholder-value', + * // Optional view for the returned Role objects. When `FULL` is specified, + * // the `includedPermissions` field is returned, which includes a list of all + * // permissions in the role. The default value is `BASIC`, which does not + * // return the `includedPermissions` field. + * view: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "roles": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iam.organizations.roles.list * @memberOf! () * @@ -1555,59 +1632,86 @@ export namespace iam_v1 { * iam.organizations.roles.patch * @desc Updates a Role definition. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the role in one of the following formats: - * // `roles/{ROLE_NAME}` - * // `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` - * // `projects/{PROJECT_ID}/roles/{ROLE_NAME}` - * name: 'organizations/my-organization/roles/my-role', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * iam.organizations.roles.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * const iam = google.iam('v1'); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * 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/cloud-platform'], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 iam.organizations.roles.patch({ + * // The `name` parameter's value depends on the target resource for the + * // request, namely + * // [`projects`](/iam/reference/rest/v1/projects.roles) or + * // [`organizations`](/iam/reference/rest/v1/organizations.roles). Each + * // resource type's `name` value format is described below: + * // + * // * [`projects.roles.patch()`](/iam/reference/rest/v1/projects.roles/patch): + * // `projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method updates only + * // [custom roles](/iam/docs/understanding-custom-roles) that have been + * // created at the project level. Example request URL: + * // `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}` + * // + * // * [`organizations.roles.patch()`](/iam/reference/rest/v1/organizations.roles/patch): + * // `organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method + * // updates only [custom roles](/iam/docs/understanding-custom-roles) that + * // have been created at the organization level. Example request URL: + * // `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}` + * // + * // Note: Wildcard (*) values are invalid; you must specify a complete project + * // ID or organization ID. + * name: 'organizations/my-organization/roles/my-role', + * // A mask describing which fields in the Role have changed. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deleted": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "includedPermissions": [], + * // "name": "my_name", + * // "stage": "my_stage", + * // "title": "my_title" + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deleted": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "includedPermissions": [], + * // "name": "my_name", + * // "stage": "my_stage", + * // "title": "my_title" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iam.organizations.roles.patch * @memberOf! () * @@ -1680,57 +1784,78 @@ export namespace iam_v1 { * iam.organizations.roles.undelete * @desc Undelete a Role, bringing it back in its previous state. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('v1'); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the role in one of the following formats: - * // `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` - * // `projects/{PROJECT_ID}/roles/{ROLE_NAME}` - * name: 'organizations/my-organization/roles/my-role', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 iam.organizations.roles.undelete({ + * // The `name` parameter's value depends on the target resource for the + * // request, namely + * // [`projects`](/iam/reference/rest/v1/projects.roles) or + * // [`organizations`](/iam/reference/rest/v1/organizations.roles). Each + * // resource type's `name` value format is described below: + * // + * // * [`projects.roles.undelete()`](/iam/reference/rest/v1/projects.roles/undelete): + * // `projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method undeletes + * // only [custom roles](/iam/docs/understanding-custom-roles) that have been + * // created at the project level. Example request URL: + * // `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}` + * // + * // * [`organizations.roles.undelete()`](/iam/reference/rest/v1/organizations.roles/undelete): + * // `organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method + * // undeletes only [custom roles](/iam/docs/understanding-custom-roles) that + * // have been created at the organization level. Example request URL: + * // `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}` + * // + * // Note: Wildcard (*) values are invalid; you must specify a complete project + * // ID or organization ID. + * name: 'organizations/my-organization/roles/my-role', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag" + * // } * }, - * - * auth: authClient, - * }; - * - * iam.organizations.roles.undelete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deleted": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "includedPermissions": [], + * // "name": "my_name", + * // "stage": "my_stage", + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.organizations.roles.undelete * @memberOf! () * @@ -1924,65 +2049,53 @@ export namespace iam_v1 { * iam.permissions.queryTestablePermissions * @desc Lists the permissions testable on a resource. A permission is testable if it can be tested for an identity on a resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 iam.permissions.queryTestablePermissions({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fullResourceName": "my_fullResourceName", + * // "pageSize": 0, + * // "pageToken": "my_pageToken" + * // } * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "permissions": [] + * // } + * } * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var permissionsPage = response['permissions']; - * if (!permissionsPage) { - * return; - * } - * for (var i = 0; i < permissionsPage.length; i++) { - * // TODO: Change code below to process each resource in `permissionsPage`: - * console.log(JSON.stringify(permissionsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * iam.permissions.queryTestablePermissions(request, handlePage); - * } - * }; - * - * iam.permissions.queryTestablePermissions(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.permissions.queryTestablePermissions * @memberOf! () * @@ -2100,57 +2213,79 @@ export namespace iam_v1 { * iam.projects.roles.create * @desc Creates a new Role. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('v1'); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the parent resource in one of the following formats: - * // `organizations/{ORGANIZATION_ID}` - * // `projects/{PROJECT_ID}` - * parent: 'projects/my-project', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 iam.projects.roles.create({ + * // The `parent` parameter's value depends on the target resource for the + * // request, namely + * // [`projects`](/iam/reference/rest/v1/projects.roles) or + * // [`organizations`](/iam/reference/rest/v1/organizations.roles). Each + * // resource type's `parent` value format is described below: + * // + * // * [`projects.roles.create()`](/iam/reference/rest/v1/projects.roles/create): + * // `projects/{PROJECT_ID}`. This method creates project-level + * // [custom roles](/iam/docs/understanding-custom-roles). + * // Example request URL: + * // `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles` + * // + * // * [`organizations.roles.create()`](/iam/reference/rest/v1/organizations.roles/create): + * // `organizations/{ORGANIZATION_ID}`. This method creates organization-level + * // [custom roles](/iam/docs/understanding-custom-roles). Example request + * // URL: + * // `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles` + * // + * // Note: Wildcard (*) values are invalid; you must specify a complete project + * // ID or organization ID. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "role": {}, + * // "roleId": "my_roleId" + * // } * }, - * - * auth: authClient, - * }; - * - * iam.projects.roles.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deleted": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "includedPermissions": [], + * // "name": "my_name", + * // "stage": "my_stage", + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.projects.roles.create * @memberOf! () * @@ -2225,53 +2360,72 @@ export namespace iam_v1 { * iam.projects.roles.delete * @desc Soft deletes a role. The role is suspended and cannot be used to create new IAM Policy Bindings. The Role will not be included in `ListRoles()` unless `show_deleted` is set in the `ListRolesRequest`. The Role contains the deleted boolean set. Existing Bindings remains, but are inactive. The Role can be undeleted within 7 days. After 7 days the Role is deleted and all Bindings associated with the role are removed. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the role in one of the following formats: - * // `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` - * // `projects/{PROJECT_ID}/roles/{ROLE_NAME}` - * name: 'projects/my-project/roles/my-role', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * iam.projects.roles.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * const iam = google.iam('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/cloud-platform'], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 iam.projects.roles.delete({ + * // Used to perform a consistent read-modify-write. + * etag: 'placeholder-value', + * // The `name` parameter's value depends on the target resource for the + * // request, namely + * // [`projects`](/iam/reference/rest/v1/projects.roles) or + * // [`organizations`](/iam/reference/rest/v1/organizations.roles). Each + * // resource type's `name` value format is described below: + * // + * // * [`projects.roles.delete()`](/iam/reference/rest/v1/projects.roles/delete): + * // `projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method deletes only + * // [custom roles](/iam/docs/understanding-custom-roles) that have been + * // created at the project level. Example request URL: + * // `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}` + * // + * // * [`organizations.roles.delete()`](/iam/reference/rest/v1/organizations.roles/delete): + * // `organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method + * // deletes only [custom roles](/iam/docs/understanding-custom-roles) that + * // have been created at the organization level. Example request URL: + * // `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}` + * // + * // Note: Wildcard (*) values are invalid; you must specify a complete project + * // ID or organization ID. + * name: 'projects/my-project/roles/my-role', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deleted": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "includedPermissions": [], + * // "name": "my_name", + * // "stage": "my_stage", + * // "title": "my_title" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iam.projects.roles.delete * @memberOf! () * @@ -2343,54 +2497,77 @@ export namespace iam_v1 { * iam.projects.roles.get * @desc Gets a Role definition. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the role in one of the following formats: - * // `roles/{ROLE_NAME}` - * // `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` - * // `projects/{PROJECT_ID}/roles/{ROLE_NAME}` - * name: 'projects/my-project/roles/my-role', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * iam.projects.roles.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * const iam = google.iam('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/cloud-platform'], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 iam.projects.roles.get({ + * // The `name` parameter's value depends on the target resource for the + * // request, namely + * // [`roles`](/iam/reference/rest/v1/roles), + * // [`projects`](/iam/reference/rest/v1/projects.roles), or + * // [`organizations`](/iam/reference/rest/v1/organizations.roles). Each + * // resource type's `name` value format is described below: + * // + * // * [`roles.get()`](/iam/reference/rest/v1/roles/get): `roles/{ROLE_NAME}`. + * // This method returns results from all + * // [predefined roles](/iam/docs/understanding-roles#predefined_roles) in + * // Cloud IAM. Example request URL: + * // `https://iam.googleapis.com/v1/roles/{ROLE_NAME}` + * // + * // * [`projects.roles.get()`](/iam/reference/rest/v1/projects.roles/get): + * // `projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method returns only + * // [custom roles](/iam/docs/understanding-custom-roles) that have been + * // created at the project level. Example request URL: + * // `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}` + * // + * // * [`organizations.roles.get()`](/iam/reference/rest/v1/organizations.roles/get): + * // `organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method + * // returns only [custom roles](/iam/docs/understanding-custom-roles) that + * // have been created at the organization level. Example request URL: + * // `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}` + * // + * // Note: Wildcard (*) values are invalid; you must specify a complete project + * // ID or organization ID. + * name: 'projects/my-project/roles/my-role', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deleted": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "includedPermissions": [], + * // "name": "my_name", + * // "stage": "my_stage", + * // "title": "my_title" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iam.projects.roles.get * @memberOf! () * @@ -2461,67 +2638,83 @@ export namespace iam_v1 { * iam.projects.roles.list * @desc Lists the Roles defined on a resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the parent resource in one of the following formats: - * // `` (empty string) -- this refers to curated roles. - * // `organizations/{ORGANIZATION_ID}` - * // `projects/{PROJECT_ID}` - * parent: 'projects/my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var rolesPage = response['roles']; - * if (!rolesPage) { - * return; - * } - * for (var i = 0; i < rolesPage.length; i++) { - * // TODO: Change code below to process each resource in `rolesPage`: - * console.log(JSON.stringify(rolesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * iam.projects.roles.list(request, handlePage); - * } - * }; - * - * iam.projects.roles.list(request, handlePage); - * }); + * const iam = google.iam('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/cloud-platform'], + * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 iam.projects.roles.list({ + * // Optional limit on the number of roles to include in the response. + * pageSize: 'placeholder-value', + * // Optional pagination token returned in an earlier ListRolesResponse. + * pageToken: 'placeholder-value', + * // The `parent` parameter's value depends on the target resource for the + * // request, namely + * // [`roles`](/iam/reference/rest/v1/roles), + * // [`projects`](/iam/reference/rest/v1/projects.roles), or + * // [`organizations`](/iam/reference/rest/v1/organizations.roles). Each + * // resource type's `parent` value format is described below: + * // + * // * [`roles.list()`](/iam/reference/rest/v1/roles/list): An empty string. + * // This method doesn't require a resource; it simply returns all + * // [predefined roles](/iam/docs/understanding-roles#predefined_roles) in + * // Cloud IAM. Example request URL: + * // `https://iam.googleapis.com/v1/roles` + * // + * // * [`projects.roles.list()`](/iam/reference/rest/v1/projects.roles/list): + * // `projects/{PROJECT_ID}`. This method lists all project-level + * // [custom roles](/iam/docs/understanding-custom-roles). + * // Example request URL: + * // `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles` + * // + * // * [`organizations.roles.list()`](/iam/reference/rest/v1/organizations.roles/list): + * // `organizations/{ORGANIZATION_ID}`. This method lists all + * // organization-level [custom roles](/iam/docs/understanding-custom-roles). + * // Example request URL: + * // `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles` + * // + * // Note: Wildcard (*) values are invalid; you must specify a complete project + * // ID or organization ID. + * parent: 'projects/my-project', + * // Include Roles that have been deleted. + * showDeleted: 'placeholder-value', + * // Optional view for the returned Role objects. When `FULL` is specified, + * // the `includedPermissions` field is returned, which includes a list of all + * // permissions in the role. The default value is `BASIC`, which does not + * // return the `includedPermissions` field. + * view: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "roles": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iam.projects.roles.list * @memberOf! () * @@ -2601,59 +2794,86 @@ export namespace iam_v1 { * iam.projects.roles.patch * @desc Updates a Role definition. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the role in one of the following formats: - * // `roles/{ROLE_NAME}` - * // `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` - * // `projects/{PROJECT_ID}/roles/{ROLE_NAME}` - * name: 'projects/my-project/roles/my-role', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * iam.projects.roles.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * const iam = google.iam('v1'); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * 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/cloud-platform'], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 iam.projects.roles.patch({ + * // The `name` parameter's value depends on the target resource for the + * // request, namely + * // [`projects`](/iam/reference/rest/v1/projects.roles) or + * // [`organizations`](/iam/reference/rest/v1/organizations.roles). Each + * // resource type's `name` value format is described below: + * // + * // * [`projects.roles.patch()`](/iam/reference/rest/v1/projects.roles/patch): + * // `projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method updates only + * // [custom roles](/iam/docs/understanding-custom-roles) that have been + * // created at the project level. Example request URL: + * // `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}` + * // + * // * [`organizations.roles.patch()`](/iam/reference/rest/v1/organizations.roles/patch): + * // `organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method + * // updates only [custom roles](/iam/docs/understanding-custom-roles) that + * // have been created at the organization level. Example request URL: + * // `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}` + * // + * // Note: Wildcard (*) values are invalid; you must specify a complete project + * // ID or organization ID. + * name: 'projects/my-project/roles/my-role', + * // A mask describing which fields in the Role have changed. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deleted": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "includedPermissions": [], + * // "name": "my_name", + * // "stage": "my_stage", + * // "title": "my_title" + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deleted": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "includedPermissions": [], + * // "name": "my_name", + * // "stage": "my_stage", + * // "title": "my_title" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iam.projects.roles.patch * @memberOf! () * @@ -2726,57 +2946,78 @@ export namespace iam_v1 { * iam.projects.roles.undelete * @desc Undelete a Role, bringing it back in its previous state. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('v1'); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the role in one of the following formats: - * // `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` - * // `projects/{PROJECT_ID}/roles/{ROLE_NAME}` - * name: 'projects/my-project/roles/my-role', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 iam.projects.roles.undelete({ + * // The `name` parameter's value depends on the target resource for the + * // request, namely + * // [`projects`](/iam/reference/rest/v1/projects.roles) or + * // [`organizations`](/iam/reference/rest/v1/organizations.roles). Each + * // resource type's `name` value format is described below: + * // + * // * [`projects.roles.undelete()`](/iam/reference/rest/v1/projects.roles/undelete): + * // `projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method undeletes + * // only [custom roles](/iam/docs/understanding-custom-roles) that have been + * // created at the project level. Example request URL: + * // `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}` + * // + * // * [`organizations.roles.undelete()`](/iam/reference/rest/v1/organizations.roles/undelete): + * // `organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method + * // undeletes only [custom roles](/iam/docs/understanding-custom-roles) that + * // have been created at the organization level. Example request URL: + * // `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}` + * // + * // Note: Wildcard (*) values are invalid; you must specify a complete project + * // ID or organization ID. + * name: 'projects/my-project/roles/my-role', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag" + * // } * }, - * - * auth: authClient, - * }; - * - * iam.projects.roles.undelete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deleted": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "includedPermissions": [], + * // "name": "my_name", + * // "stage": "my_stage", + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.projects.roles.undelete * @memberOf! () * @@ -2972,56 +3213,63 @@ export namespace iam_v1 { * iam.projects.serviceAccounts.create * @desc Creates a ServiceAccount and returns it. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 iam.projects.serviceAccounts.create({ * // Required. The resource name of the project associated with the service * // accounts, such as `projects/my-project-123`. - * name: 'projects/my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * name: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "serviceAccount": {} + * // } * }, - * - * auth: authClient, - * }; - * - * iam.projects.serviceAccounts.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "disabled": false, + * // "displayName": "my_displayName", + * // "email": "my_email", + * // "etag": "my_etag", + * // "name": "my_name", + * // "oauth2ClientId": "my_oauth2ClientId", + * // "projectId": "my_projectId", + * // "uniqueId": "my_uniqueId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.projects.serviceAccounts.create * @memberOf! () * @@ -3098,52 +3346,47 @@ export namespace iam_v1 { * iam.projects.serviceAccounts.delete * @desc Deletes a ServiceAccount. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('v1'); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the service account in the following format: + * 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/cloud-platform'], + * }); + * + * // 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 iam.projects.serviceAccounts.delete({ + * // Required. The resource name of the service account in the following format: * // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. * // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from * // the account. The `ACCOUNT` value can be the `email` address or the * // `unique_id` of the service account. - * name: 'projects/my-project/serviceAccounts/my-service-account', // TODO: Update placeholder value. + * name: 'projects/my-project/serviceAccounts/my-serviceAccount', + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * iam.projects.serviceAccounts.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.projects.serviceAccounts.delete * @memberOf! () * @@ -3214,56 +3457,53 @@ export namespace iam_v1 { * iam.projects.serviceAccounts.disable * @desc DisableServiceAccount is currently in the alpha launch stage. Disables a ServiceAccount, which immediately prevents the service account from authenticating and gaining access to APIs. Disabled service accounts can be safely restored by using EnableServiceAccount at any point. Deleted service accounts cannot be restored using this method. Disabling a service account that is bound to VMs, Apps, Functions, or other jobs will cause those jobs to lose access to resources if they are using the disabled service account. To improve reliability of your services and avoid unexpected outages, it is recommended to first disable a service account rather than delete it. After disabling the service account, wait at least 24 hours to verify there are no unintended consequences, and then delete the service account. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 iam.projects.serviceAccounts.disable({ * // The resource name of the service account in the following format: * // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. * // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from * // the account. The `ACCOUNT` value can be the `email` address or the * // `unique_id` of the service account. - * name: 'projects/my-project/serviceAccounts/my-service-account', // TODO: Update placeholder value. + * name: 'projects/my-project/serviceAccounts/my-serviceAccount', * - * resource: { - * // TODO: Add desired properties to the request body. + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * iam.projects.serviceAccounts.disable(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.projects.serviceAccounts.disable * @memberOf! () * @@ -3338,55 +3578,53 @@ export namespace iam_v1 { * iam.projects.serviceAccounts.enable * @desc EnableServiceAccount is currently in the alpha launch stage. Restores a disabled ServiceAccount that has been manually disabled by using DisableServiceAccount. Service accounts that have been disabled by other means or for other reasons, such as abuse, cannot be restored using this method. EnableServiceAccount will have no effect on a service account that is not disabled. Enabling an already enabled service account will have no effect. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 iam.projects.serviceAccounts.enable({ * // The resource name of the service account in the following format: - * // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_UNIQUE_ID}'. + * // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. * // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from - * // the account. - * name: 'projects/my-project/serviceAccounts/my-service-account', // TODO: Update placeholder value. + * // the account. The `ACCOUNT` value can be the `email` address or the + * // `unique_id` of the service account. + * name: 'projects/my-project/serviceAccounts/my-serviceAccount', * - * resource: { - * // TODO: Add desired properties to the request body. + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * iam.projects.serviceAccounts.enable(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.projects.serviceAccounts.enable * @memberOf! () * @@ -3458,55 +3696,57 @@ export namespace iam_v1 { * iam.projects.serviceAccounts.get * @desc Gets a ServiceAccount. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('v1'); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the service account in the following format: + * 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/cloud-platform'], + * }); + * + * // 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 iam.projects.serviceAccounts.get({ + * // Required. The resource name of the service account in the following format: * // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. * // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from * // the account. The `ACCOUNT` value can be the `email` address or the * // `unique_id` of the service account. - * name: 'projects/my-project/serviceAccounts/my-service-account', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * iam.projects.serviceAccounts.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * name: 'projects/my-project/serviceAccounts/my-serviceAccount', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "disabled": false, + * // "displayName": "my_displayName", + * // "email": "my_email", + * // "etag": "my_etag", + * // "name": "my_name", + * // "oauth2ClientId": "my_oauth2ClientId", + * // "projectId": "my_projectId", + * // "uniqueId": "my_uniqueId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.projects.serviceAccounts.get * @memberOf! () * @@ -3579,52 +3819,58 @@ export namespace iam_v1 { * iam.projects.serviceAccounts.getIamPolicy * @desc Returns the Cloud IAM access control policy for a ServiceAccount. Note: Service accounts are both [resources and identities](/iam/docs/service-accounts#service_account_permissions). This method treats the service account as a resource. It returns the Cloud IAM policy that reflects what members have access to the service account. This method does not return what resources the service account has access to. To see if a service account has access to a resource, call the `getIamPolicy` method on the target resource. For example, to view grants for a project, call the [projects.getIamPolicy](/resource-manager/reference/rest/v1/projects/getIamPolicy) method. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 iam.projects.serviceAccounts.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', * // REQUIRED: The resource for which the policy is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/serviceAccounts/my-service-account', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * iam.projects.serviceAccounts.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * resource: 'projects/my-project/serviceAccounts/my-serviceAccount', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.projects.serviceAccounts.getIamPolicy * @memberOf! () * @@ -3699,65 +3945,55 @@ export namespace iam_v1 { * iam.projects.serviceAccounts.list * @desc Lists ServiceAccounts for a project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await iam.projects.serviceAccounts.list({ * // Required. The resource name of the project associated with the service * // accounts, such as `projects/my-project-123`. - * name: 'projects/my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var accountsPage = response['accounts']; - * if (!accountsPage) { - * return; - * } - * for (var i = 0; i < accountsPage.length; i++) { - * // TODO: Change code below to process each resource in `accountsPage`: - * console.log(JSON.stringify(accountsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * iam.projects.serviceAccounts.list(request, handlePage); - * } - * }; - * - * iam.projects.serviceAccounts.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * name: 'projects/my-project', + * // Optional limit on the number of service accounts to include in the + * // response. Further accounts can subsequently be obtained by including the + * // ListServiceAccountsResponse.next_page_token + * // in a subsequent request. + * pageSize: 'placeholder-value', + * // Optional pagination token returned in an earlier + * // ListServiceAccountsResponse.next_page_token. + * pageToken: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accounts": [], + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iam.projects.serviceAccounts.list * @memberOf! () * @@ -3842,62 +4078,70 @@ export namespace iam_v1 { * iam.projects.serviceAccounts.patch * @desc Patches a ServiceAccount. Currently, only the following fields are updatable: `display_name` and `description`. Only fields specified in the request are guaranteed to be returned in the response. Other fields in the response may be empty. Note: The field mask is required. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 iam.projects.serviceAccounts.patch({ * // The resource name of the service account in the following format: * // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + * // * // Requests using `-` as a wildcard for the `PROJECT_ID` will infer the * // project from the `account` and the `ACCOUNT` value can be the `email` * // address or the `unique_id` of the service account. + * // * // In responses the resource name will always be in the format * // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. - * name: 'projects/my-project/serviceAccounts/my-service-account', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * name: 'projects/my-project/serviceAccounts/my-serviceAccount', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "serviceAccount": {}, + * // "updateMask": "my_updateMask" + * // } * }, - * - * auth: authClient, - * }; - * - * iam.projects.serviceAccounts.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "disabled": false, + * // "displayName": "my_displayName", + * // "email": "my_email", + * // "etag": "my_etag", + * // "name": "my_name", + * // "oauth2ClientId": "my_oauth2ClientId", + * // "projectId": "my_projectId", + * // "uniqueId": "my_uniqueId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.projects.serviceAccounts.patch * @memberOf! () * @@ -3971,56 +4215,58 @@ export namespace iam_v1 { * iam.projects.serviceAccounts.setIamPolicy * @desc Sets the Cloud IAM access control policy for a ServiceAccount. Note: Service accounts are both [resources and identities](/iam/docs/service-accounts#service_account_permissions). This method treats the service account as a resource. Use it to grant members access to the service account, such as when they need to impersonate it. This method does not grant the service account access to other resources, such as projects. To grant a service account access to resources, include the service account in the Cloud IAM policy for the desired resource, then call the appropriate `setIamPolicy` method on the target resource. For example, to grant a service account access to a project, call the [projects.setIamPolicy](/resource-manager/reference/rest/v1/projects/setIamPolicy) method. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await iam.projects.serviceAccounts.setIamPolicy({ * // REQUIRED: The resource for which the policy is being specified. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/serviceAccounts/my-service-account', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'projects/my-project/serviceAccounts/my-serviceAccount', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } * }, - * - * auth: authClient, - * }; - * - * iam.projects.serviceAccounts.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.projects.serviceAccounts.setIamPolicy * @memberOf! () * @@ -4095,59 +4341,58 @@ export namespace iam_v1 { * iam.projects.serviceAccounts.signBlob * @desc **Note**: This method is in the process of being deprecated. Call the [`signBlob()`](/iam/credentials/reference/rest/v1/projects.serviceAccounts/signBlob) method of the Cloud IAM Service Account Credentials API instead. Signs a blob using a service account's system-managed private key. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('v1'); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the service account in the following format: + * 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/cloud-platform'], + * }); + * + * // 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 iam.projects.serviceAccounts.signBlob({ + * // Required. The resource name of the service account in the following format: * // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. * // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from * // the account. The `ACCOUNT` value can be the `email` address or the * // `unique_id` of the service account. - * name: 'projects/my-project/serviceAccounts/my-service-account', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * name: 'projects/my-project/serviceAccounts/my-serviceAccount', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bytesToSign": "my_bytesToSign" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * iam.projects.serviceAccounts.signBlob(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "keyId": "my_keyId", + * // "signature": "my_signature" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.projects.serviceAccounts.signBlob * @memberOf! () * @@ -4224,59 +4469,58 @@ export namespace iam_v1 { * iam.projects.serviceAccounts.signJwt * @desc **Note**: This method is in the process of being deprecated. Call the [`signJwt()`](/iam/credentials/reference/rest/v1/projects.serviceAccounts/signJwt) method of the Cloud IAM Service Account Credentials API instead. Signs a JWT using a service account's system-managed private key. If no expiry time (`exp`) is provided in the `SignJwtRequest`, IAM sets an an expiry time of one hour by default. If you request an expiry time of more than one hour, the request will fail. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('v1'); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the service account in the following format: + * 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/cloud-platform'], + * }); + * + * // 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 iam.projects.serviceAccounts.signJwt({ + * // Required. The resource name of the service account in the following format: * // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. * // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from * // the account. The `ACCOUNT` value can be the `email` address or the * // `unique_id` of the service account. - * name: 'projects/my-project/serviceAccounts/my-service-account', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * name: 'projects/my-project/serviceAccounts/my-serviceAccount', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "payload": "my_payload" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * iam.projects.serviceAccounts.signJwt(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "keyId": "my_keyId", + * // "signedJwt": "my_signedJwt" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.projects.serviceAccounts.signJwt * @memberOf! () * @@ -4353,56 +4597,54 @@ export namespace iam_v1 { * iam.projects.serviceAccounts.testIamPermissions * @desc Tests the specified permissions against the IAM access control policy for a ServiceAccount. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('v1'); * - * authorize(function(authClient) { - * var request = { + * 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/cloud-platform'], + * }); + * + * // 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 iam.projects.serviceAccounts.testIamPermissions({ * // REQUIRED: The resource for which the policy detail is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/serviceAccounts/my-service-account', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'projects/my-project/serviceAccounts/my-serviceAccount', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * iam.projects.serviceAccounts.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.projects.serviceAccounts.testIamPermissions * @memberOf! () * @@ -4486,58 +4728,54 @@ export namespace iam_v1 { * iam.projects.serviceAccounts.undelete * @desc Restores a deleted ServiceAccount. This is to be used as an action of last resort. A service account may not always be restorable. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('v1'); * - * authorize(function(authClient) { - * var request = { + * 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/cloud-platform'], + * }); + * + * // 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 iam.projects.serviceAccounts.undelete({ * // The resource name of the service account in the following format: - * // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_UNIQUE_ID}'. + * // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_UNIQUE_ID}`. * // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from * // the account. - * name: 'projects/my-project/serviceAccounts/my-service-account', // TODO: Update placeholder value. + * name: 'projects/my-project/serviceAccounts/my-serviceAccount', * - * resource: { - * // TODO: Add desired properties to the request body. + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * iam.projects.serviceAccounts.undelete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "restoredAccount": {} + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.projects.serviceAccounts.undelete * @memberOf! () * @@ -4623,62 +4861,77 @@ export namespace iam_v1 { * iam.projects.serviceAccounts.update * @desc Note: This method is in the process of being deprecated. Use PatchServiceAccount instead. Updates a ServiceAccount. Currently, only the following fields are updatable: `display_name` and `description`. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await iam.projects.serviceAccounts.update({ * // The resource name of the service account in the following format: * // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + * // * // Requests using `-` as a wildcard for the `PROJECT_ID` will infer the * // project from the `account` and the `ACCOUNT` value can be the `email` * // address or the `unique_id` of the service account. + * // * // In responses the resource name will always be in the format * // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. - * name: 'projects/my-project/serviceAccounts/my-service-account', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * name: 'projects/my-project/serviceAccounts/my-serviceAccount', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "disabled": false, + * // "displayName": "my_displayName", + * // "email": "my_email", + * // "etag": "my_etag", + * // "name": "my_name", + * // "oauth2ClientId": "my_oauth2ClientId", + * // "projectId": "my_projectId", + * // "uniqueId": "my_uniqueId" + * // } * }, - * - * auth: authClient, - * }; - * - * iam.projects.serviceAccounts.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "disabled": false, + * // "displayName": "my_displayName", + * // "email": "my_email", + * // "etag": "my_etag", + * // "name": "my_name", + * // "oauth2ClientId": "my_oauth2ClientId", + * // "projectId": "my_projectId", + * // "uniqueId": "my_uniqueId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.projects.serviceAccounts.update * @memberOf! () * @@ -4990,59 +5243,66 @@ export namespace iam_v1 { * iam.projects.serviceAccounts.keys.create * @desc Creates a ServiceAccountKey and returns it. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('v1'); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the service account in the following format: + * 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/cloud-platform'], + * }); + * + * // 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 iam.projects.serviceAccounts.keys.create({ + * // Required. The resource name of the service account in the following format: * // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. * // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from * // the account. The `ACCOUNT` value can be the `email` address or the * // `unique_id` of the service account. - * name: 'projects/my-project/serviceAccounts/my-service-account', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * name: 'projects/my-project/serviceAccounts/my-serviceAccount', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "keyAlgorithm": "my_keyAlgorithm", + * // "privateKeyType": "my_privateKeyType" + * // } * }, - * - * auth: authClient, - * }; - * - * iam.projects.serviceAccounts.keys.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "keyAlgorithm": "my_keyAlgorithm", + * // "keyOrigin": "my_keyOrigin", + * // "keyType": "my_keyType", + * // "name": "my_name", + * // "privateKeyData": "my_privateKeyData", + * // "privateKeyType": "my_privateKeyType", + * // "publicKeyData": "my_publicKeyData", + * // "validAfterTime": "my_validAfterTime", + * // "validBeforeTime": "my_validBeforeTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.projects.serviceAccounts.keys.create * @memberOf! () * @@ -5116,52 +5376,47 @@ export namespace iam_v1 { * iam.projects.serviceAccounts.keys.delete * @desc Deletes a ServiceAccountKey. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the service account key in the following format: + * // 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 iam.projects.serviceAccounts.keys.delete({ + * // Required. The resource name of the service account key in the following format: * // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. * // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from * // the account. The `ACCOUNT` value can be the `email` address or the * // `unique_id` of the service account. - * name: 'projects/my-project/serviceAccounts/my-service-account/keys/my-key', // TODO: Update placeholder value. + * name: 'projects/my-project/serviceAccounts/my-serviceAccount/keys/my-key', + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * iam.projects.serviceAccounts.keys.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.projects.serviceAccounts.keys.delete * @memberOf! () * @@ -5232,55 +5487,61 @@ export namespace iam_v1 { * iam.projects.serviceAccounts.keys.get * @desc Gets the ServiceAccountKey by key id. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the service account key in the following format: + * // Do the magic + * const res = await iam.projects.serviceAccounts.keys.get({ + * // Required. The resource name of the service account key in the following format: * // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. + * // * // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from * // the account. The `ACCOUNT` value can be the `email` address or the * // `unique_id` of the service account. - * name: 'projects/my-project/serviceAccounts/my-service-account/keys/my-key', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * iam.projects.serviceAccounts.keys.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * name: 'projects/my-project/serviceAccounts/my-serviceAccount/keys/my-key', + * // The output format of the public key requested. + * // X509_PEM is the default output format. + * publicKeyType: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "keyAlgorithm": "my_keyAlgorithm", + * // "keyOrigin": "my_keyOrigin", + * // "keyType": "my_keyType", + * // "name": "my_name", + * // "privateKeyData": "my_privateKeyData", + * // "privateKeyType": "my_privateKeyType", + * // "publicKeyData": "my_publicKeyData", + * // "validAfterTime": "my_validAfterTime", + * // "validBeforeTime": "my_validBeforeTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.projects.serviceAccounts.keys.get * @memberOf! () * @@ -5354,55 +5615,54 @@ export namespace iam_v1 { * iam.projects.serviceAccounts.keys.list * @desc Lists ServiceAccountKeys. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('v1'); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the service account in the following format: + * 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/cloud-platform'], + * }); + * + * // 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 iam.projects.serviceAccounts.keys.list({ + * // Filters the types of keys the user wants to include in the list + * // response. Duplicate key types are not allowed. If no key type + * // is provided, all keys are returned. + * keyTypes: 'placeholder-value', + * // Required. The resource name of the service account in the following format: * // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + * // * // Using `-` as a wildcard for the `PROJECT_ID`, will infer the project from * // the account. The `ACCOUNT` value can be the `email` address or the * // `unique_id` of the service account. - * name: 'projects/my-project/serviceAccounts/my-service-account', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * name: 'projects/my-project/serviceAccounts/my-serviceAccount', + * }); + * console.log(res.data); * - * iam.projects.serviceAccounts.keys.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "keys": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.projects.serviceAccounts.keys.list * @memberOf! () * @@ -5484,6 +5744,66 @@ export namespace iam_v1 { /** * iam.projects.serviceAccounts.keys.upload * @desc Upload public key for a given service account. This rpc will create a ServiceAccountKey that has the provided public key and returns it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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 iam = google.iam('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/cloud-platform'], + * }); + * + * // 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 iam.projects.serviceAccounts.keys.upload({ + * // The resource name of the service account in the following format: + * // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + * // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from + * // the account. The `ACCOUNT` value can be the `email` address or the + * // `unique_id` of the service account. + * name: 'projects/my-project/serviceAccounts/my-serviceAccount', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "publicKeyData": "my_publicKeyData" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "keyAlgorithm": "my_keyAlgorithm", + * // "keyOrigin": "my_keyOrigin", + * // "keyType": "my_keyType", + * // "name": "my_name", + * // "privateKeyData": "my_privateKeyData", + * // "privateKeyType": "my_privateKeyType", + * // "publicKeyData": "my_publicKeyData", + * // "validAfterTime": "my_validAfterTime", + * // "validBeforeTime": "my_validBeforeTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iam.projects.serviceAccounts.keys.upload * @memberOf! () * @@ -5646,54 +5966,77 @@ export namespace iam_v1 { * iam.roles.get * @desc Gets a Role definition. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the role in one of the following formats: - * // `roles/{ROLE_NAME}` - * // `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` - * // `projects/{PROJECT_ID}/roles/{ROLE_NAME}` - * name: 'roles/my-role', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * iam.roles.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * const iam = google.iam('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/cloud-platform'], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 iam.roles.get({ + * // The `name` parameter's value depends on the target resource for the + * // request, namely + * // [`roles`](/iam/reference/rest/v1/roles), + * // [`projects`](/iam/reference/rest/v1/projects.roles), or + * // [`organizations`](/iam/reference/rest/v1/organizations.roles). Each + * // resource type's `name` value format is described below: + * // + * // * [`roles.get()`](/iam/reference/rest/v1/roles/get): `roles/{ROLE_NAME}`. + * // This method returns results from all + * // [predefined roles](/iam/docs/understanding-roles#predefined_roles) in + * // Cloud IAM. Example request URL: + * // `https://iam.googleapis.com/v1/roles/{ROLE_NAME}` + * // + * // * [`projects.roles.get()`](/iam/reference/rest/v1/projects.roles/get): + * // `projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method returns only + * // [custom roles](/iam/docs/understanding-custom-roles) that have been + * // created at the project level. Example request URL: + * // `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}` + * // + * // * [`organizations.roles.get()`](/iam/reference/rest/v1/organizations.roles/get): + * // `organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method + * // returns only [custom roles](/iam/docs/understanding-custom-roles) that + * // have been created at the organization level. Example request URL: + * // `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}` + * // + * // Note: Wildcard (*) values are invalid; you must specify a complete project + * // ID or organization ID. + * name: 'roles/my-role', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deleted": false, + * // "description": "my_description", + * // "etag": "my_etag", + * // "includedPermissions": [], + * // "name": "my_name", + * // "stage": "my_stage", + * // "title": "my_title" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iam.roles.get * @memberOf! () * @@ -5763,61 +6106,83 @@ export namespace iam_v1 { * iam.roles.list * @desc Lists the Roles defined on a resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var rolesPage = response['roles']; - * if (!rolesPage) { - * return; - * } - * for (var i = 0; i < rolesPage.length; i++) { - * // TODO: Change code below to process each resource in `rolesPage`: - * console.log(JSON.stringify(rolesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * iam.roles.list(request, handlePage); - * } - * }; - * - * iam.roles.list(request, handlePage); - * }); + * const iam = google.iam('v1'); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * 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/cloud-platform'], * }); + * + * // 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 iam.roles.list({ + * // Optional limit on the number of roles to include in the response. + * pageSize: 'placeholder-value', + * // Optional pagination token returned in an earlier ListRolesResponse. + * pageToken: 'placeholder-value', + * // The `parent` parameter's value depends on the target resource for the + * // request, namely + * // [`roles`](/iam/reference/rest/v1/roles), + * // [`projects`](/iam/reference/rest/v1/projects.roles), or + * // [`organizations`](/iam/reference/rest/v1/organizations.roles). Each + * // resource type's `parent` value format is described below: + * // + * // * [`roles.list()`](/iam/reference/rest/v1/roles/list): An empty string. + * // This method doesn't require a resource; it simply returns all + * // [predefined roles](/iam/docs/understanding-roles#predefined_roles) in + * // Cloud IAM. Example request URL: + * // `https://iam.googleapis.com/v1/roles` + * // + * // * [`projects.roles.list()`](/iam/reference/rest/v1/projects.roles/list): + * // `projects/{PROJECT_ID}`. This method lists all project-level + * // [custom roles](/iam/docs/understanding-custom-roles). + * // Example request URL: + * // `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles` + * // + * // * [`organizations.roles.list()`](/iam/reference/rest/v1/organizations.roles/list): + * // `organizations/{ORGANIZATION_ID}`. This method lists all + * // organization-level [custom roles](/iam/docs/understanding-custom-roles). + * // Example request URL: + * // `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles` + * // + * // Note: Wildcard (*) values are invalid; you must specify a complete project + * // ID or organization ID. + * parent: 'placeholder-value', + * // Include Roles that have been deleted. + * showDeleted: 'placeholder-value', + * // Optional view for the returned Role objects. When `FULL` is specified, + * // the `includedPermissions` field is returned, which includes a list of all + * // permissions in the role. The default value is `BASIC`, which does not + * // return the `includedPermissions` field. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "roles": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iam.roles.list * @memberOf! () * @@ -5893,65 +6258,54 @@ export namespace iam_v1 { * iam.roles.queryGrantableRoles * @desc Queries roles that can be granted on a particular resource. A role is grantable if it can be used as the role in a binding for a policy for that resource. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Identity and Access Management (IAM) API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/iam - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iam.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'); - * var iam = google.iam('v1'); + * const iam = google.iam('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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 iam.roles.queryGrantableRoles({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fullResourceName": "my_fullResourceName", + * // "pageSize": 0, + * // "pageToken": "my_pageToken", + * // "view": "my_view" + * // } * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "roles": [] + * // } + * } * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var rolesPage = response['roles']; - * if (!rolesPage) { - * return; - * } - * for (var i = 0; i < rolesPage.length; i++) { - * // TODO: Change code below to process each resource in `rolesPage`: - * console.log(JSON.stringify(rolesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * iam.roles.queryGrantableRoles(request, handlePage); - * } - * }; - * - * iam.roles.queryGrantableRoles(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias iam.roles.queryGrantableRoles * @memberOf! () * diff --git a/src/apis/iamcredentials/v1.ts b/src/apis/iamcredentials/v1.ts index ea752992498..e3dd47e1c68 100644 --- a/src/apis/iamcredentials/v1.ts +++ b/src/apis/iamcredentials/v1.ts @@ -218,6 +218,62 @@ export namespace iamcredentials_v1 { /** * iamcredentials.projects.serviceAccounts.generateAccessToken * @desc Generates an OAuth 2.0 access token for a service account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iamcredentials.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 iamcredentials = google.iamcredentials('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/cloud-platform'], + * }); + * + * // 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 iamcredentials.projects.serviceAccounts.generateAccessToken( + * { + * // Required. The resource name of the service account for which the credentials + * // are requested, in the following format: + * // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + * // character is required; replacing it with a project ID is invalid. + * name: 'projects/my-project/serviceAccounts/my-serviceAccount', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "delegates": [], + * // "lifetime": "my_lifetime", + * // "scope": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "accessToken": "my_accessToken", + * // "expireTime": "my_expireTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iamcredentials.projects.serviceAccounts.generateAccessToken * @memberOf! () * @@ -301,6 +357,59 @@ export namespace iamcredentials_v1 { /** * iamcredentials.projects.serviceAccounts.generateIdToken * @desc Generates an OpenID Connect ID token for a service account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iamcredentials.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 iamcredentials = google.iamcredentials('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/cloud-platform'], + * }); + * + * // 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 iamcredentials.projects.serviceAccounts.generateIdToken({ + * // Required. The resource name of the service account for which the credentials + * // are requested, in the following format: + * // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + * // character is required; replacing it with a project ID is invalid. + * name: 'projects/my-project/serviceAccounts/my-serviceAccount', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "audience": "my_audience", + * // "delegates": [], + * // "includeEmail": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "token": "my_token" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iamcredentials.projects.serviceAccounts.generateIdToken * @memberOf! () * @@ -381,6 +490,59 @@ export namespace iamcredentials_v1 { /** * iamcredentials.projects.serviceAccounts.signBlob * @desc Signs a blob using a service account's system-managed private key. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iamcredentials.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 iamcredentials = google.iamcredentials('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/cloud-platform'], + * }); + * + * // 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 iamcredentials.projects.serviceAccounts.signBlob({ + * // Required. The resource name of the service account for which the credentials + * // are requested, in the following format: + * // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + * // character is required; replacing it with a project ID is invalid. + * name: 'projects/my-project/serviceAccounts/my-serviceAccount', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "delegates": [], + * // "payload": "my_payload" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "keyId": "my_keyId", + * // "signedBlob": "my_signedBlob" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iamcredentials.projects.serviceAccounts.signBlob * @memberOf! () * @@ -457,6 +619,59 @@ export namespace iamcredentials_v1 { /** * iamcredentials.projects.serviceAccounts.signJwt * @desc Signs a JWT using a service account's system-managed private key. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iamcredentials.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 iamcredentials = google.iamcredentials('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/cloud-platform'], + * }); + * + * // 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 iamcredentials.projects.serviceAccounts.signJwt({ + * // Required. The resource name of the service account for which the credentials + * // are requested, in the following format: + * // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + * // character is required; replacing it with a project ID is invalid. + * name: 'projects/my-project/serviceAccounts/my-serviceAccount', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "delegates": [], + * // "payload": "my_payload" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "keyId": "my_keyId", + * // "signedJwt": "my_signedJwt" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iamcredentials.projects.serviceAccounts.signJwt * @memberOf! () * diff --git a/src/apis/iap/v1.ts b/src/apis/iap/v1.ts index 21b2c9d682b..2c3ee038da2 100644 --- a/src/apis/iap/v1.ts +++ b/src/apis/iap/v1.ts @@ -460,6 +460,61 @@ export namespace iap_v1 { /** * iap.projects.brands.create * @desc Constructs a new OAuth brand for the project if one does not exist. The created brand is "internal only", meaning that OAuth clients created under it only accept requests from users who belong to the same G Suite organization as the project. The brand is created in an un-reviewed status. NOTE: The "internal only" status can be manually changed in the Google Cloud console. Requires that a brand does not already exist for the project, and that the specified support email is owned by the caller. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iap.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 iap = google.iap('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/cloud-platform'], + * }); + * + * // 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 iap.projects.brands.create({ + * // Required. GCP Project number/id under which the brand is to be created. + * // In the following format: projects/{project_number/id}. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "applicationTitle": "my_applicationTitle", + * // "name": "my_name", + * // "orgInternalOnly": false, + * // "supportEmail": "my_supportEmail" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applicationTitle": "my_applicationTitle", + * // "name": "my_name", + * // "orgInternalOnly": false, + * // "supportEmail": "my_supportEmail" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iap.projects.brands.create * @memberOf! () * @@ -533,6 +588,50 @@ export namespace iap_v1 { /** * iap.projects.brands.get * @desc Retrieves the OAuth brand of the project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iap.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 iap = google.iap('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/cloud-platform'], + * }); + * + * // 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 iap.projects.brands.get({ + * // Required. Name of the brand to be fetched. + * // In the following format: projects/{project_number/id}/brands/{brand}. + * name: 'projects/my-project/brands/my-brand', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applicationTitle": "my_applicationTitle", + * // "name": "my_name", + * // "orgInternalOnly": false, + * // "supportEmail": "my_supportEmail" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iap.projects.brands.get * @memberOf! () * @@ -602,6 +701,47 @@ export namespace iap_v1 { /** * iap.projects.brands.list * @desc Lists the existing brands for the project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iap.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 iap = google.iap('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/cloud-platform'], + * }); + * + * // 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 iap.projects.brands.list({ + * // Required. GCP Project number/id. + * // In the following format: projects/{project_number/id}. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "brands": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iap.projects.brands.list * @memberOf! () * @@ -725,6 +865,61 @@ export namespace iap_v1 { /** * iap.projects.brands.identityAwareProxyClients.create * @desc Creates an Identity Aware Proxy (IAP) OAuth client. The client is owned by IAP. Requires that the brand for the project exists and that it is set for internal-only use. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iap.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 iap = google.iap('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/cloud-platform'], + * }); + * + * // 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 iap.projects.brands.identityAwareProxyClients.create({ + * // Required. Path to create the client in. + * // In the following format: + * // projects/{project_number/id}/brands/{brand}. + * // The project must belong to a GSuite account. + * parent: 'projects/my-project/brands/my-brand', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "secret": "my_secret" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "secret": "my_secret" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iap.projects.brands.identityAwareProxyClients.create * @memberOf! () * @@ -804,6 +999,47 @@ export namespace iap_v1 { /** * iap.projects.brands.identityAwareProxyClients.delete * @desc Deletes an Identity Aware Proxy (IAP) OAuth client. Useful for removing obsolete clients, managing the number of clients in a given project, and cleaning up after tests. Requires that the client is owned by IAP. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iap.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 iap = google.iap('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/cloud-platform'], + * }); + * + * // 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 iap.projects.brands.identityAwareProxyClients.delete({ + * // Required. Name of the Identity Aware Proxy client to be deleted. + * // In the following format: + * // projects/{project_number/id}/brands/{brand}/identityAwareProxyClients/{client_id}. + * name: + * 'projects/my-project/brands/my-brand/identityAwareProxyClients/my-identityAwareProxyClient', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iap.projects.brands.identityAwareProxyClients.delete * @memberOf! () * @@ -873,6 +1109,51 @@ export namespace iap_v1 { /** * iap.projects.brands.identityAwareProxyClients.get * @desc Retrieves an Identity Aware Proxy (IAP) OAuth client. Requires that the client is owned by IAP. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iap.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 iap = google.iap('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/cloud-platform'], + * }); + * + * // 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 iap.projects.brands.identityAwareProxyClients.get({ + * // Required. Name of the Identity Aware Proxy client to be fetched. + * // In the following format: + * // projects/{project_number/id}/brands/{brand}/identityAwareProxyClients/{client_id}. + * name: + * 'projects/my-project/brands/my-brand/identityAwareProxyClients/my-identityAwareProxyClient', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "secret": "my_secret" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iap.projects.brands.identityAwareProxyClients.get * @memberOf! () * @@ -946,6 +1227,60 @@ export namespace iap_v1 { /** * iap.projects.brands.identityAwareProxyClients.list * @desc Lists the existing clients for the brand. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iap.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 iap = google.iap('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/cloud-platform'], + * }); + * + * // 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 iap.projects.brands.identityAwareProxyClients.list({ + * // The maximum number of clients to return. The service may return fewer than + * // this value. + * // If unspecified, at most 100 clients will be returned. + * // The maximum value is 1000; values above 1000 will be coerced to 1000. + * pageSize: 'placeholder-value', + * // A page token, received from a previous `ListIdentityAwareProxyClients` + * // call. Provide this to retrieve the subsequent page. + * // + * // When paginating, all other parameters provided to + * // `ListIdentityAwareProxyClients` must match the call that provided the page + * // token. + * pageToken: 'placeholder-value', + * // Required. Full brand path. + * // In the following format: projects/{project_number/id}/brands/{brand}. + * parent: 'projects/my-project/brands/my-brand', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "identityAwareProxyClients": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iap.projects.brands.identityAwareProxyClients.list * @memberOf! () * @@ -1039,6 +1374,57 @@ export namespace iap_v1 { /** * iap.projects.brands.identityAwareProxyClients.resetSecret * @desc Resets an Identity Aware Proxy (IAP) OAuth client secret. Useful if the secret was compromised. Requires that the client is owned by IAP. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iap.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 iap = google.iap('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/cloud-platform'], + * }); + * + * // 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 iap.projects.brands.identityAwareProxyClients.resetSecret({ + * // Required. Name of the Identity Aware Proxy client to that will have its + * // secret reset. In the following format: + * // projects/{project_number/id}/brands/{brand}/identityAwareProxyClients/{client_id}. + * name: + * 'projects/my-project/brands/my-brand/identityAwareProxyClients/my-identityAwareProxyClient', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "secret": "my_secret" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iap.projects.brands.identityAwareProxyClients.resetSecret * @memberOf! () * @@ -1204,6 +1590,57 @@ export namespace iap_v1 { /** * iap.getIamPolicy * @desc Gets the access control policy for an Identity-Aware Proxy protected resource. More information about managing access via IAP can be found at: https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iap.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 iap = google.iap('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/cloud-platform'], + * }); + * + * // 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 iap.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: '.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iap.getIamPolicy * @memberOf! () * @@ -1276,6 +1713,50 @@ export namespace iap_v1 { /** * iap.getIapSettings * @desc Gets the IAP settings on a particular IAP protected resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iap.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 iap = google.iap('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/cloud-platform'], + * }); + * + * // 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 iap.getIapSettings({ + * // Required. The resource name for which to retrieve the settings. + * // Authorization: Requires the `getSettings` permission for the associated + * // resource. + * name: '.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accessSettings": {}, + * // "applicationSettings": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iap.getIapSettings * @memberOf! () * @@ -1350,6 +1831,57 @@ export namespace iap_v1 { /** * iap.setIamPolicy * @desc Sets the access control policy for an Identity-Aware Proxy protected resource. Replaces any existing policy. More information about managing access via IAP can be found at: https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iap.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 iap = google.iap('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/cloud-platform'], + * }); + * + * // 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 iap.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: '.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iap.setIamPolicy * @memberOf! () * @@ -1422,6 +1954,55 @@ export namespace iap_v1 { /** * iap.testIamPermissions * @desc Returns permissions that a caller has on the Identity-Aware Proxy protected resource. More information about managing access via IAP can be found at: https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iap.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 iap = google.iap('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/cloud-platform'], + * }); + * + * // 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 iap.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: '.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iap.testIamPermissions * @memberOf! () * @@ -1504,6 +2085,62 @@ export namespace iap_v1 { /** * iap.updateIapSettings * @desc Updates the IAP settings on a particular IAP protected resource. It replaces all fields unless the `update_mask` is set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iap.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 iap = google.iap('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/cloud-platform'], + * }); + * + * // 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 iap.updateIapSettings({ + * // Required. The resource name of the IAP protected resource. + * name: '.*', + * // The field mask specifying which IAP settings should be updated. + * // If omitted, the all of the settings are updated. See + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accessSettings": {}, + * // "applicationSettings": {}, + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accessSettings": {}, + * // "applicationSettings": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iap.updateIapSettings * @memberOf! () * diff --git a/src/apis/iap/v1beta1.ts b/src/apis/iap/v1beta1.ts index 41a98f23f35..8c8bf51c01c 100644 --- a/src/apis/iap/v1beta1.ts +++ b/src/apis/iap/v1beta1.ts @@ -223,6 +223,57 @@ export namespace iap_v1beta1 { /** * iap.getIamPolicy * @desc Gets the access control policy for an Identity-Aware Proxy protected resource. More information about managing access via IAP can be found at: https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iap.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 iap = google.iap('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 iap.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: '.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iap.getIamPolicy * @memberOf! () * @@ -296,6 +347,57 @@ export namespace iap_v1beta1 { /** * iap.setIamPolicy * @desc Sets the access control policy for an Identity-Aware Proxy protected resource. Replaces any existing policy. More information about managing access via IAP can be found at: https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iap.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 iap = google.iap('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 iap.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: '.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iap.setIamPolicy * @memberOf! () * @@ -369,6 +471,55 @@ export namespace iap_v1beta1 { /** * iap.testIamPermissions * @desc Returns permissions that a caller has on the Identity-Aware Proxy protected resource. If the resource does not exist or the caller does not have Identity-Aware Proxy permissions a [google.rpc.Code.PERMISSION_DENIED] will be returned. More information about managing access via IAP can be found at: https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/iap.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 iap = google.iap('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 iap.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: '.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias iap.testIamPermissions * @memberOf! () * diff --git a/src/apis/identitytoolkit/v3.ts b/src/apis/identitytoolkit/v3.ts index 306045853a3..41b37160b95 100644 --- a/src/apis/identitytoolkit/v3.ts +++ b/src/apis/identitytoolkit/v3.ts @@ -1532,6 +1532,74 @@ export namespace identitytoolkit_v3 { /** * identitytoolkit.relyingparty.createAuthUri * @desc Creates the URI used by the IdP to authenticate the user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/identitytoolkit.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 identitytoolkit = google.identitytoolkit('v3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 identitytoolkit.relyingparty.createAuthUri({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appId": "my_appId", + * // "authFlowType": "my_authFlowType", + * // "clientId": "my_clientId", + * // "context": "my_context", + * // "continueUri": "my_continueUri", + * // "customParameter": {}, + * // "hostedDomain": "my_hostedDomain", + * // "identifier": "my_identifier", + * // "oauthConsumerKey": "my_oauthConsumerKey", + * // "oauthScope": "my_oauthScope", + * // "openidRealm": "my_openidRealm", + * // "otaApp": "my_otaApp", + * // "providerId": "my_providerId", + * // "sessionId": "my_sessionId", + * // "tenantId": "my_tenantId", + * // "tenantProjectNumber": "my_tenantProjectNumber" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "allProviders": [], + * // "authUri": "my_authUri", + * // "captchaRequired": false, + * // "forExistingProvider": false, + * // "kind": "my_kind", + * // "providerId": "my_providerId", + * // "registered": false, + * // "sessionId": "my_sessionId", + * // "signinMethods": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias identitytoolkit.relyingparty.createAuthUri * @memberOf! () * @@ -1609,6 +1677,53 @@ export namespace identitytoolkit_v3 { /** * identitytoolkit.relyingparty.deleteAccount * @desc Delete user account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/identitytoolkit.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 identitytoolkit = google.identitytoolkit('v3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 identitytoolkit.relyingparty.deleteAccount({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "delegatedProjectNumber": "my_delegatedProjectNumber", + * // "idToken": "my_idToken", + * // "localId": "my_localId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias identitytoolkit.relyingparty.deleteAccount * @memberOf! () * @@ -1686,6 +1801,59 @@ export namespace identitytoolkit_v3 { /** * identitytoolkit.relyingparty.downloadAccount * @desc Batch download user accounts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/identitytoolkit.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 identitytoolkit = google.identitytoolkit('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 identitytoolkit.relyingparty.downloadAccount({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "delegatedProjectNumber": "my_delegatedProjectNumber", + * // "maxResults": 0, + * // "nextPageToken": "my_nextPageToken", + * // "targetProjectId": "my_targetProjectId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "users": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias identitytoolkit.relyingparty.downloadAccount * @memberOf! () * @@ -1763,6 +1931,59 @@ export namespace identitytoolkit_v3 { /** * identitytoolkit.relyingparty.emailLinkSignin * @desc Reset password for a user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/identitytoolkit.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 identitytoolkit = google.identitytoolkit('v3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 identitytoolkit.relyingparty.emailLinkSignin({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "email": "my_email", + * // "idToken": "my_idToken", + * // "oobCode": "my_oobCode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "email": "my_email", + * // "expiresIn": "my_expiresIn", + * // "idToken": "my_idToken", + * // "isNewUser": false, + * // "kind": "my_kind", + * // "localId": "my_localId", + * // "refreshToken": "my_refreshToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias identitytoolkit.relyingparty.emailLinkSignin * @memberOf! () * @@ -1840,6 +2061,56 @@ export namespace identitytoolkit_v3 { /** * identitytoolkit.relyingparty.getAccountInfo * @desc Returns the account info. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/identitytoolkit.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 identitytoolkit = google.identitytoolkit('v3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 identitytoolkit.relyingparty.getAccountInfo({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "delegatedProjectNumber": "my_delegatedProjectNumber", + * // "email": [], + * // "idToken": "my_idToken", + * // "localId": [], + * // "phoneNumber": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "users": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias identitytoolkit.relyingparty.getAccountInfo * @memberOf! () * @@ -1917,6 +2188,67 @@ export namespace identitytoolkit_v3 { /** * identitytoolkit.relyingparty.getOobConfirmationCode * @desc Get a code for user action confirmation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/identitytoolkit.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 identitytoolkit = google.identitytoolkit('v3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 identitytoolkit.relyingparty.getOobConfirmationCode({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "androidInstallApp": false, + * // "androidMinimumVersion": "my_androidMinimumVersion", + * // "androidPackageName": "my_androidPackageName", + * // "canHandleCodeInApp": false, + * // "captchaResp": "my_captchaResp", + * // "challenge": "my_challenge", + * // "continueUrl": "my_continueUrl", + * // "email": "my_email", + * // "iOSAppStoreId": "my_iOSAppStoreId", + * // "iOSBundleId": "my_iOSBundleId", + * // "idToken": "my_idToken", + * // "kind": "my_kind", + * // "newEmail": "my_newEmail", + * // "requestType": "my_requestType", + * // "userIp": "my_userIp" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "email": "my_email", + * // "kind": "my_kind", + * // "oobCode": "my_oobCode" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias identitytoolkit.relyingparty.getOobConfirmationCode * @memberOf! () * @@ -2000,6 +2332,59 @@ export namespace identitytoolkit_v3 { /** * identitytoolkit.relyingparty.getProjectConfig * @desc Get project configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/identitytoolkit.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 identitytoolkit = google.identitytoolkit('v3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 identitytoolkit.relyingparty.getProjectConfig({ + * // Delegated GCP project number of the request. + * delegatedProjectNumber: 'placeholder-value', + * // GCP project number of the request. + * projectNumber: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "allowPasswordUser": false, + * // "apiKey": "my_apiKey", + * // "authorizedDomains": [], + * // "changeEmailTemplate": {}, + * // "dynamicLinksDomain": "my_dynamicLinksDomain", + * // "enableAnonymousUser": false, + * // "idpConfig": [], + * // "legacyResetPasswordTemplate": {}, + * // "projectId": "my_projectId", + * // "resetPasswordTemplate": {}, + * // "useEmailSending": false, + * // "verifyEmailTemplate": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias identitytoolkit.relyingparty.getProjectConfig * @memberOf! () * @@ -2100,6 +2485,41 @@ export namespace identitytoolkit_v3 { /** * identitytoolkit.relyingparty.getPublicKeys * @desc Get token signing public key. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/identitytoolkit.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 identitytoolkit = google.identitytoolkit('v3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 identitytoolkit.relyingparty.getPublicKeys({}); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias identitytoolkit.relyingparty.getPublicKeys * @memberOf! () * @@ -2196,6 +2616,45 @@ export namespace identitytoolkit_v3 { /** * identitytoolkit.relyingparty.getRecaptchaParam * @desc Get recaptcha secure param. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/identitytoolkit.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 identitytoolkit = google.identitytoolkit('v3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 identitytoolkit.relyingparty.getRecaptchaParam({}); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "recaptchaSiteKey": "my_recaptchaSiteKey", + * // "recaptchaStoken": "my_recaptchaStoken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias identitytoolkit.relyingparty.getRecaptchaParam * @memberOf! () * @@ -2275,6 +2734,57 @@ export namespace identitytoolkit_v3 { /** * identitytoolkit.relyingparty.resetPassword * @desc Reset password for a user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/identitytoolkit.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 identitytoolkit = google.identitytoolkit('v3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 identitytoolkit.relyingparty.resetPassword({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "email": "my_email", + * // "newPassword": "my_newPassword", + * // "oldPassword": "my_oldPassword", + * // "oobCode": "my_oobCode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "email": "my_email", + * // "kind": "my_kind", + * // "newEmail": "my_newEmail", + * // "requestType": "my_requestType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias identitytoolkit.relyingparty.resetPassword * @memberOf! () * @@ -2352,6 +2862,54 @@ export namespace identitytoolkit_v3 { /** * identitytoolkit.relyingparty.sendVerificationCode * @desc Send SMS verification code. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/identitytoolkit.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 identitytoolkit = google.identitytoolkit('v3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 identitytoolkit.relyingparty.sendVerificationCode({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "iosReceipt": "my_iosReceipt", + * // "iosSecret": "my_iosSecret", + * // "phoneNumber": "my_phoneNumber", + * // "recaptchaToken": "my_recaptchaToken" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "sessionInfo": "my_sessionInfo" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias identitytoolkit.relyingparty.sendVerificationCode * @memberOf! () * @@ -2451,6 +3009,84 @@ export namespace identitytoolkit_v3 { /** * identitytoolkit.relyingparty.setAccountInfo * @desc Set account info for a user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/identitytoolkit.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 identitytoolkit = google.identitytoolkit('v3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 identitytoolkit.relyingparty.setAccountInfo({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "captchaChallenge": "my_captchaChallenge", + * // "captchaResponse": "my_captchaResponse", + * // "createdAt": "my_createdAt", + * // "customAttributes": "my_customAttributes", + * // "delegatedProjectNumber": "my_delegatedProjectNumber", + * // "deleteAttribute": [], + * // "deleteProvider": [], + * // "disableUser": false, + * // "displayName": "my_displayName", + * // "email": "my_email", + * // "emailVerified": false, + * // "idToken": "my_idToken", + * // "instanceId": "my_instanceId", + * // "lastLoginAt": "my_lastLoginAt", + * // "localId": "my_localId", + * // "oobCode": "my_oobCode", + * // "password": "my_password", + * // "phoneNumber": "my_phoneNumber", + * // "photoUrl": "my_photoUrl", + * // "provider": [], + * // "returnSecureToken": false, + * // "upgradeToFederatedLogin": false, + * // "validSince": "my_validSince" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "email": "my_email", + * // "emailVerified": false, + * // "expiresIn": "my_expiresIn", + * // "idToken": "my_idToken", + * // "kind": "my_kind", + * // "localId": "my_localId", + * // "newEmail": "my_newEmail", + * // "passwordHash": "my_passwordHash", + * // "photoUrl": "my_photoUrl", + * // "providerUserInfo": [], + * // "refreshToken": "my_refreshToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias identitytoolkit.relyingparty.setAccountInfo * @memberOf! () * @@ -2528,6 +3164,61 @@ export namespace identitytoolkit_v3 { /** * identitytoolkit.relyingparty.setProjectConfig * @desc Set project configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/identitytoolkit.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 identitytoolkit = google.identitytoolkit('v3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 identitytoolkit.relyingparty.setProjectConfig({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "allowPasswordUser": false, + * // "apiKey": "my_apiKey", + * // "authorizedDomains": [], + * // "changeEmailTemplate": {}, + * // "delegatedProjectNumber": "my_delegatedProjectNumber", + * // "enableAnonymousUser": false, + * // "idpConfig": [], + * // "legacyResetPasswordTemplate": {}, + * // "resetPasswordTemplate": {}, + * // "useEmailSending": false, + * // "verifyEmailTemplate": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "projectId": "my_projectId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias identitytoolkit.relyingparty.setProjectConfig * @memberOf! () * @@ -2627,6 +3318,52 @@ export namespace identitytoolkit_v3 { /** * identitytoolkit.relyingparty.signOutUser * @desc Sign out user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/identitytoolkit.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 identitytoolkit = google.identitytoolkit('v3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 identitytoolkit.relyingparty.signOutUser({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instanceId": "my_instanceId", + * // "localId": "my_localId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "localId": "my_localId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias identitytoolkit.relyingparty.signOutUser * @memberOf! () * @@ -2725,6 +3462,70 @@ export namespace identitytoolkit_v3 { /** * identitytoolkit.relyingparty.signupNewUser * @desc Signup new user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/identitytoolkit.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 identitytoolkit = google.identitytoolkit('v3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 identitytoolkit.relyingparty.signupNewUser({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "captchaChallenge": "my_captchaChallenge", + * // "captchaResponse": "my_captchaResponse", + * // "disabled": false, + * // "displayName": "my_displayName", + * // "email": "my_email", + * // "emailVerified": false, + * // "idToken": "my_idToken", + * // "instanceId": "my_instanceId", + * // "localId": "my_localId", + * // "password": "my_password", + * // "phoneNumber": "my_phoneNumber", + * // "photoUrl": "my_photoUrl", + * // "tenantId": "my_tenantId", + * // "tenantProjectNumber": "my_tenantProjectNumber" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "email": "my_email", + * // "expiresIn": "my_expiresIn", + * // "idToken": "my_idToken", + * // "kind": "my_kind", + * // "localId": "my_localId", + * // "refreshToken": "my_refreshToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias identitytoolkit.relyingparty.signupNewUser * @memberOf! () * @@ -2802,6 +3603,68 @@ export namespace identitytoolkit_v3 { /** * identitytoolkit.relyingparty.uploadAccount * @desc Batch upload existing user accounts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/identitytoolkit.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 identitytoolkit = google.identitytoolkit('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/firebase', + * ], + * }); + * + * // 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 identitytoolkit.relyingparty.uploadAccount({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "allowOverwrite": false, + * // "blockSize": 0, + * // "cpuMemCost": 0, + * // "delegatedProjectNumber": "my_delegatedProjectNumber", + * // "dkLen": 0, + * // "hashAlgorithm": "my_hashAlgorithm", + * // "memoryCost": 0, + * // "parallelization": 0, + * // "rounds": 0, + * // "saltSeparator": "my_saltSeparator", + * // "sanityCheck": false, + * // "signerKey": "my_signerKey", + * // "targetProjectId": "my_targetProjectId", + * // "users": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "error": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias identitytoolkit.relyingparty.uploadAccount * @memberOf! () * @@ -2879,6 +3742,101 @@ export namespace identitytoolkit_v3 { /** * identitytoolkit.relyingparty.verifyAssertion * @desc Verifies the assertion returned by the IdP. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/identitytoolkit.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 identitytoolkit = google.identitytoolkit('v3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 identitytoolkit.relyingparty.verifyAssertion({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "autoCreate": false, + * // "delegatedProjectNumber": "my_delegatedProjectNumber", + * // "idToken": "my_idToken", + * // "instanceId": "my_instanceId", + * // "pendingIdToken": "my_pendingIdToken", + * // "postBody": "my_postBody", + * // "requestUri": "my_requestUri", + * // "returnIdpCredential": false, + * // "returnRefreshToken": false, + * // "returnSecureToken": false, + * // "sessionId": "my_sessionId", + * // "tenantId": "my_tenantId", + * // "tenantProjectNumber": "my_tenantProjectNumber" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "action": "my_action", + * // "appInstallationUrl": "my_appInstallationUrl", + * // "appScheme": "my_appScheme", + * // "context": "my_context", + * // "dateOfBirth": "my_dateOfBirth", + * // "displayName": "my_displayName", + * // "email": "my_email", + * // "emailRecycled": false, + * // "emailVerified": false, + * // "errorMessage": "my_errorMessage", + * // "expiresIn": "my_expiresIn", + * // "federatedId": "my_federatedId", + * // "firstName": "my_firstName", + * // "fullName": "my_fullName", + * // "idToken": "my_idToken", + * // "inputEmail": "my_inputEmail", + * // "isNewUser": false, + * // "kind": "my_kind", + * // "language": "my_language", + * // "lastName": "my_lastName", + * // "localId": "my_localId", + * // "needConfirmation": false, + * // "needEmail": false, + * // "nickName": "my_nickName", + * // "oauthAccessToken": "my_oauthAccessToken", + * // "oauthAuthorizationCode": "my_oauthAuthorizationCode", + * // "oauthExpireIn": 0, + * // "oauthIdToken": "my_oauthIdToken", + * // "oauthRequestToken": "my_oauthRequestToken", + * // "oauthScope": "my_oauthScope", + * // "oauthTokenSecret": "my_oauthTokenSecret", + * // "originalEmail": "my_originalEmail", + * // "photoUrl": "my_photoUrl", + * // "providerId": "my_providerId", + * // "rawUserInfo": "my_rawUserInfo", + * // "refreshToken": "my_refreshToken", + * // "screenName": "my_screenName", + * // "timeZone": "my_timeZone", + * // "verifiedProvider": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias identitytoolkit.relyingparty.verifyAssertion * @memberOf! () * @@ -2956,6 +3914,58 @@ export namespace identitytoolkit_v3 { /** * identitytoolkit.relyingparty.verifyCustomToken * @desc Verifies the developer asserted ID token. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/identitytoolkit.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 identitytoolkit = google.identitytoolkit('v3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 identitytoolkit.relyingparty.verifyCustomToken({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "delegatedProjectNumber": "my_delegatedProjectNumber", + * // "instanceId": "my_instanceId", + * // "returnSecureToken": false, + * // "token": "my_token" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "expiresIn": "my_expiresIn", + * // "idToken": "my_idToken", + * // "isNewUser": false, + * // "kind": "my_kind", + * // "refreshToken": "my_refreshToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias identitytoolkit.relyingparty.verifyCustomToken * @memberOf! () * @@ -3036,6 +4046,72 @@ export namespace identitytoolkit_v3 { /** * identitytoolkit.relyingparty.verifyPassword * @desc Verifies the user entered password. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/identitytoolkit.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 identitytoolkit = google.identitytoolkit('v3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 identitytoolkit.relyingparty.verifyPassword({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "captchaChallenge": "my_captchaChallenge", + * // "captchaResponse": "my_captchaResponse", + * // "delegatedProjectNumber": "my_delegatedProjectNumber", + * // "email": "my_email", + * // "idToken": "my_idToken", + * // "instanceId": "my_instanceId", + * // "password": "my_password", + * // "pendingIdToken": "my_pendingIdToken", + * // "returnSecureToken": false, + * // "tenantId": "my_tenantId", + * // "tenantProjectNumber": "my_tenantProjectNumber" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "email": "my_email", + * // "expiresIn": "my_expiresIn", + * // "idToken": "my_idToken", + * // "kind": "my_kind", + * // "localId": "my_localId", + * // "oauthAccessToken": "my_oauthAccessToken", + * // "oauthAuthorizationCode": "my_oauthAuthorizationCode", + * // "oauthExpireIn": 0, + * // "photoUrl": "my_photoUrl", + * // "refreshToken": "my_refreshToken", + * // "registered": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias identitytoolkit.relyingparty.verifyPassword * @memberOf! () * @@ -3113,6 +4189,66 @@ export namespace identitytoolkit_v3 { /** * identitytoolkit.relyingparty.verifyPhoneNumber * @desc Verifies ownership of a phone number and creates/updates the user account accordingly. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/identitytoolkit.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 identitytoolkit = google.identitytoolkit('v3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 identitytoolkit.relyingparty.verifyPhoneNumber({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "code": "my_code", + * // "idToken": "my_idToken", + * // "operation": "my_operation", + * // "phoneNumber": "my_phoneNumber", + * // "sessionInfo": "my_sessionInfo", + * // "temporaryProof": "my_temporaryProof", + * // "verificationProof": "my_verificationProof" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "expiresIn": "my_expiresIn", + * // "idToken": "my_idToken", + * // "isNewUser": false, + * // "localId": "my_localId", + * // "phoneNumber": "my_phoneNumber", + * // "refreshToken": "my_refreshToken", + * // "temporaryProof": "my_temporaryProof", + * // "temporaryProofExpiresIn": "my_temporaryProofExpiresIn", + * // "verificationProof": "my_verificationProof", + * // "verificationProofExpiresIn": "my_verificationProofExpiresIn" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias identitytoolkit.relyingparty.verifyPhoneNumber * @memberOf! () * diff --git a/src/apis/indexing/v3.ts b/src/apis/indexing/v3.ts index 361989d5c7c..a50c1d29610 100644 --- a/src/apis/indexing/v3.ts +++ b/src/apis/indexing/v3.ts @@ -166,6 +166,48 @@ export namespace indexing_v3 { /** * indexing.urlNotifications.getMetadata * @desc Gets metadata about a Web Document. This method can _only_ be used to query URLs that were previously seen in successful Indexing API notifications. Includes the latest `UrlNotification` received via this API. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/indexing.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 indexing = google.indexing('v3'); + * + * 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/indexing'], + * }); + * + * // 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 indexing.urlNotifications.getMetadata({ + * // URL that is being queried. + * url: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "latestRemove": {}, + * // "latestUpdate": {}, + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias indexing.urlNotifications.getMetadata * @memberOf! () * @@ -244,6 +286,53 @@ export namespace indexing_v3 { /** * indexing.urlNotifications.publish * @desc Notifies that a URL has been updated or deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/indexing.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 indexing = google.indexing('v3'); + * + * 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/indexing'], + * }); + * + * // 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 indexing.urlNotifications.publish({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "notifyTime": "my_notifyTime", + * // "type": "my_type", + * // "url": "my_url" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "urlNotificationMetadata": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias indexing.urlNotifications.publish * @memberOf! () * diff --git a/src/apis/jobs/v2.ts b/src/apis/jobs/v2.ts index 4965f2bbbb9..ba4b91c835b 100644 --- a/src/apis/jobs/v2.ts +++ b/src/apis/jobs/v2.ts @@ -1584,6 +1584,88 @@ export namespace jobs_v2 { /** * jobs.companies.create * @desc Creates a new company entity. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.companies.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "careerPageLink": "my_careerPageLink", + * // "companyInfoSources": [], + * // "companySize": "my_companySize", + * // "disableLocationOptimization": false, + * // "displayName": "my_displayName", + * // "distributorBillingCompanyId": "my_distributorBillingCompanyId", + * // "distributorCompanyId": "my_distributorCompanyId", + * // "eeoText": "my_eeoText", + * // "hiringAgency": false, + * // "hqLocation": "my_hqLocation", + * // "imageUrl": "my_imageUrl", + * // "keywordSearchableCustomAttributes": [], + * // "keywordSearchableCustomFields": [], + * // "name": "my_name", + * // "structuredCompanyHqLocation": {}, + * // "suspended": false, + * // "title": "my_title", + * // "website": "my_website" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "careerPageLink": "my_careerPageLink", + * // "companyInfoSources": [], + * // "companySize": "my_companySize", + * // "disableLocationOptimization": false, + * // "displayName": "my_displayName", + * // "distributorBillingCompanyId": "my_distributorBillingCompanyId", + * // "distributorCompanyId": "my_distributorCompanyId", + * // "eeoText": "my_eeoText", + * // "hiringAgency": false, + * // "hqLocation": "my_hqLocation", + * // "imageUrl": "my_imageUrl", + * // "keywordSearchableCustomAttributes": [], + * // "keywordSearchableCustomFields": [], + * // "name": "my_name", + * // "structuredCompanyHqLocation": {}, + * // "suspended": false, + * // "title": "my_title", + * // "website": "my_website" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.companies.create * @memberOf! () * @@ -1652,6 +1734,48 @@ export namespace jobs_v2 { /** * jobs.companies.delete * @desc Deletes the specified company. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.companies.delete({ + * // Required. The resource name of the company to be deleted, + * // such as, "companies/0000aaaa-1111-bbbb-2222-cccc3333dddd". + * name: 'companies/my-companie', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.companies.delete * @memberOf! () * @@ -1720,6 +1844,67 @@ export namespace jobs_v2 { /** * jobs.companies.get * @desc Retrieves the specified company. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.companies.get({ + * // Required. Resource name of the company to retrieve, + * // such as "companies/0000aaaa-1111-bbbb-2222-cccc3333dddd". + * name: 'companies/my-companie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "careerPageLink": "my_careerPageLink", + * // "companyInfoSources": [], + * // "companySize": "my_companySize", + * // "disableLocationOptimization": false, + * // "displayName": "my_displayName", + * // "distributorBillingCompanyId": "my_distributorBillingCompanyId", + * // "distributorCompanyId": "my_distributorCompanyId", + * // "eeoText": "my_eeoText", + * // "hiringAgency": false, + * // "hqLocation": "my_hqLocation", + * // "imageUrl": "my_imageUrl", + * // "keywordSearchableCustomAttributes": [], + * // "keywordSearchableCustomFields": [], + * // "name": "my_name", + * // "structuredCompanyHqLocation": {}, + * // "suspended": false, + * // "title": "my_title", + * // "website": "my_website" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.companies.get * @memberOf! () * @@ -1788,6 +1973,61 @@ export namespace jobs_v2 { /** * jobs.companies.list * @desc Lists all companies associated with a Cloud Talent Solution account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.companies.list({ + * // Optional. Set to true if the companies request must have open jobs. + * // + * // Defaults to false. + * // + * // If true, at most page_size of companies are fetched, among which + * // only those with open jobs are returned. + * mustHaveOpenJobs: 'placeholder-value', + * // Optional. The maximum number of companies to be returned, at most 100. + * // Default is 100 if a non-positive number is provided. + * pageSize: 'placeholder-value', + * // Optional. The starting indicator from which to return results. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "companies": [], + * // "metadata": {}, + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.companies.list * @memberOf! () * @@ -1862,6 +2102,117 @@ export namespace jobs_v2 { /** * jobs.companies.patch * @desc Updates the specified company. Company names can't be updated. To update a company name, delete the company and all jobs associated with it, and only then re-create them. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.companies.patch({ + * // Required during company update. + * // + * // The resource name for a company. This is generated by the service when a + * // company is created, for example, + * // "companies/0000aaaa-1111-bbbb-2222-cccc3333dddd". + * name: 'companies/my-companie', + * // Optional but strongly recommended to be provided for the best service + * // experience. + * // + * // If update_company_fields is provided, only the specified fields in + * // company are updated. Otherwise all the fields are updated. + * // + * // A field mask to specify the company fields to update. Valid values are: + * // + * // * displayName + * // * website + * // * imageUrl + * // * companySize + * // * distributorBillingCompanyId + * // * companyInfoSources + * // * careerPageLink + * // * hiringAgency + * // * hqLocation + * // * eeoText + * // * keywordSearchableCustomAttributes + * // * title (deprecated) + * // * keywordSearchableCustomFields (deprecated) + * updateCompanyFields: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "careerPageLink": "my_careerPageLink", + * // "companyInfoSources": [], + * // "companySize": "my_companySize", + * // "disableLocationOptimization": false, + * // "displayName": "my_displayName", + * // "distributorBillingCompanyId": "my_distributorBillingCompanyId", + * // "distributorCompanyId": "my_distributorCompanyId", + * // "eeoText": "my_eeoText", + * // "hiringAgency": false, + * // "hqLocation": "my_hqLocation", + * // "imageUrl": "my_imageUrl", + * // "keywordSearchableCustomAttributes": [], + * // "keywordSearchableCustomFields": [], + * // "name": "my_name", + * // "structuredCompanyHqLocation": {}, + * // "suspended": false, + * // "title": "my_title", + * // "website": "my_website" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "careerPageLink": "my_careerPageLink", + * // "companyInfoSources": [], + * // "companySize": "my_companySize", + * // "disableLocationOptimization": false, + * // "displayName": "my_displayName", + * // "distributorBillingCompanyId": "my_distributorBillingCompanyId", + * // "distributorCompanyId": "my_distributorCompanyId", + * // "eeoText": "my_eeoText", + * // "hiringAgency": false, + * // "hqLocation": "my_hqLocation", + * // "imageUrl": "my_imageUrl", + * // "keywordSearchableCustomAttributes": [], + * // "keywordSearchableCustomFields": [], + * // "name": "my_name", + * // "structuredCompanyHqLocation": {}, + * // "suspended": false, + * // "title": "my_title", + * // "website": "my_website" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.companies.patch * @memberOf! () * @@ -2012,6 +2363,83 @@ export namespace jobs_v2 { /** * jobs.companies.jobs.list * @desc Deprecated. Use ListJobs instead. Lists all jobs associated with a company. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.companies.jobs.list({ + * // Required. The resource name of the company that owns the jobs to be listed, + * // such as, "companies/0000aaaa-1111-bbbb-2222-cccc3333dddd". + * companyName: 'companies/my-companie', + * // Optional. If set to `true`, only job ID, job requisition ID and language code will be + * // returned. + * // + * // A typical use is to synchronize job repositories. + * // + * // Defaults to false. + * idsOnly: 'placeholder-value', + * // Deprecated. Please DO NOT use this field except for small companies. + * // Suggest counting jobs page by page instead. + * // + * // Optional. + * // + * // Set to true if the total number of open jobs is to be returned. + * // + * // Defaults to false. + * includeJobsCount: 'placeholder-value', + * // Optional. The requisition ID, also known as posting ID, assigned by the company + * // to the job. + * // + * // The maximum number of allowable characters is 225. + * jobRequisitionId: 'placeholder-value', + * // Optional. The maximum number of jobs to be returned per page of results. + * // + * // If ids_only is set to true, the maximum allowed page size + * // is 1000. Otherwise, the maximum allowed page size is 100. + * // + * // Default is 100 if empty or a number < 1 is specified. + * pageSize: 'placeholder-value', + * // Optional. The starting point of a query result. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "jobs": [], + * // "metadata": {}, + * // "nextPageToken": "my_nextPageToken", + * // "totalSize": "my_totalSize" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.companies.jobs.list * @memberOf! () * @@ -2133,6 +2561,52 @@ export namespace jobs_v2 { /** * jobs.jobs.batchDelete * @desc Deletes a list of Job postings by filter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.jobs.batchDelete({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "filter": "my_filter" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.jobs.batchDelete * @memberOf! () * @@ -2204,6 +2678,93 @@ export namespace jobs_v2 { /** * jobs.jobs.create * @desc Creates a new job. Typically, the job becomes searchable within 10 seconds, but it may take up to 5 minutes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.jobs.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "disableStreetAddressResolution": false, + * // "job": {}, + * // "processingOptions": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applicationEmailList": [], + * // "applicationInstruction": "my_applicationInstruction", + * // "applicationUrls": [], + * // "benefits": [], + * // "companyDisplayName": "my_companyDisplayName", + * // "companyName": "my_companyName", + * // "companyTitle": "my_companyTitle", + * // "compensationInfo": {}, + * // "createTime": "my_createTime", + * // "customAttributes": {}, + * // "department": "my_department", + * // "description": "my_description", + * // "distributorCompanyId": "my_distributorCompanyId", + * // "educationLevels": [], + * // "employmentTypes": [], + * // "endDate": {}, + * // "expireTime": "my_expireTime", + * // "expiryDate": {}, + * // "extendedCompensationInfo": {}, + * // "filterableCustomFields": {}, + * // "incentives": "my_incentives", + * // "jobLocations": [], + * // "jobTitle": "my_jobTitle", + * // "languageCode": "my_languageCode", + * // "level": "my_level", + * // "locations": [], + * // "name": "my_name", + * // "promotionValue": 0, + * // "publishDate": {}, + * // "qualifications": "my_qualifications", + * // "referenceUrl": "my_referenceUrl", + * // "region": "my_region", + * // "requisitionId": "my_requisitionId", + * // "responsibilities": "my_responsibilities", + * // "startDate": {}, + * // "unindexedCustomFields": {}, + * // "updateTime": "my_updateTime", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.jobs.create * @memberOf! () * @@ -2272,6 +2833,55 @@ export namespace jobs_v2 { /** * jobs.jobs.delete * @desc Deletes the specified job. Typically, the job becomes unsearchable within 10 seconds, but it may take up to 5 minutes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.jobs.delete({ + * // Deprecated. This field is not working anymore. + * // + * // Optional. + * // + * // If set to true, this call waits for all processing steps to complete + * // before the job is cleaned up. Otherwise, the call returns while some + * // steps are still taking place asynchronously, hence faster. + * disableFastProcess: 'placeholder-value', + * // Required. The resource name of the job to be deleted, such as "jobs/11111111". + * name: 'jobs/my-job', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.jobs.delete * @memberOf! () * @@ -2341,6 +2951,53 @@ export namespace jobs_v2 { /** * jobs.jobs.deleteByFilter * @desc Deprecated. Use BatchDeleteJobs instead. Deletes the specified job by filter. You can specify whether to synchronously wait for validation, indexing, and general processing to be completed before the response is returned. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.jobs.deleteByFilter({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "disableFastProcess": false, + * // "filter": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.jobs.deleteByFilter * @memberOf! () * @@ -2413,6 +3070,86 @@ export namespace jobs_v2 { /** * jobs.jobs.get * @desc Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.jobs.get({ + * // Required. The resource name of the job to retrieve, such as "jobs/11111111". + * name: 'jobs/my-job', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applicationEmailList": [], + * // "applicationInstruction": "my_applicationInstruction", + * // "applicationUrls": [], + * // "benefits": [], + * // "companyDisplayName": "my_companyDisplayName", + * // "companyName": "my_companyName", + * // "companyTitle": "my_companyTitle", + * // "compensationInfo": {}, + * // "createTime": "my_createTime", + * // "customAttributes": {}, + * // "department": "my_department", + * // "description": "my_description", + * // "distributorCompanyId": "my_distributorCompanyId", + * // "educationLevels": [], + * // "employmentTypes": [], + * // "endDate": {}, + * // "expireTime": "my_expireTime", + * // "expiryDate": {}, + * // "extendedCompensationInfo": {}, + * // "filterableCustomFields": {}, + * // "incentives": "my_incentives", + * // "jobLocations": [], + * // "jobTitle": "my_jobTitle", + * // "languageCode": "my_languageCode", + * // "level": "my_level", + * // "locations": [], + * // "name": "my_name", + * // "promotionValue": 0, + * // "publishDate": {}, + * // "qualifications": "my_qualifications", + * // "referenceUrl": "my_referenceUrl", + * // "region": "my_region", + * // "requisitionId": "my_requisitionId", + * // "responsibilities": "my_responsibilities", + * // "startDate": {}, + * // "unindexedCustomFields": {}, + * // "updateTime": "my_updateTime", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.jobs.get * @memberOf! () * @@ -2481,6 +3218,59 @@ export namespace jobs_v2 { /** * jobs.jobs.histogram * @desc Deprecated. Use SearchJobsRequest.histogram_facets instead to make a single call with both search and histogram. Retrieves a histogram for the given GetHistogramRequest. This call provides a structured count of jobs that match against the search query, grouped by specified facets. This call constrains the visibility of jobs present in the database, and only counts jobs the caller has permission to search against. For example, use this call to generate the number of jobs in the U.S. by state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.jobs.histogram({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "allowBroadening": false, + * // "filters": {}, + * // "query": {}, + * // "requestMetadata": {}, + * // "searchTypes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "metadata": {}, + * // "results": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.jobs.histogram * @memberOf! () * @@ -2555,6 +3345,79 @@ export namespace jobs_v2 { /** * jobs.jobs.list * @desc Lists jobs by filter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.jobs.list({ + * // Required. The filter string specifies the jobs to be enumerated. + * // + * // Supported operator: =, AND + * // + * // The fields eligible for filtering are: + * // + * // * `companyName` (Required) + * // * `requisitionId` (Optional) + * // + * // Sample Query: + * // + * // * companyName = "companies/123" + * // * companyName = "companies/123" AND requisitionId = "req-1" + * filter: 'placeholder-value', + * // Optional. If set to `true`, only Job.name, Job.requisition_id and + * // Job.language_code will be returned. + * // + * // A typical use case is to synchronize job repositories. + * // + * // Defaults to false. + * idsOnly: 'placeholder-value', + * // Optional. The maximum number of jobs to be returned per page of results. + * // + * // If ids_only is set to true, the maximum allowed page size + * // is 1000. Otherwise, the maximum allowed page size is 100. + * // + * // Default is 100 if empty or a number < 1 is specified. + * pageSize: 'placeholder-value', + * // Optional. The starting point of a query result. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "jobs": [], + * // "metadata": {}, + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.jobs.list * @memberOf! () * @@ -2628,6 +3491,101 @@ export namespace jobs_v2 { /** * jobs.jobs.patch * @desc Updates specified job. Typically, updated contents become visible in search results within 10 seconds, but it may take up to 5 minutes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.jobs.patch({ + * // Required during job update. + * // + * // Resource name assigned to a job by the API, for example, "/jobs/foo". Use + * // of this field in job queries and API calls is preferred over the use of + * // requisition_id since this value is unique. + * name: 'jobs/my-job', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "disableStreetAddressResolution": false, + * // "job": {}, + * // "processingOptions": {}, + * // "updateJobFields": "my_updateJobFields" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "applicationEmailList": [], + * // "applicationInstruction": "my_applicationInstruction", + * // "applicationUrls": [], + * // "benefits": [], + * // "companyDisplayName": "my_companyDisplayName", + * // "companyName": "my_companyName", + * // "companyTitle": "my_companyTitle", + * // "compensationInfo": {}, + * // "createTime": "my_createTime", + * // "customAttributes": {}, + * // "department": "my_department", + * // "description": "my_description", + * // "distributorCompanyId": "my_distributorCompanyId", + * // "educationLevels": [], + * // "employmentTypes": [], + * // "endDate": {}, + * // "expireTime": "my_expireTime", + * // "expiryDate": {}, + * // "extendedCompensationInfo": {}, + * // "filterableCustomFields": {}, + * // "incentives": "my_incentives", + * // "jobLocations": [], + * // "jobTitle": "my_jobTitle", + * // "languageCode": "my_languageCode", + * // "level": "my_level", + * // "locations": [], + * // "name": "my_name", + * // "promotionValue": 0, + * // "publishDate": {}, + * // "qualifications": "my_qualifications", + * // "referenceUrl": "my_referenceUrl", + * // "region": "my_region", + * // "requisitionId": "my_requisitionId", + * // "responsibilities": "my_responsibilities", + * // "startDate": {}, + * // "unindexedCustomFields": {}, + * // "updateTime": "my_updateTime", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.jobs.patch * @memberOf! () * @@ -2697,6 +3655,77 @@ export namespace jobs_v2 { /** * jobs.jobs.search * @desc Searches for jobs using the provided SearchJobsRequest. This call constrains the visibility of jobs present in the database, and only returns jobs that the caller has permission to search against. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.jobs.search({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "disableRelevanceThresholding": false, + * // "enableBroadening": false, + * // "enablePreciseResultSize": false, + * // "filters": {}, + * // "histogramFacets": {}, + * // "jobView": "my_jobView", + * // "mode": "my_mode", + * // "offset": 0, + * // "orderBy": "my_orderBy", + * // "pageSize": 0, + * // "pageToken": "my_pageToken", + * // "query": {}, + * // "requestMetadata": {}, + * // "sortBy": "my_sortBy" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appliedCommuteFilter": {}, + * // "appliedJobLocationFilters": [], + * // "estimatedTotalSize": "my_estimatedTotalSize", + * // "histogramResults": {}, + * // "jobView": "my_jobView", + * // "matchingJobs": [], + * // "metadata": {}, + * // "nextPageToken": "my_nextPageToken", + * // "numJobsFromBroadenedQuery": 0, + * // "spellResult": {}, + * // "totalSize": "my_totalSize" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.jobs.search * @memberOf! () * @@ -2767,6 +3796,77 @@ export namespace jobs_v2 { /** * jobs.jobs.searchForAlert * @desc Searches for jobs using the provided SearchJobsRequest. This API call is intended for the use case of targeting passive job seekers (for example, job seekers who have signed up to receive email alerts about potential job opportunities), and has different algorithmic adjustments that are targeted to passive job seekers. This call constrains the visibility of jobs present in the database, and only returns jobs the caller has permission to search against. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.jobs.searchForAlert({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "disableRelevanceThresholding": false, + * // "enableBroadening": false, + * // "enablePreciseResultSize": false, + * // "filters": {}, + * // "histogramFacets": {}, + * // "jobView": "my_jobView", + * // "mode": "my_mode", + * // "offset": 0, + * // "orderBy": "my_orderBy", + * // "pageSize": 0, + * // "pageToken": "my_pageToken", + * // "query": {}, + * // "requestMetadata": {}, + * // "sortBy": "my_sortBy" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appliedCommuteFilter": {}, + * // "appliedJobLocationFilters": [], + * // "estimatedTotalSize": "my_estimatedTotalSize", + * // "histogramResults": {}, + * // "jobView": "my_jobView", + * // "matchingJobs": [], + * // "metadata": {}, + * // "nextPageToken": "my_nextPageToken", + * // "numJobsFromBroadenedQuery": 0, + * // "spellResult": {}, + * // "totalSize": "my_totalSize" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.jobs.searchForAlert * @memberOf! () * @@ -2984,6 +4084,75 @@ export namespace jobs_v2 { /** * jobs.complete * @desc Completes the specified prefix with job keyword suggestions. Intended for use by a job search auto-complete search box. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.complete({ + * // Optional. If provided, restricts completion to the specified company. + * companyName: 'placeholder-value', + * // Required. The language of the query. This is + * // the BCP-47 language code, such as "en-US" or "sr-Latn". + * // For more information, see + * // [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + * // + * // For CompletionType.JOB_TITLE type, only open jobs with same + * // language_code are returned. + * // + * // For CompletionType.COMPANY_NAME type, + * // only companies having open jobs with same language_code are + * // returned. + * // + * // For CompletionType.COMBINED type, only open jobs with same + * // language_code or companies having open jobs with same + * // language_code are returned. + * languageCode: 'placeholder-value', + * // Required. Completion result count. + * // The maximum allowed page size is 10. + * pageSize: 'placeholder-value', + * // Required. The query used to generate suggestions. + * query: 'placeholder-value', + * // Optional. The scope of the completion. The defaults is CompletionScope.PUBLIC. + * scope: 'placeholder-value', + * // Optional. The completion topic. The default is CompletionType.COMBINED. + * type: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "completionResults": [], + * // "metadata": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.complete * @memberOf! () * diff --git a/src/apis/jobs/v3.ts b/src/apis/jobs/v3.ts index a24a4146961..93bb503cba7 100644 --- a/src/apis/jobs/v3.ts +++ b/src/apis/jobs/v3.ts @@ -1302,6 +1302,110 @@ export namespace jobs_v3 { /** * jobs.projects.complete * @desc Completes the specified prefix with keyword suggestions. Intended for use by a job search auto-complete search box. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.complete({ + * // Optional. If provided, restricts completion to specified company. + * // + * // The format is "projects/{project_id}/companies/{company_id}", for example, + * // "projects/api-test-project/companies/foo". + * companyName: 'placeholder-value', + * // Deprecated. Use language_codes instead. + * // + * // Optional. + * // + * // The language of the query. This is + * // the BCP-47 language code, such as "en-US" or "sr-Latn". + * // For more information, see + * // [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + * // + * // For CompletionType.JOB_TITLE type, only open jobs with the same + * // language_code are returned. + * // + * // For CompletionType.COMPANY_NAME type, + * // only companies having open jobs with the same language_code are + * // returned. + * // + * // For CompletionType.COMBINED type, only open jobs with the same + * // language_code or companies having open jobs with the same + * // language_code are returned. + * // + * // The maximum number of allowed characters is 255. + * languageCode: 'placeholder-value', + * // Optional. The list of languages of the query. This is + * // the BCP-47 language code, such as "en-US" or "sr-Latn". + * // For more information, see + * // [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + * // + * // For CompletionType.JOB_TITLE type, only open jobs with the same + * // language_codes are returned. + * // + * // For CompletionType.COMPANY_NAME type, + * // only companies having open jobs with the same language_codes are + * // returned. + * // + * // For CompletionType.COMBINED type, only open jobs with the same + * // language_codes or companies having open jobs with the same + * // language_codes are returned. + * // + * // The maximum number of allowed characters is 255. + * languageCodes: 'placeholder-value', + * // Required. Resource name of project the completion is performed within. + * // + * // The format is "projects/{project_id}", for example, + * // "projects/api-test-project". + * name: 'projects/my-project', + * // Required. Completion result count. + * // + * // The maximum allowed page size is 10. + * pageSize: 'placeholder-value', + * // Required. The query used to generate suggestions. + * // + * // The maximum number of allowed characters is 255. + * query: 'placeholder-value', + * // Optional. The scope of the completion. The defaults is CompletionScope.PUBLIC. + * scope: 'placeholder-value', + * // Optional. The completion topic. The default is CompletionType.COMBINED. + * type: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "completionResults": [], + * // "metadata": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.complete * @memberOf! () * @@ -1435,6 +1539,62 @@ export namespace jobs_v3 { /** * jobs.projects.clientEvents.create * @desc Report events issued when end user interacts with customer's application that uses Cloud Talent Solution. You may inspect the created events in [self service tools](https://console.cloud.google.com/talent-solution/overview). [Learn more](https://cloud.google.com/talent-solution/docs/management-tools) about self service tools. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.clientEvents.create({ + * // Parent project name. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clientEvent": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "eventId": "my_eventId", + * // "extraInfo": {}, + * // "jobEvent": {}, + * // "parentEventId": "my_parentEventId", + * // "requestId": "my_requestId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.clientEvents.create * @memberOf! () * @@ -1535,6 +1695,72 @@ export namespace jobs_v3 { /** * jobs.projects.companies.create * @desc Creates a new company entity. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.companies.create({ + * // Required. Resource name of the project under which the company is created. + * // + * // The format is "projects/{project_id}", for example, + * // "projects/api-test-project". + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "company": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "careerSiteUri": "my_careerSiteUri", + * // "derivedInfo": {}, + * // "displayName": "my_displayName", + * // "eeoText": "my_eeoText", + * // "externalId": "my_externalId", + * // "headquartersAddress": "my_headquartersAddress", + * // "hiringAgency": false, + * // "imageUri": "my_imageUri", + * // "keywordSearchableJobCustomAttributes": [], + * // "name": "my_name", + * // "size": "my_size", + * // "suspended": false, + * // "websiteUri": "my_websiteUri" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.companies.create * @memberOf! () * @@ -1608,6 +1834,50 @@ export namespace jobs_v3 { /** * jobs.projects.companies.delete * @desc Deletes specified company. Prerequisite: The company has no jobs associated with it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.companies.delete({ + * // Required. The resource name of the company to be deleted. + * // + * // The format is "projects/{project_id}/companies/{company_id}", for example, + * // "projects/api-test-project/companies/foo". + * name: 'projects/my-project/companies/my-companie', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.companies.delete * @memberOf! () * @@ -1677,6 +1947,64 @@ export namespace jobs_v3 { /** * jobs.projects.companies.get * @desc Retrieves specified company. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.companies.get({ + * // Required. The resource name of the company to be retrieved. + * // + * // The format is "projects/{project_id}/companies/{company_id}", for example, + * // "projects/api-test-project/companies/foo". + * name: 'projects/my-project/companies/my-companie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "careerSiteUri": "my_careerSiteUri", + * // "derivedInfo": {}, + * // "displayName": "my_displayName", + * // "eeoText": "my_eeoText", + * // "externalId": "my_externalId", + * // "headquartersAddress": "my_headquartersAddress", + * // "hiringAgency": false, + * // "imageUri": "my_imageUri", + * // "keywordSearchableJobCustomAttributes": [], + * // "name": "my_name", + * // "size": "my_size", + * // "suspended": false, + * // "websiteUri": "my_websiteUri" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.companies.get * @memberOf! () * @@ -1746,6 +2074,66 @@ export namespace jobs_v3 { /** * jobs.projects.companies.list * @desc Lists all companies associated with the service account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.companies.list({ + * // Optional. The maximum number of companies to be returned, at most 100. + * // Default is 100 if a non-positive number is provided. + * pageSize: 'placeholder-value', + * // Optional. The starting indicator from which to return results. + * pageToken: 'placeholder-value', + * // Required. Resource name of the project under which the company is created. + * // + * // The format is "projects/{project_id}", for example, + * // "projects/api-test-project". + * parent: 'projects/my-project', + * // Optional. Set to true if the companies requested must have open jobs. + * // + * // Defaults to false. + * // + * // If true, at most page_size of companies are fetched, among which + * // only those with open jobs are returned. + * requireOpenJobs: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "companies": [], + * // "metadata": {}, + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.companies.list * @memberOf! () * @@ -1825,6 +2213,76 @@ export namespace jobs_v3 { /** * jobs.projects.companies.patch * @desc Updates specified company. Company names can't be updated. To update a company name, delete the company and all jobs associated with it, and only then re-create them. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.companies.patch({ + * // Required during company update. + * // + * // The resource name for a company. This is generated by the service when a + * // company is created. + * // + * // The format is "projects/{project_id}/companies/{company_id}", for example, + * // "projects/api-test-project/companies/foo". + * name: 'projects/my-project/companies/my-companie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "company": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "careerSiteUri": "my_careerSiteUri", + * // "derivedInfo": {}, + * // "displayName": "my_displayName", + * // "eeoText": "my_eeoText", + * // "externalId": "my_externalId", + * // "headquartersAddress": "my_headquartersAddress", + * // "hiringAgency": false, + * // "imageUri": "my_imageUri", + * // "keywordSearchableJobCustomAttributes": [], + * // "name": "my_name", + * // "size": "my_size", + * // "suspended": false, + * // "websiteUri": "my_websiteUri" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.companies.patch * @memberOf! () * @@ -1985,6 +2443,58 @@ export namespace jobs_v3 { /** * jobs.projects.jobs.batchDelete * @desc Deletes a list of Jobs by filter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.jobs.batchDelete({ + * // Required. The resource name of the project under which the job is created. + * // + * // The format is "projects/{project_id}", for example, + * // "projects/api-test-project". + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "filter": "my_filter" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.jobs.batchDelete * @memberOf! () * @@ -2058,6 +2568,89 @@ export namespace jobs_v3 { /** * jobs.projects.jobs.create * @desc Creates a new job. Typically, the job becomes searchable within 10 seconds, but it may take up to 5 minutes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.jobs.create({ + * // Required. The resource name of the project under which the job is created. + * // + * // The format is "projects/{project_id}", for example, + * // "projects/api-test-project". + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "job": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "addresses": [], + * // "applicationInfo": {}, + * // "companyDisplayName": "my_companyDisplayName", + * // "companyName": "my_companyName", + * // "compensationInfo": {}, + * // "customAttributes": {}, + * // "degreeTypes": [], + * // "department": "my_department", + * // "derivedInfo": {}, + * // "description": "my_description", + * // "employmentTypes": [], + * // "incentives": "my_incentives", + * // "jobBenefits": [], + * // "jobEndTime": "my_jobEndTime", + * // "jobLevel": "my_jobLevel", + * // "jobStartTime": "my_jobStartTime", + * // "languageCode": "my_languageCode", + * // "name": "my_name", + * // "postingCreateTime": "my_postingCreateTime", + * // "postingExpireTime": "my_postingExpireTime", + * // "postingPublishTime": "my_postingPublishTime", + * // "postingRegion": "my_postingRegion", + * // "postingUpdateTime": "my_postingUpdateTime", + * // "processingOptions": {}, + * // "promotionValue": 0, + * // "qualifications": "my_qualifications", + * // "requisitionId": "my_requisitionId", + * // "responsibilities": "my_responsibilities", + * // "title": "my_title", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.jobs.create * @memberOf! () * @@ -2128,6 +2721,50 @@ export namespace jobs_v3 { /** * jobs.projects.jobs.delete * @desc Deletes the specified job. Typically, the job becomes unsearchable within 10 seconds, but it may take up to 5 minutes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.jobs.delete({ + * // Required. The resource name of the job to be deleted. + * // + * // The format is "projects/{project_id}/jobs/{job_id}", + * // for example, "projects/api-test-project/jobs/1234". + * name: 'projects/my-project/jobs/my-job', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.jobs.delete * @memberOf! () * @@ -2197,6 +2834,81 @@ export namespace jobs_v3 { /** * jobs.projects.jobs.get * @desc Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.jobs.get({ + * // Required. The resource name of the job to retrieve. + * // + * // The format is "projects/{project_id}/jobs/{job_id}", + * // for example, "projects/api-test-project/jobs/1234". + * name: 'projects/my-project/jobs/my-job', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "addresses": [], + * // "applicationInfo": {}, + * // "companyDisplayName": "my_companyDisplayName", + * // "companyName": "my_companyName", + * // "compensationInfo": {}, + * // "customAttributes": {}, + * // "degreeTypes": [], + * // "department": "my_department", + * // "derivedInfo": {}, + * // "description": "my_description", + * // "employmentTypes": [], + * // "incentives": "my_incentives", + * // "jobBenefits": [], + * // "jobEndTime": "my_jobEndTime", + * // "jobLevel": "my_jobLevel", + * // "jobStartTime": "my_jobStartTime", + * // "languageCode": "my_languageCode", + * // "name": "my_name", + * // "postingCreateTime": "my_postingCreateTime", + * // "postingExpireTime": "my_postingExpireTime", + * // "postingPublishTime": "my_postingPublishTime", + * // "postingRegion": "my_postingRegion", + * // "postingUpdateTime": "my_postingUpdateTime", + * // "processingOptions": {}, + * // "promotionValue": 0, + * // "qualifications": "my_qualifications", + * // "requisitionId": "my_requisitionId", + * // "responsibilities": "my_responsibilities", + * // "title": "my_title", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.jobs.get * @memberOf! () * @@ -2266,6 +2978,82 @@ export namespace jobs_v3 { /** * jobs.projects.jobs.list * @desc Lists jobs by filter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.jobs.list({ + * // Required. The filter string specifies the jobs to be enumerated. + * // + * // Supported operator: =, AND + * // + * // The fields eligible for filtering are: + * // + * // * `companyName` (Required) + * // * `requisitionId` (Optional) + * // + * // Sample Query: + * // + * // * companyName = "projects/api-test-project/companies/123" + * // * companyName = "projects/api-test-project/companies/123" AND requisitionId + * // = "req-1" + * filter: 'placeholder-value', + * // Optional. The desired job attributes returned for jobs in the + * // search response. Defaults to JobView.JOB_VIEW_FULL if no value is + * // specified. + * jobView: 'placeholder-value', + * // Optional. The maximum number of jobs to be returned per page of results. + * // + * // If job_view is set to JobView.JOB_VIEW_ID_ONLY, the maximum allowed + * // page size is 1000. Otherwise, the maximum allowed page size is 100. + * // + * // Default is 100 if empty or a number < 1 is specified. + * pageSize: 'placeholder-value', + * // Optional. The starting point of a query result. + * pageToken: 'placeholder-value', + * // Required. The resource name of the project under which the job is created. + * // + * // The format is "projects/{project_id}", for example, + * // "projects/api-test-project". + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "jobs": [], + * // "metadata": {}, + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.jobs.list * @memberOf! () * @@ -2341,6 +3129,96 @@ export namespace jobs_v3 { /** * jobs.projects.jobs.patch * @desc Updates specified job. Typically, updated contents become visible in search results within 10 seconds, but it may take up to 5 minutes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.jobs.patch({ + * // Required during job update. + * // + * // The resource name for the job. This is generated by the service when a + * // job is created. + * // + * // The format is "projects/{project_id}/jobs/{job_id}", + * // for example, "projects/api-test-project/jobs/1234". + * // + * // Use of this field in job queries and API calls is preferred over the use of + * // requisition_id since this value is unique. + * name: 'projects/my-project/jobs/my-job', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "job": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "addresses": [], + * // "applicationInfo": {}, + * // "companyDisplayName": "my_companyDisplayName", + * // "companyName": "my_companyName", + * // "compensationInfo": {}, + * // "customAttributes": {}, + * // "degreeTypes": [], + * // "department": "my_department", + * // "derivedInfo": {}, + * // "description": "my_description", + * // "employmentTypes": [], + * // "incentives": "my_incentives", + * // "jobBenefits": [], + * // "jobEndTime": "my_jobEndTime", + * // "jobLevel": "my_jobLevel", + * // "jobStartTime": "my_jobStartTime", + * // "languageCode": "my_languageCode", + * // "name": "my_name", + * // "postingCreateTime": "my_postingCreateTime", + * // "postingExpireTime": "my_postingExpireTime", + * // "postingPublishTime": "my_postingPublishTime", + * // "postingRegion": "my_postingRegion", + * // "postingUpdateTime": "my_postingUpdateTime", + * // "processingOptions": {}, + * // "promotionValue": 0, + * // "qualifications": "my_qualifications", + * // "requisitionId": "my_requisitionId", + * // "responsibilities": "my_responsibilities", + * // "title": "my_title", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.jobs.patch * @memberOf! () * @@ -2411,6 +3289,80 @@ export namespace jobs_v3 { /** * jobs.projects.jobs.search * @desc Searches for jobs using the provided SearchJobsRequest. This call constrains the visibility of jobs present in the database, and only returns jobs that the caller has permission to search against. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.jobs.search({ + * // Required. The resource name of the project to search within. + * // + * // The format is "projects/{project_id}", for example, + * // "projects/api-test-project". + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "disableKeywordMatch": false, + * // "diversificationLevel": "my_diversificationLevel", + * // "enableBroadening": false, + * // "histogramFacets": {}, + * // "jobQuery": {}, + * // "jobView": "my_jobView", + * // "offset": 0, + * // "orderBy": "my_orderBy", + * // "pageSize": 0, + * // "pageToken": "my_pageToken", + * // "requestMetadata": {}, + * // "requirePreciseResultSize": false, + * // "searchMode": "my_searchMode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "broadenedQueryJobsCount": 0, + * // "estimatedTotalSize": 0, + * // "histogramResults": {}, + * // "locationFilters": [], + * // "matchingJobs": [], + * // "metadata": {}, + * // "nextPageToken": "my_nextPageToken", + * // "spellCorrection": {}, + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.jobs.search * @memberOf! () * @@ -2486,6 +3438,80 @@ export namespace jobs_v3 { /** * jobs.projects.jobs.searchForAlert * @desc Searches for jobs using the provided SearchJobsRequest. This API call is intended for the use case of targeting passive job seekers (for example, job seekers who have signed up to receive email alerts about potential job opportunities), and has different algorithmic adjustments that are targeted to passive job seekers. This call constrains the visibility of jobs present in the database, and only returns jobs the caller has permission to search against. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.jobs.searchForAlert({ + * // Required. The resource name of the project to search within. + * // + * // The format is "projects/{project_id}", for example, + * // "projects/api-test-project". + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "disableKeywordMatch": false, + * // "diversificationLevel": "my_diversificationLevel", + * // "enableBroadening": false, + * // "histogramFacets": {}, + * // "jobQuery": {}, + * // "jobView": "my_jobView", + * // "offset": 0, + * // "orderBy": "my_orderBy", + * // "pageSize": 0, + * // "pageToken": "my_pageToken", + * // "requestMetadata": {}, + * // "requirePreciseResultSize": false, + * // "searchMode": "my_searchMode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "broadenedQueryJobsCount": 0, + * // "estimatedTotalSize": 0, + * // "histogramResults": {}, + * // "locationFilters": [], + * // "matchingJobs": [], + * // "metadata": {}, + * // "nextPageToken": "my_nextPageToken", + * // "spellCorrection": {}, + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.jobs.searchForAlert * @memberOf! () * diff --git a/src/apis/jobs/v3p1beta1.ts b/src/apis/jobs/v3p1beta1.ts index 611adf5115a..c1a44b39e63 100644 --- a/src/apis/jobs/v3p1beta1.ts +++ b/src/apis/jobs/v3p1beta1.ts @@ -1397,6 +1397,110 @@ export namespace jobs_v3p1beta1 { /** * jobs.projects.complete * @desc Completes the specified prefix with keyword suggestions. Intended for use by a job search auto-complete search box. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.complete({ + * // Optional. If provided, restricts completion to specified company. + * // + * // The format is "projects/{project_id}/companies/{company_id}", for example, + * // "projects/api-test-project/companies/foo". + * companyName: 'placeholder-value', + * // Deprecated. Use language_codes instead. + * // + * // Optional. + * // + * // The language of the query. This is + * // the BCP-47 language code, such as "en-US" or "sr-Latn". + * // For more information, see + * // [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + * // + * // For CompletionType.JOB_TITLE type, only open jobs with the same + * // language_code are returned. + * // + * // For CompletionType.COMPANY_NAME type, + * // only companies having open jobs with the same language_code are + * // returned. + * // + * // For CompletionType.COMBINED type, only open jobs with the same + * // language_code or companies having open jobs with the same + * // language_code are returned. + * // + * // The maximum number of allowed characters is 255. + * languageCode: 'placeholder-value', + * // Optional. The list of languages of the query. This is + * // the BCP-47 language code, such as "en-US" or "sr-Latn". + * // For more information, see + * // [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + * // + * // For CompletionType.JOB_TITLE type, only open jobs with the same + * // language_codes are returned. + * // + * // For CompletionType.COMPANY_NAME type, + * // only companies having open jobs with the same language_codes are + * // returned. + * // + * // For CompletionType.COMBINED type, only open jobs with the same + * // language_codes or companies having open jobs with the same + * // language_codes are returned. + * // + * // The maximum number of allowed characters is 255. + * languageCodes: 'placeholder-value', + * // Required. Resource name of project the completion is performed within. + * // + * // The format is "projects/{project_id}", for example, + * // "projects/api-test-project". + * name: 'projects/my-project', + * // Required. Completion result count. + * // + * // The maximum allowed page size is 10. + * pageSize: 'placeholder-value', + * // Required. The query used to generate suggestions. + * // + * // The maximum number of allowed characters is 255. + * query: 'placeholder-value', + * // Optional. The scope of the completion. The defaults is CompletionScope.PUBLIC. + * scope: 'placeholder-value', + * // Optional. The completion topic. The default is CompletionType.COMBINED. + * type: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "completionResults": [], + * // "metadata": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.complete * @memberOf! () * @@ -1530,6 +1634,62 @@ export namespace jobs_v3p1beta1 { /** * jobs.projects.clientEvents.create * @desc Report events issued when end user interacts with customer's application that uses Cloud Talent Solution. You may inspect the created events in [self service tools](https://console.cloud.google.com/talent-solution/overview). [Learn more](https://cloud.google.com/talent-solution/docs/management-tools) about self service tools. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.clientEvents.create({ + * // Parent project name. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clientEvent": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "eventId": "my_eventId", + * // "extraInfo": {}, + * // "jobEvent": {}, + * // "parentEventId": "my_parentEventId", + * // "requestId": "my_requestId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.clientEvents.create * @memberOf! () * @@ -1630,6 +1790,72 @@ export namespace jobs_v3p1beta1 { /** * jobs.projects.companies.create * @desc Creates a new company entity. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.companies.create({ + * // Required. Resource name of the project under which the company is created. + * // + * // The format is "projects/{project_id}", for example, + * // "projects/api-test-project". + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "company": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "careerSiteUri": "my_careerSiteUri", + * // "derivedInfo": {}, + * // "displayName": "my_displayName", + * // "eeoText": "my_eeoText", + * // "externalId": "my_externalId", + * // "headquartersAddress": "my_headquartersAddress", + * // "hiringAgency": false, + * // "imageUri": "my_imageUri", + * // "keywordSearchableJobCustomAttributes": [], + * // "name": "my_name", + * // "size": "my_size", + * // "suspended": false, + * // "websiteUri": "my_websiteUri" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.companies.create * @memberOf! () * @@ -1703,6 +1929,50 @@ export namespace jobs_v3p1beta1 { /** * jobs.projects.companies.delete * @desc Deletes specified company. Prerequisite: The company has no jobs associated with it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.companies.delete({ + * // Required. The resource name of the company to be deleted. + * // + * // The format is "projects/{project_id}/companies/{company_id}", for example, + * // "projects/api-test-project/companies/foo". + * name: 'projects/my-project/companies/my-companie', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.companies.delete * @memberOf! () * @@ -1772,6 +2042,64 @@ export namespace jobs_v3p1beta1 { /** * jobs.projects.companies.get * @desc Retrieves specified company. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.companies.get({ + * // Required. The resource name of the company to be retrieved. + * // + * // The format is "projects/{project_id}/companies/{company_id}", for example, + * // "projects/api-test-project/companies/foo". + * name: 'projects/my-project/companies/my-companie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "careerSiteUri": "my_careerSiteUri", + * // "derivedInfo": {}, + * // "displayName": "my_displayName", + * // "eeoText": "my_eeoText", + * // "externalId": "my_externalId", + * // "headquartersAddress": "my_headquartersAddress", + * // "hiringAgency": false, + * // "imageUri": "my_imageUri", + * // "keywordSearchableJobCustomAttributes": [], + * // "name": "my_name", + * // "size": "my_size", + * // "suspended": false, + * // "websiteUri": "my_websiteUri" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.companies.get * @memberOf! () * @@ -1841,6 +2169,66 @@ export namespace jobs_v3p1beta1 { /** * jobs.projects.companies.list * @desc Lists all companies associated with the service account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.companies.list({ + * // Optional. The maximum number of companies to be returned, at most 100. + * // Default is 100 if a non-positive number is provided. + * pageSize: 'placeholder-value', + * // Optional. The starting indicator from which to return results. + * pageToken: 'placeholder-value', + * // Required. Resource name of the project under which the company is created. + * // + * // The format is "projects/{project_id}", for example, + * // "projects/api-test-project". + * parent: 'projects/my-project', + * // Optional. Set to true if the companies requested must have open jobs. + * // + * // Defaults to false. + * // + * // If true, at most page_size of companies are fetched, among which + * // only those with open jobs are returned. + * requireOpenJobs: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "companies": [], + * // "metadata": {}, + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.companies.list * @memberOf! () * @@ -1920,6 +2308,76 @@ export namespace jobs_v3p1beta1 { /** * jobs.projects.companies.patch * @desc Updates specified company. Company names can't be updated. To update a company name, delete the company and all jobs associated with it, and only then re-create them. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.companies.patch({ + * // Required during company update. + * // + * // The resource name for a company. This is generated by the service when a + * // company is created. + * // + * // The format is "projects/{project_id}/companies/{company_id}", for example, + * // "projects/api-test-project/companies/foo". + * name: 'projects/my-project/companies/my-companie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "company": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "careerSiteUri": "my_careerSiteUri", + * // "derivedInfo": {}, + * // "displayName": "my_displayName", + * // "eeoText": "my_eeoText", + * // "externalId": "my_externalId", + * // "headquartersAddress": "my_headquartersAddress", + * // "hiringAgency": false, + * // "imageUri": "my_imageUri", + * // "keywordSearchableJobCustomAttributes": [], + * // "name": "my_name", + * // "size": "my_size", + * // "suspended": false, + * // "websiteUri": "my_websiteUri" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.companies.patch * @memberOf! () * @@ -2080,6 +2538,58 @@ export namespace jobs_v3p1beta1 { /** * jobs.projects.jobs.batchDelete * @desc Deletes a list of Jobs by filter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.jobs.batchDelete({ + * // Required. The resource name of the project under which the job is created. + * // + * // The format is "projects/{project_id}", for example, + * // "projects/api-test-project". + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "filter": "my_filter" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.jobs.batchDelete * @memberOf! () * @@ -2153,6 +2663,89 @@ export namespace jobs_v3p1beta1 { /** * jobs.projects.jobs.create * @desc Creates a new job. Typically, the job becomes searchable within 10 seconds, but it may take up to 5 minutes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.jobs.create({ + * // Required. The resource name of the project under which the job is created. + * // + * // The format is "projects/{project_id}", for example, + * // "projects/api-test-project". + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "job": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "addresses": [], + * // "applicationInfo": {}, + * // "companyDisplayName": "my_companyDisplayName", + * // "companyName": "my_companyName", + * // "compensationInfo": {}, + * // "customAttributes": {}, + * // "degreeTypes": [], + * // "department": "my_department", + * // "derivedInfo": {}, + * // "description": "my_description", + * // "employmentTypes": [], + * // "incentives": "my_incentives", + * // "jobBenefits": [], + * // "jobEndTime": "my_jobEndTime", + * // "jobLevel": "my_jobLevel", + * // "jobStartTime": "my_jobStartTime", + * // "languageCode": "my_languageCode", + * // "name": "my_name", + * // "postingCreateTime": "my_postingCreateTime", + * // "postingExpireTime": "my_postingExpireTime", + * // "postingPublishTime": "my_postingPublishTime", + * // "postingRegion": "my_postingRegion", + * // "postingUpdateTime": "my_postingUpdateTime", + * // "processingOptions": {}, + * // "promotionValue": 0, + * // "qualifications": "my_qualifications", + * // "requisitionId": "my_requisitionId", + * // "responsibilities": "my_responsibilities", + * // "title": "my_title", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.jobs.create * @memberOf! () * @@ -2226,6 +2819,50 @@ export namespace jobs_v3p1beta1 { /** * jobs.projects.jobs.delete * @desc Deletes the specified job. Typically, the job becomes unsearchable within 10 seconds, but it may take up to 5 minutes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.jobs.delete({ + * // Required. The resource name of the job to be deleted. + * // + * // The format is "projects/{project_id}/jobs/{job_id}", + * // for example, "projects/api-test-project/jobs/1234". + * name: 'projects/my-project/jobs/my-job', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.jobs.delete * @memberOf! () * @@ -2295,6 +2932,81 @@ export namespace jobs_v3p1beta1 { /** * jobs.projects.jobs.get * @desc Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.jobs.get({ + * // Required. The resource name of the job to retrieve. + * // + * // The format is "projects/{project_id}/jobs/{job_id}", + * // for example, "projects/api-test-project/jobs/1234". + * name: 'projects/my-project/jobs/my-job', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "addresses": [], + * // "applicationInfo": {}, + * // "companyDisplayName": "my_companyDisplayName", + * // "companyName": "my_companyName", + * // "compensationInfo": {}, + * // "customAttributes": {}, + * // "degreeTypes": [], + * // "department": "my_department", + * // "derivedInfo": {}, + * // "description": "my_description", + * // "employmentTypes": [], + * // "incentives": "my_incentives", + * // "jobBenefits": [], + * // "jobEndTime": "my_jobEndTime", + * // "jobLevel": "my_jobLevel", + * // "jobStartTime": "my_jobStartTime", + * // "languageCode": "my_languageCode", + * // "name": "my_name", + * // "postingCreateTime": "my_postingCreateTime", + * // "postingExpireTime": "my_postingExpireTime", + * // "postingPublishTime": "my_postingPublishTime", + * // "postingRegion": "my_postingRegion", + * // "postingUpdateTime": "my_postingUpdateTime", + * // "processingOptions": {}, + * // "promotionValue": 0, + * // "qualifications": "my_qualifications", + * // "requisitionId": "my_requisitionId", + * // "responsibilities": "my_responsibilities", + * // "title": "my_title", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.jobs.get * @memberOf! () * @@ -2364,6 +3076,82 @@ export namespace jobs_v3p1beta1 { /** * jobs.projects.jobs.list * @desc Lists jobs by filter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.jobs.list({ + * // Required. The filter string specifies the jobs to be enumerated. + * // + * // Supported operator: =, AND + * // + * // The fields eligible for filtering are: + * // + * // * `companyName` (Required) + * // * `requisitionId` (Optional) + * // + * // Sample Query: + * // + * // * companyName = "projects/api-test-project/companies/123" + * // * companyName = "projects/api-test-project/companies/123" AND requisitionId + * // = "req-1" + * filter: 'placeholder-value', + * // Optional. The desired job attributes returned for jobs in the + * // search response. Defaults to JobView.JOB_VIEW_FULL if no value is + * // specified. + * jobView: 'placeholder-value', + * // Optional. The maximum number of jobs to be returned per page of results. + * // + * // If job_view is set to JobView.JOB_VIEW_ID_ONLY, the maximum allowed + * // page size is 1000. Otherwise, the maximum allowed page size is 100. + * // + * // Default is 100 if empty or a number < 1 is specified. + * pageSize: 'placeholder-value', + * // Optional. The starting point of a query result. + * pageToken: 'placeholder-value', + * // Required. The resource name of the project under which the job is created. + * // + * // The format is "projects/{project_id}", for example, + * // "projects/api-test-project". + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "jobs": [], + * // "metadata": {}, + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.jobs.list * @memberOf! () * @@ -2442,6 +3230,96 @@ export namespace jobs_v3p1beta1 { /** * jobs.projects.jobs.patch * @desc Updates specified job. Typically, updated contents become visible in search results within 10 seconds, but it may take up to 5 minutes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.jobs.patch({ + * // Required during job update. + * // + * // The resource name for the job. This is generated by the service when a + * // job is created. + * // + * // The format is "projects/{project_id}/jobs/{job_id}", + * // for example, "projects/api-test-project/jobs/1234". + * // + * // Use of this field in job queries and API calls is preferred over the use of + * // requisition_id since this value is unique. + * name: 'projects/my-project/jobs/my-job', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "job": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "addresses": [], + * // "applicationInfo": {}, + * // "companyDisplayName": "my_companyDisplayName", + * // "companyName": "my_companyName", + * // "compensationInfo": {}, + * // "customAttributes": {}, + * // "degreeTypes": [], + * // "department": "my_department", + * // "derivedInfo": {}, + * // "description": "my_description", + * // "employmentTypes": [], + * // "incentives": "my_incentives", + * // "jobBenefits": [], + * // "jobEndTime": "my_jobEndTime", + * // "jobLevel": "my_jobLevel", + * // "jobStartTime": "my_jobStartTime", + * // "languageCode": "my_languageCode", + * // "name": "my_name", + * // "postingCreateTime": "my_postingCreateTime", + * // "postingExpireTime": "my_postingExpireTime", + * // "postingPublishTime": "my_postingPublishTime", + * // "postingRegion": "my_postingRegion", + * // "postingUpdateTime": "my_postingUpdateTime", + * // "processingOptions": {}, + * // "promotionValue": 0, + * // "qualifications": "my_qualifications", + * // "requisitionId": "my_requisitionId", + * // "responsibilities": "my_responsibilities", + * // "title": "my_title", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.jobs.patch * @memberOf! () * @@ -2512,6 +3390,83 @@ export namespace jobs_v3p1beta1 { /** * jobs.projects.jobs.search * @desc Searches for jobs using the provided SearchJobsRequest. This call constrains the visibility of jobs present in the database, and only returns jobs that the caller has permission to search against. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.jobs.search({ + * // Required. The resource name of the project to search within. + * // + * // The format is "projects/{project_id}", for example, + * // "projects/api-test-project". + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "customRankingInfo": {}, + * // "disableKeywordMatch": false, + * // "diversificationLevel": "my_diversificationLevel", + * // "enableBroadening": false, + * // "histogramFacets": {}, + * // "histogramQueries": [], + * // "jobQuery": {}, + * // "jobView": "my_jobView", + * // "offset": 0, + * // "orderBy": "my_orderBy", + * // "pageSize": 0, + * // "pageToken": "my_pageToken", + * // "requestMetadata": {}, + * // "requirePreciseResultSize": false, + * // "searchMode": "my_searchMode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "broadenedQueryJobsCount": 0, + * // "estimatedTotalSize": 0, + * // "histogramQueryResults": [], + * // "histogramResults": {}, + * // "locationFilters": [], + * // "matchingJobs": [], + * // "metadata": {}, + * // "nextPageToken": "my_nextPageToken", + * // "spellCorrection": {}, + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.jobs.search * @memberOf! () * @@ -2587,6 +3542,83 @@ export namespace jobs_v3p1beta1 { /** * jobs.projects.jobs.searchForAlert * @desc Searches for jobs using the provided SearchJobsRequest. This API call is intended for the use case of targeting passive job seekers (for example, job seekers who have signed up to receive email alerts about potential job opportunities), and has different algorithmic adjustments that are targeted to passive job seekers. This call constrains the visibility of jobs present in the database, and only returns jobs the caller has permission to search against. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.jobs.searchForAlert({ + * // Required. The resource name of the project to search within. + * // + * // The format is "projects/{project_id}", for example, + * // "projects/api-test-project". + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "customRankingInfo": {}, + * // "disableKeywordMatch": false, + * // "diversificationLevel": "my_diversificationLevel", + * // "enableBroadening": false, + * // "histogramFacets": {}, + * // "histogramQueries": [], + * // "jobQuery": {}, + * // "jobView": "my_jobView", + * // "offset": 0, + * // "orderBy": "my_orderBy", + * // "pageSize": 0, + * // "pageToken": "my_pageToken", + * // "requestMetadata": {}, + * // "requirePreciseResultSize": false, + * // "searchMode": "my_searchMode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "broadenedQueryJobsCount": 0, + * // "estimatedTotalSize": 0, + * // "histogramQueryResults": [], + * // "histogramResults": {}, + * // "locationFilters": [], + * // "matchingJobs": [], + * // "metadata": {}, + * // "nextPageToken": "my_nextPageToken", + * // "spellCorrection": {}, + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.jobs.searchForAlert * @memberOf! () * @@ -2809,6 +3841,53 @@ export namespace jobs_v3p1beta1 { /** * jobs.projects.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/jobs.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 jobs = google.jobs('v3p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/jobs', + * ], + * }); + * + * // 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 jobs.projects.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias jobs.projects.operations.get * @memberOf! () * diff --git a/src/apis/kgsearch/v1.ts b/src/apis/kgsearch/v1.ts index 9888085f577..b19cf53bdbf 100644 --- a/src/apis/kgsearch/v1.ts +++ b/src/apis/kgsearch/v1.ts @@ -140,6 +140,65 @@ export namespace kgsearch_v1 { /** * kgsearch.entities.search * @desc Searches Knowledge Graph for entities that match the constraints. A list of matched entities will be returned in response, which will be in JSON-LD format and compatible with http://schema.org + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/kgsearch.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 kgsearch = google.kgsearch('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: [], + * }); + * + * // 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 kgsearch.entities.search({ + * // The list of entity id to be used for search instead of query string. + * // To specify multiple ids in the HTTP request, repeat the parameter in the + * // URL as in ...?ids=A&ids=B + * ids: 'placeholder-value', + * // Enables indenting of json results. + * indent: 'placeholder-value', + * // The list of language codes (defined in ISO 693) to run the query with, + * // e.g. 'en'. + * languages: 'placeholder-value', + * // Limits the number of entities to be returned. + * limit: 'placeholder-value', + * // Enables prefix match against names and aliases of entities + * prefix: 'placeholder-value', + * // The literal query string for search. + * query: 'placeholder-value', + * // Restricts returned entities with these types, e.g. Person + * // (as defined in http://schema.org/Person). If multiple types are specified, + * // returned entities will contain one or more of these types. + * types: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "@context": {}, + * // "@type": {}, + * // "itemListElement": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias kgsearch.entities.search * @memberOf! () * diff --git a/src/apis/language/v1.ts b/src/apis/language/v1.ts index 8d696433c6e..71f0609f95f 100644 --- a/src/apis/language/v1.ts +++ b/src/apis/language/v1.ts @@ -547,6 +547,56 @@ export namespace language_v1 { /** * language.documents.analyzeEntities * @desc Finds named entities (currently proper names and common nouns) in the text along with entity types, salience, mentions for each entity, and other properties. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/language.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 language = google.language('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/cloud-language', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.documents.analyzeEntities({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "document": {}, + * // "encodingType": "my_encodingType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "language": "my_language" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.documents.analyzeEntities * @memberOf! () * @@ -625,6 +675,56 @@ export namespace language_v1 { /** * language.documents.analyzeEntitySentiment * @desc Finds entities, similar to AnalyzeEntities in the text and analyzes sentiment associated with each entity and its mentions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/language.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 language = google.language('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/cloud-language', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.documents.analyzeEntitySentiment({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "document": {}, + * // "encodingType": "my_encodingType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "language": "my_language" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.documents.analyzeEntitySentiment * @memberOf! () * @@ -708,6 +808,57 @@ export namespace language_v1 { /** * language.documents.analyzeSentiment * @desc Analyzes the sentiment of the provided text. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/language.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 language = google.language('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/cloud-language', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.documents.analyzeSentiment({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "document": {}, + * // "encodingType": "my_encodingType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "documentSentiment": {}, + * // "language": "my_language", + * // "sentences": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.documents.analyzeSentiment * @memberOf! () * @@ -786,6 +937,57 @@ export namespace language_v1 { /** * language.documents.analyzeSyntax * @desc Analyzes the syntax of the text and provides sentence boundaries and tokenization along with part of speech tags, dependency trees, and other properties. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/language.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 language = google.language('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/cloud-language', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.documents.analyzeSyntax({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "document": {}, + * // "encodingType": "my_encodingType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "language": "my_language", + * // "sentences": [], + * // "tokens": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.documents.analyzeSyntax * @memberOf! () * @@ -864,6 +1066,61 @@ export namespace language_v1 { /** * language.documents.annotateText * @desc A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one call. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/language.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 language = google.language('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/cloud-language', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.documents.annotateText({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "document": {}, + * // "encodingType": "my_encodingType", + * // "features": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "categories": [], + * // "documentSentiment": {}, + * // "entities": [], + * // "language": "my_language", + * // "sentences": [], + * // "tokens": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.documents.annotateText * @memberOf! () * @@ -942,6 +1199,54 @@ export namespace language_v1 { /** * language.documents.classifyText * @desc Classifies a document into categories. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/language.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 language = google.language('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/cloud-language', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.documents.classifyText({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "document": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "categories": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.documents.classifyText * @memberOf! () * diff --git a/src/apis/language/v1beta1.ts b/src/apis/language/v1beta1.ts index 07299985702..c30edacdda6 100644 --- a/src/apis/language/v1beta1.ts +++ b/src/apis/language/v1beta1.ts @@ -474,6 +474,56 @@ export namespace language_v1beta1 { /** * language.documents.analyzeEntities * @desc Finds named entities (currently proper names and common nouns) in the text along with entity types, salience, mentions for each entity, and other properties. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/language.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 language = google.language('v1beta1'); + * + * 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/cloud-language', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.documents.analyzeEntities({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "document": {}, + * // "encodingType": "my_encodingType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "language": "my_language" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.documents.analyzeEntities * @memberOf! () * @@ -552,6 +602,57 @@ export namespace language_v1beta1 { /** * language.documents.analyzeSentiment * @desc Analyzes the sentiment of the provided text. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/language.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 language = google.language('v1beta1'); + * + * 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/cloud-language', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.documents.analyzeSentiment({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "document": {}, + * // "encodingType": "my_encodingType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "documentSentiment": {}, + * // "language": "my_language", + * // "sentences": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.documents.analyzeSentiment * @memberOf! () * @@ -630,6 +731,57 @@ export namespace language_v1beta1 { /** * language.documents.analyzeSyntax * @desc Analyzes the syntax of the text and provides sentence boundaries and tokenization along with part of speech tags, dependency trees, and other properties. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/language.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 language = google.language('v1beta1'); + * + * 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/cloud-language', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.documents.analyzeSyntax({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "document": {}, + * // "encodingType": "my_encodingType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "language": "my_language", + * // "sentences": [], + * // "tokens": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.documents.analyzeSyntax * @memberOf! () * @@ -708,6 +860,60 @@ export namespace language_v1beta1 { /** * language.documents.annotateText * @desc A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one call. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/language.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 language = google.language('v1beta1'); + * + * 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/cloud-language', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.documents.annotateText({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "document": {}, + * // "encodingType": "my_encodingType", + * // "features": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "documentSentiment": {}, + * // "entities": [], + * // "language": "my_language", + * // "sentences": [], + * // "tokens": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.documents.annotateText * @memberOf! () * diff --git a/src/apis/language/v1beta2.ts b/src/apis/language/v1beta2.ts index 0aa3e4006c3..cfb8f53e9e7 100644 --- a/src/apis/language/v1beta2.ts +++ b/src/apis/language/v1beta2.ts @@ -555,6 +555,56 @@ export namespace language_v1beta2 { /** * language.documents.analyzeEntities * @desc Finds named entities (currently proper names and common nouns) in the text along with entity types, salience, mentions for each entity, and other properties. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/language.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 language = google.language('v1beta2'); + * + * 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/cloud-language', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.documents.analyzeEntities({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "document": {}, + * // "encodingType": "my_encodingType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "language": "my_language" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.documents.analyzeEntities * @memberOf! () * @@ -633,6 +683,56 @@ export namespace language_v1beta2 { /** * language.documents.analyzeEntitySentiment * @desc Finds entities, similar to AnalyzeEntities in the text and analyzes sentiment associated with each entity and its mentions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/language.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 language = google.language('v1beta2'); + * + * 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/cloud-language', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.documents.analyzeEntitySentiment({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "document": {}, + * // "encodingType": "my_encodingType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entities": [], + * // "language": "my_language" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.documents.analyzeEntitySentiment * @memberOf! () * @@ -715,6 +815,57 @@ export namespace language_v1beta2 { /** * language.documents.analyzeSentiment * @desc Analyzes the sentiment of the provided text. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/language.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 language = google.language('v1beta2'); + * + * 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/cloud-language', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.documents.analyzeSentiment({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "document": {}, + * // "encodingType": "my_encodingType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "documentSentiment": {}, + * // "language": "my_language", + * // "sentences": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.documents.analyzeSentiment * @memberOf! () * @@ -793,6 +944,57 @@ export namespace language_v1beta2 { /** * language.documents.analyzeSyntax * @desc Analyzes the syntax of the text and provides sentence boundaries and tokenization along with part of speech tags, dependency trees, and other properties. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/language.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 language = google.language('v1beta2'); + * + * 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/cloud-language', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.documents.analyzeSyntax({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "document": {}, + * // "encodingType": "my_encodingType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "language": "my_language", + * // "sentences": [], + * // "tokens": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.documents.analyzeSyntax * @memberOf! () * @@ -871,6 +1073,61 @@ export namespace language_v1beta2 { /** * language.documents.annotateText * @desc A convenience method that provides all syntax, sentiment, entity, and classification features in one call. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/language.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 language = google.language('v1beta2'); + * + * 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/cloud-language', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.documents.annotateText({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "document": {}, + * // "encodingType": "my_encodingType", + * // "features": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "categories": [], + * // "documentSentiment": {}, + * // "entities": [], + * // "language": "my_language", + * // "sentences": [], + * // "tokens": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.documents.annotateText * @memberOf! () * @@ -949,6 +1206,54 @@ export namespace language_v1beta2 { /** * language.documents.classifyText * @desc Classifies a document into categories. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/language.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 language = google.language('v1beta2'); + * + * 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/cloud-language', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.documents.classifyText({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "document": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "categories": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.documents.classifyText * @memberOf! () * diff --git a/src/apis/libraryagent/v1.ts b/src/apis/libraryagent/v1.ts index 3b25413dd9c..e9434634abe 100644 --- a/src/apis/libraryagent/v1.ts +++ b/src/apis/libraryagent/v1.ts @@ -185,6 +185,47 @@ export namespace libraryagent_v1 { /** * libraryagent.shelves.get * @desc Gets a shelf. Returns NOT_FOUND if the shelf does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/libraryagent.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 libraryagent = google.libraryagent('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/cloud-platform'], + * }); + * + * // 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 libraryagent.shelves.get({ + * // Required. The name of the shelf to retrieve. + * name: 'shelves/my-shelve', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "theme": "my_theme" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias libraryagent.shelves.get * @memberOf! () * @@ -264,6 +305,53 @@ export namespace libraryagent_v1 { /** * libraryagent.shelves.list * @desc Lists shelves. The order is unspecified but deterministic. Newly created shelves will not necessarily be added to the end of this list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/libraryagent.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 libraryagent = google.libraryagent('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/cloud-platform'], + * }); + * + * // 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 libraryagent.shelves.list({ + * // Requested page size. Server may return fewer shelves than requested. + * // If unspecified, server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListShelvesResponse.next_page_token + * // returned from the previous call to `ListShelves` method. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "shelves": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias libraryagent.shelves.list * @memberOf! () * @@ -394,6 +482,49 @@ export namespace libraryagent_v1 { /** * libraryagent.shelves.books.borrow * @desc Borrow a book from the library. Returns the book if it is borrowed successfully. Returns NOT_FOUND if the book does not exist in the library. Returns quota exceeded error if the amount of books borrowed exceeds allocation quota in any dimensions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/libraryagent.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 libraryagent = google.libraryagent('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/cloud-platform'], + * }); + * + * // 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 libraryagent.shelves.books.borrow({ + * // Required. The name of the book to borrow. + * name: 'shelves/my-shelve/books/my-book', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": "my_author", + * // "name": "my_name", + * // "read": false, + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias libraryagent.shelves.books.borrow * @memberOf! () * @@ -474,6 +605,49 @@ export namespace libraryagent_v1 { /** * libraryagent.shelves.books.get * @desc Gets a book. Returns NOT_FOUND if the book does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/libraryagent.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 libraryagent = google.libraryagent('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/cloud-platform'], + * }); + * + * // 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 libraryagent.shelves.books.get({ + * // Required. The name of the book to retrieve. + * name: 'shelves/my-shelve/books/my-book', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": "my_author", + * // "name": "my_name", + * // "read": false, + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias libraryagent.shelves.books.get * @memberOf! () * @@ -554,6 +728,55 @@ export namespace libraryagent_v1 { /** * libraryagent.shelves.books.list * @desc Lists books in a shelf. The order is unspecified but deterministic. Newly created books will not necessarily be added to the end of this list. Returns NOT_FOUND if the shelf does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/libraryagent.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 libraryagent = google.libraryagent('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/cloud-platform'], + * }); + * + * // 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 libraryagent.shelves.books.list({ + * // Requested page size. Server may return fewer books than requested. + * // If unspecified, server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. + * // Typically, this is the value of + * // ListBooksResponse.next_page_token. + * // returned from the previous call to `ListBooks` method. + * pageToken: 'placeholder-value', + * // Required. The name of the shelf whose books we'd like to list. + * parent: 'shelves/my-shelve', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "books": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias libraryagent.shelves.books.list * @memberOf! () * @@ -655,6 +878,49 @@ export namespace libraryagent_v1 { /** * libraryagent.shelves.books.return * @desc Return a book to the library. Returns the book if it is returned to the library successfully. Returns error if the book does not belong to the library or the users didn't borrow before. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/libraryagent.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 libraryagent = google.libraryagent('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/cloud-platform'], + * }); + * + * // 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 libraryagent.shelves.books.return({ + * // Required. The name of the book to return. + * name: 'shelves/my-shelve/books/my-book', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "author": "my_author", + * // "name": "my_name", + * // "read": false, + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias libraryagent.shelves.books.return * @memberOf! () * diff --git a/src/apis/licensing/v1.ts b/src/apis/licensing/v1.ts index 7cf6a0935e5..d16a5cd4272 100644 --- a/src/apis/licensing/v1.ts +++ b/src/apis/licensing/v1.ts @@ -174,6 +174,47 @@ export namespace licensing_v1 { /** * licensing.licenseAssignments.delete * @desc Revoke a license. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/licensing.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 licensing = google.licensing('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/apps.licensing'], + * }); + * + * // 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 licensing.licenseAssignments.delete({ + * // A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. + * productId: 'placeholder-value', + * // A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. + * skuId: 'placeholder-value', + * // The user's current primary email address. If the user's email address changes, use the new email address in your API requests. + * // Since a userId is subject to change, do not use a userId value as a key for persistent data. This key could break if the current user's email address changes. + * // If the userId is suspended, the license status changes. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias licensing.licenseAssignments.delete * @memberOf! () * @@ -248,6 +289,59 @@ export namespace licensing_v1 { /** * licensing.licenseAssignments.get * @desc Get a specific user's license by product SKU. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/licensing.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 licensing = google.licensing('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/apps.licensing'], + * }); + * + * // 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 licensing.licenseAssignments.get({ + * // A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. + * productId: 'placeholder-value', + * // A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. + * skuId: 'placeholder-value', + * // The user's current primary email address. If the user's email address changes, use the new email address in your API requests. + * // Since a userId is subject to change, do not use a userId value as a key for persistent data. This key could break if the current user's email address changes. + * // If the userId is suspended, the license status changes. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etags": "my_etags", + * // "kind": "my_kind", + * // "productId": "my_productId", + * // "productName": "my_productName", + * // "selfLink": "my_selfLink", + * // "skuId": "my_skuId", + * // "skuName": "my_skuName", + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias licensing.licenseAssignments.get * @memberOf! () * @@ -324,6 +418,63 @@ export namespace licensing_v1 { /** * licensing.licenseAssignments.insert * @desc Assign a license. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/licensing.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 licensing = google.licensing('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/apps.licensing'], + * }); + * + * // 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 licensing.licenseAssignments.insert({ + * // A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. + * productId: 'placeholder-value', + * // A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. + * skuId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "userId": "my_userId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etags": "my_etags", + * // "kind": "my_kind", + * // "productId": "my_productId", + * // "productName": "my_productName", + * // "selfLink": "my_selfLink", + * // "skuId": "my_skuId", + * // "skuName": "my_skuName", + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias licensing.licenseAssignments.insert * @memberOf! () * @@ -400,6 +551,56 @@ export namespace licensing_v1 { /** * licensing.licenseAssignments.listForProduct * @desc List all users assigned licenses for a specific product SKU. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/licensing.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 licensing = google.licensing('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/apps.licensing'], + * }); + * + * // 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 licensing.licenseAssignments.listForProduct({ + * // Customer's customerId. A previous version of this API accepted the primary domain name as a value for this field. + * // If the customer is suspended, the server returns an error. + * customerId: 'placeholder-value', + * // The maxResults query string determines how many entries are returned on each page of a large response. This is an optional parameter. The value must be a positive number. + * maxResults: 'placeholder-value', + * // Token to fetch the next page of data. The maxResults query string is related to the pageToken since maxResults determines how many entries are returned on each page. This is an optional query string. If not specified, the server returns the first page. + * pageToken: 'placeholder-value', + * // A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. + * productId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias licensing.licenseAssignments.listForProduct * @memberOf! () * @@ -480,6 +681,58 @@ export namespace licensing_v1 { /** * licensing.licenseAssignments.listForProductAndSku * @desc List all users assigned licenses for a specific product SKU. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/licensing.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 licensing = google.licensing('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/apps.licensing'], + * }); + * + * // 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 licensing.licenseAssignments.listForProductAndSku({ + * // Customer's customerId. A previous version of this API accepted the primary domain name as a value for this field. + * // If the customer is suspended, the server returns an error. + * customerId: 'placeholder-value', + * // The maxResults query string determines how many entries are returned on each page of a large response. This is an optional parameter. The value must be a positive number. + * maxResults: 'placeholder-value', + * // Token to fetch the next page of data. The maxResults query string is related to the pageToken since maxResults determines how many entries are returned on each page. This is an optional query string. If not specified, the server returns the first page. + * pageToken: 'placeholder-value', + * // A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. + * productId: 'placeholder-value', + * // A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. + * skuId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias licensing.licenseAssignments.listForProductAndSku * @memberOf! () * @@ -562,6 +815,74 @@ export namespace licensing_v1 { /** * licensing.licenseAssignments.patch * @desc Reassign a user's product SKU with a different SKU in the same product. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/licensing.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 licensing = google.licensing('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/apps.licensing'], + * }); + * + * // 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 licensing.licenseAssignments.patch({ + * // A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. + * productId: 'placeholder-value', + * // A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. + * skuId: 'placeholder-value', + * // The user's current primary email address. If the user's email address changes, use the new email address in your API requests. + * // Since a userId is subject to change, do not use a userId value as a key for persistent data. This key could break if the current user's email address changes. + * // If the userId is suspended, the license status changes. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etags": "my_etags", + * // "kind": "my_kind", + * // "productId": "my_productId", + * // "productName": "my_productName", + * // "selfLink": "my_selfLink", + * // "skuId": "my_skuId", + * // "skuName": "my_skuName", + * // "userId": "my_userId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etags": "my_etags", + * // "kind": "my_kind", + * // "productId": "my_productId", + * // "productName": "my_productName", + * // "selfLink": "my_selfLink", + * // "skuId": "my_skuId", + * // "skuName": "my_skuName", + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias licensing.licenseAssignments.patch * @memberOf! () * @@ -639,6 +960,74 @@ export namespace licensing_v1 { /** * licensing.licenseAssignments.update * @desc Reassign a user's product SKU with a different SKU in the same product. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/licensing.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 licensing = google.licensing('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/apps.licensing'], + * }); + * + * // 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 licensing.licenseAssignments.update({ + * // A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. + * productId: 'placeholder-value', + * // A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. + * skuId: 'placeholder-value', + * // The user's current primary email address. If the user's email address changes, use the new email address in your API requests. + * // Since a userId is subject to change, do not use a userId value as a key for persistent data. This key could break if the current user's email address changes. + * // If the userId is suspended, the license status changes. + * userId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etags": "my_etags", + * // "kind": "my_kind", + * // "productId": "my_productId", + * // "productName": "my_productName", + * // "selfLink": "my_selfLink", + * // "skuId": "my_skuId", + * // "skuName": "my_skuName", + * // "userId": "my_userId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etags": "my_etags", + * // "kind": "my_kind", + * // "productId": "my_productId", + * // "productName": "my_productName", + * // "selfLink": "my_selfLink", + * // "skuId": "my_skuId", + * // "skuName": "my_skuName", + * // "userId": "my_userId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias licensing.licenseAssignments.update * @memberOf! () * diff --git a/src/apis/lifesciences/v2beta.ts b/src/apis/lifesciences/v2beta.ts index 3a738577645..c249f9a5862 100644 --- a/src/apis/lifesciences/v2beta.ts +++ b/src/apis/lifesciences/v2beta.ts @@ -730,6 +730,50 @@ export namespace lifesciences_v2beta { /** * lifesciences.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/lifesciences.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 lifesciences = google.lifesciences('v2beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 lifesciences.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias lifesciences.projects.locations.get * @memberOf! () * @@ -799,6 +843,53 @@ export namespace lifesciences_v2beta { /** * lifesciences.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/lifesciences.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 lifesciences = google.lifesciences('v2beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 lifesciences.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias lifesciences.projects.locations.list * @memberOf! () * @@ -922,6 +1013,50 @@ export namespace lifesciences_v2beta { /** * lifesciences.projects.locations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients may use Operations.GetOperation or Operations.ListOperations to check whether the cancellation succeeded or the operation completed despite cancellation. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission: * `lifesciences.operations.cancel` + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/lifesciences.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 lifesciences = google.lifesciences('v2beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 lifesciences.projects.locations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias lifesciences.projects.locations.operations.cancel * @memberOf! () * @@ -995,6 +1130,50 @@ export namespace lifesciences_v2beta { /** * lifesciences.projects.locations.operations.get * @desc 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. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission: * `lifesciences.operations.get` + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/lifesciences.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 lifesciences = google.lifesciences('v2beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 lifesciences.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias lifesciences.projects.locations.operations.get * @memberOf! () * @@ -1066,6 +1245,64 @@ export namespace lifesciences_v2beta { /** * lifesciences.projects.locations.operations.list * @desc Lists operations that match the specified filter in the request. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission: * `lifesciences.operations.list` + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/lifesciences.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 lifesciences = google.lifesciences('v2beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 lifesciences.projects.locations.operations.list({ + * // A string for filtering Operations. + * // The following filter fields are supported: + * // + * // * createTime: The time this job was created + * // * events: The set of event (names) that have occurred while running + * // the pipeline. The : operator can be used to determine if a + * // particular event has occurred. + * // * error: If the pipeline is running, this value is NULL. Once the + * // pipeline finishes, the value is the standard Google error code. + * // * labels.key or labels."key with space" where key is a label key. + * // * done: If the pipeline is running, this value is false. Once the + * // pipeline finishes, the value is true. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location', + * // The maximum number of results to return. The maximum value is 256. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias lifesciences.projects.locations.operations.list * @memberOf! () * @@ -1206,6 +1443,59 @@ export namespace lifesciences_v2beta { /** * lifesciences.projects.locations.pipelines.run * @desc Runs a pipeline. The returned Operation's metadata field will contain a google.cloud.lifesciences.v2beta.Metadata object describing the status of the pipeline execution. The response field will contain a google.cloud.lifesciences.v2beta.RunPipelineResponse object if the pipeline completes successfully. **Note:** Before you can use this method, the *Life Sciences Service Agent* must have access to your project. This is done automatically when the Cloud Life Sciences API is first enabled, but if you delete this permission you must disable and re-enable the API to grant the Life Sciences Service Agent the required permissions. Authorization requires the following [Google IAM](https://cloud.google.com/iam/) permission: * `lifesciences.workflows.run` + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/lifesciences.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 lifesciences = google.lifesciences('v2beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 lifesciences.projects.locations.pipelines.run({ + * // The project and location that this request should be executed against. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labels": {}, + * // "pipeline": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias lifesciences.projects.locations.pipelines.run * @memberOf! () * diff --git a/src/apis/logging/v2.ts b/src/apis/logging/v2.ts index fed49e309b6..54ff4d30d33 100644 --- a/src/apis/logging/v2.ts +++ b/src/apis/logging/v2.ts @@ -1063,6 +1063,61 @@ export namespace logging_v2 { /** * logging.billingAccounts.buckets.get * @desc Gets a bucket (Beta). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.billingAccounts.buckets.get({ + * // Required. The resource name of the bucket: + * // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". + * name: 'billingAccounts/my-billingAccount/buckets/my-bucket', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "retentionDays": 0, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.billingAccounts.buckets.get * @memberOf! () * @@ -1154,6 +1209,72 @@ export namespace logging_v2 { /** * logging.billingAccounts.exclusions.create * @desc Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.billingAccounts.exclusions.create({ + * // Required. The parent resource in which to create the exclusion: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // Examples: "projects/my-logging-project", "organizations/123456789". + * parent: 'billingAccounts/my-billingAccount', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.billingAccounts.exclusions.create * @memberOf! () * @@ -1229,6 +1350,52 @@ export namespace logging_v2 { /** * logging.billingAccounts.exclusions.delete * @desc Deletes an exclusion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.billingAccounts.exclusions.delete({ + * // Required. The resource name of an existing exclusion to delete: + * // "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * // "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * // "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * // Example: "projects/my-project-id/exclusions/my-exclusion-id". + * name: 'billingAccounts/my-billingAccount/exclusions/my-exclusion', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.billingAccounts.exclusions.delete * @memberOf! () * @@ -1298,6 +1465,61 @@ export namespace logging_v2 { /** * logging.billingAccounts.exclusions.get * @desc Gets the description of an exclusion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.billingAccounts.exclusions.get({ + * // Required. The resource name of an existing exclusion: + * // "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * // "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * // "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * // Example: "projects/my-project-id/exclusions/my-exclusion-id". + * name: 'billingAccounts/my-billingAccount/exclusions/my-exclusion', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.billingAccounts.exclusions.get * @memberOf! () * @@ -1369,6 +1591,61 @@ export namespace logging_v2 { /** * logging.billingAccounts.exclusions.list * @desc Lists all the exclusions in a parent resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.billingAccounts.exclusions.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The parent resource whose exclusions are to be listed. + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // + * parent: 'billingAccounts/my-billingAccount', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "exclusions": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.billingAccounts.exclusions.list * @memberOf! () * @@ -1447,6 +1724,74 @@ export namespace logging_v2 { /** * logging.billingAccounts.exclusions.patch * @desc Changes one or more properties of an existing exclusion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.billingAccounts.exclusions.patch({ + * // Required. The resource name of the exclusion to update: + * // "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * // "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * // "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * // Example: "projects/my-project-id/exclusions/my-exclusion-id". + * name: 'billingAccounts/my-billingAccount/exclusions/my-exclusion', + * // Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.billingAccounts.exclusions.patch * @memberOf! () * @@ -1621,6 +1966,61 @@ export namespace logging_v2 { /** * logging.billingAccounts.locations.buckets.list * @desc Lists buckets (Beta). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.billingAccounts.locations.buckets.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The parent resource whose buckets are to be listed: + * // "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + * // "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + * // Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets. + * parent: 'billingAccounts/my-billingAccount/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "buckets": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.billingAccounts.locations.buckets.list * @memberOf! () * @@ -1697,6 +2097,75 @@ export namespace logging_v2 { /** * logging.billingAccounts.locations.buckets.patch * @desc Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created. This method is in Beta. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.billingAccounts.locations.buckets.patch({ + * // Required. The full resource name of the bucket to update. + * // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property + * name: + * 'billingAccounts/my-billingAccount/locations/my-location/buckets/my-bucket', + * // Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=retention_days. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "retentionDays": 0, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "retentionDays": 0, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.billingAccounts.locations.buckets.patch * @memberOf! () * @@ -1819,6 +2288,52 @@ export namespace logging_v2 { /** * logging.billingAccounts.logs.delete * @desc Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.billingAccounts.logs.delete({ + * // Required. The resource name of the log to delete: + * // "projects/[PROJECT_ID]/logs/[LOG_ID]" + * // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + * // "folders/[FOLDER_ID]/logs/[LOG_ID]" + * // [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + * logName: 'billingAccounts/my-billingAccount/logs/my-log', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.billingAccounts.logs.delete * @memberOf! () * @@ -1888,6 +2403,61 @@ export namespace logging_v2 { /** * logging.billingAccounts.logs.list * @desc Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.billingAccounts.logs.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The resource name that owns the logs: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // + * parent: 'billingAccounts/my-billingAccount', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "logNames": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.billingAccounts.logs.list * @memberOf! () * @@ -2001,6 +2571,84 @@ export namespace logging_v2 { /** * logging.billingAccounts.sinks.create * @desc Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.billingAccounts.sinks.create({ + * // Required. The resource in which to create the sink: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // Examples: "projects/my-logging-project", "organizations/123456789". + * parent: 'billingAccounts/my-billingAccount', + * // Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. + * uniqueWriterIdentity: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.billingAccounts.sinks.create * @memberOf! () * @@ -2075,6 +2723,52 @@ export namespace logging_v2 { /** * logging.billingAccounts.sinks.delete * @desc Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.billingAccounts.sinks.delete({ + * // Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: 'billingAccounts/my-billingAccount/sinks/my-sink', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.billingAccounts.sinks.delete * @memberOf! () * @@ -2144,6 +2838,66 @@ export namespace logging_v2 { /** * logging.billingAccounts.sinks.get * @desc Gets a sink. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.billingAccounts.sinks.get({ + * // Required. The resource name of the sink: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: 'billingAccounts/my-billingAccount/sinks/my-sink', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.billingAccounts.sinks.get * @memberOf! () * @@ -2213,6 +2967,61 @@ export namespace logging_v2 { /** * logging.billingAccounts.sinks.list * @desc Lists sinks. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.billingAccounts.sinks.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The parent resource whose sinks are to be listed: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // + * parent: 'billingAccounts/my-billingAccount', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "sinks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.billingAccounts.sinks.list * @memberOf! () * @@ -2289,6 +3098,89 @@ export namespace logging_v2 { /** * logging.billingAccounts.sinks.patch * @desc Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.billingAccounts.sinks.patch({ + * // Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: 'billingAccounts/my-billingAccount/sinks/my-sink', + * // Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + * // If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + * // If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + * // It is an error if the old value is true and the new value is set to false or defaulted to false. + * uniqueWriterIdentity: 'placeholder-value', + * // Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.billingAccounts.sinks.patch * @memberOf! () * @@ -2361,6 +3253,89 @@ export namespace logging_v2 { /** * logging.billingAccounts.sinks.update * @desc Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.billingAccounts.sinks.update({ + * // Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: 'billingAccounts/my-billingAccount/sinks/my-sink', + * // Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + * // If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + * // If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + * // It is an error if the old value is true and the new value is set to false or defaulted to false. + * uniqueWriterIdentity: 'placeholder-value', + * // Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.billingAccounts.sinks.update * @memberOf! () * @@ -2556,6 +3531,62 @@ export namespace logging_v2 { /** * logging.entries.list * @desc Lists log entries. Use this method to retrieve log entries that originated from a project/folder/organization/billing account. For ways to export log entries, see Exporting Logs. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.entries.list({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "filter": "my_filter", + * // "orderBy": "my_orderBy", + * // "pageSize": 0, + * // "pageToken": "my_pageToken", + * // "projectIds": [], + * // "resourceNames": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "entries": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.entries.list * @memberOf! () * @@ -2628,6 +3659,58 @@ export namespace logging_v2 { /** * logging.entries.write * @desc Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 different resources (projects, organizations, billing accounts or folders) + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.write', + * ], + * }); + * + * // 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 logging.entries.write({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dryRun": false, + * // "entries": [], + * // "labels": {}, + * // "logName": "my_logName", + * // "partialSuccess": false, + * // "resource": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.entries.write * @memberOf! () * @@ -2730,6 +3813,72 @@ export namespace logging_v2 { /** * logging.exclusions.create * @desc Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.exclusions.create({ + * // Required. The parent resource in which to create the exclusion: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // Examples: "projects/my-logging-project", "organizations/123456789". + * parent: '[^/]+/[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.exclusions.create * @memberOf! () * @@ -2805,6 +3954,52 @@ export namespace logging_v2 { /** * logging.exclusions.delete * @desc Deletes an exclusion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.exclusions.delete({ + * // Required. The resource name of an existing exclusion to delete: + * // "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * // "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * // "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * // Example: "projects/my-project-id/exclusions/my-exclusion-id". + * name: '[^/]+/[^/]+/exclusions/my-exclusion', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.exclusions.delete * @memberOf! () * @@ -2874,6 +4069,61 @@ export namespace logging_v2 { /** * logging.exclusions.get * @desc Gets the description of an exclusion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.exclusions.get({ + * // Required. The resource name of an existing exclusion: + * // "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * // "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * // "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * // Example: "projects/my-project-id/exclusions/my-exclusion-id". + * name: '[^/]+/[^/]+/exclusions/my-exclusion', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.exclusions.get * @memberOf! () * @@ -2944,6 +4194,61 @@ export namespace logging_v2 { /** * logging.exclusions.list * @desc Lists all the exclusions in a parent resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.exclusions.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The parent resource whose exclusions are to be listed. + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // + * parent: '[^/]+/[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "exclusions": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.exclusions.list * @memberOf! () * @@ -3021,6 +4326,74 @@ export namespace logging_v2 { /** * logging.exclusions.patch * @desc Changes one or more properties of an existing exclusion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.exclusions.patch({ + * // Required. The resource name of the exclusion to update: + * // "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * // "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * // "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * // Example: "projects/my-project-id/exclusions/my-exclusion-id". + * name: '[^/]+/[^/]+/exclusions/my-exclusion', + * // Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.exclusions.patch * @memberOf! () * @@ -3195,6 +4568,72 @@ export namespace logging_v2 { /** * logging.folders.exclusions.create * @desc Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.folders.exclusions.create({ + * // Required. The parent resource in which to create the exclusion: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // Examples: "projects/my-logging-project", "organizations/123456789". + * parent: 'folders/my-folder', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.folders.exclusions.create * @memberOf! () * @@ -3270,6 +4709,52 @@ export namespace logging_v2 { /** * logging.folders.exclusions.delete * @desc Deletes an exclusion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.folders.exclusions.delete({ + * // Required. The resource name of an existing exclusion to delete: + * // "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * // "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * // "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * // Example: "projects/my-project-id/exclusions/my-exclusion-id". + * name: 'folders/my-folder/exclusions/my-exclusion', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.folders.exclusions.delete * @memberOf! () * @@ -3339,6 +4824,61 @@ export namespace logging_v2 { /** * logging.folders.exclusions.get * @desc Gets the description of an exclusion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.folders.exclusions.get({ + * // Required. The resource name of an existing exclusion: + * // "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * // "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * // "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * // Example: "projects/my-project-id/exclusions/my-exclusion-id". + * name: 'folders/my-folder/exclusions/my-exclusion', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.folders.exclusions.get * @memberOf! () * @@ -3410,6 +4950,61 @@ export namespace logging_v2 { /** * logging.folders.exclusions.list * @desc Lists all the exclusions in a parent resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.folders.exclusions.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The parent resource whose exclusions are to be listed. + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // + * parent: 'folders/my-folder', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "exclusions": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.folders.exclusions.list * @memberOf! () * @@ -3488,6 +5083,74 @@ export namespace logging_v2 { /** * logging.folders.exclusions.patch * @desc Changes one or more properties of an existing exclusion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.folders.exclusions.patch({ + * // Required. The resource name of the exclusion to update: + * // "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * // "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * // "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * // Example: "projects/my-project-id/exclusions/my-exclusion-id". + * name: 'folders/my-folder/exclusions/my-exclusion', + * // Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.folders.exclusions.patch * @memberOf! () * @@ -3660,6 +5323,61 @@ export namespace logging_v2 { /** * logging.folders.locations.buckets.get * @desc Gets a bucket (Beta). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.folders.locations.buckets.get({ + * // Required. The resource name of the bucket: + * // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". + * name: 'folders/my-folder/locations/my-location/buckets/my-bucket', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "retentionDays": 0, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.folders.locations.buckets.get * @memberOf! () * @@ -3731,6 +5449,61 @@ export namespace logging_v2 { /** * logging.folders.locations.buckets.list * @desc Lists buckets (Beta). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.folders.locations.buckets.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The parent resource whose buckets are to be listed: + * // "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + * // "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + * // Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets. + * parent: 'folders/my-folder/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "buckets": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.folders.locations.buckets.list * @memberOf! () * @@ -3807,6 +5580,74 @@ export namespace logging_v2 { /** * logging.folders.locations.buckets.patch * @desc Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created. This method is in Beta. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.folders.locations.buckets.patch({ + * // Required. The full resource name of the bucket to update. + * // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property + * name: 'folders/my-folder/locations/my-location/buckets/my-bucket', + * // Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=retention_days. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "retentionDays": 0, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "retentionDays": 0, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.folders.locations.buckets.patch * @memberOf! () * @@ -3941,6 +5782,52 @@ export namespace logging_v2 { /** * logging.folders.logs.delete * @desc Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.folders.logs.delete({ + * // Required. The resource name of the log to delete: + * // "projects/[PROJECT_ID]/logs/[LOG_ID]" + * // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + * // "folders/[FOLDER_ID]/logs/[LOG_ID]" + * // [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + * logName: 'folders/my-folder/logs/my-log', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.folders.logs.delete * @memberOf! () * @@ -4010,6 +5897,61 @@ export namespace logging_v2 { /** * logging.folders.logs.list * @desc Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.folders.logs.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The resource name that owns the logs: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // + * parent: 'folders/my-folder', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "logNames": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.folders.logs.list * @memberOf! () * @@ -4123,6 +6065,84 @@ export namespace logging_v2 { /** * logging.folders.sinks.create * @desc Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.folders.sinks.create({ + * // Required. The resource in which to create the sink: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // Examples: "projects/my-logging-project", "organizations/123456789". + * parent: 'folders/my-folder', + * // Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. + * uniqueWriterIdentity: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.folders.sinks.create * @memberOf! () * @@ -4197,6 +6217,52 @@ export namespace logging_v2 { /** * logging.folders.sinks.delete * @desc Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.folders.sinks.delete({ + * // Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: 'folders/my-folder/sinks/my-sink', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.folders.sinks.delete * @memberOf! () * @@ -4266,6 +6332,66 @@ export namespace logging_v2 { /** * logging.folders.sinks.get * @desc Gets a sink. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.folders.sinks.get({ + * // Required. The resource name of the sink: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: 'folders/my-folder/sinks/my-sink', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.folders.sinks.get * @memberOf! () * @@ -4335,6 +6461,61 @@ export namespace logging_v2 { /** * logging.folders.sinks.list * @desc Lists sinks. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.folders.sinks.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The parent resource whose sinks are to be listed: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // + * parent: 'folders/my-folder', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "sinks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.folders.sinks.list * @memberOf! () * @@ -4411,6 +6592,89 @@ export namespace logging_v2 { /** * logging.folders.sinks.patch * @desc Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.folders.sinks.patch({ + * // Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: 'folders/my-folder/sinks/my-sink', + * // Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + * // If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + * // If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + * // It is an error if the old value is true and the new value is set to false or defaulted to false. + * uniqueWriterIdentity: 'placeholder-value', + * // Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.folders.sinks.patch * @memberOf! () * @@ -4483,6 +6747,89 @@ export namespace logging_v2 { /** * logging.folders.sinks.update * @desc Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.folders.sinks.update({ + * // Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: 'folders/my-folder/sinks/my-sink', + * // Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + * // If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + * // If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + * // It is an error if the old value is true and the new value is set to false or defaulted to false. + * uniqueWriterIdentity: 'placeholder-value', + * // Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.folders.sinks.update * @memberOf! () * @@ -4687,6 +7034,61 @@ export namespace logging_v2 { /** * logging.locations.buckets.get * @desc Gets a bucket (Beta). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.locations.buckets.get({ + * // Required. The resource name of the bucket: + * // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". + * name: '[^/]+/[^/]+/locations/my-location/buckets/my-bucket', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "retentionDays": 0, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.locations.buckets.get * @memberOf! () * @@ -4758,6 +7160,61 @@ export namespace logging_v2 { /** * logging.locations.buckets.list * @desc Lists buckets (Beta). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.locations.buckets.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The parent resource whose buckets are to be listed: + * // "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + * // "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + * // Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets. + * parent: '[^/]+/[^/]+/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "buckets": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.locations.buckets.list * @memberOf! () * @@ -4834,6 +7291,74 @@ export namespace logging_v2 { /** * logging.locations.buckets.patch * @desc Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created. This method is in Beta. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.locations.buckets.patch({ + * // Required. The full resource name of the bucket to update. + * // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property + * name: '[^/]+/[^/]+/locations/my-location/buckets/my-bucket', + * // Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=retention_days. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "retentionDays": 0, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "retentionDays": 0, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.locations.buckets.patch * @memberOf! () * @@ -4968,6 +7493,52 @@ export namespace logging_v2 { /** * logging.logs.delete * @desc Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.logs.delete({ + * // Required. The resource name of the log to delete: + * // "projects/[PROJECT_ID]/logs/[LOG_ID]" + * // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + * // "folders/[FOLDER_ID]/logs/[LOG_ID]" + * // [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + * logName: '[^/]+/[^/]+/logs/my-log', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.logs.delete * @memberOf! () * @@ -5036,6 +7607,61 @@ export namespace logging_v2 { /** * logging.logs.list * @desc Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.logs.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The resource name that owns the logs: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // + * parent: '[^/]+/[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "logNames": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.logs.list * @memberOf! () * @@ -5146,6 +7772,54 @@ export namespace logging_v2 { /** * logging.monitoredResourceDescriptors.list * @desc Lists the descriptors for monitored resource types used by Logging. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.monitoredResourceDescriptors.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "resourceDescriptors": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.monitoredResourceDescriptors.list * @memberOf! () * @@ -5270,6 +7944,58 @@ export namespace logging_v2 { /** * logging.organizations.getCmekSettings * @desc Gets the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.See Enabling CMEK for Logs Router for more information. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.organizations.getCmekSettings({ + * // Required. The resource for which to retrieve CMEK settings. + * // "projects/[PROJECT_ID]/cmekSettings" + * // "organizations/[ORGANIZATION_ID]/cmekSettings" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + * // "folders/[FOLDER_ID]/cmekSettings" + * // Example: "organizations/12345/cmekSettings".Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization. + * name: 'organizations/my-organization', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kmsKeyName": "my_kmsKeyName", + * // "name": "my_name", + * // "serviceAccountId": "my_serviceAccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.organizations.getCmekSettings * @memberOf! () * @@ -5344,6 +8070,68 @@ export namespace logging_v2 { /** * logging.organizations.updateCmekSettings * @desc Updates the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.UpdateCmekSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled.See Enabling CMEK for Logs Router for more information. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.organizations.updateCmekSettings({ + * // Required. The resource name for the CMEK settings to update. + * // "projects/[PROJECT_ID]/cmekSettings" + * // "organizations/[ORGANIZATION_ID]/cmekSettings" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + * // "folders/[FOLDER_ID]/cmekSettings" + * // Example: "organizations/12345/cmekSettings".Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization. + * name: 'organizations/my-organization', + * // Optional. Field mask identifying which fields from cmek_settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.See FieldMask for more information.Example: "updateMask=kmsKeyName" + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kmsKeyName": "my_kmsKeyName", + * // "name": "my_name", + * // "serviceAccountId": "my_serviceAccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kmsKeyName": "my_kmsKeyName", + * // "name": "my_name", + * // "serviceAccountId": "my_serviceAccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.organizations.updateCmekSettings * @memberOf! () * @@ -5463,6 +8251,72 @@ export namespace logging_v2 { /** * logging.organizations.exclusions.create * @desc Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.organizations.exclusions.create({ + * // Required. The parent resource in which to create the exclusion: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // Examples: "projects/my-logging-project", "organizations/123456789". + * parent: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.organizations.exclusions.create * @memberOf! () * @@ -5538,6 +8392,52 @@ export namespace logging_v2 { /** * logging.organizations.exclusions.delete * @desc Deletes an exclusion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.organizations.exclusions.delete({ + * // Required. The resource name of an existing exclusion to delete: + * // "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * // "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * // "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * // Example: "projects/my-project-id/exclusions/my-exclusion-id". + * name: 'organizations/my-organization/exclusions/my-exclusion', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.organizations.exclusions.delete * @memberOf! () * @@ -5607,6 +8507,61 @@ export namespace logging_v2 { /** * logging.organizations.exclusions.get * @desc Gets the description of an exclusion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.organizations.exclusions.get({ + * // Required. The resource name of an existing exclusion: + * // "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * // "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * // "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * // Example: "projects/my-project-id/exclusions/my-exclusion-id". + * name: 'organizations/my-organization/exclusions/my-exclusion', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.organizations.exclusions.get * @memberOf! () * @@ -5678,6 +8633,61 @@ export namespace logging_v2 { /** * logging.organizations.exclusions.list * @desc Lists all the exclusions in a parent resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.organizations.exclusions.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The parent resource whose exclusions are to be listed. + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // + * parent: 'organizations/my-organization', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "exclusions": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.organizations.exclusions.list * @memberOf! () * @@ -5756,6 +8766,74 @@ export namespace logging_v2 { /** * logging.organizations.exclusions.patch * @desc Changes one or more properties of an existing exclusion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.organizations.exclusions.patch({ + * // Required. The resource name of the exclusion to update: + * // "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * // "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * // "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * // Example: "projects/my-project-id/exclusions/my-exclusion-id". + * name: 'organizations/my-organization/exclusions/my-exclusion', + * // Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.organizations.exclusions.patch * @memberOf! () * @@ -5928,6 +9006,62 @@ export namespace logging_v2 { /** * logging.organizations.locations.buckets.get * @desc Gets a bucket (Beta). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.organizations.locations.buckets.get({ + * // Required. The resource name of the bucket: + * // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". + * name: + * 'organizations/my-organization/locations/my-location/buckets/my-bucket', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "retentionDays": 0, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.organizations.locations.buckets.get * @memberOf! () * @@ -5999,6 +9133,61 @@ export namespace logging_v2 { /** * logging.organizations.locations.buckets.list * @desc Lists buckets (Beta). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.organizations.locations.buckets.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The parent resource whose buckets are to be listed: + * // "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + * // "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + * // Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets. + * parent: 'organizations/my-organization/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "buckets": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.organizations.locations.buckets.list * @memberOf! () * @@ -6075,6 +9264,75 @@ export namespace logging_v2 { /** * logging.organizations.locations.buckets.patch * @desc Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created. This method is in Beta. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.organizations.locations.buckets.patch({ + * // Required. The full resource name of the bucket to update. + * // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property + * name: + * 'organizations/my-organization/locations/my-location/buckets/my-bucket', + * // Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=retention_days. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "retentionDays": 0, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "retentionDays": 0, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.organizations.locations.buckets.patch * @memberOf! () * @@ -6209,6 +9467,52 @@ export namespace logging_v2 { /** * logging.organizations.logs.delete * @desc Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.organizations.logs.delete({ + * // Required. The resource name of the log to delete: + * // "projects/[PROJECT_ID]/logs/[LOG_ID]" + * // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + * // "folders/[FOLDER_ID]/logs/[LOG_ID]" + * // [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + * logName: 'organizations/my-organization/logs/my-log', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.organizations.logs.delete * @memberOf! () * @@ -6278,6 +9582,61 @@ export namespace logging_v2 { /** * logging.organizations.logs.list * @desc Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.organizations.logs.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The resource name that owns the logs: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // + * parent: 'organizations/my-organization', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "logNames": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.organizations.logs.list * @memberOf! () * @@ -6391,6 +9750,84 @@ export namespace logging_v2 { /** * logging.organizations.sinks.create * @desc Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.organizations.sinks.create({ + * // Required. The resource in which to create the sink: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // Examples: "projects/my-logging-project", "organizations/123456789". + * parent: 'organizations/my-organization', + * // Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. + * uniqueWriterIdentity: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.organizations.sinks.create * @memberOf! () * @@ -6465,6 +9902,52 @@ export namespace logging_v2 { /** * logging.organizations.sinks.delete * @desc Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.organizations.sinks.delete({ + * // Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: 'organizations/my-organization/sinks/my-sink', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.organizations.sinks.delete * @memberOf! () * @@ -6534,6 +10017,66 @@ export namespace logging_v2 { /** * logging.organizations.sinks.get * @desc Gets a sink. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.organizations.sinks.get({ + * // Required. The resource name of the sink: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: 'organizations/my-organization/sinks/my-sink', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.organizations.sinks.get * @memberOf! () * @@ -6603,6 +10146,61 @@ export namespace logging_v2 { /** * logging.organizations.sinks.list * @desc Lists sinks. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.organizations.sinks.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The parent resource whose sinks are to be listed: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // + * parent: 'organizations/my-organization', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "sinks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.organizations.sinks.list * @memberOf! () * @@ -6679,6 +10277,89 @@ export namespace logging_v2 { /** * logging.organizations.sinks.patch * @desc Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.organizations.sinks.patch({ + * // Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: 'organizations/my-organization/sinks/my-sink', + * // Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + * // If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + * // If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + * // It is an error if the old value is true and the new value is set to false or defaulted to false. + * uniqueWriterIdentity: 'placeholder-value', + * // Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.organizations.sinks.patch * @memberOf! () * @@ -6751,6 +10432,89 @@ export namespace logging_v2 { /** * logging.organizations.sinks.update * @desc Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.organizations.sinks.update({ + * // Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: 'organizations/my-organization/sinks/my-sink', + * // Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + * // If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + * // If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + * // It is an error if the old value is true and the new value is set to false or defaulted to false. + * uniqueWriterIdentity: 'placeholder-value', + * // Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.organizations.sinks.update * @memberOf! () * @@ -6963,6 +10727,72 @@ export namespace logging_v2 { /** * logging.projects.exclusions.create * @desc Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.projects.exclusions.create({ + * // Required. The parent resource in which to create the exclusion: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // Examples: "projects/my-logging-project", "organizations/123456789". + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.exclusions.create * @memberOf! () * @@ -7038,6 +10868,52 @@ export namespace logging_v2 { /** * logging.projects.exclusions.delete * @desc Deletes an exclusion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.projects.exclusions.delete({ + * // Required. The resource name of an existing exclusion to delete: + * // "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * // "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * // "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * // Example: "projects/my-project-id/exclusions/my-exclusion-id". + * name: 'projects/my-project/exclusions/my-exclusion', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.exclusions.delete * @memberOf! () * @@ -7107,6 +10983,61 @@ export namespace logging_v2 { /** * logging.projects.exclusions.get * @desc Gets the description of an exclusion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.projects.exclusions.get({ + * // Required. The resource name of an existing exclusion: + * // "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * // "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * // "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * // Example: "projects/my-project-id/exclusions/my-exclusion-id". + * name: 'projects/my-project/exclusions/my-exclusion', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.exclusions.get * @memberOf! () * @@ -7178,6 +11109,61 @@ export namespace logging_v2 { /** * logging.projects.exclusions.list * @desc Lists all the exclusions in a parent resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.projects.exclusions.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The parent resource whose exclusions are to be listed. + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "exclusions": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.exclusions.list * @memberOf! () * @@ -7256,6 +11242,74 @@ export namespace logging_v2 { /** * logging.projects.exclusions.patch * @desc Changes one or more properties of an existing exclusion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.projects.exclusions.patch({ + * // Required. The resource name of the exclusion to update: + * // "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * // "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * // "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * // Example: "projects/my-project-id/exclusions/my-exclusion-id". + * name: 'projects/my-project/exclusions/my-exclusion', + * // Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "disabled": false, + * // "filter": "my_filter", + * // "name": "my_name", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.exclusions.patch * @memberOf! () * @@ -7428,6 +11482,61 @@ export namespace logging_v2 { /** * logging.projects.locations.buckets.get * @desc Gets a bucket (Beta). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.projects.locations.buckets.get({ + * // Required. The resource name of the bucket: + * // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". + * name: 'projects/my-project/locations/my-location/buckets/my-bucket', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "retentionDays": 0, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.locations.buckets.get * @memberOf! () * @@ -7499,6 +11608,61 @@ export namespace logging_v2 { /** * logging.projects.locations.buckets.list * @desc Lists buckets (Beta). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.projects.locations.buckets.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The parent resource whose buckets are to be listed: + * // "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + * // "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + * // Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "buckets": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.locations.buckets.list * @memberOf! () * @@ -7575,6 +11739,74 @@ export namespace logging_v2 { /** * logging.projects.locations.buckets.patch * @desc Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created. This method is in Beta. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.projects.locations.buckets.patch({ + * // Required. The full resource name of the bucket to update. + * // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * // Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property + * name: 'projects/my-project/locations/my-location/buckets/my-bucket', + * // Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=retention_days. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "retentionDays": 0, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "lifecycleState": "my_lifecycleState", + * // "name": "my_name", + * // "retentionDays": 0, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.locations.buckets.patch * @memberOf! () * @@ -7709,6 +11941,52 @@ export namespace logging_v2 { /** * logging.projects.logs.delete * @desc Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.projects.logs.delete({ + * // Required. The resource name of the log to delete: + * // "projects/[PROJECT_ID]/logs/[LOG_ID]" + * // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + * // "folders/[FOLDER_ID]/logs/[LOG_ID]" + * // [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + * logName: 'projects/my-project/logs/my-log', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.logs.delete * @memberOf! () * @@ -7778,6 +12056,61 @@ export namespace logging_v2 { /** * logging.projects.logs.list * @desc Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.projects.logs.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The resource name that owns the logs: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "logNames": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.logs.list * @memberOf! () * @@ -7891,6 +12224,78 @@ export namespace logging_v2 { /** * logging.projects.metrics.create * @desc Creates a logs-based metric. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.write', + * ], + * }); + * + * // 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 logging.projects.metrics.create({ + * // Required. The resource name of the project in which to create the metric: + * // "projects/[PROJECT_ID]" + * // The new metric must be provided in the request. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucketOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "filter": "my_filter", + * // "labelExtractors": {}, + * // "metricDescriptor": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime", + * // "valueExtractor": "my_valueExtractor", + * // "version": "my_version" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucketOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "filter": "my_filter", + * // "labelExtractors": {}, + * // "metricDescriptor": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime", + * // "valueExtractor": "my_valueExtractor", + * // "version": "my_version" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.metrics.create * @memberOf! () * @@ -7966,6 +12371,50 @@ export namespace logging_v2 { /** * logging.projects.metrics.delete * @desc Deletes a logs-based metric. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.write', + * ], + * }); + * + * // 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 logging.projects.metrics.delete({ + * // Required. The resource name of the metric to delete: + * // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * // + * metricName: 'projects/my-project/metrics/my-metric', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.metrics.delete * @memberOf! () * @@ -8035,6 +12484,62 @@ export namespace logging_v2 { /** * logging.projects.metrics.get * @desc Gets a logs-based metric. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.projects.metrics.get({ + * // Required. The resource name of the desired metric: + * // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * // + * metricName: 'projects/my-project/metrics/my-metric', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucketOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "filter": "my_filter", + * // "labelExtractors": {}, + * // "metricDescriptor": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime", + * // "valueExtractor": "my_valueExtractor", + * // "version": "my_version" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.metrics.get * @memberOf! () * @@ -8106,6 +12611,58 @@ export namespace logging_v2 { /** * logging.projects.metrics.list * @desc Lists logs-based metrics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.projects.metrics.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The name of the project containing the metrics: + * // "projects/[PROJECT_ID]" + * // + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "metrics": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.metrics.list * @memberOf! () * @@ -8184,6 +12741,78 @@ export namespace logging_v2 { /** * logging.projects.metrics.update * @desc Creates or updates a logs-based metric. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.write', + * ], + * }); + * + * // 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 logging.projects.metrics.update({ + * // Required. The resource name of the metric to update: + * // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * // The updated metric must be provided in the request and it's name field must be the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a new metric is created. + * metricName: 'projects/my-project/metrics/my-metric', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucketOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "filter": "my_filter", + * // "labelExtractors": {}, + * // "metricDescriptor": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime", + * // "valueExtractor": "my_valueExtractor", + * // "version": "my_version" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucketOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "filter": "my_filter", + * // "labelExtractors": {}, + * // "metricDescriptor": {}, + * // "name": "my_name", + * // "updateTime": "my_updateTime", + * // "valueExtractor": "my_valueExtractor", + * // "version": "my_version" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.metrics.update * @memberOf! () * @@ -8342,6 +12971,84 @@ export namespace logging_v2 { /** * logging.projects.sinks.create * @desc Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.projects.sinks.create({ + * // Required. The resource in which to create the sink: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // Examples: "projects/my-logging-project", "organizations/123456789". + * parent: 'projects/my-project', + * // Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. + * uniqueWriterIdentity: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.sinks.create * @memberOf! () * @@ -8416,6 +13123,52 @@ export namespace logging_v2 { /** * logging.projects.sinks.delete * @desc Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.projects.sinks.delete({ + * // Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: 'projects/my-project/sinks/my-sink', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.sinks.delete * @memberOf! () * @@ -8485,6 +13238,66 @@ export namespace logging_v2 { /** * logging.projects.sinks.get * @desc Gets a sink. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.projects.sinks.get({ + * // Required. The resource name of the sink: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: 'projects/my-project/sinks/my-sink', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.sinks.get * @memberOf! () * @@ -8554,6 +13367,61 @@ export namespace logging_v2 { /** * logging.projects.sinks.list * @desc Lists sinks. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.projects.sinks.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The parent resource whose sinks are to be listed: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "sinks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.sinks.list * @memberOf! () * @@ -8630,6 +13498,89 @@ export namespace logging_v2 { /** * logging.projects.sinks.patch * @desc Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.projects.sinks.patch({ + * // Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: 'projects/my-project/sinks/my-sink', + * // Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + * // If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + * // If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + * // It is an error if the old value is true and the new value is set to false or defaulted to false. + * uniqueWriterIdentity: 'placeholder-value', + * // Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.sinks.patch * @memberOf! () * @@ -8702,6 +13653,89 @@ export namespace logging_v2 { /** * logging.projects.sinks.update * @desc Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.projects.sinks.update({ + * // Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: 'projects/my-project/sinks/my-sink', + * // Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + * // If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + * // If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + * // It is an error if the old value is true and the new value is set to false or defaulted to false. + * uniqueWriterIdentity: 'placeholder-value', + * // Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.projects.sinks.update * @memberOf! () * @@ -8897,6 +13931,84 @@ export namespace logging_v2 { /** * logging.sinks.create * @desc Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.sinks.create({ + * // Required. The resource in which to create the sink: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // Examples: "projects/my-logging-project", "organizations/123456789". + * parent: '[^/]+/[^/]+', + * // Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. + * uniqueWriterIdentity: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.sinks.create * @memberOf! () * @@ -8970,6 +14082,52 @@ export namespace logging_v2 { /** * logging.sinks.delete * @desc Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.sinks.delete({ + * // Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: '[^/]+/[^/]+/sinks/my-sink', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.sinks.delete * @memberOf! () * @@ -9038,6 +14196,66 @@ export namespace logging_v2 { /** * logging.sinks.get * @desc Gets a sink. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.sinks.get({ + * // Required. The resource name of the sink: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: '[^/]+/[^/]+/sinks/my-sink', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.sinks.get * @memberOf! () * @@ -9106,6 +14324,61 @@ export namespace logging_v2 { /** * logging.sinks.list * @desc Lists sinks. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.sinks.list({ + * // Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * pageSize: 'placeholder-value', + * // Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The parent resource whose sinks are to be listed: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // + * parent: '[^/]+/[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "sinks": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.sinks.list * @memberOf! () * @@ -9181,6 +14454,89 @@ export namespace logging_v2 { /** * logging.sinks.update * @desc Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.sinks.update({ + * // Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: '[^/]+/[^/]+/sinks/my-sink', + * // Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + * // If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + * // If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + * // It is an error if the old value is true and the new value is set to false or defaulted to false. + * uniqueWriterIdentity: 'placeholder-value', + * // Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bigqueryOptions": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": "my_destination", + * // "disabled": false, + * // "filter": "my_filter", + * // "includeChildren": false, + * // "name": "my_name", + * // "outputVersionFormat": "my_outputVersionFormat", + * // "updateTime": "my_updateTime", + * // "writerIdentity": "my_writerIdentity" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.sinks.update * @memberOf! () * @@ -9345,6 +14701,58 @@ export namespace logging_v2 { /** * logging.getCmekSettings * @desc Gets the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.See Enabling CMEK for Logs Router for more information. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/logging.admin', + * 'https://www.googleapis.com/auth/logging.read', + * ], + * }); + * + * // 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 logging.getCmekSettings({ + * // Required. The resource for which to retrieve CMEK settings. + * // "projects/[PROJECT_ID]/cmekSettings" + * // "organizations/[ORGANIZATION_ID]/cmekSettings" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + * // "folders/[FOLDER_ID]/cmekSettings" + * // Example: "organizations/12345/cmekSettings".Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization. + * name: '[^/]+/[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kmsKeyName": "my_kmsKeyName", + * // "name": "my_name", + * // "serviceAccountId": "my_serviceAccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.getCmekSettings * @memberOf! () * @@ -9419,6 +14827,68 @@ export namespace logging_v2 { /** * logging.updateCmekSettings * @desc Updates the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.UpdateCmekSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled.See Enabling CMEK for Logs Router for more information. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/logging.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 logging = google.logging('v2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/logging.admin', + * ], + * }); + * + * // 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 logging.updateCmekSettings({ + * // Required. The resource name for the CMEK settings to update. + * // "projects/[PROJECT_ID]/cmekSettings" + * // "organizations/[ORGANIZATION_ID]/cmekSettings" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + * // "folders/[FOLDER_ID]/cmekSettings" + * // Example: "organizations/12345/cmekSettings".Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization. + * name: '[^/]+/[^/]+', + * // Optional. Field mask identifying which fields from cmek_settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.See FieldMask for more information.Example: "updateMask=kmsKeyName" + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kmsKeyName": "my_kmsKeyName", + * // "name": "my_name", + * // "serviceAccountId": "my_serviceAccountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kmsKeyName": "my_kmsKeyName", + * // "name": "my_name", + * // "serviceAccountId": "my_serviceAccountId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias logging.updateCmekSettings * @memberOf! () * diff --git a/src/apis/managedidentities/v1.ts b/src/apis/managedidentities/v1.ts index 222e9a20675..c2fe74e2d7c 100644 --- a/src/apis/managedidentities/v1.ts +++ b/src/apis/managedidentities/v1.ts @@ -777,6 +777,50 @@ export namespace managedidentities_v1 { /** * managedidentities.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.get * @memberOf! () * @@ -847,6 +891,56 @@ export namespace managedidentities_v1 { /** * managedidentities.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // If true, the returned list will include locations which are not yet + * // revealed. + * includeUnrevealedLocations: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.list * @memberOf! () * @@ -991,6 +1085,61 @@ export namespace managedidentities_v1 { /** * managedidentities.projects.locations.global.domains.attachTrust * @desc Adds an AD trust to a domain. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.attachTrust( + * { + * // Required. The resource domain name, project name and location using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "trust": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.attachTrust * @memberOf! () * @@ -1067,6 +1216,83 @@ export namespace managedidentities_v1 { /** * managedidentities.projects.locations.global.domains.create * @desc Creates a Microsoft AD domain. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.create({ + * // Required. The fully qualified domain name. + * // e.g. mydomain.myorganization.com, with the following restrictions: + * // + * // * Must contain only lowercase letters, numbers, periods and hyphens. + * // * Must start with a letter. + * // * Must contain between 2-64 characters. + * // * Must end with a number or a letter. + * // * Must not start with period. + * // * First segement length (mydomain form example above) shouldn't exceed + * // 15 chars. + * // * The last segment cannot be fully numeric. + * // * Must be unique within the customer project. + * domainName: 'placeholder-value', + * // Required. The resource project name and location using the form: + * // `projects/{project_id}/locations/global` + * parent: 'projects/my-project/locations/global', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "admin": "my_admin", + * // "authorizedNetworks": [], + * // "createTime": "my_createTime", + * // "fqdn": "my_fqdn", + * // "labels": {}, + * // "locations": [], + * // "name": "my_name", + * // "reservedIpRange": "my_reservedIpRange", + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "trusts": [], + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.create * @memberOf! () * @@ -1144,6 +1370,51 @@ export namespace managedidentities_v1 { /** * managedidentities.projects.locations.global.domains.delete * @desc Deletes a domain. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.delete({ + * // Required. The domain resource name using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.delete * @memberOf! () * @@ -1216,6 +1487,61 @@ export namespace managedidentities_v1 { /** * managedidentities.projects.locations.global.domains.detachTrust * @desc Removes an AD trust. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.detachTrust( + * { + * // Required. The resource domain name, project name, and location using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "trust": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.detachTrust * @memberOf! () * @@ -1292,6 +1618,58 @@ export namespace managedidentities_v1 { /** * managedidentities.projects.locations.global.domains.get * @desc Gets information about a domain. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.get({ + * // Required. The domain resource name using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "admin": "my_admin", + * // "authorizedNetworks": [], + * // "createTime": "my_createTime", + * // "fqdn": "my_fqdn", + * // "labels": {}, + * // "locations": [], + * // "name": "my_name", + * // "reservedIpRange": "my_reservedIpRange", + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "trusts": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.get * @memberOf! () * @@ -1362,6 +1740,60 @@ export namespace managedidentities_v1 { /** * managedidentities.projects.locations.global.domains.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.getIamPolicy( + * { + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/global/domains/my-domain', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.getIamPolicy * @memberOf! () * @@ -1436,6 +1868,67 @@ export namespace managedidentities_v1 { /** * managedidentities.projects.locations.global.domains.list * @desc Lists domains in a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.list({ + * // Optional. A filter specifying constraints of a list operation. + * // For example, `Domain.fqdn="mydomain.myorginization"`. + * filter: 'placeholder-value', + * // Optional. Specifies the ordering of results. See + * // [Sorting + * // order](https://cloud.google.com/apis/design/design_patterns#sorting_order) + * // for more information. + * orderBy: 'placeholder-value', + * // Optional. The maximum number of items to return. + * // If not specified, a default value of 1000 will be used. + * // Regardless of the page_size value, the response may include a partial list. + * // Callers should rely on a response's + * // next_page_token + * // to determine if there are additional results to list. + * pageSize: 'placeholder-value', + * // Optional. The `next_page_token` value returned from a previous ListDomainsRequest + * // request, if any. + * pageToken: 'placeholder-value', + * // Required. The resource name of the domain location using the form: + * // `projects/{project_id}/locations/global` + * parent: 'projects/my-project/locations/global', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domains": [], + * // "nextPageToken": "my_nextPageToken", + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.list * @memberOf! () * @@ -1515,6 +2008,77 @@ export namespace managedidentities_v1 { /** * managedidentities.projects.locations.global.domains.patch * @desc Updates the metadata and configuration of a domain. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.patch({ + * // Required. The unique name of the domain using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}`. + * name: 'projects/my-project/locations/global/domains/my-domain', + * // Required. Mask of fields to update. At least one path must be supplied in this + * // field. The elements of the repeated paths field may only include + * // fields from Domain: + * // * `labels` + * // * `locations` + * // * `authorized_networks` + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "admin": "my_admin", + * // "authorizedNetworks": [], + * // "createTime": "my_createTime", + * // "fqdn": "my_fqdn", + * // "labels": {}, + * // "locations": [], + * // "name": "my_name", + * // "reservedIpRange": "my_reservedIpRange", + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "trusts": [], + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.patch * @memberOf! () * @@ -1589,6 +2153,62 @@ export namespace managedidentities_v1 { /** * managedidentities.projects.locations.global.domains.reconfigureTrust * @desc Updates the DNS conditional forwarder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.reconfigureTrust( + * { + * // Required. The resource domain name, project name and location using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "targetDnsIpAddresses": [], + * // "targetDomainName": "my_targetDomainName" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.reconfigureTrust * @memberOf! () * @@ -1665,6 +2285,55 @@ export namespace managedidentities_v1 { /** * managedidentities.projects.locations.global.domains.resetAdminPassword * @desc Resets a domain's administrator password. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.resetAdminPassword( + * { + * // Required. The domain resource name using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "password": "my_password" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.resetAdminPassword * @memberOf! () * @@ -1748,6 +2417,59 @@ export namespace managedidentities_v1 { /** * managedidentities.projects.locations.global.domains.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.setIamPolicy * @memberOf! () * @@ -1822,6 +2544,57 @@ export namespace managedidentities_v1 { /** * managedidentities.projects.locations.global.domains.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.testIamPermissions * @memberOf! () * @@ -1905,6 +2678,61 @@ export namespace managedidentities_v1 { /** * managedidentities.projects.locations.global.domains.validateTrust * @desc Validates a trust state, that the target domain is reachable, and that the target domain is able to accept incoming trust requests. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.validateTrust( + * { + * // Required. The resource domain name, project name, and location using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "trust": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.validateTrust * @memberOf! () * @@ -2218,6 +3046,52 @@ export namespace managedidentities_v1 { /** * managedidentities.projects.locations.global.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.operations.cancel( + * { + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/global/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.operations.cancel * @memberOf! () * @@ -2289,6 +3163,46 @@ export namespace managedidentities_v1 { /** * managedidentities.projects.locations.global.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.operations.delete( + * { + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/locations/global/operations/my-operation', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.operations.delete * @memberOf! () * @@ -2359,6 +3273,50 @@ export namespace managedidentities_v1 { /** * managedidentities.projects.locations.global.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/global/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.operations.get * @memberOf! () * @@ -2431,6 +3389,55 @@ export namespace managedidentities_v1 { /** * managedidentities.projects.locations.global.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.operations.list( + * { + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/global/operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.operations.list * @memberOf! () * diff --git a/src/apis/managedidentities/v1alpha1.ts b/src/apis/managedidentities/v1alpha1.ts index f9a6631b066..88873b00a39 100644 --- a/src/apis/managedidentities/v1alpha1.ts +++ b/src/apis/managedidentities/v1alpha1.ts @@ -749,6 +749,50 @@ export namespace managedidentities_v1alpha1 { /** * managedidentities.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.get * @memberOf! () * @@ -819,6 +863,56 @@ export namespace managedidentities_v1alpha1 { /** * managedidentities.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // If true, the returned list will include locations which are not yet + * // revealed. + * includeUnrevealedLocations: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.list * @memberOf! () * @@ -963,6 +1057,61 @@ export namespace managedidentities_v1alpha1 { /** * managedidentities.projects.locations.global.domains.attachTrust * @desc Adds AD trust in a given domain. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.attachTrust( + * { + * // The resource domain name, project name and location using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "trust": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.attachTrust * @memberOf! () * @@ -1039,6 +1188,83 @@ export namespace managedidentities_v1alpha1 { /** * managedidentities.projects.locations.global.domains.create * @desc Creates a Microsoft AD Domain in a given project. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.create({ + * // The fully qualified domain name. + * // e.g. mydomain.myorganization.com, with the following restrictions: + * // + * // * Must contain only lowercase letters, numbers, periods and hyphens. + * // * Must start with a letter. + * // * Must contain between 2-64 characters. + * // * Must end with a number or a letter. + * // * Must not start with period. + * // * Must be unique within the project. + * // * First segement length (mydomain form example above) shouldn't exceed + * // 15 chars. + * // * The last segment cannot be fully numeric. + * domainName: 'placeholder-value', + * // Resource project name and location using the form: + * // `projects/{project_id}/locations/global` + * parent: 'projects/my-project/locations/global', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "authorizedNetworks": [], + * // "createTime": "my_createTime", + * // "fqdn": "my_fqdn", + * // "labels": {}, + * // "locations": [], + * // "managedIdentitiesAdminName": "my_managedIdentitiesAdminName", + * // "name": "my_name", + * // "reservedIpRange": "my_reservedIpRange", + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "trusts": [], + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.create * @memberOf! () * @@ -1116,6 +1342,51 @@ export namespace managedidentities_v1alpha1 { /** * managedidentities.projects.locations.global.domains.delete * @desc Deletes identified domain. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.delete({ + * // Domain resource name using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.delete * @memberOf! () * @@ -1188,6 +1459,61 @@ export namespace managedidentities_v1alpha1 { /** * managedidentities.projects.locations.global.domains.detachTrust * @desc Removes identified trust. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.detachTrust( + * { + * // The resource domain name, project name, and location using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "trust": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.detachTrust * @memberOf! () * @@ -1264,6 +1590,58 @@ export namespace managedidentities_v1alpha1 { /** * managedidentities.projects.locations.global.domains.get * @desc Gets details of a single Domain. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.get({ + * // Domain resource name using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authorizedNetworks": [], + * // "createTime": "my_createTime", + * // "fqdn": "my_fqdn", + * // "labels": {}, + * // "locations": [], + * // "managedIdentitiesAdminName": "my_managedIdentitiesAdminName", + * // "name": "my_name", + * // "reservedIpRange": "my_reservedIpRange", + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "trusts": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.get * @memberOf! () * @@ -1334,6 +1712,60 @@ export namespace managedidentities_v1alpha1 { /** * managedidentities.projects.locations.global.domains.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.getIamPolicy( + * { + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/global/domains/my-domain', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.getIamPolicy * @memberOf! () * @@ -1408,6 +1840,63 @@ export namespace managedidentities_v1alpha1 { /** * managedidentities.projects.locations.global.domains.list * @desc Lists Domains in a given project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.list({ + * // Optional. Filter specifying constraints of a list operation. + * // For example, `Domain.fqdn="mydomain.myorginization"`. + * filter: 'placeholder-value', + * // Optional. Specifies the ordering of results following syntax at + * // https://cloud.google.com/apis/design/design_patterns#sorting_order. + * orderBy: 'placeholder-value', + * // If not specified, a default value of 1000 will be used by the service. + * // Regardless of the page_size value, the response may include a partial list + * // and a caller should only rely on response's + * // next_page_token + * // to determine if there are more instances left to be queried. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // Required. The resource name of the domain location using the form: + * // `projects/{project_id}/locations/global` + * parent: 'projects/my-project/locations/global', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domains": [], + * // "nextPageToken": "my_nextPageToken", + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.list * @memberOf! () * @@ -1487,6 +1976,78 @@ export namespace managedidentities_v1alpha1 { /** * managedidentities.projects.locations.global.domains.patch * @desc Updates the metadata and configuration of a specified domain. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.patch({ + * // Output only. Unique name of the domain in this scope including projects and + * // location using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}`. + * name: 'projects/my-project/locations/global/domains/my-domain', + * // Mask of fields to update. At least one path must be supplied in this + * // field. The elements of the repeated paths field may only include these + * // fields from Domain: + * // * `labels` + * // * `locations` + * // * `authorized_networks` + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "authorizedNetworks": [], + * // "createTime": "my_createTime", + * // "fqdn": "my_fqdn", + * // "labels": {}, + * // "locations": [], + * // "managedIdentitiesAdminName": "my_managedIdentitiesAdminName", + * // "name": "my_name", + * // "reservedIpRange": "my_reservedIpRange", + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "trusts": [], + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.patch * @memberOf! () * @@ -1561,6 +2122,61 @@ export namespace managedidentities_v1alpha1 { /** * managedidentities.projects.locations.global.domains.reconfigureTrust * @desc Updates the dns conditional forwarder. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.reconfigureTrust( + * { + * // The resource domain name, project name and location using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "trust": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.reconfigureTrust * @memberOf! () * @@ -1637,6 +2253,55 @@ export namespace managedidentities_v1alpha1 { /** * managedidentities.projects.locations.global.domains.resetAdminPassword * @desc Resets managed identities admin password identified by managed_identities_admin_name + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.resetAdminPassword( + * { + * // The domain resource name using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "password": "my_password" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.resetAdminPassword * @memberOf! () * @@ -1720,6 +2385,59 @@ export namespace managedidentities_v1alpha1 { /** * managedidentities.projects.locations.global.domains.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.setIamPolicy * @memberOf! () * @@ -1794,6 +2512,57 @@ export namespace managedidentities_v1alpha1 { /** * managedidentities.projects.locations.global.domains.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.testIamPermissions * @memberOf! () * @@ -1877,6 +2646,61 @@ export namespace managedidentities_v1alpha1 { /** * managedidentities.projects.locations.global.domains.validateTrust * @desc Validate the trust state Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.validateTrust( + * { + * // The resource domain name, project name, and location using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "trust": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.validateTrust * @memberOf! () * @@ -2190,6 +3014,52 @@ export namespace managedidentities_v1alpha1 { /** * managedidentities.projects.locations.global.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.operations.cancel( + * { + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/global/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.operations.cancel * @memberOf! () * @@ -2264,6 +3134,46 @@ export namespace managedidentities_v1alpha1 { /** * managedidentities.projects.locations.global.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.operations.delete( + * { + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/locations/global/operations/my-operation', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.operations.delete * @memberOf! () * @@ -2334,6 +3244,50 @@ export namespace managedidentities_v1alpha1 { /** * managedidentities.projects.locations.global.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/global/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.operations.get * @memberOf! () * @@ -2406,6 +3360,55 @@ export namespace managedidentities_v1alpha1 { /** * managedidentities.projects.locations.global.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.operations.list( + * { + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/global', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.operations.list * @memberOf! () * diff --git a/src/apis/managedidentities/v1beta1.ts b/src/apis/managedidentities/v1beta1.ts index f3da1a98c11..a94d7d43e2b 100644 --- a/src/apis/managedidentities/v1beta1.ts +++ b/src/apis/managedidentities/v1beta1.ts @@ -777,6 +777,50 @@ export namespace managedidentities_v1beta1 { /** * managedidentities.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.get * @memberOf! () * @@ -847,6 +891,56 @@ export namespace managedidentities_v1beta1 { /** * managedidentities.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // If true, the returned list will include locations which are not yet + * // revealed. + * includeUnrevealedLocations: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.list * @memberOf! () * @@ -991,6 +1085,61 @@ export namespace managedidentities_v1beta1 { /** * managedidentities.projects.locations.global.domains.attachTrust * @desc Adds an AD trust to a domain. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.attachTrust( + * { + * // Required. The resource domain name, project name and location using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "trust": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.attachTrust * @memberOf! () * @@ -1067,6 +1216,81 @@ export namespace managedidentities_v1beta1 { /** * managedidentities.projects.locations.global.domains.create * @desc Creates a Microsoft AD domain. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.create({ + * // Required. A domain name, e.g. mydomain.myorg.com, with the following restrictions: + * // * Must contain only lowercase letters, numbers, periods and hyphens. + * // * Must start with a letter. + * // * Must contain between 2-64 characters. + * // * Must end with a number or a letter. + * // * Must not start with period. + * // * First segement length (mydomain form example above) shouldn't exceed + * // 15 chars. + * // * The last segment cannot be fully numeric. + * // * Must be unique within the customer project. + * domainName: 'placeholder-value', + * // Required. The resource project name and location using the form: + * // `projects/{project_id}/locations/global` + * parent: 'projects/my-project/locations/global', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "admin": "my_admin", + * // "authorizedNetworks": [], + * // "createTime": "my_createTime", + * // "fqdn": "my_fqdn", + * // "labels": {}, + * // "locations": [], + * // "name": "my_name", + * // "reservedIpRange": "my_reservedIpRange", + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "trusts": [], + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.create * @memberOf! () * @@ -1144,6 +1368,51 @@ export namespace managedidentities_v1beta1 { /** * managedidentities.projects.locations.global.domains.delete * @desc Deletes a domain. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.delete({ + * // Required. The domain resource name using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.delete * @memberOf! () * @@ -1216,6 +1485,61 @@ export namespace managedidentities_v1beta1 { /** * managedidentities.projects.locations.global.domains.detachTrust * @desc Removes an AD trust. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.detachTrust( + * { + * // Required. The resource domain name, project name, and location using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "trust": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.detachTrust * @memberOf! () * @@ -1292,6 +1616,58 @@ export namespace managedidentities_v1beta1 { /** * managedidentities.projects.locations.global.domains.get * @desc Gets information about a domain. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.get({ + * // Required. The domain resource name using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "admin": "my_admin", + * // "authorizedNetworks": [], + * // "createTime": "my_createTime", + * // "fqdn": "my_fqdn", + * // "labels": {}, + * // "locations": [], + * // "name": "my_name", + * // "reservedIpRange": "my_reservedIpRange", + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "trusts": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.get * @memberOf! () * @@ -1362,6 +1738,60 @@ export namespace managedidentities_v1beta1 { /** * managedidentities.projects.locations.global.domains.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.getIamPolicy( + * { + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/global/domains/my-domain', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.getIamPolicy * @memberOf! () * @@ -1436,6 +1866,67 @@ export namespace managedidentities_v1beta1 { /** * managedidentities.projects.locations.global.domains.list * @desc Lists domains in a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.list({ + * // Optional. A filter specifying constraints of a list operation. + * // For example, `Domain.fqdn="mydomain.myorginization"`. + * filter: 'placeholder-value', + * // Optional. Specifies the ordering of results. See + * // [Sorting + * // order](https://cloud.google.com/apis/design/design_patterns#sorting_order) + * // for more information. + * orderBy: 'placeholder-value', + * // Optional. The maximum number of items to return. + * // If not specified, a default value of 1000 will be used. + * // Regardless of the page_size value, the response may include a partial list. + * // Callers should rely on a response's + * // next_page_token + * // to determine if there are additional results to list. + * pageSize: 'placeholder-value', + * // The `next_page_token` value returned from a previous ListDomainsRequest + * // request, if any. + * pageToken: 'placeholder-value', + * // Required. The resource name of the domain location using the form: + * // `projects/{project_id}/locations/global` + * parent: 'projects/my-project/locations/global', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domains": [], + * // "nextPageToken": "my_nextPageToken", + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.list * @memberOf! () * @@ -1515,6 +2006,77 @@ export namespace managedidentities_v1beta1 { /** * managedidentities.projects.locations.global.domains.patch * @desc Updates the metadata and configuration of a domain. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.patch({ + * // Output only. The unique name of the domain using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}`. + * name: 'projects/my-project/locations/global/domains/my-domain', + * // Required. Mask of fields to update. At least one path must be supplied in this + * // field. The elements of the repeated paths field may only include + * // fields from Domain: + * // * `labels` + * // * `locations` + * // * `authorized_networks` + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "admin": "my_admin", + * // "authorizedNetworks": [], + * // "createTime": "my_createTime", + * // "fqdn": "my_fqdn", + * // "labels": {}, + * // "locations": [], + * // "name": "my_name", + * // "reservedIpRange": "my_reservedIpRange", + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "trusts": [], + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.patch * @memberOf! () * @@ -1589,6 +2151,62 @@ export namespace managedidentities_v1beta1 { /** * managedidentities.projects.locations.global.domains.reconfigureTrust * @desc Updates the DNS conditional forwarder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.reconfigureTrust( + * { + * // Required. The resource domain name, project name and location using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "targetDnsIpAddresses": [], + * // "targetDomainName": "my_targetDomainName" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.reconfigureTrust * @memberOf! () * @@ -1665,6 +2283,55 @@ export namespace managedidentities_v1beta1 { /** * managedidentities.projects.locations.global.domains.resetAdminPassword * @desc Resets a domain's administrator password. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.resetAdminPassword( + * { + * // Required. The domain resource name using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "password": "my_password" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.resetAdminPassword * @memberOf! () * @@ -1748,6 +2415,59 @@ export namespace managedidentities_v1beta1 { /** * managedidentities.projects.locations.global.domains.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.setIamPolicy * @memberOf! () * @@ -1822,6 +2542,57 @@ export namespace managedidentities_v1beta1 { /** * managedidentities.projects.locations.global.domains.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.testIamPermissions * @memberOf! () * @@ -1905,6 +2676,61 @@ export namespace managedidentities_v1beta1 { /** * managedidentities.projects.locations.global.domains.validateTrust * @desc Validates a trust state, that the target domain is reachable, and that the target domain is able to accept incoming trust requests. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.domains.validateTrust( + * { + * // Required. The resource domain name, project name, and location using the form: + * // `projects/{project_id}/locations/global/domains/{domain_name}` + * name: 'projects/my-project/locations/global/domains/my-domain', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "trust": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.domains.validateTrust * @memberOf! () * @@ -2218,6 +3044,52 @@ export namespace managedidentities_v1beta1 { /** * managedidentities.projects.locations.global.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.operations.cancel( + * { + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/global/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.operations.cancel * @memberOf! () * @@ -2292,6 +3164,46 @@ export namespace managedidentities_v1beta1 { /** * managedidentities.projects.locations.global.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.operations.delete( + * { + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/locations/global/operations/my-operation', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.operations.delete * @memberOf! () * @@ -2362,6 +3274,50 @@ export namespace managedidentities_v1beta1 { /** * managedidentities.projects.locations.global.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/global/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.operations.get * @memberOf! () * @@ -2434,6 +3390,55 @@ export namespace managedidentities_v1beta1 { /** * managedidentities.projects.locations.global.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/managedidentities.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 managedidentities = google.managedidentities('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 managedidentities.projects.locations.global.operations.list( + * { + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/global/operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias managedidentities.projects.locations.global.operations.list * @memberOf! () * diff --git a/src/apis/manufacturers/v1.ts b/src/apis/manufacturers/v1.ts index dea60081db7..6a24a077844 100644 --- a/src/apis/manufacturers/v1.ts +++ b/src/apis/manufacturers/v1.ts @@ -472,6 +472,57 @@ export namespace manufacturers_v1 { /** * manufacturers.accounts.products.delete * @desc Deletes the product from a Manufacturer Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/manufacturers.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 manufacturers = google.manufacturers('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/manufacturercenter'], + * }); + * + * // 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 manufacturers.accounts.products.delete({ + * // Name in the format `{target_country}:{content_language}:{product_id}`. + * // + * // `target_country` - The target country of the product as a CLDR territory + * // code (for example, US). + * // + * // `content_language` - The content language of the product as a two-letter + * // ISO 639-1 language code (for example, en). + * // + * // `product_id` - The ID of the product. For more information, see + * // https://support.google.com/manufacturers/answer/6124116#id. + * name: '[^/]+', + * // Parent ID in the format `accounts/{account_id}`. + * // + * // `account_id` - The ID of the Manufacturer Center account. + * parent: 'accounts/my-account', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias manufacturers.accounts.products.delete * @memberOf! () * @@ -546,6 +597,69 @@ export namespace manufacturers_v1 { /** * manufacturers.accounts.products.get * @desc Gets the product from a Manufacturer Center account, including product issues. A recently updated product takes around 15 minutes to process. Changes are only visible after it has been processed. While some issues may be available once the product has been processed, other issues may take days to appear. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/manufacturers.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 manufacturers = google.manufacturers('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/manufacturercenter'], + * }); + * + * // 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 manufacturers.accounts.products.get({ + * // The information to be included in the response. Only sections listed here + * // will be returned. + * include: 'placeholder-value', + * // Name in the format `{target_country}:{content_language}:{product_id}`. + * // + * // `target_country` - The target country of the product as a CLDR territory + * // code (for example, US). + * // + * // `content_language` - The content language of the product as a two-letter + * // ISO 639-1 language code (for example, en). + * // + * // `product_id` - The ID of the product. For more information, see + * // https://support.google.com/manufacturers/answer/6124116#id. + * name: '[^/]+', + * // Parent ID in the format `accounts/{account_id}`. + * // + * // `account_id` - The ID of the Manufacturer Center account. + * parent: 'accounts/my-account', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "attributes": {}, + * // "contentLanguage": "my_contentLanguage", + * // "destinationStatuses": [], + * // "issues": [], + * // "name": "my_name", + * // "parent": "my_parent", + * // "productId": "my_productId", + * // "targetCountry": "my_targetCountry" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias manufacturers.accounts.products.get * @memberOf! () * @@ -621,6 +735,57 @@ export namespace manufacturers_v1 { /** * manufacturers.accounts.products.list * @desc Lists all the products in a Manufacturer Center account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/manufacturers.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 manufacturers = google.manufacturers('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/manufacturercenter'], + * }); + * + * // 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 manufacturers.accounts.products.list({ + * // The information to be included in the response. Only sections listed here + * // will be returned. + * include: 'placeholder-value', + * // Maximum number of product statuses to return in the response, used for + * // paging. + * pageSize: 'placeholder-value', + * // The token returned by the previous request. + * pageToken: 'placeholder-value', + * // Parent ID in the format `accounts/{account_id}`. + * // + * // `account_id` - The ID of the Manufacturer Center account. + * parent: 'accounts/my-account', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "products": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias manufacturers.accounts.products.list * @memberOf! () * @@ -701,6 +866,100 @@ export namespace manufacturers_v1 { /** * manufacturers.accounts.products.update * @desc Inserts or updates the attributes of the product in a Manufacturer Center account. Creates a product with the provided attributes. If the product already exists, then all attributes are replaced with the new ones. The checks at upload time are minimal. All required attributes need to be present for a product to be valid. Issues may show up later after the API has accepted a new upload for a product and it is possible to overwrite an existing valid product with an invalid product. To detect this, you should retrieve the product and check it for issues once the new version is available. Uploaded attributes first need to be processed before they can be retrieved. Until then, new products will be unavailable, and retrieval of previously uploaded products will return the original state of the product. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/manufacturers.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 manufacturers = google.manufacturers('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/manufacturercenter'], + * }); + * + * // 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 manufacturers.accounts.products.update({ + * // Name in the format `{target_country}:{content_language}:{product_id}`. + * // + * // `target_country` - The target country of the product as a CLDR territory + * // code (for example, US). + * // + * // `content_language` - The content language of the product as a two-letter + * // ISO 639-1 language code (for example, en). + * // + * // `product_id` - The ID of the product. For more information, see + * // https://support.google.com/manufacturers/answer/6124116#id. + * name: '[^/]+', + * // Parent ID in the format `accounts/{account_id}`. + * // + * // `account_id` - The ID of the Manufacturer Center account. + * parent: 'accounts/my-account', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "additionalImageLink": [], + * // "ageGroup": "my_ageGroup", + * // "brand": "my_brand", + * // "capacity": {}, + * // "color": "my_color", + * // "count": {}, + * // "description": "my_description", + * // "disclosureDate": "my_disclosureDate", + * // "excludedDestination": [], + * // "featureDescription": [], + * // "flavor": "my_flavor", + * // "format": "my_format", + * // "gender": "my_gender", + * // "gtin": [], + * // "imageLink": {}, + * // "includedDestination": [], + * // "itemGroupId": "my_itemGroupId", + * // "material": "my_material", + * // "mpn": "my_mpn", + * // "pattern": "my_pattern", + * // "productDetail": [], + * // "productLine": "my_productLine", + * // "productName": "my_productName", + * // "productPageUrl": "my_productPageUrl", + * // "productType": [], + * // "releaseDate": "my_releaseDate", + * // "richProductContent": [], + * // "scent": "my_scent", + * // "size": "my_size", + * // "sizeSystem": "my_sizeSystem", + * // "sizeType": "my_sizeType", + * // "suggestedRetailPrice": {}, + * // "targetClientId": "my_targetClientId", + * // "theme": "my_theme", + * // "title": "my_title", + * // "videoLink": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias manufacturers.accounts.products.update * @memberOf! () * diff --git a/src/apis/memcache/v1beta2.ts b/src/apis/memcache/v1beta2.ts index f371c6dacea..71900eff2ef 100644 --- a/src/apis/memcache/v1beta2.ts +++ b/src/apis/memcache/v1beta2.ts @@ -734,6 +734,50 @@ export namespace memcache_v1beta2 { /** * memcache.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/memcache.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 memcache = google.memcache('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 memcache.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias memcache.projects.locations.get * @memberOf! () * @@ -803,6 +847,53 @@ export namespace memcache_v1beta2 { /** * memcache.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/memcache.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 memcache = google.memcache('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 memcache.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias memcache.projects.locations.list * @memberOf! () * @@ -926,6 +1017,60 @@ export namespace memcache_v1beta2 { /** * memcache.projects.locations.instances.applyParameters * @desc ApplyParameters will update current set of Parameters to the set of specified nodes of the Memcached Instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/memcache.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 memcache = google.memcache('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 memcache.projects.locations.instances.applyParameters({ + * // Required. Resource name of the Memcached instance for which parameter group updates + * // should be applied. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "applyAll": false, + * // "nodeIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias memcache.projects.locations.instances.applyParameters * @memberOf! () * @@ -1001,6 +1146,84 @@ export namespace memcache_v1beta2 { /** * memcache.projects.locations.instances.create * @desc Creates a new Instance in a given project and location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/memcache.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 memcache = google.memcache('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 memcache.projects.locations.instances.create({ + * // Required. The logical name of the Memcached instance in the user + * // project with the following restrictions: + * // + * // * Must contain only lowercase letters, numbers, and hyphens. + * // * Must start with a letter. + * // * Must be between 1-40 characters. + * // * Must end with a number or a letter. + * // * Must be unique within the user project / location + * instanceId: 'placeholder-value', + * // Required. The resource name of the instance location using the form: + * // `projects/{project_id}/locations/{location_id}` + * // where `location_id` refers to a GCP region + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "authorizedNetwork": "my_authorizedNetwork", + * // "createTime": "my_createTime", + * // "discoveryEndpoint": "my_discoveryEndpoint", + * // "displayName": "my_displayName", + * // "instanceMessages": [], + * // "labels": {}, + * // "memcacheFullVersion": "my_memcacheFullVersion", + * // "memcacheNodes": [], + * // "memcacheVersion": "my_memcacheVersion", + * // "name": "my_name", + * // "nodeConfig": {}, + * // "nodeCount": 0, + * // "parameters": {}, + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "zones": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias memcache.projects.locations.instances.create * @memberOf! () * @@ -1077,6 +1300,52 @@ export namespace memcache_v1beta2 { /** * memcache.projects.locations.instances.delete * @desc Deletes a single Instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/memcache.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 memcache = google.memcache('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 memcache.projects.locations.instances.delete({ + * // Required. Memcached instance resource name in the format: + * // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * // where `location_id` refers to a GCP region + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias memcache.projects.locations.instances.delete * @memberOf! () * @@ -1148,6 +1417,63 @@ export namespace memcache_v1beta2 { /** * memcache.projects.locations.instances.get * @desc Gets details of a single Instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/memcache.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 memcache = google.memcache('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 memcache.projects.locations.instances.get({ + * // Required. Memcached instance resource name in the format: + * // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * // where `location_id` refers to a GCP region + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authorizedNetwork": "my_authorizedNetwork", + * // "createTime": "my_createTime", + * // "discoveryEndpoint": "my_discoveryEndpoint", + * // "displayName": "my_displayName", + * // "instanceMessages": [], + * // "labels": {}, + * // "memcacheFullVersion": "my_memcacheFullVersion", + * // "memcacheNodes": [], + * // "memcacheVersion": "my_memcacheVersion", + * // "name": "my_name", + * // "nodeConfig": {}, + * // "nodeCount": 0, + * // "parameters": {}, + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "zones": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias memcache.projects.locations.instances.get * @memberOf! () * @@ -1217,6 +1543,59 @@ export namespace memcache_v1beta2 { /** * memcache.projects.locations.instances.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/memcache.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 memcache = google.memcache('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 memcache.projects.locations.instances.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/my-location/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias memcache.projects.locations.instances.getIamPolicy * @memberOf! () * @@ -1290,6 +1669,66 @@ export namespace memcache_v1beta2 { /** * memcache.projects.locations.instances.list * @desc Lists Instances in a given project and location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/memcache.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 memcache = google.memcache('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 memcache.projects.locations.instances.list({ + * // List filter. For example, exclude all Memcached instances with name as + * // my-instance by specifying "name != my-instance". + * filter: 'placeholder-value', + * // Sort results. Supported values are "name", "name desc" or "" (unsorted). + * orderBy: 'placeholder-value', + * // The maximum number of items to return. + * // + * // If not specified, a default value of 1000 will be used by the service. + * // Regardless of the page_size value, the response may include a partial list + * // and a caller should only rely on response's + * // next_page_token + * // to determine if there are more instances left to be queried. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, + * // if any. + * pageToken: 'placeholder-value', + * // Required. The resource name of the instance location using the form: + * // `projects/{project_id}/locations/{location_id}` + * // where `location_id` refers to a GCP region + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "resources": [], + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias memcache.projects.locations.instances.list * @memberOf! () * @@ -1370,6 +1809,83 @@ export namespace memcache_v1beta2 { /** * memcache.projects.locations.instances.patch * @desc Updates an existing Instance in a given project and location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/memcache.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 memcache = google.memcache('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 memcache.projects.locations.instances.patch({ + * // Required. Unique name of the resource in this scope including project and + * // location using the form: + * // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * // + * // Note: Memcached instances are managed and addressed at regional level so + * // location_id here refers to a GCP region; however, users may choose which + * // zones Memcached nodes within an instances should be provisioned in. + * // Refer to [zones] field for more details. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * // Required. Mask of fields to update. + * // * `displayName` + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "authorizedNetwork": "my_authorizedNetwork", + * // "createTime": "my_createTime", + * // "discoveryEndpoint": "my_discoveryEndpoint", + * // "displayName": "my_displayName", + * // "instanceMessages": [], + * // "labels": {}, + * // "memcacheFullVersion": "my_memcacheFullVersion", + * // "memcacheNodes": [], + * // "memcacheVersion": "my_memcacheVersion", + * // "name": "my_name", + * // "nodeConfig": {}, + * // "nodeCount": 0, + * // "parameters": {}, + * // "state": "my_state", + * // "updateTime": "my_updateTime", + * // "zones": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias memcache.projects.locations.instances.patch * @memberOf! () * @@ -1443,6 +1959,59 @@ export namespace memcache_v1beta2 { /** * memcache.projects.locations.instances.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/memcache.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 memcache = google.memcache('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 memcache.projects.locations.instances.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/my-location/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias memcache.projects.locations.instances.setIamPolicy * @memberOf! () * @@ -1516,6 +2085,55 @@ export namespace memcache_v1beta2 { /** * memcache.projects.locations.instances.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/memcache.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 memcache = google.memcache('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 memcache.projects.locations.instances.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/my-location/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias memcache.projects.locations.instances.testIamPermissions * @memberOf! () * @@ -1598,6 +2216,60 @@ export namespace memcache_v1beta2 { /** * memcache.projects.locations.instances.updateParameters * @desc Updates the defined Memcached Parameters for an existing Instance. This method only stages the parameters, it must be followed by ApplyParameters to apply the parameters to nodes of the Memcached Instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/memcache.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 memcache = google.memcache('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 memcache.projects.locations.instances.updateParameters({ + * // Required. Resource name of the Memcached instance for which the parameters should be + * // updated. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parameters": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias memcache.projects.locations.instances.updateParameters * @memberOf! () * @@ -1859,6 +2531,50 @@ export namespace memcache_v1beta2 { /** * memcache.projects.locations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/memcache.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 memcache = google.memcache('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 memcache.projects.locations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias memcache.projects.locations.operations.cancel * @memberOf! () * @@ -1932,6 +2648,44 @@ export namespace memcache_v1beta2 { /** * memcache.projects.locations.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/memcache.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 memcache = google.memcache('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 memcache.projects.locations.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias memcache.projects.locations.operations.delete * @memberOf! () * @@ -2001,6 +2755,50 @@ export namespace memcache_v1beta2 { /** * memcache.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/memcache.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 memcache = google.memcache('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 memcache.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias memcache.projects.locations.operations.get * @memberOf! () * @@ -2072,6 +2870,53 @@ export namespace memcache_v1beta2 { /** * memcache.projects.locations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/memcache.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 memcache = google.memcache('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 memcache.projects.locations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias memcache.projects.locations.operations.list * @memberOf! () * diff --git a/src/apis/ml/v1.ts b/src/apis/ml/v1.ts index d15a39e0129..b8b09807e71 100644 --- a/src/apis/ml/v1.ts +++ b/src/apis/ml/v1.ts @@ -1543,6 +1543,58 @@ export namespace ml_v1 { /** * ml.projects.explain * @desc Performs explanation on the data in the request. AI Platform implements a custom `explain` verb on top of an HTTP POST method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.explain({ + * // Required. The resource name of a model or a version. + * // + * // Authorization: requires the `predict` permission on the specified resource. + * name: 'projects/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "httpBody": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.explain * @memberOf! () * @@ -1617,6 +1669,48 @@ export namespace ml_v1 { /** * ml.projects.getConfig * @desc Get the service account information associated with your project. You need this information in order to grant the service account permissions for the Google Cloud Storage location where you put your model training code for training the model with Google Cloud Machine Learning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.getConfig({ + * // Required. The project name. + * name: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "config": {}, + * // "serviceAccount": "my_serviceAccount", + * // "serviceAccountProject": "my_serviceAccountProject" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.getConfig * @memberOf! () * @@ -1700,6 +1794,58 @@ export namespace ml_v1 { /** * ml.projects.predict * @desc Performs online prediction on the data in the request.
                          {% dynamic include "/ai-platform/includes/___predict-request" %}
                          + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.predict({ + * // Required. The resource name of a model or a version. + * // + * // Authorization: requires the `predict` permission on the specified resource. + * name: 'projects/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "httpBody": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.predict * @memberOf! () * @@ -1826,6 +1972,50 @@ export namespace ml_v1 { /** * ml.projects.jobs.cancel * @desc Cancels a running job. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.jobs.cancel({ + * // Required. The name of the job to cancel. + * name: 'projects/my-project/jobs/my-job', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.jobs.cancel * @memberOf! () * @@ -1900,6 +2090,76 @@ export namespace ml_v1 { /** * ml.projects.jobs.create * @desc Creates a training or a batch prediction job. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.jobs.create({ + * // Required. The project name. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "endTime": "my_endTime", + * // "errorMessage": "my_errorMessage", + * // "etag": "my_etag", + * // "jobId": "my_jobId", + * // "labels": {}, + * // "predictionInput": {}, + * // "predictionOutput": {}, + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "trainingInput": {}, + * // "trainingOutput": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "endTime": "my_endTime", + * // "errorMessage": "my_errorMessage", + * // "etag": "my_etag", + * // "jobId": "my_jobId", + * // "labels": {}, + * // "predictionInput": {}, + * // "predictionOutput": {}, + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "trainingInput": {}, + * // "trainingOutput": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.jobs.create * @memberOf! () * @@ -1974,6 +2234,60 @@ export namespace ml_v1 { /** * ml.projects.jobs.get * @desc Describes a job. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 ml.projects.jobs.get({ + * // Required. The name of the job to get the description of. + * name: 'projects/my-project/jobs/my-job', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "endTime": "my_endTime", + * // "errorMessage": "my_errorMessage", + * // "etag": "my_etag", + * // "jobId": "my_jobId", + * // "labels": {}, + * // "predictionInput": {}, + * // "predictionOutput": {}, + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "trainingInput": {}, + * // "trainingOutput": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.jobs.get * @memberOf! () * @@ -2047,6 +2361,59 @@ export namespace ml_v1 { /** * ml.projects.jobs.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.jobs.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/jobs/my-job', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.jobs.getIamPolicy * @memberOf! () * @@ -2124,6 +2491,71 @@ export namespace ml_v1 { /** * ml.projects.jobs.list * @desc Lists the jobs in the project. If there are no jobs that match the request parameters, the list request returns an empty response body: {}. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 ml.projects.jobs.list({ + * // Optional. Specifies the subset of jobs to retrieve. + * // You can filter on the value of one or more attributes of the job object. + * // For example, retrieve jobs with a job identifier that starts with 'census': + * //

                          gcloud ai-platform jobs list --filter='jobId:census*' + * //

                          List all failed jobs with names that start with 'rnn': + * //

                          gcloud ai-platform jobs list --filter='jobId:rnn* + * // AND state:FAILED' + * //

                          For more examples, see the guide to + * // monitoring jobs. + * filter: 'placeholder-value', + * // Optional. The number of jobs to retrieve per "page" of results. If there + * // are more remaining results than this number, the response message will + * // contain a valid value in the `next_page_token` field. + * // + * // The default value is 20, and the maximum page size is 100. + * pageSize: 'placeholder-value', + * // Optional. A page token to request the next page of results. + * // + * // You get the token from the `next_page_token` field of the response from + * // the previous call. + * pageToken: 'placeholder-value', + * // Required. The name of the project for which to list jobs. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "jobs": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.jobs.list * @memberOf! () * @@ -2207,6 +2639,96 @@ export namespace ml_v1 { /** * ml.projects.jobs.patch * @desc Updates a specific job resource. Currently the only supported fields to update are `labels`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.jobs.patch({ + * // Required. The job name. + * name: 'projects/my-project/jobs/my-job', + * // Required. Specifies the path, relative to `Job`, of the field to update. + * // To adopt etag mechanism, include `etag` field in the mask, and include the + * // `etag` value in your job resource. + * // + * // For example, to change the labels of a job, the `update_mask` parameter + * // would be specified as `labels`, `etag`, and the + * // `PATCH` request body would specify the new value, as follows: + * // { + * // "labels": { + * // "owner": "Google", + * // "color": "Blue" + * // } + * // "etag": "33a64df551425fcc55e4d42a148795d9f25f89d4" + * // } + * // If `etag` matches the one on the server, the labels of the job will be + * // replaced with the given ones, and the server end `etag` will be + * // recalculated. + * // + * // Currently the only supported update masks are `labels` and `etag`. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "endTime": "my_endTime", + * // "errorMessage": "my_errorMessage", + * // "etag": "my_etag", + * // "jobId": "my_jobId", + * // "labels": {}, + * // "predictionInput": {}, + * // "predictionOutput": {}, + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "trainingInput": {}, + * // "trainingOutput": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "endTime": "my_endTime", + * // "errorMessage": "my_errorMessage", + * // "etag": "my_etag", + * // "jobId": "my_jobId", + * // "labels": {}, + * // "predictionInput": {}, + * // "predictionOutput": {}, + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "trainingInput": {}, + * // "trainingOutput": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.jobs.patch * @memberOf! () * @@ -2282,6 +2804,59 @@ export namespace ml_v1 { /** * ml.projects.jobs.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.jobs.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/jobs/my-job', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.jobs.setIamPolicy * @memberOf! () * @@ -2359,6 +2934,55 @@ export namespace ml_v1 { /** * ml.projects.jobs.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.jobs.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/jobs/my-job', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.jobs.testIamPermissions * @memberOf! () * @@ -2606,6 +3230,50 @@ export namespace ml_v1 { /** * ml.projects.locations.get * @desc Get the complete list of CMLE capabilities in a location, along with their location-specific properties. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 ml.projects.locations.get({ + * // Required. The name of the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "capabilities": [], + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.locations.get * @memberOf! () * @@ -2682,6 +3350,62 @@ export namespace ml_v1 { /** * ml.projects.locations.list * @desc List all locations that provides at least one type of CMLE capability. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 ml.projects.locations.list({ + * // Optional. The number of locations to retrieve per "page" of results. If + * // there are more remaining results than this number, the response message + * // will contain a valid value in the `next_page_token` field. + * // + * // The default value is 20, and the maximum page size is 100. + * pageSize: 'placeholder-value', + * // Optional. A page token to request the next page of results. + * // + * // You get the token from the `next_page_token` field of the response from + * // the previous call. + * pageToken: 'placeholder-value', + * // Required. The name of the project for which available locations are to be + * // listed (since some locations might be whitelisted for specific projects). + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.locations.list * @memberOf! () * @@ -2815,6 +3539,44 @@ export namespace ml_v1 { /** * ml.projects.locations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.locations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.locations.operations.cancel * @memberOf! () * @@ -2888,6 +3650,50 @@ export namespace ml_v1 { /** * ml.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.locations.operations.get * @memberOf! () * @@ -3004,6 +3810,66 @@ export namespace ml_v1 { /** * ml.projects.locations.studies.create * @desc Creates a study. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.locations.studies.create({ + * // Required. The project and location that the study belongs to. + * // Format: projects/{project}/locations/{location} + * parent: 'projects/my-project/locations/my-location', + * // Required. The ID to use for the study, which will become the final component of + * // the study's resource name. + * studyId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "inactiveReason": "my_inactiveReason", + * // "name": "my_name", + * // "state": "my_state", + * // "studyConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "inactiveReason": "my_inactiveReason", + * // "name": "my_name", + * // "state": "my_state", + * // "studyConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.locations.studies.create * @memberOf! () * @@ -3082,6 +3948,44 @@ export namespace ml_v1 { /** * ml.projects.locations.studies.delete * @desc Deletes a study. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.locations.studies.delete({ + * // Required. The study name. + * name: 'projects/my-project/locations/my-location/studies/my-studie', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.locations.studies.delete * @memberOf! () * @@ -3155,6 +4059,50 @@ export namespace ml_v1 { /** * ml.projects.locations.studies.get * @desc Gets a study. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.locations.studies.get({ + * // Required. The study name. + * name: 'projects/my-project/locations/my-location/studies/my-studie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "inactiveReason": "my_inactiveReason", + * // "name": "my_name", + * // "state": "my_state", + * // "studyConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.locations.studies.get * @memberOf! () * @@ -3228,6 +4176,47 @@ export namespace ml_v1 { /** * ml.projects.locations.studies.list * @desc Lists all the studies in a region for an associated project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.locations.studies.list({ + * // Required. The project and location that the study belongs to. + * // Format: projects/{project}/locations/{location} + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "studies": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.locations.studies.list * @memberOf! () * @@ -3384,6 +4373,64 @@ export namespace ml_v1 { /** * ml.projects.locations.studies.trials.addMeasurement * @desc Adds a measurement of the objective metrics to a trial. This measurement is assumed to have been taken before the trial is complete. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.locations.studies.trials.addMeasurement({ + * // Required. The trial name. + * name: + * 'projects/my-project/locations/my-location/studies/my-studie/trials/my-trial', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "measurement": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientId": "my_clientId", + * // "endTime": "my_endTime", + * // "finalMeasurement": {}, + * // "infeasibleReason": "my_infeasibleReason", + * // "measurements": [], + * // "name": "my_name", + * // "parameters": [], + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "trialInfeasible": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.locations.studies.trials.addMeasurement * @memberOf! () * @@ -3463,6 +4510,59 @@ export namespace ml_v1 { /** * ml.projects.locations.studies.trials.checkEarlyStoppingState * @desc Checks whether a trial should stop or not. Returns a long-running operation. When the operation is successful, it will contain a CheckTrialEarlyStoppingStateResponse. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.locations.studies.trials.checkEarlyStoppingState( + * { + * // Required. The trial name. + * name: + * 'projects/my-project/locations/my-location/studies/my-studie/trials/my-trial', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.locations.studies.trials.checkEarlyStoppingState * @memberOf! () * @@ -3547,6 +4647,66 @@ export namespace ml_v1 { /** * ml.projects.locations.studies.trials.complete * @desc Marks a trial as complete. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.locations.studies.trials.complete({ + * // Required. The trial name.metat + * name: + * 'projects/my-project/locations/my-location/studies/my-studie/trials/my-trial', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "finalMeasurement": {}, + * // "infeasibleReason": "my_infeasibleReason", + * // "trialInfeasible": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientId": "my_clientId", + * // "endTime": "my_endTime", + * // "finalMeasurement": {}, + * // "infeasibleReason": "my_infeasibleReason", + * // "measurements": [], + * // "name": "my_name", + * // "parameters": [], + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "trialInfeasible": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.locations.studies.trials.complete * @memberOf! () * @@ -3626,6 +4786,72 @@ export namespace ml_v1 { /** * ml.projects.locations.studies.trials.create * @desc Adds a user provided trial to a study. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.locations.studies.trials.create({ + * // Required. The name of the study that the trial belongs to. + * parent: 'projects/my-project/locations/my-location/studies/my-studie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clientId": "my_clientId", + * // "endTime": "my_endTime", + * // "finalMeasurement": {}, + * // "infeasibleReason": "my_infeasibleReason", + * // "measurements": [], + * // "name": "my_name", + * // "parameters": [], + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "trialInfeasible": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientId": "my_clientId", + * // "endTime": "my_endTime", + * // "finalMeasurement": {}, + * // "infeasibleReason": "my_infeasibleReason", + * // "measurements": [], + * // "name": "my_name", + * // "parameters": [], + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "trialInfeasible": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.locations.studies.trials.create * @memberOf! () * @@ -3703,6 +4929,45 @@ export namespace ml_v1 { /** * ml.projects.locations.studies.trials.delete * @desc Deletes a trial. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.locations.studies.trials.delete({ + * // Required. The trial name. + * name: + * 'projects/my-project/locations/my-location/studies/my-studie/trials/my-trial', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.locations.studies.trials.delete * @memberOf! () * @@ -3776,6 +5041,56 @@ export namespace ml_v1 { /** * ml.projects.locations.studies.trials.get * @desc Gets a trial. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.locations.studies.trials.get({ + * // Required. The trial name. + * name: + * 'projects/my-project/locations/my-location/studies/my-studie/trials/my-trial', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientId": "my_clientId", + * // "endTime": "my_endTime", + * // "finalMeasurement": {}, + * // "infeasibleReason": "my_infeasibleReason", + * // "measurements": [], + * // "name": "my_name", + * // "parameters": [], + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "trialInfeasible": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.locations.studies.trials.get * @memberOf! () * @@ -3849,6 +5164,46 @@ export namespace ml_v1 { /** * ml.projects.locations.studies.trials.list * @desc Lists the trials associated with a study. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.locations.studies.trials.list({ + * // Required. The name of the study that the trial belongs to. + * parent: 'projects/my-project/locations/my-location/studies/my-studie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "trials": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.locations.studies.trials.list * @memberOf! () * @@ -3934,6 +5289,62 @@ export namespace ml_v1 { /** * ml.projects.locations.studies.trials.stop * @desc Stops a trial. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.locations.studies.trials.stop({ + * // Required. The trial name. + * name: + * 'projects/my-project/locations/my-location/studies/my-studie/trials/my-trial', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientId": "my_clientId", + * // "endTime": "my_endTime", + * // "finalMeasurement": {}, + * // "infeasibleReason": "my_infeasibleReason", + * // "measurements": [], + * // "name": "my_name", + * // "parameters": [], + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "trialInfeasible": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.locations.studies.trials.stop * @memberOf! () * @@ -4008,6 +5419,59 @@ export namespace ml_v1 { /** * ml.projects.locations.studies.trials.suggest * @desc Adds one or more trials to a study, with parameter values suggested by AI Platform Optimizer. Returns a long-running operation associated with the generation of trial suggestions. When this long-running operation succeeds, it will contain a SuggestTrialsResponse. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.locations.studies.trials.suggest({ + * // Required. The name of the study that the trial belongs to. + * parent: 'projects/my-project/locations/my-location/studies/my-studie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clientId": "my_clientId", + * // "suggestionCount": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.locations.studies.trials.suggest * @memberOf! () * @@ -4240,6 +5704,68 @@ export namespace ml_v1 { /** * ml.projects.models.create * @desc Creates a model which will later contain one or more versions. You must add at least one version before you can request predictions from the model. Add versions by calling projects.models.versions.create. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.models.create({ + * // Required. The project name. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "defaultVersion": {}, + * // "description": "my_description", + * // "etag": "my_etag", + * // "labels": {}, + * // "name": "my_name", + * // "onlinePredictionConsoleLogging": false, + * // "onlinePredictionLogging": false, + * // "regions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "defaultVersion": {}, + * // "description": "my_description", + * // "etag": "my_etag", + * // "labels": {}, + * // "name": "my_name", + * // "onlinePredictionConsoleLogging": false, + * // "onlinePredictionLogging": false, + * // "regions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.models.create * @memberOf! () * @@ -4317,6 +5843,50 @@ export namespace ml_v1 { /** * ml.projects.models.delete * @desc Deletes a model. You can only delete a model if there are no versions in it. You can delete versions by calling projects.models.versions.delete. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.models.delete({ + * // Required. The name of the model. + * name: 'projects/my-project/models/my-model', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.models.delete * @memberOf! () * @@ -4397,6 +5967,56 @@ export namespace ml_v1 { /** * ml.projects.models.get * @desc Gets information about a model, including its name, the description (if set), and the default version (if at least one version of the model has been deployed). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 ml.projects.models.get({ + * // Required. The name of the model. + * name: 'projects/my-project/models/my-model', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "defaultVersion": {}, + * // "description": "my_description", + * // "etag": "my_etag", + * // "labels": {}, + * // "name": "my_name", + * // "onlinePredictionConsoleLogging": false, + * // "onlinePredictionLogging": false, + * // "regions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.models.get * @memberOf! () * @@ -4470,6 +6090,59 @@ export namespace ml_v1 { /** * ml.projects.models.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.models.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/models/my-model', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.models.getIamPolicy * @memberOf! () * @@ -4547,6 +6220,63 @@ export namespace ml_v1 { /** * ml.projects.models.list * @desc Lists the models in a project. Each project can contain multiple models, and each model can have multiple versions. If there are no models that match the request parameters, the list request returns an empty response body: {}. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 ml.projects.models.list({ + * // Optional. Specifies the subset of models to retrieve. + * filter: 'placeholder-value', + * // Optional. The number of models to retrieve per "page" of results. If there + * // are more remaining results than this number, the response message will + * // contain a valid value in the `next_page_token` field. + * // + * // The default value is 20, and the maximum page size is 100. + * pageSize: 'placeholder-value', + * // Optional. A page token to request the next page of results. + * // + * // You get the token from the `next_page_token` field of the response from + * // the previous call. + * pageToken: 'placeholder-value', + * // Required. The name of the project whose models are to be listed. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "models": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.models.list * @memberOf! () * @@ -4635,6 +6365,81 @@ export namespace ml_v1 { /** * ml.projects.models.patch * @desc Updates a specific model resource. Currently the only supported fields to update are `description` and `default_version.name`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.models.patch({ + * // Required. The project name. + * name: 'projects/my-project/models/my-model', + * // Required. Specifies the path, relative to `Model`, of the field to update. + * // + * // For example, to change the description of a model to "foo" and set its + * // default version to "version_1", the `update_mask` parameter would be + * // specified as `description`, `default_version.name`, and the `PATCH` + * // request body would specify the new value, as follows: + * // { + * // "description": "foo", + * // "defaultVersion": { + * // "name":"version_1" + * // } + * // } + * // + * // Currently the supported update masks are `description` and + * // `default_version.name`. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "defaultVersion": {}, + * // "description": "my_description", + * // "etag": "my_etag", + * // "labels": {}, + * // "name": "my_name", + * // "onlinePredictionConsoleLogging": false, + * // "onlinePredictionLogging": false, + * // "regions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.models.patch * @memberOf! () * @@ -4717,6 +6522,59 @@ export namespace ml_v1 { /** * ml.projects.models.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.models.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/models/my-model', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.models.setIamPolicy * @memberOf! () * @@ -4794,6 +6652,55 @@ export namespace ml_v1 { /** * ml.projects.models.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.models.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/models/my-model', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.models.testIamPermissions * @memberOf! () * @@ -5030,6 +6937,79 @@ export namespace ml_v1 { /** * ml.projects.models.versions.create * @desc Creates a new version of a model from a trained TensorFlow model. If the version created in the cloud by this call is the first deployed version of the specified model, it will be made the default version of the model. When you add a version to a model that already has one or more versions, the default version does not automatically change. If you want a new version to be the default, you must call projects.models.versions.setDefault. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.models.versions.create({ + * // Required. The name of the model. + * parent: 'projects/my-project/models/my-model', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "acceleratorConfig": {}, + * // "autoScaling": {}, + * // "createTime": "my_createTime", + * // "deploymentUri": "my_deploymentUri", + * // "description": "my_description", + * // "errorMessage": "my_errorMessage", + * // "etag": "my_etag", + * // "explanationConfig": {}, + * // "framework": "my_framework", + * // "isDefault": false, + * // "labels": {}, + * // "lastUseTime": "my_lastUseTime", + * // "machineType": "my_machineType", + * // "manualScaling": {}, + * // "name": "my_name", + * // "packageUris": [], + * // "predictionClass": "my_predictionClass", + * // "pythonVersion": "my_pythonVersion", + * // "requestLoggingConfig": {}, + * // "runtimeVersion": "my_runtimeVersion", + * // "serviceAccount": "my_serviceAccount", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.models.versions.create * @memberOf! () * @@ -5114,6 +7094,52 @@ export namespace ml_v1 { /** * ml.projects.models.versions.delete * @desc Deletes a model version. Each model can have multiple versions deployed and in use at any given time. Use this method to remove a single version. Note: You cannot delete the version that is set as the default version of the model unless it is the only remaining version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.models.versions.delete({ + * // Required. The name of the version. You can get the names of all the + * // versions of a model by calling + * // projects.models.versions.list. + * name: 'projects/my-project/models/my-model/versions/my-version', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.models.versions.delete * @memberOf! () * @@ -5194,6 +7220,67 @@ export namespace ml_v1 { /** * ml.projects.models.versions.get * @desc Gets information about a model version. Models can have multiple versions. You can call projects.models.versions.list to get the same information that this method returns for all of the versions of a model. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.models.versions.get({ + * // Required. The name of the version. + * name: 'projects/my-project/models/my-model/versions/my-version', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acceleratorConfig": {}, + * // "autoScaling": {}, + * // "createTime": "my_createTime", + * // "deploymentUri": "my_deploymentUri", + * // "description": "my_description", + * // "errorMessage": "my_errorMessage", + * // "etag": "my_etag", + * // "explanationConfig": {}, + * // "framework": "my_framework", + * // "isDefault": false, + * // "labels": {}, + * // "lastUseTime": "my_lastUseTime", + * // "machineType": "my_machineType", + * // "manualScaling": {}, + * // "name": "my_name", + * // "packageUris": [], + * // "predictionClass": "my_predictionClass", + * // "pythonVersion": "my_pythonVersion", + * // "requestLoggingConfig": {}, + * // "runtimeVersion": "my_runtimeVersion", + * // "serviceAccount": "my_serviceAccount", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.models.versions.get * @memberOf! () * @@ -5267,6 +7354,63 @@ export namespace ml_v1 { /** * ml.projects.models.versions.list * @desc Gets basic information about all the versions of a model. If you expect that a model has many versions, or if you need to handle only a limited number of results at a time, you can request that the list be retrieved in batches (called pages). If there are no versions that match the request parameters, the list request returns an empty response body: {}. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 ml.projects.models.versions.list({ + * // Optional. Specifies the subset of versions to retrieve. + * filter: 'placeholder-value', + * // Optional. The number of versions to retrieve per "page" of results. If + * // there are more remaining results than this number, the response message + * // will contain a valid value in the `next_page_token` field. + * // + * // The default value is 20, and the maximum page size is 100. + * pageSize: 'placeholder-value', + * // Optional. A page token to request the next page of results. + * // + * // You get the token from the `next_page_token` field of the response from + * // the previous call. + * pageToken: 'placeholder-value', + * // Required. The name of the model for which to list the version. + * parent: 'projects/my-project/models/my-model', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "versions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.models.versions.list * @memberOf! () * @@ -5361,6 +7505,98 @@ export namespace ml_v1 { /** * ml.projects.models.versions.patch * @desc Updates the specified Version resource. Currently the only update-able fields are `description`, `requestLoggingConfig`, `autoScaling.minNodes`, and `manualScaling.nodes`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.models.versions.patch({ + * // Required. The name of the model. + * name: 'projects/my-project/models/my-model/versions/my-version', + * // Required. Specifies the path, relative to `Version`, of the field to + * // update. Must be present and non-empty. + * // + * // For example, to change the description of a version to "foo", the + * // `update_mask` parameter would be specified as `description`, and the + * // `PATCH` request body would specify the new value, as follows: + * // + * // ``` + * // { + * // "description": "foo" + * // } + * // ``` + * // + * // Currently the only supported update mask fields are `description`, + * // `requestLoggingConfig`, `autoScaling.minNodes`, and `manualScaling.nodes`. + * // However, you can only update `manualScaling.nodes` if the version uses a + * // [Compute Engine (N1) + * // machine type](/ml-engine/docs/machine-types-online-prediction). + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "acceleratorConfig": {}, + * // "autoScaling": {}, + * // "createTime": "my_createTime", + * // "deploymentUri": "my_deploymentUri", + * // "description": "my_description", + * // "errorMessage": "my_errorMessage", + * // "etag": "my_etag", + * // "explanationConfig": {}, + * // "framework": "my_framework", + * // "isDefault": false, + * // "labels": {}, + * // "lastUseTime": "my_lastUseTime", + * // "machineType": "my_machineType", + * // "manualScaling": {}, + * // "name": "my_name", + * // "packageUris": [], + * // "predictionClass": "my_predictionClass", + * // "pythonVersion": "my_pythonVersion", + * // "requestLoggingConfig": {}, + * // "runtimeVersion": "my_runtimeVersion", + * // "serviceAccount": "my_serviceAccount", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.models.versions.patch * @memberOf! () * @@ -5443,6 +7679,75 @@ export namespace ml_v1 { /** * ml.projects.models.versions.setDefault * @desc Designates a version to be the default for the model. The default version is used for prediction requests made against the model that don't specify a version. The first version to be created for a model is automatically set as the default. You must make any subsequent changes to the default version setting manually using this method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.models.versions.setDefault({ + * // Required. The name of the version to make the default for the model. You + * // can get the names of all the versions of a model by calling + * // projects.models.versions.list. + * name: 'projects/my-project/models/my-model/versions/my-version', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acceleratorConfig": {}, + * // "autoScaling": {}, + * // "createTime": "my_createTime", + * // "deploymentUri": "my_deploymentUri", + * // "description": "my_description", + * // "errorMessage": "my_errorMessage", + * // "etag": "my_etag", + * // "explanationConfig": {}, + * // "framework": "my_framework", + * // "isDefault": false, + * // "labels": {}, + * // "lastUseTime": "my_lastUseTime", + * // "machineType": "my_machineType", + * // "manualScaling": {}, + * // "name": "my_name", + * // "packageUris": [], + * // "predictionClass": "my_predictionClass", + * // "pythonVersion": "my_pythonVersion", + * // "requestLoggingConfig": {}, + * // "runtimeVersion": "my_runtimeVersion", + * // "serviceAccount": "my_serviceAccount", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.models.versions.setDefault * @memberOf! () * @@ -5633,6 +7938,44 @@ export namespace ml_v1 { /** * ml.projects.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.operations.cancel * @memberOf! () * @@ -5706,6 +8049,50 @@ export namespace ml_v1 { /** * ml.projects.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.operations.get * @memberOf! () * @@ -5786,6 +8173,53 @@ export namespace ml_v1 { /** * ml.projects.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/ml.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 ml = google.ml('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/cloud-platform'], + * }); + * + * // 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 ml.projects.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias ml.projects.operations.list * @memberOf! () * diff --git a/src/apis/monitoring/v1.ts b/src/apis/monitoring/v1.ts index bcecd8f4462..017e247b5cd 100644 --- a/src/apis/monitoring/v1.ts +++ b/src/apis/monitoring/v1.ts @@ -641,6 +641,70 @@ export namespace monitoring_v1 { /** * monitoring.projects.dashboards.create * @desc Creates a new custom dashboard.This method requires the monitoring.dashboards.create permission on the specified project. For more information, see Google Cloud IAM (https://cloud.google.com/iam). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.write', + * ], + * }); + * + * // 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 monitoring.projects.dashboards.create({ + * // Required. The project on which to execute the request. The format is: + * // projects/[PROJECT_ID_OR_NUMBER] + * // The [PROJECT_ID_OR_NUMBER] must match the dashboard resource name. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "columnLayout": {}, + * // "displayName": "my_displayName", + * // "etag": "my_etag", + * // "gridLayout": {}, + * // "name": "my_name", + * // "rowLayout": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "columnLayout": {}, + * // "displayName": "my_displayName", + * // "etag": "my_etag", + * // "gridLayout": {}, + * // "name": "my_name", + * // "rowLayout": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.dashboards.create * @memberOf! () * @@ -716,6 +780,50 @@ export namespace monitoring_v1 { /** * monitoring.projects.dashboards.delete * @desc Deletes an existing custom dashboard.This method requires the monitoring.dashboards.delete permission on the specified dashboard. For more information, see Google Cloud IAM (https://cloud.google.com/iam). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.write', + * ], + * }); + * + * // 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 monitoring.projects.dashboards.delete({ + * // Required. The resource name of the Dashboard. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID] + * // + * name: 'projects/my-project/dashboards/my-dashboard', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.dashboards.delete * @memberOf! () * @@ -785,6 +893,57 @@ export namespace monitoring_v1 { /** * monitoring.projects.dashboards.get * @desc Fetches a specific dashboard.This method requires the monitoring.dashboards.get permission on the specified dashboard. For more information, see Google Cloud IAM (https://cloud.google.com/iam). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * ], + * }); + * + * // 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 monitoring.projects.dashboards.get({ + * // Required. The resource name of the Dashboard. The format is one of: + * // dashboards/[DASHBOARD_ID] (for system dashboards) + * // projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID] (for custom dashboards). + * name: 'projects/my-project/dashboards/my-dashboard', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "columnLayout": {}, + * // "displayName": "my_displayName", + * // "etag": "my_etag", + * // "gridLayout": {}, + * // "name": "my_name", + * // "rowLayout": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.dashboards.get * @memberOf! () * @@ -856,6 +1015,57 @@ export namespace monitoring_v1 { /** * monitoring.projects.dashboards.list * @desc Lists the existing dashboards.This method requires the monitoring.dashboards.list permission on the specified project. For more information, see Google Cloud IAM (https://cloud.google.com/iam). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * ], + * }); + * + * // 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 monitoring.projects.dashboards.list({ + * // A positive number that is the maximum number of results to return. If unspecified, a default of 1000 is used. + * pageSize: 'placeholder-value', + * // If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + * pageToken: 'placeholder-value', + * // Required. The scope of the dashboards to list. The format is: + * // projects/[PROJECT_ID_OR_NUMBER] + * // + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "dashboards": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.dashboards.list * @memberOf! () * @@ -934,6 +1144,68 @@ export namespace monitoring_v1 { /** * monitoring.projects.dashboards.patch * @desc Replaces an existing custom dashboard with a new definition.This method requires the monitoring.dashboards.update permission on the specified dashboard. For more information, see Google Cloud IAM (https://cloud.google.com/iam). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.write', + * ], + * }); + * + * // 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 monitoring.projects.dashboards.patch({ + * // Immutable. The resource name of the dashboard. + * name: 'projects/my-project/dashboards/my-dashboard', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "columnLayout": {}, + * // "displayName": "my_displayName", + * // "etag": "my_etag", + * // "gridLayout": {}, + * // "name": "my_name", + * // "rowLayout": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "columnLayout": {}, + * // "displayName": "my_displayName", + * // "etag": "my_etag", + * // "gridLayout": {}, + * // "name": "my_name", + * // "rowLayout": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.dashboards.patch * @memberOf! () * diff --git a/src/apis/monitoring/v3.ts b/src/apis/monitoring/v3.ts index 93c0273ed9f..965652fd945 100644 --- a/src/apis/monitoring/v3.ts +++ b/src/apis/monitoring/v3.ts @@ -1880,6 +1880,79 @@ export namespace monitoring_v3 { /** * monitoring.projects.alertPolicies.create * @desc Creates a new alerting policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.projects.alertPolicies.create({ + * // Required. The project in which to create the alerting policy. The format is: + * // projects/[PROJECT_ID_OR_NUMBER] + * // Note that this field names the parent container in which the alerting policy will be written, not the name of the created policy. The alerting policy that is returned will have a name that contains a normalized representation of this name as a prefix but adds a suffix of the form /alertPolicies/[ALERT_POLICY_ID], identifying the policy in the container. + * name: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "combiner": "my_combiner", + * // "conditions": [], + * // "creationRecord": {}, + * // "displayName": "my_displayName", + * // "documentation": {}, + * // "enabled": false, + * // "mutationRecord": {}, + * // "name": "my_name", + * // "notificationChannels": [], + * // "userLabels": {}, + * // "validity": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "combiner": "my_combiner", + * // "conditions": [], + * // "creationRecord": {}, + * // "displayName": "my_displayName", + * // "documentation": {}, + * // "enabled": false, + * // "mutationRecord": {}, + * // "name": "my_name", + * // "notificationChannels": [], + * // "userLabels": {}, + * // "validity": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.alertPolicies.create * @memberOf! () * @@ -1955,6 +2028,49 @@ export namespace monitoring_v3 { /** * monitoring.projects.alertPolicies.delete * @desc Deletes an alerting policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.projects.alertPolicies.delete({ + * // Required. The alerting policy to delete. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + * // For more information, see AlertPolicy. + * name: 'projects/my-project/alertPolicies/my-alertPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.alertPolicies.delete * @memberOf! () * @@ -2024,6 +2140,62 @@ export namespace monitoring_v3 { /** * monitoring.projects.alertPolicies.get * @desc Gets a single alerting policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * ], + * }); + * + * // 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 monitoring.projects.alertPolicies.get({ + * // Required. The alerting policy to retrieve. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + * // + * name: 'projects/my-project/alertPolicies/my-alertPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "combiner": "my_combiner", + * // "conditions": [], + * // "creationRecord": {}, + * // "displayName": "my_displayName", + * // "documentation": {}, + * // "enabled": false, + * // "mutationRecord": {}, + * // "name": "my_name", + * // "notificationChannels": [], + * // "userLabels": {}, + * // "validity": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.alertPolicies.get * @memberOf! () * @@ -2095,6 +2267,61 @@ export namespace monitoring_v3 { /** * monitoring.projects.alertPolicies.list * @desc Lists the existing alerting policies for the project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * ], + * }); + * + * // 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 monitoring.projects.alertPolicies.list({ + * // If provided, this field specifies the criteria that must be met by alert policies to be included in the response.For more details, see sorting and filtering (https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * filter: 'placeholder-value', + * // Required. The project whose alert policies are to be listed. The format is: + * // projects/[PROJECT_ID_OR_NUMBER] + * // Note that this field names the parent container in which the alerting policies to be listed are stored. To retrieve a single alerting policy by name, use the GetAlertPolicy operation, instead. + * name: 'projects/my-project', + * // A comma-separated list of fields by which to sort the result. Supports the same set of field references as the filter field. Entries can be prefixed with a minus sign to sort by the field in descending order.For more details, see sorting and filtering (https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * orderBy: 'placeholder-value', + * // The maximum number of results to return in a single response. + * pageSize: 'placeholder-value', + * // If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return more results from the previous method call. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alertPolicies": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.alertPolicies.list * @memberOf! () * @@ -2180,6 +2407,83 @@ export namespace monitoring_v3 { /** * monitoring.projects.alertPolicies.patch * @desc Updates an alerting policy. You can either replace the entire policy with a new one or replace only certain fields in the current alerting policy by specifying the fields to be updated via updateMask. Returns the updated alerting policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.projects.alertPolicies.patch({ + * // Required if the policy exists. The resource name for this policy. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + * // [ALERT_POLICY_ID] is assigned by Stackdriver Monitoring when the policy is created. When calling the alertPolicies.create method, do not include the name field in the alerting policy passed as part of the request. + * name: 'projects/my-project/alertPolicies/my-alertPolicie', + * // Optional. A list of alerting policy field names. If this field is not empty, each listed field in the existing alerting policy is set to the value of the corresponding field in the supplied policy (alert_policy), or to the field's default value if the field is not in the supplied alerting policy. Fields not listed retain their previous value.Examples of valid field masks include display_name, documentation, documentation.content, documentation.mime_type, user_labels, user_label.nameofkey, enabled, conditions, combiner, etc.If this field is empty, then the supplied alerting policy replaces the existing policy. It is the same as deleting the existing policy and adding the supplied policy, except for the following: + * // The new policy will have the same [ALERT_POLICY_ID] as the former policy. This gives you continuity with the former policy in your notifications and incidents. + * // Conditions in the new policy will keep their former [CONDITION_ID] if the supplied condition includes the name field with that [CONDITION_ID]. If the supplied condition omits the name field, then a new [CONDITION_ID] is created. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "combiner": "my_combiner", + * // "conditions": [], + * // "creationRecord": {}, + * // "displayName": "my_displayName", + * // "documentation": {}, + * // "enabled": false, + * // "mutationRecord": {}, + * // "name": "my_name", + * // "notificationChannels": [], + * // "userLabels": {}, + * // "validity": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "combiner": "my_combiner", + * // "conditions": [], + * // "creationRecord": {}, + * // "displayName": "my_displayName", + * // "documentation": {}, + * // "enabled": false, + * // "mutationRecord": {}, + * // "name": "my_name", + * // "notificationChannels": [], + * // "userLabels": {}, + * // "validity": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.alertPolicies.patch * @memberOf! () * @@ -2352,45 +2656,62 @@ export namespace monitoring_v3 { * monitoring.projects.collectdTimeSeries.create * @desc Stackdriver Monitoring Agent only: Creates a new time series.

                          * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the quota for your project at - * // https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth application-default login' - * // 3. To install the client library and Application Default Credentials library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for the 'create' method: - * - * // The project in which to create the time series. The format is `"projects/PROJECT_ID_OR_NUMBER"`. - * name: "projects/{MY-PROJECT}", - * resource: {}, - * // Auth client - * auth: authClient - * }; - * - * monitoring.projects.collectdTimeSeries.create(request, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * } + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.write', + * ], + * }); + * + * // 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 monitoring.projects.collectdTimeSeries.create({ + * // The project in which to create the time series. The format is: + * // projects/[PROJECT_ID_OR_NUMBER] + * // + * name: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "collectdPayloads": [], + * // "collectdVersion": "my_collectdVersion", + * // "resource": {} + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "payloadErrors": [], + * // "summary": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); + * * @alias monitoring.projects.collectdTimeSeries.create * @memberOf! () * @@ -2503,45 +2824,68 @@ export namespace monitoring_v3 { * monitoring.projects.groups.create * @desc Creates a new group. * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the quota for your project at - * // https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth application-default login' - * // 3. To install the client library and Application Default Credentials library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for the 'create' method: - * - * // The project in which to create the group. The format is `"projects/{project_id_or_number}"`. - * name: "projects/{MY-PROJECT}", - * resource: {}, - * // Auth client - * auth: authClient - * }; - * - * monitoring.projects.groups.create(request, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * } + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.projects.groups.create({ + * // Required. The project in which to create the group. The format is: + * // projects/[PROJECT_ID_OR_NUMBER] + * // + * name: 'projects/my-project', + * // If true, validate this request but do not create the group. + * validateOnly: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "filter": "my_filter", + * // "isCluster": false, + * // "name": "my_name", + * // "parentName": "my_parentName" + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "filter": "my_filter", + * // "isCluster": false, + * // "name": "my_name", + * // "parentName": "my_parentName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); + * * @alias monitoring.projects.groups.create * @memberOf! () * @@ -2614,44 +2958,50 @@ export namespace monitoring_v3 { * monitoring.projects.groups.delete * @desc Deletes an existing group. * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the quota for your project at - * // https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth application-default login' - * // 3. To install the client library and Application Default Credentials library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for the 'delete' method: - * - * // The group to delete. The format is `"projects/{project_id_or_number}/groups/{group_id}"`. - * name: "projects/{MY-PROJECT}/groups/{MY-GROUP}", - * // Auth client - * auth: authClient - * }; - * - * monitoring.projects.groups.delete(request, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * } + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], * }); + * + * // 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 monitoring.projects.groups.delete({ + * // Required. The group to delete. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * // + * name: 'projects/my-project/groups/my-group', + * // If this field is true, then the request means to delete a group with all its descendants. Otherwise, the request means to delete a group only when it has no descendants. The default value is false. + * recursive: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); + * * @alias monitoring.projects.groups.delete * @memberOf! () * @@ -2723,44 +3073,55 @@ export namespace monitoring_v3 { * monitoring.projects.groups.get * @desc Gets a single group. * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the quota for your project at - * // https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth application-default login' - * // 3. To install the client library and Application Default Credentials library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for the 'get' method: - * - * // The group to retrieve. The format is `"projects/{project_id_or_number}/groups/{group_id}"`. - * name: "projects/{MY-PROJECT}/groups/{MY-GROUP}", - * // Auth client - * auth: authClient - * }; - * - * monitoring.projects.groups.get(request, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * } + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * ], + * }); + * + * // 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 monitoring.projects.groups.get({ + * // Required. The group to retrieve. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * // + * name: 'projects/my-project/groups/my-group', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "filter": "my_filter", + * // "isCluster": false, + * // "name": "my_name", + * // "parentName": "my_parentName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); + * * @alias monitoring.projects.groups.get * @memberOf! () * @@ -2831,51 +3192,68 @@ export namespace monitoring_v3 { * monitoring.projects.groups.list * @desc Lists the existing groups. * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the quota for your project at - * // https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth application-default login' - * // 3. To install the client library and Application Default Credentials library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for the 'list' method: - * - * // The project whose groups are to be listed. The format is `"projects/{project_id_or_number}"`. - * name: "projects/{MY-PROJECT}", - * // Auth client - * auth: authClient - * }; - * - * - * var recur = function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * if (result.nextPageToken) { - * request.pageToken = result.nextPageToken; - * monitoring.projects.groups.list(request, recur); - * } - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` * - * monitoring.projects.groups.list(request, recur); + * const {google} = require('googleapis'); + * const monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * ], + * }); + * + * // 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 monitoring.projects.groups.list({ + * // A group name. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * // Returns groups that are ancestors of the specified group. The groups are returned in order, starting with the immediate parent and ending with the most distant ancestor. If the specified group has no immediate parent, the results are empty. + * ancestorsOfGroup: 'placeholder-value', + * // A group name. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * // Returns groups whose parent_name field contains the group name. If no groups have this parent, the results are empty. + * childrenOfGroup: 'placeholder-value', + * // A group name. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * // Returns the descendants of the specified group. This is a superset of the results returned by the children_of_group filter, and includes children-of-children, and so forth. + * descendantsOfGroup: 'placeholder-value', + * // Required. The project whose groups are to be listed. The format is: + * // projects/[PROJECT_ID_OR_NUMBER] + * // + * name: 'projects/my-project', + * // A positive number that is the maximum number of results to return. + * pageSize: 'placeholder-value', + * // If this field is not empty then it must contain the next_page_token value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "group": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); + * * @alias monitoring.projects.groups.list * @memberOf! () * @@ -2953,48 +3331,68 @@ export namespace monitoring_v3 { * monitoring.projects.groups.update * @desc Updates an existing group. You can change any group attributes except name. * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the quota for your project at - * // https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth application-default login' - * // 3. To install the client library and Application Default Credentials library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for the 'update' method: - * - * // The name of this group. The format is `"projects/{project_id_or_number}/groups/{group_id}"`. When - * // creating a group, this field is ignored and a new name is created consisting of the project - * // specified in the call to `CreateGroup` and a unique `{group_id}` that is generated automatically. - * // @OutputOnly - * name: "projects/{MY-PROJECT}/groups/{MY-GROUP}", - * resource: {}, - * // Auth client - * auth: authClient - * }; - * - * monitoring.projects.groups.update(request, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * } + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.projects.groups.update({ + * // Output only. The name of this group. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * // When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique [GROUP_ID] that is generated automatically. + * name: 'projects/my-project/groups/my-group', + * // If true, validate this request but do not update the existing group. + * validateOnly: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "filter": "my_filter", + * // "isCluster": false, + * // "name": "my_name", + * // "parentName": "my_parentName" + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "filter": "my_filter", + * // "isCluster": false, + * // "name": "my_name", + * // "parentName": "my_parentName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); + * * @alias monitoring.projects.groups.update * @memberOf! () * @@ -3177,52 +3575,65 @@ export namespace monitoring_v3 { * monitoring.projects.groups.members.list * @desc Lists the monitored resources that are members of a group. * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the quota for your project at - * // https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth application-default login' - * // 3. To install the client library and Application Default Credentials library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for the 'list' method: - * - * // The group whose members are listed. The format is - * // `"projects/{project_id_or_number}/groups/{group_id}"`. - * name: "projects/{MY-PROJECT}/groups/{MY-GROUP}", - * // Auth client - * auth: authClient - * }; - * - * - * var recur = function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * if (result.nextPageToken) { - * request.pageToken = result.nextPageToken; - * monitoring.projects.groups.members.list(request, recur); - * } - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); * - * monitoring.projects.groups.members.list(request, recur); + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * ], + * }); + * + * // 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 monitoring.projects.groups.members.list({ + * // An optional list filter (https://cloud.google.com/monitoring/api/learn_more#filtering) describing the members to be returned. The filter may reference the type, labels, and metadata of monitored resources that comprise the group. For example, to return only resources representing Compute Engine VM instances, use this filter: + * // `resource.type = "gce_instance"` + * // + * filter: 'placeholder-value', + * // Required. The end of the time interval. + * 'interval.endTime': 'placeholder-value', + * // Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time. + * 'interval.startTime': 'placeholder-value', + * // Required. The group whose members are listed. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * // + * name: 'projects/my-project/groups/my-group', + * // A positive number that is the maximum number of results to return. + * pageSize: 'placeholder-value', + * // If this field is not empty then it must contain the next_page_token value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "members": [], + * // "nextPageToken": "my_nextPageToken", + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); + * * @alias monitoring.projects.groups.members.list * @memberOf! () * @@ -3345,45 +3756,79 @@ export namespace monitoring_v3 { * monitoring.projects.metricDescriptors.create * @desc Creates a new metric descriptor. User-created metric descriptors define custom metrics (https://cloud.google.com/monitoring/custom-metrics). * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the quota for your project at - * // https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth application-default login' - * // 3. To install the client library and Application Default Credentials library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for the 'create' method: - * - * // The project on which to execute the request. The format is `"projects/{project_id_or_number}"`. - * name: "projects/{MY-PROJECT}", - * resource: {}, - * // Auth client - * auth: authClient - * }; - * - * monitoring.projects.metricDescriptors.create(request, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * } + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.write', + * ], * }); + * + * // 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 monitoring.projects.metricDescriptors.create({ + * // Required. The project on which to execute the request. The format is: + * // projects/[PROJECT_ID_OR_NUMBER] + * // + * name: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "labels": [], + * // "launchStage": "my_launchStage", + * // "metadata": {}, + * // "metricKind": "my_metricKind", + * // "monitoredResourceTypes": [], + * // "name": "my_name", + * // "type": "my_type", + * // "unit": "my_unit", + * // "valueType": "my_valueType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "labels": [], + * // "launchStage": "my_launchStage", + * // "metadata": {}, + * // "metricKind": "my_metricKind", + * // "monitoredResourceTypes": [], + * // "name": "my_name", + * // "type": "my_type", + * // "unit": "my_unit", + * // "valueType": "my_valueType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); + * * @alias monitoring.projects.metricDescriptors.create * @memberOf! () * @@ -3460,46 +3905,48 @@ export namespace monitoring_v3 { * monitoring.projects.metricDescriptors.delete * @desc Deletes a metric descriptor. Only user-created custom metrics (https://cloud.google.com/monitoring/custom-metrics) can be deleted. * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the quota for your project at - * // https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth application-default login' - * // 3. To install the client library and Application Default Credentials library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for the 'delete' method: - * - * // The metric descriptor on which to execute the request. The format is - * // `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. An example of `{metric_id}` is: - * // `"custom.googleapis.com/my_test_metric"`. - * name: "", - * // Auth client - * auth: authClient - * }; - * - * monitoring.projects.metricDescriptors.delete(request, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * } + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.projects.metricDescriptors.delete({ + * // Required. The metric descriptor on which to execute the request. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] + * // An example of [METRIC_ID] is: "custom.googleapis.com/my_test_metric". + * name: 'projects/my-project/metricDescriptors/.*', * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); + * * @alias monitoring.projects.metricDescriptors.delete * @memberOf! () * @@ -3570,46 +4017,62 @@ export namespace monitoring_v3 { * monitoring.projects.metricDescriptors.get * @desc Gets a single metric descriptor. This method does not require a Workspace. * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the quota for your project at - * // https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth application-default login' - * // 3. To install the client library and Application Default Credentials library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for the 'get' method: - * - * // The metric descriptor on which to execute the request. The format is - * // `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. An example value of `{metric_id}` - * // is `"compute.googleapis.com/instance/disk/read_bytes_count"`. - * name: "", - * // Auth client - * auth: authClient - * }; - * - * monitoring.projects.metricDescriptors.get(request, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * } + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * 'https://www.googleapis.com/auth/monitoring.write', + * ], + * }); + * + * // 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 monitoring.projects.metricDescriptors.get({ + * // Required. The metric descriptor on which to execute the request. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] + * // An example value of [METRIC_ID] is "compute.googleapis.com/instance/disk/read_bytes_count". + * name: 'projects/my-project/metricDescriptors/.*', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "labels": [], + * // "launchStage": "my_launchStage", + * // "metadata": {}, + * // "metricKind": "my_metricKind", + * // "monitoredResourceTypes": [], + * // "name": "my_name", + * // "type": "my_type", + * // "unit": "my_unit", + * // "valueType": "my_valueType" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); + * * @alias monitoring.projects.metricDescriptors.get * @memberOf! () * @@ -3682,51 +4145,61 @@ export namespace monitoring_v3 { * monitoring.projects.metricDescriptors.list * @desc Lists metric descriptors that match a filter. This method does not require a Workspace. * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the quota for your project at - * // https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth application-default login' - * // 3. To install the client library and Application Default Credentials library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for the 'list' method: - * - * // The project on which to execute the request. The format is `"projects/{project_id_or_number}"`. - * name: "projects/{MY-PROJECT}", - * // Auth client - * auth: authClient - * }; - * - * - * var recur = function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * if (result.nextPageToken) { - * request.pageToken = result.nextPageToken; - * monitoring.projects.metricDescriptors.list(request, recur); - * } - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * 'https://www.googleapis.com/auth/monitoring.write', + * ], + * }); + * + * // 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 monitoring.projects.metricDescriptors.list({ + * // If this field is empty, all custom and system-defined metric descriptors are returned. Otherwise, the filter (https://cloud.google.com/monitoring/api/v3/filters) specifies which metric descriptors are to be returned. For example, the following filter matches all custom metrics (https://cloud.google.com/monitoring/custom-metrics): + * // metric.type = starts_with("custom.googleapis.com/") + * // + * filter: 'placeholder-value', + * // Required. The project on which to execute the request. The format is: + * // projects/[PROJECT_ID_OR_NUMBER] + * // + * name: 'projects/my-project', + * // A positive number that is the maximum number of results to return. + * pageSize: 'placeholder-value', + * // If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "metricDescriptors": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } * - * monitoring.projects.metricDescriptors.list(request, recur); + * main().catch(e => { + * console.error(e); + * throw e; * }); + * * @alias monitoring.projects.metricDescriptors.list * @memberOf! () * @@ -3887,46 +4360,57 @@ export namespace monitoring_v3 { * monitoring.projects.monitoredResourceDescriptors.get * @desc Gets a single monitored resource descriptor. This method does not require a Workspace. * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the quota for your project at - * // https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth application-default login' - * // 3. To install the client library and Application Default Credentials library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for the 'get' method: - * - * // The monitored resource descriptor to get. The format is - * // `"projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}"`. The - * // `{resource_type}` is a predefined type, such as `cloudsql_database`. - * name: "projects/{MY-PROJECT}/monitoredResourceDescriptors/{MY-MONITOREDRESOURCEDESCRIPTOR}", - * // Auth client - * auth: authClient - * }; - * - * monitoring.projects.monitoredResourceDescriptors.get(request, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * } + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * 'https://www.googleapis.com/auth/monitoring.write', + * ], * }); + * + * // 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 monitoring.projects.monitoredResourceDescriptors.get({ + * // Required. The monitored resource descriptor to get. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/monitoredResourceDescriptors/[RESOURCE_TYPE] + * // The [RESOURCE_TYPE] is a predefined type, such as cloudsql_database. + * name: 'projects/my-project/monitoredResourceDescriptors/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "labels": [], + * // "launchStage": "my_launchStage", + * // "name": "my_name", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); + * * @alias monitoring.projects.monitoredResourceDescriptors.get * @memberOf! () * @@ -4006,51 +4490,61 @@ export namespace monitoring_v3 { * monitoring.projects.monitoredResourceDescriptors.list * @desc Lists monitored resource descriptors that match a filter. This method does not require a Workspace. * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the quota for your project at - * // https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth application-default login' - * // 3. To install the client library and Application Default Credentials library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for the 'list' method: - * - * // The project on which to execute the request. The format is `"projects/{project_id_or_number}"`. - * name: "projects/{MY-PROJECT}", - * // Auth client - * auth: authClient - * }; - * - * - * var recur = function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * if (result.nextPageToken) { - * request.pageToken = result.nextPageToken; - * monitoring.projects.monitoredResourceDescriptors.list(request, recur); - * } - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); * - * monitoring.projects.monitoredResourceDescriptors.list(request, recur); + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * 'https://www.googleapis.com/auth/monitoring.write', + * ], + * }); + * + * // 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 monitoring.projects.monitoredResourceDescriptors.list({ + * // An optional filter (https://cloud.google.com/monitoring/api/v3/filters) describing the descriptors to be returned. The filter can reference the descriptor's type and labels. For example, the following filter returns only Google Compute Engine descriptors that have an id label: + * // resource.type = starts_with("gce_") AND resource.label:id + * // + * filter: 'placeholder-value', + * // Required. The project on which to execute the request. The format is: + * // projects/[PROJECT_ID_OR_NUMBER] + * // + * name: 'projects/my-project', + * // A positive number that is the maximum number of results to return. + * pageSize: 'placeholder-value', + * // If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "resourceDescriptors": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); + * * @alias monitoring.projects.monitoredResourceDescriptors.list * @memberOf! () * @@ -4189,6 +4683,58 @@ export namespace monitoring_v3 { /** * monitoring.projects.notificationChannelDescriptors.get * @desc Gets a single channel descriptor. The descriptor indicates which fields are expected / permitted for a notification channel of the given type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * ], + * }); + * + * // 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 monitoring.projects.notificationChannelDescriptors.get({ + * // Required. The channel type for which to execute the request. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] + * // + * name: + * 'projects/my-project/notificationChannelDescriptors/my-notificationChannelDescriptor', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "labels": [], + * // "launchStage": "my_launchStage", + * // "name": "my_name", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.notificationChannelDescriptors.get * @memberOf! () * @@ -4269,6 +4815,57 @@ export namespace monitoring_v3 { /** * monitoring.projects.notificationChannelDescriptors.list * @desc Lists the descriptors for supported channel types. The use of descriptors makes it possible for new channel types to be dynamically added. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * ], + * }); + * + * // 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 monitoring.projects.notificationChannelDescriptors.list({ + * // Required. The REST resource name of the parent from which to retrieve the notification channel descriptors. The expected syntax is: + * // projects/[PROJECT_ID_OR_NUMBER] + * // Note that this names the parent container in which to look for the descriptors; to retrieve a single descriptor by name, use the GetNotificationChannelDescriptor operation, instead. + * name: 'projects/my-project', + * // The maximum number of results to return in a single response. If not set to a positive number, a reasonable value will be chosen by the service. + * pageSize: 'placeholder-value', + * // If non-empty, page_token must contain a value returned as the next_page_token in a previous response to request the next set of results. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "channelDescriptors": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.notificationChannelDescriptors.list * @memberOf! () * @@ -4407,6 +5004,73 @@ export namespace monitoring_v3 { /** * monitoring.projects.notificationChannels.create * @desc Creates a new notification channel, representing a single notification endpoint such as an email address, SMS number, or PagerDuty service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.projects.notificationChannels.create({ + * // Required. The project on which to execute the request. The format is: + * // projects/[PROJECT_ID_OR_NUMBER] + * // This names the container into which the channel will be written, this does not name the newly created channel. The resulting channel's name will have a normalized version of this field as a prefix, but will add /notificationChannels/[CHANNEL_ID] to identify the channel. + * name: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "enabled": false, + * // "labels": {}, + * // "name": "my_name", + * // "type": "my_type", + * // "userLabels": {}, + * // "verificationStatus": "my_verificationStatus" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "enabled": false, + * // "labels": {}, + * // "name": "my_name", + * // "type": "my_type", + * // "userLabels": {}, + * // "verificationStatus": "my_verificationStatus" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.notificationChannels.create * @memberOf! () * @@ -4482,6 +5146,51 @@ export namespace monitoring_v3 { /** * monitoring.projects.notificationChannels.delete * @desc Deletes a notification channel. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.projects.notificationChannels.delete({ + * // If true, the notification channel will be deleted regardless of its use in alert policies (the policies will be updated to remove the channel). If false, channels that are still referenced by an existing alerting policy will fail to be deleted in a delete operation. + * force: 'placeholder-value', + * // Required. The channel for which to execute the request. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * // + * name: 'projects/my-project/notificationChannels/my-notificationChannel', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.notificationChannels.delete * @memberOf! () * @@ -4552,6 +5261,59 @@ export namespace monitoring_v3 { /** * monitoring.projects.notificationChannels.get * @desc Gets a single notification channel. The channel includes the relevant configuration details with which the channel was created. However, the response may truncate or omit passwords, API keys, or other private key matter and thus the response may not be 100% identical to the information that was supplied in the call to the create method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * ], + * }); + * + * // 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 monitoring.projects.notificationChannels.get({ + * // Required. The channel for which to execute the request. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * // + * name: 'projects/my-project/notificationChannels/my-notificationChannel', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "enabled": false, + * // "labels": {}, + * // "name": "my_name", + * // "type": "my_type", + * // "userLabels": {}, + * // "verificationStatus": "my_verificationStatus" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.notificationChannels.get * @memberOf! () * @@ -4623,6 +5385,60 @@ export namespace monitoring_v3 { /** * monitoring.projects.notificationChannels.getVerificationCode * @desc Requests a verification code for an already verified channel that can then be used in a call to VerifyNotificationChannel() on a different channel with an equivalent identity in the same or in a different project. This makes it possible to copy a channel between projects without requiring manual reverification of the channel. If the channel is not in the verified state, this method will fail (in other words, this may only be used if the SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been used to put the given channel into the verified state).There is no guarantee that the verification codes returned by this method will be of a similar structure or form as the ones that are delivered to the channel via SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both the codes delivered via SendNotificationChannelVerificationCode() and returned from GetNotificationChannelVerificationCode(), it is typically the case that the verification codes delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return a much longer, websafe base 64 encoded string that has a longer expiration time. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.projects.notificationChannels.getVerificationCode( + * { + * // Required. The notification channel for which a verification code is to be generated and retrieved. This must name a channel that is already verified; if the specified channel is not verified, the request will fail. + * name: 'projects/my-project/notificationChannels/my-notificationChannel', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "expireTime": "my_expireTime" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "code": "my_code", + * // "expireTime": "my_expireTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.notificationChannels.getVerificationCode * @memberOf! () * @@ -4723,6 +5539,61 @@ export namespace monitoring_v3 { /** * monitoring.projects.notificationChannels.list * @desc Lists the notification channels that have been created for the project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * ], + * }); + * + * // 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 monitoring.projects.notificationChannels.list({ + * // If provided, this field specifies the criteria that must be met by notification channels to be included in the response.For more details, see sorting and filtering (https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * filter: 'placeholder-value', + * // Required. The project on which to execute the request. The format is: + * // projects/[PROJECT_ID_OR_NUMBER] + * // This names the container in which to look for the notification channels; it does not name a specific channel. To query a specific channel by REST resource name, use the GetNotificationChannel operation. + * name: 'projects/my-project', + * // A comma-separated list of fields by which to sort the result. Supports the same set of fields as in filter. Entries can be prefixed with a minus sign to sort in descending rather than ascending order.For more details, see sorting and filtering (https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * orderBy: 'placeholder-value', + * // The maximum number of results to return in a single response. If not set to a positive number, a reasonable value will be chosen by the service. + * pageSize: 'placeholder-value', + * // If non-empty, page_token must contain a value returned as the next_page_token in a previous response to request the next set of results. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "notificationChannels": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.notificationChannels.list * @memberOf! () * @@ -4810,6 +5681,75 @@ export namespace monitoring_v3 { /** * monitoring.projects.notificationChannels.patch * @desc Updates a notification channel. Fields not specified in the field mask remain unchanged. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.projects.notificationChannels.patch({ + * // The full REST resource name for this channel. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * // The [CHANNEL_ID] is automatically assigned by the server on creation. + * name: 'projects/my-project/notificationChannels/my-notificationChannel', + * // The fields to update. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "enabled": false, + * // "labels": {}, + * // "name": "my_name", + * // "type": "my_type", + * // "userLabels": {}, + * // "verificationStatus": "my_verificationStatus" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "enabled": false, + * // "labels": {}, + * // "name": "my_name", + * // "type": "my_type", + * // "userLabels": {}, + * // "verificationStatus": "my_verificationStatus" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.notificationChannels.patch * @memberOf! () * @@ -4883,6 +5823,55 @@ export namespace monitoring_v3 { /** * monitoring.projects.notificationChannels.sendVerificationCode * @desc Causes a verification code to be delivered to the channel. The code can then be supplied in VerifyNotificationChannel to verify the channel. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.projects.notificationChannels.sendVerificationCode( + * { + * // Required. The notification channel to which to send a verification code. + * name: 'projects/my-project/notificationChannels/my-notificationChannel', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.notificationChannels.sendVerificationCode * @memberOf! () * @@ -4956,6 +5945,64 @@ export namespace monitoring_v3 { /** * monitoring.projects.notificationChannels.verify * @desc Verifies a NotificationChannel by proving receipt of the code delivered to the channel as a result of calling SendNotificationChannelVerificationCode. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.projects.notificationChannels.verify({ + * // Required. The notification channel to verify. + * name: 'projects/my-project/notificationChannels/my-notificationChannel', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "code": "my_code" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "enabled": false, + * // "labels": {}, + * // "name": "my_name", + * // "type": "my_type", + * // "userLabels": {}, + * // "verificationStatus": "my_verificationStatus" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.notificationChannels.verify * @memberOf! () * @@ -5182,45 +6229,57 @@ export namespace monitoring_v3 { * monitoring.projects.timeSeries.create * @desc Creates or adds data to one or more time series. The response is empty if all time series in the request were written. If any time series could not be written, a corresponding failure message is included in the error response. * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the quota for your project at - * // https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth application-default login' - * // 3. To install the client library and Application Default Credentials library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for the 'create' method: - * - * // The project on which to execute the request. The format is `"projects/{project_id_or_number}"`. - * name: "projects/{MY-PROJECT}", - * resource: {}, - * // Auth client - * auth: authClient - * }; - * - * monitoring.projects.timeSeries.create(request, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * } + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.write', + * ], + * }); + * + * // 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 monitoring.projects.timeSeries.create({ + * // Required. The project on which to execute the request. The format is: + * // projects/[PROJECT_ID_OR_NUMBER] + * // + * name: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "timeSeries": [] + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); + * * @alias monitoring.projects.timeSeries.create * @memberOf! () * @@ -5295,51 +6354,78 @@ export namespace monitoring_v3 { * monitoring.projects.timeSeries.list * @desc Lists time series that match a filter. This method does not require a Workspace. * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the quota for your project at - * // https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth application-default login' - * // 3. To install the client library and Application Default Credentials library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) { - * var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for the 'list' method: - * - * // The project on which to execute the request. The format is "projects/{project_id_or_number}". - * name: "projects/{MY-PROJECT}", - * // Auth client - * auth: authClient - * }; - * - * - * var recur = function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * if (result.nextPageToken) { - * request.pageToken = result.nextPageToken; - * monitoring.projects.timeSeries.list(request, recur); - * } - * } - * }; + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * ], + * }); + * + * // 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 monitoring.projects.timeSeries.list({ + * // The alignment_period specifies a time interval, in seconds, that is used to divide the data in all the time series into consistent blocks of time. This will be done before the per-series aligner can be applied to the data.The value must be at least 60 seconds. If a per-series aligner other than ALIGN_NONE is specified, this field is required or an error is returned. If no per-series aligner is specified, or the aligner ALIGN_NONE is specified, then this field is ignored. + * 'aggregation.alignmentPeriod': 'placeholder-value', + * // The reduction operation to be used to combine time series into a single time series, where the value of each data point in the resulting series is a function of all the already aligned values in the input time series.Not all reducer operations can be applied to all time series. The valid choices depend on the metric_kind and the value_type of the original time series. Reduction can yield a time series with a different metric_kind or value_type than the input time series.Time series data must first be aligned (see per_series_aligner) in order to perform cross-time series reduction. If cross_series_reducer is specified, then per_series_aligner must be specified, and must not be ALIGN_NONE. An alignment_period must also be specified; otherwise, an error is returned. + * 'aggregation.crossSeriesReducer': 'placeholder-value', + * // The set of fields to preserve when cross_series_reducer is specified. The group_by_fields determine how the time series are partitioned into subsets prior to applying the aggregation operation. Each subset contains time series that have the same value for each of the grouping fields. Each individual time series is a member of exactly one subset. The cross_series_reducer is applied to each subset of time series. It is not possible to reduce across different resource types, so this field implicitly contains resource.type. Fields not specified in group_by_fields are aggregated away. If group_by_fields is not specified and all the time series have the same resource type, then the time series are aggregated into a single output time series. If cross_series_reducer is not defined, this field is ignored. + * 'aggregation.groupByFields': 'placeholder-value', + * // An Aligner describes how to bring the data points in a single time series into temporal alignment. Except for ALIGN_NONE, all alignments cause all the data points in an alignment_period to be mathematically grouped together, resulting in a single data point for each alignment_period with end timestamp at the end of the period.Not all alignment operations may be applied to all time series. The valid choices depend on the metric_kind and value_type of the original time series. Alignment can change the metric_kind or the value_type of the time series.Time series data must be aligned in order to perform cross-time series reduction. If cross_series_reducer is specified, then per_series_aligner must be specified and not equal to ALIGN_NONE and alignment_period must be specified; otherwise, an error is returned. + * 'aggregation.perSeriesAligner': 'placeholder-value', + * // Required. A monitoring filter (https://cloud.google.com/monitoring/api/v3/filters) that specifies which time series should be returned. The filter must specify a single metric type, and can additionally specify metric labels and other information. For example: + * // metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND + * // metric.labels.instance_name = "my-instance-name" + * // + * filter: 'placeholder-value', + * // Required. The end of the time interval. + * 'interval.endTime': 'placeholder-value', + * // Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time. + * 'interval.startTime': 'placeholder-value', + * // Required. The project on which to execute the request. The format is: + * // projects/[PROJECT_ID_OR_NUMBER] + * // + * name: 'projects/my-project', + * // Unsupported: must be left blank. The points in each time series are currently returned in reverse time order (most recent to oldest). + * orderBy: 'placeholder-value', + * // A positive number that is the maximum number of results to return. If page_size is empty or more than 100,000 results, the effective page_size is 100,000 results. If view is set to FULL, this is the maximum number of Points returned. If view is set to HEADERS, this is the maximum number of TimeSeries returned. + * pageSize: 'placeholder-value', + * // If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + * pageToken: 'placeholder-value', + * // Required. Specifies which information is returned about the time series. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionErrors": [], + * // "nextPageToken": "my_nextPageToken", + * // "timeSeries": [] + * // } + * } * - * monitoring.projects.timeSeries.list(request, recur); + * main().catch(e => { + * console.error(e); + * throw e; * }); + * * @alias monitoring.projects.timeSeries.list * @memberOf! () * @@ -5427,6 +6513,65 @@ export namespace monitoring_v3 { /** * monitoring.projects.timeSeries.query * @desc Queries time series using the time series query language. This method does not require a Workspace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * ], + * }); + * + * // 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 monitoring.projects.timeSeries.query({ + * // Required. The project on which to execute the request. The format is: + * // projects/[PROJECT_ID_OR_NUMBER] + * // + * name: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "pageSize": 0, + * // "pageToken": "my_pageToken", + * // "query": "my_query" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "partialErrors": [], + * // "timeSeriesData": [], + * // "timeSeriesDescriptor": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.timeSeries.query * @memberOf! () * @@ -5602,6 +6747,81 @@ export namespace monitoring_v3 { /** * monitoring.projects.uptimeCheckConfigs.create * @desc Creates a new Uptime check configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.projects.uptimeCheckConfigs.create({ + * // Required. The project in which to create the Uptime check. The format is: + * // projects/[PROJECT_ID_OR_NUMBER] + * // + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentMatchers": [], + * // "displayName": "my_displayName", + * // "httpCheck": {}, + * // "internalCheckers": [], + * // "isInternal": false, + * // "monitoredResource": {}, + * // "name": "my_name", + * // "period": "my_period", + * // "resourceGroup": {}, + * // "selectedRegions": [], + * // "tcpCheck": {}, + * // "timeout": "my_timeout" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentMatchers": [], + * // "displayName": "my_displayName", + * // "httpCheck": {}, + * // "internalCheckers": [], + * // "isInternal": false, + * // "monitoredResource": {}, + * // "name": "my_name", + * // "period": "my_period", + * // "resourceGroup": {}, + * // "selectedRegions": [], + * // "tcpCheck": {}, + * // "timeout": "my_timeout" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.uptimeCheckConfigs.create * @memberOf! () * @@ -5677,6 +6897,49 @@ export namespace monitoring_v3 { /** * monitoring.projects.uptimeCheckConfigs.delete * @desc Deletes an Uptime check configuration. Note that this method will fail if the Uptime check configuration is referenced by an alert policy or other dependent configs that would be rendered invalid by the deletion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.projects.uptimeCheckConfigs.delete({ + * // Required. The Uptime check configuration to delete. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * // + * name: 'projects/my-project/uptimeCheckConfigs/my-uptimeCheckConfig', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.uptimeCheckConfigs.delete * @memberOf! () * @@ -5746,6 +7009,63 @@ export namespace monitoring_v3 { /** * monitoring.projects.uptimeCheckConfigs.get * @desc Gets a single Uptime check configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * ], + * }); + * + * // 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 monitoring.projects.uptimeCheckConfigs.get({ + * // Required. The Uptime check configuration to retrieve. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * // + * name: 'projects/my-project/uptimeCheckConfigs/my-uptimeCheckConfig', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentMatchers": [], + * // "displayName": "my_displayName", + * // "httpCheck": {}, + * // "internalCheckers": [], + * // "isInternal": false, + * // "monitoredResource": {}, + * // "name": "my_name", + * // "period": "my_period", + * // "resourceGroup": {}, + * // "selectedRegions": [], + * // "tcpCheck": {}, + * // "timeout": "my_timeout" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.uptimeCheckConfigs.get * @memberOf! () * @@ -5817,6 +7137,58 @@ export namespace monitoring_v3 { /** * monitoring.projects.uptimeCheckConfigs.list * @desc Lists the existing valid Uptime check configurations for the project (leaving out any invalid configurations). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * ], + * }); + * + * // 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 monitoring.projects.uptimeCheckConfigs.list({ + * // The maximum number of results to return in a single response. The server may further constrain the maximum number of results returned in a single page. If the page_size is <=0, the server will decide the number of results to be returned. + * pageSize: 'placeholder-value', + * // If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return more results from the previous method call. + * pageToken: 'placeholder-value', + * // Required. The project whose Uptime check configurations are listed. The format is: + * // projects/[PROJECT_ID_OR_NUMBER] + * // + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "totalSize": 0, + * // "uptimeCheckConfigs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.uptimeCheckConfigs.list * @memberOf! () * @@ -5902,6 +7274,83 @@ export namespace monitoring_v3 { /** * monitoring.projects.uptimeCheckConfigs.patch * @desc Updates an Uptime check configuration. You can either replace the entire configuration with a new one or replace only certain fields in the current configuration by specifying the fields to be updated via updateMask. Returns the updated configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.projects.uptimeCheckConfigs.patch({ + * // A unique resource name for this Uptime check configuration. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * // This field should be omitted when creating the Uptime check configuration; on create, the resource name is assigned by the server and included in the response. + * name: 'projects/my-project/uptimeCheckConfigs/my-uptimeCheckConfig', + * // Optional. If present, only the listed fields in the current Uptime check configuration are updated with values from the new configuration. If this field is empty, then the current configuration is completely replaced with the new configuration. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentMatchers": [], + * // "displayName": "my_displayName", + * // "httpCheck": {}, + * // "internalCheckers": [], + * // "isInternal": false, + * // "monitoredResource": {}, + * // "name": "my_name", + * // "period": "my_period", + * // "resourceGroup": {}, + * // "selectedRegions": [], + * // "tcpCheck": {}, + * // "timeout": "my_timeout" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentMatchers": [], + * // "displayName": "my_displayName", + * // "httpCheck": {}, + * // "internalCheckers": [], + * // "isInternal": false, + * // "monitoredResource": {}, + * // "name": "my_name", + * // "period": "my_period", + * // "resourceGroup": {}, + * // "selectedRegions": [], + * // "tcpCheck": {}, + * // "timeout": "my_timeout" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.projects.uptimeCheckConfigs.patch * @memberOf! () * @@ -6069,6 +7518,75 @@ export namespace monitoring_v3 { /** * monitoring.services.create * @desc Create a Service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.services.create({ + * // Required. Resource name of the parent workspace. The format is: + * // projects/[PROJECT_ID_OR_NUMBER] + * // + * parent: '[^/]+/[^/]+', + * // Optional. The Service id to use for this Service. If omitted, an id will be generated instead. Must match the pattern [a-z0-9\-]+ + * serviceId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appEngine": {}, + * // "cloudEndpoints": {}, + * // "clusterIstio": {}, + * // "custom": {}, + * // "displayName": "my_displayName", + * // "meshIstio": {}, + * // "name": "my_name", + * // "telemetry": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngine": {}, + * // "cloudEndpoints": {}, + * // "clusterIstio": {}, + * // "custom": {}, + * // "displayName": "my_displayName", + * // "meshIstio": {}, + * // "name": "my_name", + * // "telemetry": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.services.create * @memberOf! () * @@ -6142,6 +7660,49 @@ export namespace monitoring_v3 { /** * monitoring.services.delete * @desc Soft delete this Service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.services.delete({ + * // Required. Resource name of the Service to delete. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * // + * name: '[^/]+/[^/]+/services/my-service', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.services.delete * @memberOf! () * @@ -6210,6 +7771,59 @@ export namespace monitoring_v3 { /** * monitoring.services.get * @desc Get the named Service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * ], + * }); + * + * // 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 monitoring.services.get({ + * // Required. Resource name of the Service. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * // + * name: '[^/]+/[^/]+/services/my-service', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngine": {}, + * // "cloudEndpoints": {}, + * // "clusterIstio": {}, + * // "custom": {}, + * // "displayName": "my_displayName", + * // "meshIstio": {}, + * // "name": "my_name", + * // "telemetry": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.services.get * @memberOf! () * @@ -6278,6 +7892,68 @@ export namespace monitoring_v3 { /** * monitoring.services.list * @desc List Services for this workspace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * ], + * }); + * + * // 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 monitoring.services.list({ + * // A filter specifying what Services to return. The filter currently supports the following fields: + * // - `identifier_case` + * // - `app_engine.module_id` + * // - `cloud_endpoints.service` + * // - `cluster_istio.location` + * // - `cluster_istio.cluster_name` + * // - `cluster_istio.service_namespace` + * // - `cluster_istio.service_name` + * // identifier_case refers to which option in the identifier oneof is populated. For example, the filter identifier_case = "CUSTOM" would match all services with a value for the custom field. Valid options are "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + * filter: 'placeholder-value', + * // A non-negative number that is the maximum number of results to return. When 0, use default page size. + * pageSize: 'placeholder-value', + * // If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + * pageToken: 'placeholder-value', + * // Required. Resource name of the parent containing the listed services, either a project or a Monitoring Workspace. The formats are: + * // projects/[PROJECT_ID_OR_NUMBER] + * // workspaces/[HOST_PROJECT_ID_OR_NUMBER] + * // + * parent: '[^/]+/[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "services": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.services.list * @memberOf! () * @@ -6356,6 +8032,75 @@ export namespace monitoring_v3 { /** * monitoring.services.patch * @desc Update this Service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.services.patch({ + * // Resource name for this Service. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * // + * name: '[^/]+/[^/]+/services/my-service', + * // A set of field paths defining which fields to use for the update. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appEngine": {}, + * // "cloudEndpoints": {}, + * // "clusterIstio": {}, + * // "custom": {}, + * // "displayName": "my_displayName", + * // "meshIstio": {}, + * // "name": "my_name", + * // "telemetry": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appEngine": {}, + * // "cloudEndpoints": {}, + * // "clusterIstio": {}, + * // "custom": {}, + * // "displayName": "my_displayName", + * // "meshIstio": {}, + * // "name": "my_name", + * // "telemetry": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.services.patch * @memberOf! () * @@ -6519,6 +8264,71 @@ export namespace monitoring_v3 { /** * monitoring.services.serviceLevelObjectives.create * @desc Create a ServiceLevelObjective for the given Service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.services.serviceLevelObjectives.create({ + * // Required. Resource name of the parent Service. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * // + * parent: '[^/]+/[^/]+/services/my-service', + * // Optional. The ServiceLevelObjective id to use for this ServiceLevelObjective. If omitted, an id will be generated instead. Must match the pattern [a-z0-9\-]+ + * serviceLevelObjectiveId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "calendarPeriod": "my_calendarPeriod", + * // "displayName": "my_displayName", + * // "goal": {}, + * // "name": "my_name", + * // "rollingPeriod": "my_rollingPeriod", + * // "serviceLevelIndicator": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "calendarPeriod": "my_calendarPeriod", + * // "displayName": "my_displayName", + * // "goal": {}, + * // "name": "my_name", + * // "rollingPeriod": "my_rollingPeriod", + * // "serviceLevelIndicator": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.services.serviceLevelObjectives.create * @memberOf! () * @@ -6597,6 +8407,50 @@ export namespace monitoring_v3 { /** * monitoring.services.serviceLevelObjectives.delete * @desc Delete the given ServiceLevelObjective. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.services.serviceLevelObjectives.delete({ + * // Required. Resource name of the ServiceLevelObjective to delete. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + * // + * name: + * '[^/]+/[^/]+/services/my-service/serviceLevelObjectives/my-serviceLevelObjective', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.services.serviceLevelObjectives.delete * @memberOf! () * @@ -6666,6 +8520,60 @@ export namespace monitoring_v3 { /** * monitoring.services.serviceLevelObjectives.get * @desc Get a ServiceLevelObjective by name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * ], + * }); + * + * // 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 monitoring.services.serviceLevelObjectives.get({ + * // Required. Resource name of the ServiceLevelObjective to get. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + * // + * name: + * '[^/]+/[^/]+/services/my-service/serviceLevelObjectives/my-serviceLevelObjective', + * // View of the ServiceLevelObjective to return. If DEFAULT, return the ServiceLevelObjective as originally defined. If EXPLICIT and the ServiceLevelObjective is defined in terms of a BasicSli, replace the BasicSli with a RequestBasedSli spelling out how the SLI is computed. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "calendarPeriod": "my_calendarPeriod", + * // "displayName": "my_displayName", + * // "goal": {}, + * // "name": "my_name", + * // "rollingPeriod": "my_rollingPeriod", + * // "serviceLevelIndicator": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.services.serviceLevelObjectives.get * @memberOf! () * @@ -6740,6 +8648,62 @@ export namespace monitoring_v3 { /** * monitoring.services.serviceLevelObjectives.list * @desc List the ServiceLevelObjectives for the given Service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * ], + * }); + * + * // 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 monitoring.services.serviceLevelObjectives.list({ + * // A filter specifying what ServiceLevelObjectives to return. + * filter: 'placeholder-value', + * // A non-negative number that is the maximum number of results to return. When 0, use default page size. + * pageSize: 'placeholder-value', + * // If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + * pageToken: 'placeholder-value', + * // Required. Resource name of the parent containing the listed SLOs, either a project or a Monitoring Workspace. The formats are: + * // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * // workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- + * // + * parent: '[^/]+/[^/]+/services/my-service', + * // View of the ServiceLevelObjectives to return. If DEFAULT, return each ServiceLevelObjective as originally defined. If EXPLICIT and the ServiceLevelObjective is defined in terms of a BasicSli, replace the BasicSli with a RequestBasedSli spelling out how the SLI is computed. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "serviceLevelObjectives": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.services.serviceLevelObjectives.list * @memberOf! () * @@ -6827,6 +8791,72 @@ export namespace monitoring_v3 { /** * monitoring.services.serviceLevelObjectives.patch * @desc Update the given ServiceLevelObjective. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * ], + * }); + * + * // 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 monitoring.services.serviceLevelObjectives.patch({ + * // Resource name for this ServiceLevelObjective. The format is: + * // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + * // + * name: + * '[^/]+/[^/]+/services/my-service/serviceLevelObjectives/my-serviceLevelObjective', + * // A set of field paths defining which fields to use for the update. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "calendarPeriod": "my_calendarPeriod", + * // "displayName": "my_displayName", + * // "goal": {}, + * // "name": "my_name", + * // "rollingPeriod": "my_rollingPeriod", + * // "serviceLevelIndicator": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "calendarPeriod": "my_calendarPeriod", + * // "displayName": "my_displayName", + * // "goal": {}, + * // "name": "my_name", + * // "rollingPeriod": "my_rollingPeriod", + * // "serviceLevelIndicator": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.services.serviceLevelObjectives.patch * @memberOf! () * @@ -7008,6 +9038,53 @@ export namespace monitoring_v3 { /** * monitoring.uptimeCheckIps.list * @desc Returns the list of IP addresses that checkers run from + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/monitoring.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 monitoring = google.monitoring('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/monitoring', + * 'https://www.googleapis.com/auth/monitoring.read', + * ], + * }); + * + * // 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 monitoring.uptimeCheckIps.list({ + * // The maximum number of results to return in a single response. The server may further constrain the maximum number of results returned in a single page. If the page_size is <=0, the server will decide the number of results to be returned. NOTE: this field is not yet implemented + * pageSize: 'placeholder-value', + * // If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return more results from the previous method call. NOTE: this field is not yet implemented + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "uptimeCheckIps": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias monitoring.uptimeCheckIps.list * @memberOf! () * diff --git a/src/apis/networkmanagement/v1beta1.ts b/src/apis/networkmanagement/v1beta1.ts index e78b3579be1..eb8253369c7 100644 --- a/src/apis/networkmanagement/v1beta1.ts +++ b/src/apis/networkmanagement/v1beta1.ts @@ -960,6 +960,50 @@ export namespace networkmanagement_v1beta1 { /** * networkmanagement.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/networkmanagement.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 networkmanagement = google.networkmanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 networkmanagement.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias networkmanagement.projects.locations.get * @memberOf! () * @@ -1030,6 +1074,53 @@ export namespace networkmanagement_v1beta1 { /** * networkmanagement.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/networkmanagement.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 networkmanagement = google.networkmanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 networkmanagement.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias networkmanagement.projects.locations.list * @memberOf! () * @@ -1169,6 +1260,80 @@ export namespace networkmanagement_v1beta1 { /** * networkmanagement.projects.locations.global.connectivityTests.create * @desc Creates a new Connectivity Test. After you create a test, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes. If the endpoint specifications in `ConnectivityTest` are invalid (for example, containing non-existent resources in the network, or you don't have read permissions to the network configurations of listed projects), then the reachability result returns a value of `UNKNOWN`. If the endpoint specifications in `ConnectivityTest` are incomplete, the reachability result returns a value of AMBIGUOUS. For more information, see the Connectivity Test documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/networkmanagement.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 networkmanagement = google.networkmanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 networkmanagement.projects.locations.global.connectivityTests.create( + * { + * // Required. The parent resource of the Connectivity Test to create: + * // `projects/{project_id}/locations/global` + * parent: 'projects/my-project/locations/global', + * // Required. The logical name of the Connectivity Test in your project + * // with the following restrictions: + * // + * // * Must contain only lowercase letters, numbers, and hyphens. + * // * Must start with a letter. + * // * Must be between 1-40 characters. + * // * Must end with a number or a letter. + * // * Must be unique within the customer project + * testId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": {}, + * // "displayName": "my_displayName", + * // "labels": {}, + * // "name": "my_name", + * // "protocol": "my_protocol", + * // "reachabilityDetails": {}, + * // "relatedProjects": [], + * // "source": {}, + * // "updateTime": "my_updateTime" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias networkmanagement.projects.locations.global.connectivityTests.create * @memberOf! () * @@ -1246,6 +1411,54 @@ export namespace networkmanagement_v1beta1 { /** * networkmanagement.projects.locations.global.connectivityTests.delete * @desc Deletes a specific `ConnectivityTest`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/networkmanagement.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 networkmanagement = google.networkmanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 networkmanagement.projects.locations.global.connectivityTests.delete( + * { + * // Required. Connectivity Test resource name using the form: + * // `projects/{project_id}/connectivityTests/{test_id}` + * name: + * 'projects/my-project/locations/global/connectivityTests/my-connectivityTest', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias networkmanagement.projects.locations.global.connectivityTests.delete * @memberOf! () * @@ -1318,6 +1531,60 @@ export namespace networkmanagement_v1beta1 { /** * networkmanagement.projects.locations.global.connectivityTests.get * @desc Gets the details of a specific Connectivity Test. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/networkmanagement.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 networkmanagement = google.networkmanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 networkmanagement.projects.locations.global.connectivityTests.get( + * { + * // Required. `ConnectivityTest` resource name using the form: + * // `projects/{project_id}/locations/global/connectivityTests/{test_id}` + * name: + * 'projects/my-project/locations/global/connectivityTests/my-connectivityTest', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": {}, + * // "displayName": "my_displayName", + * // "labels": {}, + * // "name": "my_name", + * // "protocol": "my_protocol", + * // "reachabilityDetails": {}, + * // "relatedProjects": [], + * // "source": {}, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias networkmanagement.projects.locations.global.connectivityTests.get * @memberOf! () * @@ -1390,6 +1657,62 @@ export namespace networkmanagement_v1beta1 { /** * networkmanagement.projects.locations.global.connectivityTests.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/networkmanagement.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 networkmanagement = google.networkmanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 networkmanagement.projects.locations.global.connectivityTests.getIamPolicy( + * { + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/global/connectivityTests/my-connectivityTest', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias networkmanagement.projects.locations.global.connectivityTests.getIamPolicy * @memberOf! () * @@ -1464,6 +1787,76 @@ export namespace networkmanagement_v1beta1 { /** * networkmanagement.projects.locations.global.connectivityTests.list * @desc Lists all Connectivity Tests owned by a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/networkmanagement.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 networkmanagement = google.networkmanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 networkmanagement.projects.locations.global.connectivityTests.list( + * { + * // Lists the `ConnectivityTests` that match the filter expression. A filter + * // expression filters the resources listed in the response. The expression + * // must be of the form ` ` where operators: `<`, `>`, + * // `<=`, + * // `>=`, + * // `!=`, `=`, `:` are supported (colon `:` represents a HAS operator which is + * // roughly synonymous with equality). can refer to a proto or JSON + * // field, or a synthetic field. Field names can be camelCase or snake_case. + * // + * // Examples: + * // - Filter by name: + * // name = "projects/proj-1/connectivityTests/test-1 + * // + * // - Filter by labels: + * // - Resources that have a key called `foo` + * // labels.foo:* + * // - Resources that have a key called `foo` whose value is `bar` + * // labels.foo = bar + * filter: 'placeholder-value', + * // Field to use to sort the list. + * orderBy: 'placeholder-value', + * // Number of `ConnectivityTests` to return. + * pageSize: 'placeholder-value', + * // Page token from an earlier query, as returned in `next_page_token`. + * pageToken: 'placeholder-value', + * // Required. The parent resource of the Connectivity Tests: + * // `projects/{project_id}/locations/global` + * parent: 'projects/my-project/locations/global', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "resources": [], + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias networkmanagement.projects.locations.global.connectivityTests.list * @memberOf! () * @@ -1552,6 +1945,75 @@ export namespace networkmanagement_v1beta1 { /** * networkmanagement.projects.locations.global.connectivityTests.patch * @desc Updates the configuration of an existing `ConnectivityTest`. After you update a test, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes. The Reachability state in the test resource is updated with the new result. If the endpoint specifications in `ConnectivityTest` are invalid (for example, they contain non-existent resources in the network, or the user does not have read permissions to the network configurations of listed projects), then the reachability result returns a value of UNKNOWN. If the endpoint specifications in `ConnectivityTest` are incomplete, the reachability result returns a value of `AMBIGUOUS`. See the documentation in `ConnectivityTest` for for more details. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/networkmanagement.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 networkmanagement = google.networkmanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 networkmanagement.projects.locations.global.connectivityTests.patch( + * { + * // Required. Unique name of the resource using the form: + * // `projects/{project_id}/tests/{test_id}` + * name: + * 'projects/my-project/locations/global/connectivityTests/my-connectivityTest', + * // Required. Mask of fields to update. At least one path must be supplied in + * // this field. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "destination": {}, + * // "displayName": "my_displayName", + * // "labels": {}, + * // "name": "my_name", + * // "protocol": "my_protocol", + * // "reachabilityDetails": {}, + * // "relatedProjects": [], + * // "source": {}, + * // "updateTime": "my_updateTime" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias networkmanagement.projects.locations.global.connectivityTests.patch * @memberOf! () * @@ -1626,6 +2088,60 @@ export namespace networkmanagement_v1beta1 { /** * networkmanagement.projects.locations.global.connectivityTests.rerun * @desc Rerun an existing `ConnectivityTest`. After the user triggers the rerun, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes. Even though the test configuration remains the same, the reachability result may change due to underlying network configuration changes. If the endpoint specifications in `ConnectivityTest` become invalid (for example, specified resources are deleted in the network, or you lost read permissions to the network configurations of listed projects), then the reachability result returns a value of `UNKNOWN`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/networkmanagement.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 networkmanagement = google.networkmanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 networkmanagement.projects.locations.global.connectivityTests.rerun( + * { + * // Required. Connectivity Test resource name using the form: + * // `projects/{project_id}/connectivityTests/{test_id}` + * name: + * 'projects/my-project/locations/global/connectivityTests/my-connectivityTest', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias networkmanagement.projects.locations.global.connectivityTests.rerun * @memberOf! () * @@ -1702,6 +2218,62 @@ export namespace networkmanagement_v1beta1 { /** * networkmanagement.projects.locations.global.connectivityTests.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/networkmanagement.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 networkmanagement = google.networkmanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 networkmanagement.projects.locations.global.connectivityTests.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/global/connectivityTests/my-connectivityTest', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias networkmanagement.projects.locations.global.connectivityTests.setIamPolicy * @memberOf! () * @@ -1776,6 +2348,58 @@ export namespace networkmanagement_v1beta1 { /** * networkmanagement.projects.locations.global.connectivityTests.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/networkmanagement.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 networkmanagement = google.networkmanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 networkmanagement.projects.locations.global.connectivityTests.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/global/connectivityTests/my-connectivityTest', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias networkmanagement.projects.locations.global.connectivityTests.testIamPermissions * @memberOf! () * @@ -2028,6 +2652,52 @@ export namespace networkmanagement_v1beta1 { /** * networkmanagement.projects.locations.global.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/networkmanagement.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 networkmanagement = google.networkmanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 networkmanagement.projects.locations.global.operations.cancel( + * { + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/global/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias networkmanagement.projects.locations.global.operations.cancel * @memberOf! () * @@ -2102,6 +2772,46 @@ export namespace networkmanagement_v1beta1 { /** * networkmanagement.projects.locations.global.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/networkmanagement.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 networkmanagement = google.networkmanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 networkmanagement.projects.locations.global.operations.delete( + * { + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/locations/global/operations/my-operation', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias networkmanagement.projects.locations.global.operations.delete * @memberOf! () * @@ -2172,6 +2882,50 @@ export namespace networkmanagement_v1beta1 { /** * networkmanagement.projects.locations.global.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/networkmanagement.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 networkmanagement = google.networkmanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 networkmanagement.projects.locations.global.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/global/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias networkmanagement.projects.locations.global.operations.get * @memberOf! () * @@ -2244,6 +2998,55 @@ export namespace networkmanagement_v1beta1 { /** * networkmanagement.projects.locations.global.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/networkmanagement.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 networkmanagement = google.networkmanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 networkmanagement.projects.locations.global.operations.list( + * { + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/global', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias networkmanagement.projects.locations.global.operations.list * @memberOf! () * diff --git a/src/apis/oauth2/v2.ts b/src/apis/oauth2/v2.ts index 4cda2dd32d2..9a929fa1f4d 100644 --- a/src/apis/oauth2/v2.ts +++ b/src/apis/oauth2/v2.ts @@ -98,6 +98,53 @@ export namespace oauth2_v2 { /** * oauth2.tokeninfo + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oauth2.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 oauth2 = google.oauth2('v2'); + * + * 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: [], + * }); + * + * // 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 oauth2.tokeninfo({ + * access_token: 'placeholder-value', + * + * id_token: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "audience": "my_audience", + * // "email": "my_email", + * // "expires_in": 0, + * // "issued_to": "my_issued_to", + * // "scope": "my_scope", + * // "user_id": "my_user_id", + * // "verified_email": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oauth2.tokeninfo * @memberOf! oauth2(v2) * @@ -273,6 +320,57 @@ export namespace oauth2_v2 { /** * oauth2.userinfo.get + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oauth2.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 oauth2 = google.oauth2('v2'); + * + * 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: [ + * 'openid', + * 'https://www.googleapis.com/auth/userinfo.email', + * 'https://www.googleapis.com/auth/userinfo.profile', + * ], + * }); + * + * // 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 oauth2.userinfo.get({}); + * console.log(res.data); + * + * // Example response + * // { + * // "email": "my_email", + * // "family_name": "my_family_name", + * // "gender": "my_gender", + * // "given_name": "my_given_name", + * // "hd": "my_hd", + * // "id": "my_id", + * // "link": "my_link", + * // "locale": "my_locale", + * // "name": "my_name", + * // "picture": "my_picture", + * // "verified_email": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oauth2.userinfo.get * @memberOf! () * @@ -365,6 +463,57 @@ export namespace oauth2_v2 { /** * oauth2.userinfo.v2.me.get + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oauth2.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 oauth2 = google.oauth2('v2'); + * + * 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: [ + * 'openid', + * 'https://www.googleapis.com/auth/userinfo.email', + * 'https://www.googleapis.com/auth/userinfo.profile', + * ], + * }); + * + * // 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 oauth2.userinfo.v2.me.get({}); + * console.log(res.data); + * + * // Example response + * // { + * // "email": "my_email", + * // "family_name": "my_family_name", + * // "gender": "my_gender", + * // "given_name": "my_given_name", + * // "hd": "my_hd", + * // "id": "my_id", + * // "link": "my_link", + * // "locale": "my_locale", + * // "name": "my_name", + * // "picture": "my_picture", + * // "verified_email": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oauth2.userinfo.v2.me.get * @memberOf! () * diff --git a/src/apis/osconfig/v1.ts b/src/apis/osconfig/v1.ts index 290ca226207..a715e5850b7 100644 --- a/src/apis/osconfig/v1.ts +++ b/src/apis/osconfig/v1.ts @@ -737,6 +737,80 @@ export namespace osconfig_v1 { /** * osconfig.projects.patchDeployments.create * @desc Create an OS Config patch deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.patchDeployments.create({ + * // Required. The project to apply this patch deployment to in the form `projects/x`. + * parent: 'projects/my-project', + * // Required. A name for the patch deployment in the project. When creating a name + * // the following rules apply: + * // * Must contain only lowercase letters, numbers, and hyphens. + * // * Must start with a letter. + * // * Must be between 1-63 characters. + * // * Must end with a number or a letter. + * // * Must be unique within the project. + * patchDeploymentId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "duration": "my_duration", + * // "instanceFilter": {}, + * // "lastExecuteTime": "my_lastExecuteTime", + * // "name": "my_name", + * // "oneTimeSchedule": {}, + * // "patchConfig": {}, + * // "recurringSchedule": {}, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "duration": "my_duration", + * // "instanceFilter": {}, + * // "lastExecuteTime": "my_lastExecuteTime", + * // "name": "my_name", + * // "oneTimeSchedule": {}, + * // "patchConfig": {}, + * // "recurringSchedule": {}, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.patchDeployments.create * @memberOf! () * @@ -813,6 +887,45 @@ export namespace osconfig_v1 { /** * osconfig.projects.patchDeployments.delete * @desc Delete an OS Config patch deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.patchDeployments.delete({ + * // Required. The resource name of the patch deployment in the form + * // `projects/x/patchDeployments/x`. + * name: 'projects/my-project/patchDeployments/my-patchDeployment', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.patchDeployments.delete * @memberOf! () * @@ -882,6 +995,56 @@ export namespace osconfig_v1 { /** * osconfig.projects.patchDeployments.get * @desc Get an OS Config patch deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.patchDeployments.get({ + * // Required. The resource name of the patch deployment in the form + * // `projects/x/patchDeployments/x`. + * name: 'projects/my-project/patchDeployments/my-patchDeployment', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "duration": "my_duration", + * // "instanceFilter": {}, + * // "lastExecuteTime": "my_lastExecuteTime", + * // "name": "my_name", + * // "oneTimeSchedule": {}, + * // "patchConfig": {}, + * // "recurringSchedule": {}, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.patchDeployments.get * @memberOf! () * @@ -953,6 +1116,52 @@ export namespace osconfig_v1 { /** * osconfig.projects.patchDeployments.list * @desc Get a page of OS Config patch deployments. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.patchDeployments.list({ + * // Optional. The maximum number of patch deployments to return. Default is 100. + * pageSize: 'placeholder-value', + * // Optional. A pagination token returned from a previous call to ListPatchDeployments + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The resource name of the parent in the form `projects/x`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "patchDeployments": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.patchDeployments.list * @memberOf! () * @@ -1115,6 +1324,65 @@ export namespace osconfig_v1 { /** * osconfig.projects.patchJobs.cancel * @desc Cancel a patch job. The patch job must be active. Canceled patch jobs cannot be restarted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.patchJobs.cancel({ + * // Required. Name of the patch in the form `projects/x/patchJobs/x` + * name: 'projects/my-project/patchJobs/my-patchJob', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "dryRun": false, + * // "duration": "my_duration", + * // "errorMessage": "my_errorMessage", + * // "instanceDetailsSummary": {}, + * // "instanceFilter": {}, + * // "name": "my_name", + * // "patchConfig": {}, + * // "patchDeployment": "my_patchDeployment", + * // "percentComplete": {}, + * // "state": "my_state", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.patchJobs.cancel * @memberOf! () * @@ -1185,6 +1453,72 @@ export namespace osconfig_v1 { /** * osconfig.projects.patchJobs.execute * @desc Patch VM instances by creating and running a patch job. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.patchJobs.execute({ + * // Required. The project in which to run this patch in the form `projects/x` + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "dryRun": false, + * // "duration": "my_duration", + * // "instanceFilter": {}, + * // "patchConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "dryRun": false, + * // "duration": "my_duration", + * // "errorMessage": "my_errorMessage", + * // "instanceDetailsSummary": {}, + * // "instanceFilter": {}, + * // "name": "my_name", + * // "patchConfig": {}, + * // "patchDeployment": "my_patchDeployment", + * // "percentComplete": {}, + * // "state": "my_state", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.patchJobs.execute * @memberOf! () * @@ -1258,6 +1592,59 @@ export namespace osconfig_v1 { /** * osconfig.projects.patchJobs.get * @desc Get the patch job. This can be used to track the progress of an ongoing patch job or review the details of completed jobs. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.patchJobs.get({ + * // Required. Name of the patch in the form `projects/x/patchJobs/x` + * name: 'projects/my-project/patchJobs/my-patchJob', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "dryRun": false, + * // "duration": "my_duration", + * // "errorMessage": "my_errorMessage", + * // "instanceDetailsSummary": {}, + * // "instanceFilter": {}, + * // "name": "my_name", + * // "patchConfig": {}, + * // "patchDeployment": "my_patchDeployment", + * // "percentComplete": {}, + * // "state": "my_state", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.patchJobs.get * @memberOf! () * @@ -1327,6 +1714,56 @@ export namespace osconfig_v1 { /** * osconfig.projects.patchJobs.list * @desc Get a list of patch jobs. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.patchJobs.list({ + * // If provided, this field specifies the criteria that must be met by patch + * // jobs to be included in the response. + * // Currently, filtering is only available on the patch_deployment field. + * filter: 'placeholder-value', + * // The maximum number of instance status to return. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. In the form of `projects/x` + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "patchJobs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.patchJobs.list * @memberOf! () * @@ -1484,6 +1921,56 @@ export namespace osconfig_v1 { /** * osconfig.projects.patchJobs.instanceDetails.list * @desc Get a list of instance details for a given patch job. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.patchJobs.instanceDetails.list({ + * // A filter expression that filters results listed in the response. This + * // field supports filtering results by instance zone, name, state, or + * // `failure_reason`. + * filter: 'placeholder-value', + * // The maximum number of instance details records to return. Default is 100. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The parent for the instances are in the form of `projects/x/patchJobs/x`. + * parent: 'projects/my-project/patchJobs/my-patchJob', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "patchJobInstanceDetails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.patchJobs.instanceDetails.list * @memberOf! () * diff --git a/src/apis/osconfig/v1beta.ts b/src/apis/osconfig/v1beta.ts index a020e07b01f..aa3706c2119 100644 --- a/src/apis/osconfig/v1beta.ts +++ b/src/apis/osconfig/v1beta.ts @@ -1261,6 +1261,80 @@ export namespace osconfig_v1beta { /** * osconfig.projects.guestPolicies.create * @desc Create an OS Config guest policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.guestPolicies.create({ + * // Required. The logical name of the guest policy in the project + * // with the following restrictions: + * // + * // * Must contain only lowercase letters, numbers, and hyphens. + * // * Must start with a letter. + * // * Must be between 1-63 characters. + * // * Must end with a number or a letter. + * // * Must be unique within the project. + * guestPolicyId: 'placeholder-value', + * // Required. The resource name of the parent using one of the following forms: + * // `projects/{project_number}`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "assignment": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "name": "my_name", + * // "packageRepositories": [], + * // "packages": [], + * // "recipes": [], + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assignment": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "name": "my_name", + * // "packageRepositories": [], + * // "packages": [], + * // "recipes": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.guestPolicies.create * @memberOf! () * @@ -1337,6 +1411,45 @@ export namespace osconfig_v1beta { /** * osconfig.projects.guestPolicies.delete * @desc Delete an OS Config guest policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.guestPolicies.delete({ + * // Required. The resource name of the guest policy using one of the following forms: + * // `projects/{project_number}/guestPolicies/{guest_policy_id}`. + * name: 'projects/my-project/guestPolicies/my-guestPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.guestPolicies.delete * @memberOf! () * @@ -1406,6 +1519,55 @@ export namespace osconfig_v1beta { /** * osconfig.projects.guestPolicies.get * @desc Get an OS Config guest policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.guestPolicies.get({ + * // Required. The resource name of the guest policy using one of the following forms: + * // `projects/{project_number}/guestPolicies/{guest_policy_id}`. + * name: 'projects/my-project/guestPolicies/my-guestPolicie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assignment": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "name": "my_name", + * // "packageRepositories": [], + * // "packages": [], + * // "recipes": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.guestPolicies.get * @memberOf! () * @@ -1477,6 +1639,53 @@ export namespace osconfig_v1beta { /** * osconfig.projects.guestPolicies.list * @desc Get a page of OS Config guest policies. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.guestPolicies.list({ + * // The maximum number of guest policies to return. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call to `ListGuestPolicies` + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The resource name of the parent using one of the following forms: + * // `projects/{project_number}`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "guestPolicies": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.guestPolicies.list * @memberOf! () * @@ -1560,6 +1769,75 @@ export namespace osconfig_v1beta { /** * osconfig.projects.guestPolicies.patch * @desc Update an OS Config guest policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.guestPolicies.patch({ + * // Required. Unique name of the resource in this project using one of the following + * // forms: + * // `projects/{project_number}/guestPolicies/{guest_policy_id}`. + * name: 'projects/my-project/guestPolicies/my-guestPolicie', + * // Field mask that controls which fields of the guest policy should be + * // updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "assignment": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "name": "my_name", + * // "packageRepositories": [], + * // "packages": [], + * // "recipes": [], + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assignment": {}, + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "etag": "my_etag", + * // "name": "my_name", + * // "packageRepositories": [], + * // "packages": [], + * // "recipes": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.guestPolicies.patch * @memberOf! () * @@ -1727,6 +2005,80 @@ export namespace osconfig_v1beta { /** * osconfig.projects.patchDeployments.create * @desc Create an OS Config patch deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.patchDeployments.create({ + * // Required. The project to apply this patch deployment to in the form `projects/x`. + * parent: 'projects/my-project', + * // Required. A name for the patch deployment in the project. When creating a name + * // the following rules apply: + * // * Must contain only lowercase letters, numbers, and hyphens. + * // * Must start with a letter. + * // * Must be between 1-63 characters. + * // * Must end with a number or a letter. + * // * Must be unique within the project. + * patchDeploymentId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "duration": "my_duration", + * // "instanceFilter": {}, + * // "lastExecuteTime": "my_lastExecuteTime", + * // "name": "my_name", + * // "oneTimeSchedule": {}, + * // "patchConfig": {}, + * // "recurringSchedule": {}, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "duration": "my_duration", + * // "instanceFilter": {}, + * // "lastExecuteTime": "my_lastExecuteTime", + * // "name": "my_name", + * // "oneTimeSchedule": {}, + * // "patchConfig": {}, + * // "recurringSchedule": {}, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.patchDeployments.create * @memberOf! () * @@ -1803,6 +2155,45 @@ export namespace osconfig_v1beta { /** * osconfig.projects.patchDeployments.delete * @desc Delete an OS Config patch deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.patchDeployments.delete({ + * // Required. The resource name of the patch deployment in the form + * // `projects/x/patchDeployments/x`. + * name: 'projects/my-project/patchDeployments/my-patchDeployment', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.patchDeployments.delete * @memberOf! () * @@ -1872,6 +2263,56 @@ export namespace osconfig_v1beta { /** * osconfig.projects.patchDeployments.get * @desc Get an OS Config patch deployment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.patchDeployments.get({ + * // Required. The resource name of the patch deployment in the form + * // `projects/x/patchDeployments/x`. + * name: 'projects/my-project/patchDeployments/my-patchDeployment', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "duration": "my_duration", + * // "instanceFilter": {}, + * // "lastExecuteTime": "my_lastExecuteTime", + * // "name": "my_name", + * // "oneTimeSchedule": {}, + * // "patchConfig": {}, + * // "recurringSchedule": {}, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.patchDeployments.get * @memberOf! () * @@ -1943,6 +2384,52 @@ export namespace osconfig_v1beta { /** * osconfig.projects.patchDeployments.list * @desc Get a page of OS Config patch deployments. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.patchDeployments.list({ + * // Optional. The maximum number of patch deployments to return. Default is 100. + * pageSize: 'placeholder-value', + * // Optional. A pagination token returned from a previous call to ListPatchDeployments + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The resource name of the parent in the form `projects/x`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "patchDeployments": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.patchDeployments.list * @memberOf! () * @@ -2105,6 +2592,65 @@ export namespace osconfig_v1beta { /** * osconfig.projects.patchJobs.cancel * @desc Cancel a patch job. The patch job must be active. Canceled patch jobs cannot be restarted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.patchJobs.cancel({ + * // Required. Name of the patch in the form `projects/x/patchJobs/x` + * name: 'projects/my-project/patchJobs/my-patchJob', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "dryRun": false, + * // "duration": "my_duration", + * // "errorMessage": "my_errorMessage", + * // "instanceDetailsSummary": {}, + * // "instanceFilter": {}, + * // "name": "my_name", + * // "patchConfig": {}, + * // "patchDeployment": "my_patchDeployment", + * // "percentComplete": {}, + * // "state": "my_state", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.patchJobs.cancel * @memberOf! () * @@ -2178,6 +2724,72 @@ export namespace osconfig_v1beta { /** * osconfig.projects.patchJobs.execute * @desc Patch VM instances by creating and running a patch job. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.patchJobs.execute({ + * // Required. The project in which to run this patch in the form `projects/x` + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "dryRun": false, + * // "duration": "my_duration", + * // "instanceFilter": {}, + * // "patchConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "dryRun": false, + * // "duration": "my_duration", + * // "errorMessage": "my_errorMessage", + * // "instanceDetailsSummary": {}, + * // "instanceFilter": {}, + * // "name": "my_name", + * // "patchConfig": {}, + * // "patchDeployment": "my_patchDeployment", + * // "percentComplete": {}, + * // "state": "my_state", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.patchJobs.execute * @memberOf! () * @@ -2251,6 +2863,59 @@ export namespace osconfig_v1beta { /** * osconfig.projects.patchJobs.get * @desc Get the patch job. This can be used to track the progress of an ongoing patch job or review the details of completed jobs. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.patchJobs.get({ + * // Required. Name of the patch in the form `projects/x/patchJobs/x` + * name: 'projects/my-project/patchJobs/my-patchJob', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "dryRun": false, + * // "duration": "my_duration", + * // "errorMessage": "my_errorMessage", + * // "instanceDetailsSummary": {}, + * // "instanceFilter": {}, + * // "name": "my_name", + * // "patchConfig": {}, + * // "patchDeployment": "my_patchDeployment", + * // "percentComplete": {}, + * // "state": "my_state", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.patchJobs.get * @memberOf! () * @@ -2320,6 +2985,56 @@ export namespace osconfig_v1beta { /** * osconfig.projects.patchJobs.list * @desc Get a list of patch jobs. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.patchJobs.list({ + * // If provided, this field specifies the criteria that must be met by patch + * // jobs to be included in the response. + * // Currently, filtering is only available on the patch_deployment field. + * filter: 'placeholder-value', + * // The maximum number of instance status to return. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. In the form of `projects/x` + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "patchJobs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.patchJobs.list * @memberOf! () * @@ -2477,6 +3192,56 @@ export namespace osconfig_v1beta { /** * osconfig.projects.patchJobs.instanceDetails.list * @desc Get a list of instance details for a given patch job. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.patchJobs.instanceDetails.list({ + * // A filter expression that filters results listed in the response. This + * // field supports filtering results by instance zone, name, state, or + * // `failure_reason`. + * filter: 'placeholder-value', + * // The maximum number of instance details records to return. Default is 100. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The parent for the instances are in the form of `projects/x/patchJobs/x`. + * parent: 'projects/my-project/patchJobs/my-patchJob', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "patchJobInstanceDetails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.patchJobs.instanceDetails.list * @memberOf! () * @@ -2606,6 +3371,60 @@ export namespace osconfig_v1beta { /** * osconfig.projects.zones.instances.lookupEffectiveGuestPolicy * @desc Lookup the effective guest policy that applies to a VM instance. This lookup merges all policies that are assigned to the instance ancestry. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/osconfig.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 osconfig = google.osconfig('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 osconfig.projects.zones.instances.lookupEffectiveGuestPolicy( + * { + * // Required. The VM instance whose policies are being looked up. + * instance: 'projects/my-project/zones/my-zone/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "osArchitecture": "my_osArchitecture", + * // "osShortName": "my_osShortName", + * // "osVersion": "my_osVersion" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "packageRepositories": [], + * // "packages": [], + * // "softwareRecipes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias osconfig.projects.zones.instances.lookupEffectiveGuestPolicy * @memberOf! () * diff --git a/src/apis/oslogin/v1.ts b/src/apis/oslogin/v1.ts index c2c4262109c..280616ed346 100644 --- a/src/apis/oslogin/v1.ts +++ b/src/apis/oslogin/v1.ts @@ -227,6 +227,55 @@ export namespace oslogin_v1 { /** * oslogin.users.getLoginProfile * @desc Retrieves the profile information used for logging in to a virtual machine on Google Compute Engine. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oslogin.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 oslogin = google.oslogin('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 oslogin.users.getLoginProfile({ + * // Required. The unique ID for the user in format `users/{user}`. + * name: 'users/my-user', + * // The project ID of the Google Cloud Platform project. + * projectId: 'placeholder-value', + * // A system ID for filtering the results of the request. + * systemId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "posixAccounts": [], + * // "sshPublicKeys": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oslogin.users.getLoginProfile * @memberOf! () * @@ -303,6 +352,62 @@ export namespace oslogin_v1 { /** * oslogin.users.importSshPublicKey * @desc Adds an SSH public key and returns the profile information. Default POSIX account information is set when no username and UID exist as part of the login profile. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oslogin.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 oslogin = google.oslogin('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 oslogin.users.importSshPublicKey({ + * // Required. The unique ID for the user in format `users/{user}`. + * parent: 'users/my-user', + * // The project ID of the Google Cloud Platform project. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "expirationTimeUsec": "my_expirationTimeUsec", + * // "fingerprint": "my_fingerprint", + * // "key": "my_key", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "loginProfile": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oslogin.users.importSshPublicKey * @memberOf! () * @@ -435,6 +540,49 @@ export namespace oslogin_v1 { /** * oslogin.users.projects.delete * @desc Deletes a POSIX account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oslogin.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 oslogin = google.oslogin('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 oslogin.users.projects.delete({ + * // Required. A reference to the POSIX account to update. POSIX accounts are identified + * // by the project ID they are associated with. A reference to the POSIX + * // account is in format `users/{user}/projects/{project}`. + * name: 'users/my-user/projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oslogin.users.projects.delete * @memberOf! () * @@ -524,6 +672,49 @@ export namespace oslogin_v1 { /** * oslogin.users.sshPublicKeys.delete * @desc Deletes an SSH public key. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oslogin.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 oslogin = google.oslogin('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 oslogin.users.sshPublicKeys.delete({ + * // Required. The fingerprint of the public key to update. Public keys are identified by + * // their SHA-256 fingerprint. The fingerprint of the public key is in format + * // `users/{user}/sshPublicKeys/{fingerprint}`. + * name: 'users/my-user/sshPublicKeys/my-sshPublicKey', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oslogin.users.sshPublicKeys.delete * @memberOf! () * @@ -593,6 +784,54 @@ export namespace oslogin_v1 { /** * oslogin.users.sshPublicKeys.get * @desc Retrieves an SSH public key. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oslogin.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 oslogin = google.oslogin('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 oslogin.users.sshPublicKeys.get({ + * // Required. The fingerprint of the public key to retrieve. Public keys are identified + * // by their SHA-256 fingerprint. The fingerprint of the public key is in + * // format `users/{user}/sshPublicKeys/{fingerprint}`. + * name: 'users/my-user/sshPublicKeys/my-sshPublicKey', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "expirationTimeUsec": "my_expirationTimeUsec", + * // "fingerprint": "my_fingerprint", + * // "key": "my_key", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oslogin.users.sshPublicKeys.get * @memberOf! () * @@ -664,6 +903,67 @@ export namespace oslogin_v1 { /** * oslogin.users.sshPublicKeys.patch * @desc Updates an SSH public key and returns the profile information. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oslogin.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 oslogin = google.oslogin('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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 oslogin.users.sshPublicKeys.patch({ + * // Required. The fingerprint of the public key to update. Public keys are identified by + * // their SHA-256 fingerprint. The fingerprint of the public key is in format + * // `users/{user}/sshPublicKeys/{fingerprint}`. + * name: 'users/my-user/sshPublicKeys/my-sshPublicKey', + * // Mask to control which fields get updated. Updates all if not present. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "expirationTimeUsec": "my_expirationTimeUsec", + * // "fingerprint": "my_fingerprint", + * // "key": "my_key", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "expirationTimeUsec": "my_expirationTimeUsec", + * // "fingerprint": "my_fingerprint", + * // "key": "my_key", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oslogin.users.sshPublicKeys.patch * @memberOf! () * diff --git a/src/apis/oslogin/v1alpha.ts b/src/apis/oslogin/v1alpha.ts index 2694ff37e44..2ca7c0f7dea 100644 --- a/src/apis/oslogin/v1alpha.ts +++ b/src/apis/oslogin/v1alpha.ts @@ -227,6 +227,59 @@ export namespace oslogin_v1alpha { /** * oslogin.users.getLoginProfile * @desc Retrieves the profile information used for logging in to a virtual machine on Google Compute Engine. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oslogin.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 oslogin = google.oslogin('v1alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 oslogin.users.getLoginProfile({ + * // The unique ID for the user in format `users/{user}`. + * name: 'users/my-user', + * // The type of operating system associated with the account. + * operatingSystemType: 'placeholder-value', + * // The project ID of the Google Cloud Platform project. + * projectId: 'placeholder-value', + * // A system ID for filtering the results of the request. + * systemId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "posixAccounts": [], + * // "sshPublicKeys": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oslogin.users.getLoginProfile * @memberOf! () * @@ -304,6 +357,62 @@ export namespace oslogin_v1alpha { /** * oslogin.users.importSshPublicKey * @desc Adds an SSH public key and returns the profile information. Default POSIX account information is set when no username and UID exist as part of the login profile. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oslogin.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 oslogin = google.oslogin('v1alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 oslogin.users.importSshPublicKey({ + * // The unique ID for the user in format `users/{user}`. + * parent: 'users/my-user', + * // The project ID of the Google Cloud Platform project. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "expirationTimeUsec": "my_expirationTimeUsec", + * // "fingerprint": "my_fingerprint", + * // "key": "my_key", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "loginProfile": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oslogin.users.importSshPublicKey * @memberOf! () * @@ -440,6 +549,51 @@ export namespace oslogin_v1alpha { /** * oslogin.users.projects.delete * @desc Deletes a POSIX account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oslogin.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 oslogin = google.oslogin('v1alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 oslogin.users.projects.delete({ + * // A reference to the POSIX account to update. POSIX accounts are identified + * // by the project ID they are associated with. A reference to the POSIX + * // account is in format `users/{user}/projects/{project}`. + * name: 'users/my-user/projects/my-project', + * // The type of operating system associated with the account. + * operatingSystemType: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oslogin.users.projects.delete * @memberOf! () * @@ -534,6 +688,49 @@ export namespace oslogin_v1alpha { /** * oslogin.users.sshPublicKeys.delete * @desc Deletes an SSH public key. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oslogin.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 oslogin = google.oslogin('v1alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 oslogin.users.sshPublicKeys.delete({ + * // The fingerprint of the public key to update. Public keys are identified by + * // their SHA-256 fingerprint. The fingerprint of the public key is in format + * // `users/{user}/sshPublicKeys/{fingerprint}`. + * name: 'users/my-user/sshPublicKeys/my-sshPublicKey', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oslogin.users.sshPublicKeys.delete * @memberOf! () * @@ -603,6 +800,54 @@ export namespace oslogin_v1alpha { /** * oslogin.users.sshPublicKeys.get * @desc Retrieves an SSH public key. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oslogin.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 oslogin = google.oslogin('v1alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 oslogin.users.sshPublicKeys.get({ + * // The fingerprint of the public key to retrieve. Public keys are identified + * // by their SHA-256 fingerprint. The fingerprint of the public key is in + * // format `users/{user}/sshPublicKeys/{fingerprint}`. + * name: 'users/my-user/sshPublicKeys/my-sshPublicKey', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "expirationTimeUsec": "my_expirationTimeUsec", + * // "fingerprint": "my_fingerprint", + * // "key": "my_key", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oslogin.users.sshPublicKeys.get * @memberOf! () * @@ -674,6 +919,67 @@ export namespace oslogin_v1alpha { /** * oslogin.users.sshPublicKeys.patch * @desc Updates an SSH public key and returns the profile information. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oslogin.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 oslogin = google.oslogin('v1alpha'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 oslogin.users.sshPublicKeys.patch({ + * // The fingerprint of the public key to update. Public keys are identified by + * // their SHA-256 fingerprint. The fingerprint of the public key is in format + * // `users/{user}/sshPublicKeys/{fingerprint}`. + * name: 'users/my-user/sshPublicKeys/my-sshPublicKey', + * // Mask to control which fields get updated. Updates all if not present. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "expirationTimeUsec": "my_expirationTimeUsec", + * // "fingerprint": "my_fingerprint", + * // "key": "my_key", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "expirationTimeUsec": "my_expirationTimeUsec", + * // "fingerprint": "my_fingerprint", + * // "key": "my_key", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oslogin.users.sshPublicKeys.patch * @memberOf! () * diff --git a/src/apis/oslogin/v1beta.ts b/src/apis/oslogin/v1beta.ts index 490616c7c31..416a4948cbe 100644 --- a/src/apis/oslogin/v1beta.ts +++ b/src/apis/oslogin/v1beta.ts @@ -227,6 +227,57 @@ export namespace oslogin_v1beta { /** * oslogin.users.getLoginProfile * @desc Retrieves the profile information used for logging in to a virtual machine on Google Compute Engine. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oslogin.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 oslogin = google.oslogin('v1beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/compute', + * 'https://www.googleapis.com/auth/compute.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 oslogin.users.getLoginProfile({ + * // Required. The unique ID for the user in format `users/{user}`. + * name: 'users/my-user', + * // The project ID of the Google Cloud Platform project. + * projectId: 'placeholder-value', + * // A system ID for filtering the results of the request. + * systemId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "posixAccounts": [], + * // "sshPublicKeys": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oslogin.users.getLoginProfile * @memberOf! () * @@ -303,6 +354,62 @@ export namespace oslogin_v1beta { /** * oslogin.users.importSshPublicKey * @desc Adds an SSH public key and returns the profile information. Default POSIX account information is set when no username and UID exist as part of the login profile. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oslogin.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 oslogin = google.oslogin('v1beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 oslogin.users.importSshPublicKey({ + * // The unique ID for the user in format `users/{user}`. + * parent: 'users/my-user', + * // The project ID of the Google Cloud Platform project. + * projectId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "expirationTimeUsec": "my_expirationTimeUsec", + * // "fingerprint": "my_fingerprint", + * // "key": "my_key", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "loginProfile": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oslogin.users.importSshPublicKey * @memberOf! () * @@ -435,6 +542,49 @@ export namespace oslogin_v1beta { /** * oslogin.users.projects.delete * @desc Deletes a POSIX account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oslogin.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 oslogin = google.oslogin('v1beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 oslogin.users.projects.delete({ + * // Required. A reference to the POSIX account to update. POSIX accounts are identified + * // by the project ID they are associated with. A reference to the POSIX + * // account is in format `users/{user}/projects/{project}`. + * name: 'users/my-user/projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oslogin.users.projects.delete * @memberOf! () * @@ -524,6 +674,49 @@ export namespace oslogin_v1beta { /** * oslogin.users.sshPublicKeys.delete * @desc Deletes an SSH public key. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oslogin.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 oslogin = google.oslogin('v1beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 oslogin.users.sshPublicKeys.delete({ + * // Required. The fingerprint of the public key to update. Public keys are identified by + * // their SHA-256 fingerprint. The fingerprint of the public key is in format + * // `users/{user}/sshPublicKeys/{fingerprint}`. + * name: 'users/my-user/sshPublicKeys/my-sshPublicKey', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oslogin.users.sshPublicKeys.delete * @memberOf! () * @@ -593,6 +786,54 @@ export namespace oslogin_v1beta { /** * oslogin.users.sshPublicKeys.get * @desc Retrieves an SSH public key. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oslogin.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 oslogin = google.oslogin('v1beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 oslogin.users.sshPublicKeys.get({ + * // Required. The fingerprint of the public key to retrieve. Public keys are identified + * // by their SHA-256 fingerprint. The fingerprint of the public key is in + * // format `users/{user}/sshPublicKeys/{fingerprint}`. + * name: 'users/my-user/sshPublicKeys/my-sshPublicKey', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "expirationTimeUsec": "my_expirationTimeUsec", + * // "fingerprint": "my_fingerprint", + * // "key": "my_key", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oslogin.users.sshPublicKeys.get * @memberOf! () * @@ -664,6 +905,67 @@ export namespace oslogin_v1beta { /** * oslogin.users.sshPublicKeys.patch * @desc Updates an SSH public key and returns the profile information. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/oslogin.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 oslogin = google.oslogin('v1beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/compute', + * ], + * }); + * + * // 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 oslogin.users.sshPublicKeys.patch({ + * // Required. The fingerprint of the public key to update. Public keys are identified by + * // their SHA-256 fingerprint. The fingerprint of the public key is in format + * // `users/{user}/sshPublicKeys/{fingerprint}`. + * name: 'users/my-user/sshPublicKeys/my-sshPublicKey', + * // Mask to control which fields get updated. Updates all if not present. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "expirationTimeUsec": "my_expirationTimeUsec", + * // "fingerprint": "my_fingerprint", + * // "key": "my_key", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "expirationTimeUsec": "my_expirationTimeUsec", + * // "fingerprint": "my_fingerprint", + * // "key": "my_key", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias oslogin.users.sshPublicKeys.patch * @memberOf! () * diff --git a/src/apis/pagespeedonline/v1.ts b/src/apis/pagespeedonline/v1.ts index 83423e0bcdd..58fa4c66a8b 100644 --- a/src/apis/pagespeedonline/v1.ts +++ b/src/apis/pagespeedonline/v1.ts @@ -196,6 +196,66 @@ export namespace pagespeedonline_v1 { /** * pagespeedonline.pagespeedapi.runpagespeed * @desc Runs PageSpeed analysis on the page at the specified URL, and returns a PageSpeed score, a list of suggestions to make that page faster, and other information. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pagespeedonline.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 pagespeedonline = google.pagespeedonline('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: [], + * }); + * + * // 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 pagespeedonline.pagespeedapi.runpagespeed({ + * // Indicates if third party resources should be filtered out before PageSpeed analysis. + * filter_third_party_resources: 'placeholder-value', + * // The locale used to localize formatted results + * locale: '[a-zA-Z]+(_[a-zA-Z]+)?', + * // A PageSpeed rule to run; if none are given, all rules are run + * rule: '[a-zA-Z]+', + * // Indicates if binary data containing a screenshot should be included + * screenshot: 'placeholder-value', + * // The analysis strategy to use + * strategy: 'placeholder-value', + * // The URL to fetch and analyze + * url: '(?i)http(s)?://.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "captchaResult": "my_captchaResult", + * // "formattedResults": {}, + * // "id": "my_id", + * // "invalidRules": [], + * // "kind": "my_kind", + * // "pageStats": {}, + * // "responseCode": 0, + * // "score": 0, + * // "screenshot": {}, + * // "title": "my_title", + * // "version": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pagespeedonline.pagespeedapi.runpagespeed * @memberOf! () * diff --git a/src/apis/pagespeedonline/v2.ts b/src/apis/pagespeedonline/v2.ts index 107868c6b9d..966a468d57d 100644 --- a/src/apis/pagespeedonline/v2.ts +++ b/src/apis/pagespeedonline/v2.ts @@ -241,6 +241,66 @@ export namespace pagespeedonline_v2 { /** * pagespeedonline.pagespeedapi.runpagespeed * @desc Runs PageSpeed analysis on the page at the specified URL, and returns PageSpeed scores, a list of suggestions to make that page faster, and other information. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pagespeedonline.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 pagespeedonline = google.pagespeedonline('v2'); + * + * 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: [], + * }); + * + * // 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 pagespeedonline.pagespeedapi.runpagespeed({ + * // Indicates if third party resources should be filtered out before PageSpeed analysis. + * filter_third_party_resources: 'placeholder-value', + * // The locale used to localize formatted results + * locale: '[a-zA-Z]+(_[a-zA-Z]+)?', + * // A PageSpeed rule to run; if none are given, all rules are run + * rule: '[a-zA-Z]+', + * // Indicates if binary data containing a screenshot should be included + * screenshot: 'placeholder-value', + * // The analysis strategy to use + * strategy: 'placeholder-value', + * // The URL to fetch and analyze + * url: '(?i)http(s)?://.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "captchaResult": "my_captchaResult", + * // "formattedResults": {}, + * // "id": "my_id", + * // "invalidRules": [], + * // "kind": "my_kind", + * // "pageStats": {}, + * // "responseCode": 0, + * // "ruleGroups": {}, + * // "screenshot": {}, + * // "title": "my_title", + * // "version": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pagespeedonline.pagespeedapi.runpagespeed * @memberOf! () * diff --git a/src/apis/pagespeedonline/v4.ts b/src/apis/pagespeedonline/v4.ts index 540e8a0ca55..8c843c60827 100644 --- a/src/apis/pagespeedonline/v4.ts +++ b/src/apis/pagespeedonline/v4.ts @@ -270,6 +270,74 @@ export namespace pagespeedonline_v4 { /** * pagespeedonline.pagespeedapi.runpagespeed * @desc Runs PageSpeed analysis on the page at the specified URL, and returns PageSpeed scores, a list of suggestions to make that page faster, and other information. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pagespeedonline.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 pagespeedonline = google.pagespeedonline('v4'); + * + * 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: [], + * }); + * + * // 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 pagespeedonline.pagespeedapi.runpagespeed({ + * // Indicates if third party resources should be filtered out before PageSpeed analysis. + * filter_third_party_resources: 'placeholder-value', + * // The locale used to localize formatted results + * locale: '[a-zA-Z]+(_[a-zA-Z]+)?', + * // A PageSpeed rule to run; if none are given, all rules are run + * rule: '[a-zA-Z]+', + * // Indicates if binary data containing a screenshot should be included + * screenshot: 'placeholder-value', + * // Indicates if binary data containing snapshot images should be included + * snapshots: 'placeholder-value', + * // The analysis strategy (desktop or mobile) to use, and desktop is the default + * strategy: 'placeholder-value', + * // The URL to fetch and analyze + * url: '(?i)(site:|origin:)?http(s)?://.*', + * // Campaign name for analytics. + * utm_campaign: 'placeholder-value', + * // Campaign source for analytics. + * utm_source: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "captchaResult": "my_captchaResult", + * // "formattedResults": {}, + * // "id": "my_id", + * // "invalidRules": [], + * // "kind": "my_kind", + * // "loadingExperience": {}, + * // "pageStats": {}, + * // "responseCode": 0, + * // "ruleGroups": {}, + * // "screenshot": {}, + * // "snapshots": [], + * // "title": "my_title", + * // "version": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pagespeedonline.pagespeedapi.runpagespeed * @memberOf! () * diff --git a/src/apis/pagespeedonline/v5.ts b/src/apis/pagespeedonline/v5.ts index c721dc09dda..7352c583304 100644 --- a/src/apis/pagespeedonline/v5.ts +++ b/src/apis/pagespeedonline/v5.ts @@ -597,6 +597,67 @@ export namespace pagespeedonline_v5 { /** * pagespeedonline.pagespeedapi.runpagespeed * @desc Runs PageSpeed analysis on the page at the specified URL, and returns PageSpeed scores, a list of suggestions to make that page faster, and other information. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pagespeedonline.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 pagespeedonline = google.pagespeedonline('v5'); + * + * 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: ['openid'], + * }); + * + * // 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 pagespeedonline.pagespeedapi.runpagespeed({ + * // The captcha token passed when filling out a captcha. + * captchaToken: 'placeholder-value', + * // A Lighthouse category to run; if none are given, only Performance category + * // will be run + * category: 'placeholder-value', + * // The locale used to localize formatted results + * locale: 'placeholder-value', + * // The analysis strategy (desktop or mobile) to use, and desktop is the + * // default + * strategy: 'placeholder-value', + * // The URL to fetch and analyze + * url: 'placeholder-value', + * // Campaign name for analytics. + * utm_campaign: 'placeholder-value', + * // Campaign source for analytics. + * utm_source: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "analysisUTCTimestamp": "my_analysisUTCTimestamp", + * // "captchaResult": "my_captchaResult", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lighthouseResult": {}, + * // "loadingExperience": {}, + * // "originLoadingExperience": {}, + * // "version": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pagespeedonline.pagespeedapi.runpagespeed * @memberOf! () * diff --git a/src/apis/people/v1.ts b/src/apis/people/v1.ts index dc5f1a78221..9c7b4a76ac6 100644 --- a/src/apis/people/v1.ts +++ b/src/apis/people/v1.ts @@ -1247,6 +1247,52 @@ export namespace people_v1 { /** * people.contactGroups.batchGet * @desc Get a list of contact groups owned by the authenticated user by specifying a list of contact group resource names. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/people.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 people = google.people('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/contacts', + * 'https://www.googleapis.com/auth/contacts.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 people.contactGroups.batchGet({ + * // Optional. Specifies the maximum number of members to return for each group. Defaults + * // to 0 if not set, which will return zero members. + * maxMembers: 'placeholder-value', + * // Required. The resource names of the contact groups to get. + * resourceNames: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias people.contactGroups.batchGet * @memberOf! () * @@ -1331,6 +1377,58 @@ export namespace people_v1 { /** * people.contactGroups.create * @desc Create a new contact group owned by the authenticated user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/people.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 people = google.people('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/contacts'], + * }); + * + * // 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 people.contactGroups.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contactGroup": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "formattedName": "my_formattedName", + * // "groupType": "my_groupType", + * // "memberCount": 0, + * // "memberResourceNames": [], + * // "metadata": {}, + * // "name": "my_name", + * // "resourceName": "my_resourceName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias people.contactGroups.create * @memberOf! () * @@ -1402,6 +1500,46 @@ export namespace people_v1 { /** * people.contactGroups.delete * @desc Delete an existing contact group owned by the authenticated user by specifying a contact group resource name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/people.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 people = google.people('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/contacts'], + * }); + * + * // 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 people.contactGroups.delete({ + * // Optional. Set to true to also delete the contacts in the specified group. + * deleteContacts: 'placeholder-value', + * // Required. The resource name of the contact group to delete. + * resourceName: 'contactGroups/my-contactGroup', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias people.contactGroups.delete * @memberOf! () * @@ -1475,6 +1613,59 @@ export namespace people_v1 { /** * people.contactGroups.get * @desc Get a specific contact group owned by the authenticated user by specifying a contact group resource name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/people.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 people = google.people('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/contacts', + * 'https://www.googleapis.com/auth/contacts.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 people.contactGroups.get({ + * // Optional. Specifies the maximum number of members to return. Defaults to 0 if not + * // set, which will return zero members. + * maxMembers: 'placeholder-value', + * // Required. The resource name of the contact group to get. + * resourceName: 'contactGroups/my-contactGroup', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "formattedName": "my_formattedName", + * // "groupType": "my_groupType", + * // "memberCount": 0, + * // "memberResourceNames": [], + * // "metadata": {}, + * // "name": "my_name", + * // "resourceName": "my_resourceName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias people.contactGroups.get * @memberOf! () * @@ -1550,6 +1741,60 @@ export namespace people_v1 { /** * people.contactGroups.list * @desc List all contact groups owned by the authenticated user. Members of the contact groups are not populated. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/people.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 people = google.people('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/contacts', + * 'https://www.googleapis.com/auth/contacts.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 people.contactGroups.list({ + * // Optional. The maximum number of resources to return. Valid values are between 1 and + * // 1000, inclusive. Defaults to 30 if not set or set to 0. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous call to + * // [ListContactGroups](/people/api/rest/v1/contactgroups/list). + * // Requests the next page of resources. + * pageToken: 'placeholder-value', + * // Optional. A sync token, returned by a previous call to `contactgroups.list`. + * // Only resources changed since the sync token was created will be returned. + * syncToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contactGroups": [], + * // "nextPageToken": "my_nextPageToken", + * // "nextSyncToken": "my_nextSyncToken", + * // "totalItems": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias people.contactGroups.list * @memberOf! () * @@ -1630,6 +1875,62 @@ export namespace people_v1 { /** * people.contactGroups.update * @desc Update the name of an existing contact group owned by the authenticated user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/people.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 people = google.people('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/contacts'], + * }); + * + * // 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 people.contactGroups.update({ + * // The resource name for the contact group, assigned by the server. An ASCII + * // string, in the form of `contactGroups/{contact_group_id}`. + * resourceName: 'contactGroups/my-contactGroup', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contactGroup": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "formattedName": "my_formattedName", + * // "groupType": "my_groupType", + * // "memberCount": 0, + * // "memberResourceNames": [], + * // "metadata": {}, + * // "name": "my_name", + * // "resourceName": "my_resourceName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias people.contactGroups.update * @memberOf! () * @@ -1810,6 +2111,56 @@ export namespace people_v1 { /** * people.contactGroups.members.modify * @desc Modify the members of a contact group owned by the authenticated user. The only system contact groups that can have members added are `contactGroups/myContacts` and `contactGroups/starred`. Other system contact groups are deprecated and can only have contacts removed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/people.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 people = google.people('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/contacts'], + * }); + * + * // 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 people.contactGroups.members.modify({ + * // Required. The resource name of the contact group to modify. + * resourceName: 'contactGroups/my-contactGroup', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourceNamesToAdd": [], + * // "resourceNamesToRemove": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "canNotRemoveLastContactGroupResourceNames": [], + * // "notFoundResourceNames": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias people.contactGroups.members.modify * @memberOf! () * @@ -1921,6 +2272,113 @@ export namespace people_v1 { /** * people.people.createContact * @desc Create a new contact and return the person resource for that contact. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/people.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 people = google.people('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/contacts'], + * }); + * + * // 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 people.people.createContact({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "addresses": [], + * // "ageRange": "my_ageRange", + * // "ageRanges": [], + * // "biographies": [], + * // "birthdays": [], + * // "braggingRights": [], + * // "coverPhotos": [], + * // "emailAddresses": [], + * // "etag": "my_etag", + * // "events": [], + * // "genders": [], + * // "imClients": [], + * // "interests": [], + * // "locales": [], + * // "memberships": [], + * // "metadata": {}, + * // "names": [], + * // "nicknames": [], + * // "occupations": [], + * // "organizations": [], + * // "phoneNumbers": [], + * // "photos": [], + * // "relations": [], + * // "relationshipInterests": [], + * // "relationshipStatuses": [], + * // "residences": [], + * // "resourceName": "my_resourceName", + * // "sipAddresses": [], + * // "skills": [], + * // "taglines": [], + * // "urls": [], + * // "userDefined": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "addresses": [], + * // "ageRange": "my_ageRange", + * // "ageRanges": [], + * // "biographies": [], + * // "birthdays": [], + * // "braggingRights": [], + * // "coverPhotos": [], + * // "emailAddresses": [], + * // "etag": "my_etag", + * // "events": [], + * // "genders": [], + * // "imClients": [], + * // "interests": [], + * // "locales": [], + * // "memberships": [], + * // "metadata": {}, + * // "names": [], + * // "nicknames": [], + * // "occupations": [], + * // "organizations": [], + * // "phoneNumbers": [], + * // "photos": [], + * // "relations": [], + * // "relationshipInterests": [], + * // "relationshipStatuses": [], + * // "residences": [], + * // "resourceName": "my_resourceName", + * // "sipAddresses": [], + * // "skills": [], + * // "taglines": [], + * // "urls": [], + * // "userDefined": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias people.people.createContact * @memberOf! () * @@ -1993,6 +2451,44 @@ export namespace people_v1 { /** * people.people.deleteContact * @desc Delete a contact person. Any non-contact data will not be deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/people.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 people = google.people('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/contacts'], + * }); + * + * // 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 people.people.deleteContact({ + * // Required. The resource name of the contact to delete. + * resourceName: 'people/[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias people.people.deleteContact * @memberOf! () * @@ -2065,6 +2561,76 @@ export namespace people_v1 { /** * people.people.deleteContactPhoto * @desc Delete a contact's photo. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/people.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 people = google.people('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/contacts'], + * }); + * + * // 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 people.people.deleteContactPhoto({ + * // Optional. A field mask to restrict which fields on the person are returned. Multiple + * // fields can be specified by separating them with commas. Defaults to empty + * // if not set, which will skip the post mutate get. Valid values are: + * // + * // * addresses + * // * ageRanges + * // * biographies + * // * birthdays + * // * coverPhotos + * // * emailAddresses + * // * events + * // * genders + * // * imClients + * // * interests + * // * locales + * // * memberships + * // * metadata + * // * names + * // * nicknames + * // * occupations + * // * organizations + * // * phoneNumbers + * // * photos + * // * relations + * // * residences + * // * sipAddresses + * // * skills + * // * urls + * // * userDefined + * personFields: 'placeholder-value', + * // Required. The resource name of the contact whose photo will be deleted. + * resourceName: 'people/[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "person": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias people.people.deleteContactPhoto * @memberOf! () * @@ -2147,6 +2713,129 @@ export namespace people_v1 { /** * people.people.get * @desc Provides information about a person by specifying a resource name. Use `people/me` to indicate the authenticated user. The request throws a 400 error if 'personFields' is not specified. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/people.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 people = google.people('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/contacts', + * 'https://www.googleapis.com/auth/contacts.readonly', + * 'https://www.googleapis.com/auth/directory.readonly', + * 'https://www.googleapis.com/auth/user.addresses.read', + * 'https://www.googleapis.com/auth/user.birthday.read', + * 'https://www.googleapis.com/auth/user.emails.read', + * 'https://www.googleapis.com/auth/user.gender.read', + * 'https://www.googleapis.com/auth/user.organization.read', + * 'https://www.googleapis.com/auth/user.phonenumbers.read', + * 'https://www.googleapis.com/auth/userinfo.email', + * 'https://www.googleapis.com/auth/userinfo.profile', + * ], + * }); + * + * // 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 people.people.get({ + * // Required. A field mask to restrict which fields on the person are returned. Multiple + * // fields can be specified by separating them with commas. Valid values are: + * // + * // * addresses + * // * ageRanges + * // * biographies + * // * birthdays + * // * coverPhotos + * // * emailAddresses + * // * events + * // * genders + * // * imClients + * // * interests + * // * locales + * // * memberships + * // * metadata + * // * names + * // * nicknames + * // * occupations + * // * organizations + * // * phoneNumbers + * // * photos + * // * relations + * // * residences + * // * sipAddresses + * // * skills + * // * urls + * // * userDefined + * personFields: 'placeholder-value', + * // Required. Comma-separated list of person fields to be included in the response. Each + * // path should start with `person.`: for example, `person.names` or + * // `person.photos`. + * 'requestMask.includeField': 'placeholder-value', + * // Required. The resource name of the person to provide information about. + * // + * // - To get information about the authenticated user, specify `people/me`. + * // - To get information about a google account, specify + * // `people/{account_id}`. + * // - To get information about a contact, specify the resource name that + * // identifies the contact as returned by + * // [`people.connections.list`](/people/api/rest/v1/people.connections/list). + * resourceName: 'people/[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "addresses": [], + * // "ageRange": "my_ageRange", + * // "ageRanges": [], + * // "biographies": [], + * // "birthdays": [], + * // "braggingRights": [], + * // "coverPhotos": [], + * // "emailAddresses": [], + * // "etag": "my_etag", + * // "events": [], + * // "genders": [], + * // "imClients": [], + * // "interests": [], + * // "locales": [], + * // "memberships": [], + * // "metadata": {}, + * // "names": [], + * // "nicknames": [], + * // "occupations": [], + * // "organizations": [], + * // "phoneNumbers": [], + * // "photos": [], + * // "relations": [], + * // "relationshipInterests": [], + * // "relationshipStatuses": [], + * // "residences": [], + * // "resourceName": "my_resourceName", + * // "sipAddresses": [], + * // "skills": [], + * // "taglines": [], + * // "urls": [], + * // "userDefined": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias people.people.get * @memberOf! () * @@ -2220,6 +2909,100 @@ export namespace people_v1 { /** * people.people.getBatchGet * @desc Provides information about a list of specific people by specifying a list of requested resource names. Use `people/me` to indicate the authenticated user. The request throws a 400 error if 'personFields' is not specified. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/people.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 people = google.people('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/contacts', + * 'https://www.googleapis.com/auth/contacts.readonly', + * 'https://www.googleapis.com/auth/directory.readonly', + * 'https://www.googleapis.com/auth/user.addresses.read', + * 'https://www.googleapis.com/auth/user.birthday.read', + * 'https://www.googleapis.com/auth/user.emails.read', + * 'https://www.googleapis.com/auth/user.gender.read', + * 'https://www.googleapis.com/auth/user.organization.read', + * 'https://www.googleapis.com/auth/user.phonenumbers.read', + * 'https://www.googleapis.com/auth/userinfo.email', + * 'https://www.googleapis.com/auth/userinfo.profile', + * ], + * }); + * + * // 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 people.people.getBatchGet({ + * // Required. A field mask to restrict which fields on each person are returned. Multiple + * // fields can be specified by separating them with commas. Valid values are: + * // + * // * addresses + * // * ageRanges + * // * biographies + * // * birthdays + * // * coverPhotos + * // * emailAddresses + * // * events + * // * genders + * // * imClients + * // * interests + * // * locales + * // * memberships + * // * metadata + * // * names + * // * nicknames + * // * occupations + * // * organizations + * // * phoneNumbers + * // * photos + * // * relations + * // * residences + * // * sipAddresses + * // * skills + * // * urls + * // * userDefined + * personFields: 'placeholder-value', + * // Required. Comma-separated list of person fields to be included in the response. Each + * // path should start with `person.`: for example, `person.names` or + * // `person.photos`. + * 'requestMask.includeField': 'placeholder-value', + * // Required. The resource names of the people to provide information about. + * // + * // - To get information about the authenticated user, specify `people/me`. + * // - To get information about a google account, specify + * // `people/{account_id}`. + * // - To get information about a contact, specify the resource name that + * // identifies the contact as returned by + * // [`people.connections.list`](/people/api/rest/v1/people.connections/list). + * // + * // You can include up to 50 resource names in one request. + * resourceNames: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias people.people.getBatchGet * @memberOf! () * @@ -2296,6 +3079,143 @@ export namespace people_v1 { /** * people.people.updateContact * @desc Update contact data for an existing contact person. Any non-contact data will not be modified. The request throws a 400 error if `updatePersonFields` is not specified. The request throws a 400 error if `person.metadata.sources` is not specified for the contact to be updated. The request throws a 400 error with an error with reason `"failedPrecondition"` if `person.metadata.sources.etag` is different than the contact's etag, which indicates the contact has changed since its data was read. Clients should get the latest person and re-apply their updates to the latest person. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/people.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 people = google.people('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/contacts'], + * }); + * + * // 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 people.people.updateContact({ + * // The resource name for the person, assigned by the server. An ASCII string + * // with a max length of 27 characters, in the form of + * // `people/{person_id}`. + * resourceName: 'people/[^/]+', + * // Required. A field mask to restrict which fields on the person are updated. Multiple + * // fields can be specified by separating them with commas. + * // All updated fields will be replaced. Valid values are: + * // + * // * addresses + * // * biographies + * // * birthdays + * // * emailAddresses + * // * events + * // * genders + * // * imClients + * // * interests + * // * locales + * // * memberships + * // * names + * // * nicknames + * // * occupations + * // * organizations + * // * phoneNumbers + * // * relations + * // * residences + * // * sipAddresses + * // * urls + * // * userDefined + * updatePersonFields: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "addresses": [], + * // "ageRange": "my_ageRange", + * // "ageRanges": [], + * // "biographies": [], + * // "birthdays": [], + * // "braggingRights": [], + * // "coverPhotos": [], + * // "emailAddresses": [], + * // "etag": "my_etag", + * // "events": [], + * // "genders": [], + * // "imClients": [], + * // "interests": [], + * // "locales": [], + * // "memberships": [], + * // "metadata": {}, + * // "names": [], + * // "nicknames": [], + * // "occupations": [], + * // "organizations": [], + * // "phoneNumbers": [], + * // "photos": [], + * // "relations": [], + * // "relationshipInterests": [], + * // "relationshipStatuses": [], + * // "residences": [], + * // "resourceName": "my_resourceName", + * // "sipAddresses": [], + * // "skills": [], + * // "taglines": [], + * // "urls": [], + * // "userDefined": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "addresses": [], + * // "ageRange": "my_ageRange", + * // "ageRanges": [], + * // "biographies": [], + * // "birthdays": [], + * // "braggingRights": [], + * // "coverPhotos": [], + * // "emailAddresses": [], + * // "etag": "my_etag", + * // "events": [], + * // "genders": [], + * // "imClients": [], + * // "interests": [], + * // "locales": [], + * // "memberships": [], + * // "metadata": {}, + * // "names": [], + * // "nicknames": [], + * // "occupations": [], + * // "organizations": [], + * // "phoneNumbers": [], + * // "photos": [], + * // "relations": [], + * // "relationshipInterests": [], + * // "relationshipStatuses": [], + * // "residences": [], + * // "resourceName": "my_resourceName", + * // "sipAddresses": [], + * // "skills": [], + * // "taglines": [], + * // "urls": [], + * // "userDefined": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias people.people.updateContact * @memberOf! () * @@ -2370,6 +3290,55 @@ export namespace people_v1 { /** * people.people.updateContactPhoto * @desc Update a contact's photo. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/people.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 people = google.people('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/contacts'], + * }); + * + * // 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 people.people.updateContactPhoto({ + * // Required. Person resource name + * resourceName: 'people/[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "personFields": "my_personFields", + * // "photoBytes": "my_photoBytes" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "person": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias people.people.updateContactPhoto * @memberOf! () * @@ -2577,6 +3546,110 @@ export namespace people_v1 { /** * people.people.connections.list * @desc Provides a list of the authenticated user's contacts merged with any connected profiles. The request throws a 400 error if 'personFields' is not specified. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/people.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 people = google.people('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/contacts', + * 'https://www.googleapis.com/auth/contacts.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 people.people.connections.list({ + * // Optional. The number of connections to include in the response. Valid values are + * // between 1 and 2000, inclusive. Defaults to 100 if not set or set to 0. + * pageSize: 'placeholder-value', + * // Optional. A page token, received from a previous `ListConnections` call. + * // Provide this to retrieve the subsequent page. + * // + * // When paginating, all other parameters provided to `ListConnections` + * // must match the call that provided the page token. + * pageToken: 'placeholder-value', + * // Required. A field mask to restrict which fields on each person are returned. Multiple + * // fields can be specified by separating them with commas. Valid values are: + * // + * // * addresses + * // * ageRanges + * // * biographies + * // * birthdays + * // * coverPhotos + * // * emailAddresses + * // * events + * // * genders + * // * imClients + * // * interests + * // * locales + * // * memberships + * // * metadata + * // * names + * // * nicknames + * // * occupations + * // * organizations + * // * phoneNumbers + * // * photos + * // * relations + * // * residences + * // * sipAddresses + * // * skills + * // * urls + * // * userDefined + * personFields: 'placeholder-value', + * // Required. Comma-separated list of person fields to be included in the response. Each + * // path should start with `person.`: for example, `person.names` or + * // `person.photos`. + * 'requestMask.includeField': 'placeholder-value', + * // Optional. Whether the response should include `next_sync_token`, which can be used to + * // get all changes since the last request. For subsequent sync requests use + * // the `sync_token` param instead. Initial sync requests that specify + * // `request_sync_token` have an additional rate limit. + * requestSyncToken: 'placeholder-value', + * // Required. The resource name to return connections for. Only `people/me` is valid. + * resourceName: 'people/[^/]+', + * // Optional. The order in which the connections should be sorted. Defaults to + * // `LAST_MODIFIED_ASCENDING`. + * sortOrder: 'placeholder-value', + * // Optional. A sync token, received from a previous `ListConnections` call. + * // Provide this to retrieve only the resources changed since the last request. + * // Sync requests that specify `sync_token` have an additional rate limit. + * // + * // When syncing, all other parameters provided to `ListConnections` + * // must match the call that provided the sync token. + * syncToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "connections": [], + * // "nextPageToken": "my_nextPageToken", + * // "nextSyncToken": "my_nextSyncToken", + * // "totalItems": 0, + * // "totalPeople": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias people.people.connections.list * @memberOf! () * diff --git a/src/apis/playcustomapp/v1.ts b/src/apis/playcustomapp/v1.ts index 4cb0e82169b..991e07d8f43 100644 --- a/src/apis/playcustomapp/v1.ts +++ b/src/apis/playcustomapp/v1.ts @@ -129,6 +129,60 @@ export namespace playcustomapp_v1 { /** * playcustomapp.accounts.customApps.create * @desc Create and publish a new custom app. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/playcustomapp.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 playcustomapp = google.playcustomapp('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/androidpublisher'], + * }); + * + * // 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 playcustomapp.accounts.customApps.create({ + * // Developer account ID. + * account: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "languageCode": "my_languageCode", + * // "title": "my_title" + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "languageCode": "my_languageCode", + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias playcustomapp.accounts.customApps.create * @memberOf! () * diff --git a/src/apis/plus/v1.ts b/src/apis/plus/v1.ts index fc39f9e2b5f..e701e82d280 100644 --- a/src/apis/plus/v1.ts +++ b/src/apis/plus/v1.ts @@ -595,6 +595,68 @@ export namespace plus_v1 { /** * plus.activities.get * @desc Shut down. See https://developers.google.com/+/api-shutdown for more details. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/plus.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 plus = google.plus('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/plus.login', + * 'https://www.googleapis.com/auth/plus.me', + * ], + * }); + * + * // 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 plus.activities.get({ + * // The ID of the activity to get. + * activityId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "access": {}, + * // "actor": {}, + * // "address": "my_address", + * // "annotation": "my_annotation", + * // "crosspostSource": "my_crosspostSource", + * // "etag": "my_etag", + * // "geocode": "my_geocode", + * // "id": "my_id", + * // "kind": "my_kind", + * // "location": {}, + * // "object": {}, + * // "placeId": "my_placeId", + * // "placeName": "my_placeName", + * // "provider": {}, + * // "published": "my_published", + * // "radius": "my_radius", + * // "title": "my_title", + * // "updated": "my_updated", + * // "url": "my_url", + * // "verb": "my_verb" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias plus.activities.get * @memberOf! () * @@ -666,6 +728,63 @@ export namespace plus_v1 { /** * plus.activities.list * @desc Shut down. See https://developers.google.com/+/api-shutdown for more details. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/plus.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 plus = google.plus('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/plus.login', + * 'https://www.googleapis.com/auth/plus.me', + * ], + * }); + * + * // 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 plus.activities.list({ + * // The collection of activities to list. + * collection: 'placeholder-value', + * // The maximum number of activities to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * // The ID of the user to get activities for. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "title": "my_title", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias plus.activities.list * @memberOf! () * @@ -741,6 +860,65 @@ export namespace plus_v1 { /** * plus.activities.search * @desc Shut down. See https://developers.google.com/+/api-shutdown for more details. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/plus.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 plus = google.plus('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/plus.login', + * 'https://www.googleapis.com/auth/plus.me', + * ], + * }); + * + * // 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 plus.activities.search({ + * // Specify the preferred language to search with. See search language codes for available values. + * language: 'placeholder-value', + * // The maximum number of activities to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // Specifies how to order search results. + * orderBy: 'placeholder-value', + * // The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. This token can be of any length. + * pageToken: 'placeholder-value', + * // Full-text search query string. + * query: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "title": "my_title", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias plus.activities.search * @memberOf! () * @@ -889,6 +1067,59 @@ export namespace plus_v1 { /** * plus.comments.get * @desc Shut down. See https://developers.google.com/+/api-shutdown for more details. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/plus.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 plus = google.plus('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/plus.login', + * 'https://www.googleapis.com/auth/plus.me', + * ], + * }); + * + * // 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 plus.comments.get({ + * // The ID of the comment to get. + * commentId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "actor": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "inReplyTo": [], + * // "kind": "my_kind", + * // "object": {}, + * // "plusoners": {}, + * // "published": "my_published", + * // "selfLink": "my_selfLink", + * // "updated": "my_updated", + * // "verb": "my_verb" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias plus.comments.get * @memberOf! () * @@ -960,6 +1191,62 @@ export namespace plus_v1 { /** * plus.comments.list * @desc Shut down. See https://developers.google.com/+/api-shutdown for more details. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/plus.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 plus = google.plus('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/plus.login', + * 'https://www.googleapis.com/auth/plus.me', + * ], + * }); + * + * // 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 plus.comments.list({ + * // The ID of the activity to get comments for. + * activityId: 'placeholder-value', + * // The maximum number of comments to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * // The order in which to sort the list of comments. + * sortOrder: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "items": [], + * // "kind": "my_kind", + * // "nextLink": "my_nextLink", + * // "nextPageToken": "my_nextPageToken", + * // "title": "my_title", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias plus.comments.list * @memberOf! () * @@ -1077,6 +1364,80 @@ export namespace plus_v1 { /** * plus.people.get * @desc Get a person's profile. If your app uses scope https://www.googleapis.com/auth/plus.login, this method is guaranteed to return ageRange and language. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/plus.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 plus = google.plus('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/plus.login', + * 'https://www.googleapis.com/auth/plus.me', + * 'https://www.googleapis.com/auth/userinfo.email', + * 'https://www.googleapis.com/auth/userinfo.profile', + * ], + * }); + * + * // 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 plus.people.get({ + * // The ID of the person to get the profile for. The special value "me" can be used to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "aboutMe": "my_aboutMe", + * // "ageRange": {}, + * // "birthday": "my_birthday", + * // "braggingRights": "my_braggingRights", + * // "circledByCount": 0, + * // "cover": {}, + * // "currentLocation": "my_currentLocation", + * // "displayName": "my_displayName", + * // "domain": "my_domain", + * // "emails": [], + * // "etag": "my_etag", + * // "gender": "my_gender", + * // "id": "my_id", + * // "image": {}, + * // "isPlusUser": false, + * // "kind": "my_kind", + * // "language": "my_language", + * // "name": {}, + * // "nickname": "my_nickname", + * // "objectType": "my_objectType", + * // "occupation": "my_occupation", + * // "organizations": [], + * // "placesLived": [], + * // "plusOneCount": 0, + * // "relationshipStatus": "my_relationshipStatus", + * // "skills": "my_skills", + * // "tagline": "my_tagline", + * // "url": "my_url", + * // "urls": [], + * // "verified": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias plus.people.get * @memberOf! () * @@ -1148,6 +1509,63 @@ export namespace plus_v1 { /** * plus.people.list * @desc List all of the people in the specified collection. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/plus.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 plus = google.plus('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/plus.login', + * 'https://www.googleapis.com/auth/plus.me', + * ], + * }); + * + * // 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 plus.people.list({ + * // The collection of people to list. + * collection: 'placeholder-value', + * // The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // The order to return people in. + * orderBy: 'placeholder-value', + * // The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * // Get the collection of people for the person identified. Use "me" to indicate the authenticated user. + * userId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "title": "my_title", + * // "totalItems": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias plus.people.list * @memberOf! () * @@ -1224,6 +1642,61 @@ export namespace plus_v1 { /** * plus.people.listByActivity * @desc Shut down. See https://developers.google.com/+/api-shutdown for more details. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/plus.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 plus = google.plus('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/plus.login', + * 'https://www.googleapis.com/auth/plus.me', + * ], + * }); + * + * // 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 plus.people.listByActivity({ + * // The ID of the activity to get the list of people for. + * activityId: 'placeholder-value', + * // The collection of people to list. + * collection: 'placeholder-value', + * // The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "title": "my_title", + * // "totalItems": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias plus.people.listByActivity * @memberOf! () * @@ -1300,6 +1773,61 @@ export namespace plus_v1 { /** * plus.people.search * @desc Shut down. See https://developers.google.com/+/api-shutdown for more details. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/plus.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 plus = google.plus('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/plus.login', + * 'https://www.googleapis.com/auth/plus.me', + * ], + * }); + * + * // 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 plus.people.search({ + * // Specify the preferred language to search with. See search language codes for available values. + * language: 'placeholder-value', + * // The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. + * maxResults: 'placeholder-value', + * // The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. This token can be of any length. + * pageToken: 'placeholder-value', + * // Specify a query string for full text search of public text in all profiles. + * query: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "selfLink": "my_selfLink", + * // "title": "my_title", + * // "totalItems": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias plus.people.search * @memberOf! () * diff --git a/src/apis/policytroubleshooter/v1.ts b/src/apis/policytroubleshooter/v1.ts index c7bc90f9cfb..5b0f9e411fa 100644 --- a/src/apis/policytroubleshooter/v1.ts +++ b/src/apis/policytroubleshooter/v1.ts @@ -322,6 +322,52 @@ export namespace policytroubleshooter_v1 { /** * policytroubleshooter.iam.troubleshoot * @desc Checks whether a member has a specific permission for a specific resource, and explains why the member does or does not have that permission. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/policytroubleshooter.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 policytroubleshooter = google.policytroubleshooter('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/cloud-platform'], + * }); + * + * // 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 policytroubleshooter.iam.troubleshoot({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accessTuple": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "access": "my_access", + * // "explainedPolicies": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias policytroubleshooter.iam.troubleshoot * @memberOf! () * diff --git a/src/apis/policytroubleshooter/v1beta.ts b/src/apis/policytroubleshooter/v1beta.ts index e4bcda800ae..050310936f5 100644 --- a/src/apis/policytroubleshooter/v1beta.ts +++ b/src/apis/policytroubleshooter/v1beta.ts @@ -322,6 +322,52 @@ export namespace policytroubleshooter_v1beta { /** * policytroubleshooter.iam.troubleshoot * @desc Checks whether a member has a specific permission for a specific resource, and explains why the member does or does not have that permission. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/policytroubleshooter.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 policytroubleshooter = google.policytroubleshooter('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 policytroubleshooter.iam.troubleshoot({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accessTuple": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "access": "my_access", + * // "explainedPolicies": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias policytroubleshooter.iam.troubleshoot * @memberOf! () * diff --git a/src/apis/poly/v1.ts b/src/apis/poly/v1.ts index e286c63ec71..759ed2324b2 100644 --- a/src/apis/poly/v1.ts +++ b/src/apis/poly/v1.ts @@ -428,6 +428,59 @@ export namespace poly_v1 { /** * poly.assets.get * @desc Returns detailed information about an asset given its name. PRIVATE assets are returned only if the currently authenticated user (via OAuth token) is the author of the asset. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/poly.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 poly = google.poly('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: [], + * }); + * + * // 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 poly.assets.get({ + * // Required. An asset's name in the form `assets/{ASSET_ID}`. + * name: 'assets/my-asset', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authorName": "my_authorName", + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "formats": [], + * // "isCurated": false, + * // "license": "my_license", + * // "metadata": "my_metadata", + * // "name": "my_name", + * // "presentationParams": {}, + * // "remixInfo": {}, + * // "thumbnail": {}, + * // "updateTime": "my_updateTime", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias poly.assets.get * @memberOf! () * @@ -496,6 +549,77 @@ export namespace poly_v1 { /** * poly.assets.list * @desc Lists all public, remixable assets. These are assets with an access level of PUBLIC and published under the CC-By license. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/poly.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 poly = google.poly('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: [], + * }); + * + * // 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 poly.assets.list({ + * // Filter assets based on the specified category. Supported values are: + * // `animals`, `architecture`, `art`, `food`, `nature`, `objects`, `people`, + * // `scenes`, `technology`, and `transport`. + * category: 'placeholder-value', + * // Return only assets that have been curated by the Poly team. + * curated: 'placeholder-value', + * // Return only assets with the matching format. Acceptable values are: + * // `BLOCKS`, `FBX`, `GLTF`, `GLTF2`, `OBJ`, `TILT`. + * format: 'placeholder-value', + * // One or more search terms to be matched against all text that Poly has + * // indexed for assets, which includes display_name, + * // description, and tags. Multiple keywords should be + * // separated by spaces. + * keywords: 'placeholder-value', + * // Returns assets that are of the specified complexity or less. Defaults to + * // COMPLEX. For example, a request for + * // MEDIUM assets also includes + * // SIMPLE assets. + * maxComplexity: 'placeholder-value', + * // Specifies an ordering for assets. Acceptable values are: + * // `BEST`, `NEWEST`, `OLDEST`. Defaults to `BEST`, which ranks assets + * // based on a combination of popularity and other features. + * orderBy: 'placeholder-value', + * // The maximum number of assets to be returned. This value must be between `1` + * // and `100`. Defaults to `20`. + * pageSize: 'placeholder-value', + * // Specifies a continuation token from a previous search whose results were + * // split into multiple pages. To get the next page, submit the same request + * // specifying the value from + * // next_page_token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assets": [], + * // "nextPageToken": "my_nextPageToken", + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias poly.assets.list * @memberOf! () * @@ -642,6 +766,70 @@ export namespace poly_v1 { /** * poly.users.assets.list * @desc Lists assets authored by the given user. Only the value 'me', representing the currently-authenticated user, is supported. May include assets with an access level of PRIVATE or UNLISTED and assets which are All Rights Reserved for the currently-authenticated user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/poly.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 poly = google.poly('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: [], + * }); + * + * // 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 poly.users.assets.list({ + * // Return only assets with the matching format. Acceptable values are: + * // `BLOCKS`, `FBX`, `GLTF`, `GLTF2`, `OBJ`, and `TILT`. + * format: 'placeholder-value', + * // A valid user id. Currently, only the special value 'me', representing the + * // currently-authenticated user is supported. To use 'me', you must pass + * // an OAuth token with the request. + * name: 'users/my-user', + * // Specifies an ordering for assets. Acceptable values are: + * // `BEST`, `NEWEST`, `OLDEST`. Defaults to `BEST`, which ranks assets + * // based on a combination of popularity and other features. + * orderBy: 'placeholder-value', + * // The maximum number of assets to be returned. This value must be between `1` + * // and `100`. Defaults to `20`. + * pageSize: 'placeholder-value', + * // Specifies a continuation token from a previous search whose results were + * // split into multiple pages. To get the next page, submit the same request + * // specifying the value from + * // next_page_token. + * pageToken: 'placeholder-value', + * // The visibility of the assets to be returned. + * // Defaults to + * // VISIBILITY_UNSPECIFIED + * // which returns all assets. + * visibility: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "totalSize": 0, + * // "userAssets": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias poly.users.assets.list * @memberOf! () * @@ -760,6 +948,65 @@ export namespace poly_v1 { /** * poly.users.likedassets.list * @desc Lists assets that the user has liked. Only the value 'me', representing the currently-authenticated user, is supported. May include assets with an access level of UNLISTED. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/poly.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 poly = google.poly('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: [], + * }); + * + * // 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 poly.users.likedassets.list({ + * // Return only assets with the matching format. Acceptable values are: + * // `BLOCKS`, `FBX`, `GLTF`, `GLTF2`, `OBJ`, `TILT`. + * format: 'placeholder-value', + * // A valid user id. Currently, only the special value 'me', representing the + * // currently-authenticated user is supported. To use 'me', you must pass + * // an OAuth token with the request. + * name: 'users/my-user', + * // Specifies an ordering for assets. Acceptable values are: + * // `BEST`, `NEWEST`, `OLDEST`, 'LIKED_TIME'. Defaults to `LIKED_TIME`, which + * // ranks assets based on how recently they were liked. + * orderBy: 'placeholder-value', + * // The maximum number of assets to be returned. This value must be between `1` + * // and `100`. Defaults to `20`. + * pageSize: 'placeholder-value', + * // Specifies a continuation token from a previous search whose results were + * // split into multiple pages. To get the next page, submit the same request + * // specifying the value from + * // next_page_token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assets": [], + * // "nextPageToken": "my_nextPageToken", + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias poly.users.likedassets.list * @memberOf! () * diff --git a/src/apis/prod_tt_sasportal/v1alpha1.ts b/src/apis/prod_tt_sasportal/v1alpha1.ts index 69f924a1075..c3c6cd35ed0 100644 --- a/src/apis/prod_tt_sasportal/v1alpha1.ts +++ b/src/apis/prod_tt_sasportal/v1alpha1.ts @@ -661,6 +661,48 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.get * @desc Returns a requested customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.get({ + * // Required. The name of the customer. + * name: 'customers/my-customer', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.get * @memberOf! () * @@ -732,6 +774,51 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.list * @desc Returns a list of requested customers. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.list({ + * // The maximum number of customers + * // to return in the response. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call to ListCustomers method that indicates where + * // this listing should continue from. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "customers": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.list * @memberOf! () * @@ -816,6 +903,60 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.patch * @desc Updates an existing customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.patch({ + * // Output only. Resource name of the customer. + * name: 'customers/my-customer', + * // Fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.patch * @memberOf! () * @@ -943,6 +1084,54 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.devices.bulk * @desc Creates a device under a node or customer. Returned devices are unordered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.devices.bulk({ + * // Required. The name of the parent resource. + * parent: 'customers/my-customer', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "csv": "my_csv" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "devices": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.devices.bulk * @memberOf! () * @@ -1028,6 +1217,68 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.devices.create * @desc Creates a device under a node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.devices.create({ + * // Required. The name of the parent resource. + * parent: 'customers/my-customer', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.devices.create * @memberOf! () * @@ -1104,6 +1355,62 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.devices.createSigned * @desc Creates a signed device under a node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.devices.createSigned({ + * // Required. The name of the parent resource. + * parent: 'customers/my-customer', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "encodedDevice": "my_encodedDevice", + * // "installerId": "my_installerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.devices.createSigned * @memberOf! () * @@ -1180,6 +1487,44 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.devices.delete * @desc Deletes a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.devices.delete({ + * // Required. The name of the device. + * name: 'customers/my-customer/devices/my-device', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.devices.delete * @memberOf! () * @@ -1252,6 +1597,53 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.devices.get * @desc Gets details about a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.devices.get({ + * // Required. The name of the device. + * name: 'customers/my-customer/devices/my-device', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.devices.get * @memberOf! () * @@ -1324,6 +1716,58 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.devices.list * @desc Lists devices under a node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.devices.list({ + * // The filter expression. The filter should have one of the following + * // formats: "sn=123454" or "display_name=MyDevice". sn + * // corresponds to serial_number of the device. The filter is case insensitive. + * filter: 'placeholder-value', + * // The maximum number of devices to return in the response. + * // If empty or zero, all devices will be listed. + * // Must be in the range [0, 1000]. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call to ListDevices + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The name of the parent resource. + * parent: 'customers/my-customer', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "devices": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.devices.list * @memberOf! () * @@ -1411,6 +1855,58 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.devices.move * @desc Moves a device under another node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.devices.move({ + * // Required. The name of the device to move. + * name: 'customers/my-customer/devices/my-device', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destination": "my_destination" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.devices.move * @memberOf! () * @@ -1487,6 +1983,70 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.devices.patch * @desc Updates a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.devices.patch({ + * // Output only. The resource path name. + * name: 'customers/my-customer/devices/my-device', + * // Fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.devices.patch * @memberOf! () * @@ -1561,6 +2121,52 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.devices.signDevice * @desc Signs a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.devices.signDevice({ + * // Output only. The resource path name. + * name: 'customers/my-customer/devices/my-device', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "device": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.devices.signDevice * @memberOf! () * @@ -1637,6 +2243,62 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.devices.updateSigned * @desc Updates a signed device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.devices.updateSigned({ + * // Required. The name of the device to update. + * name: 'customers/my-customer/devices/my-device', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "encodedDevice": "my_encodedDevice", + * // "installerId": "my_installerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.devices.updateSigned * @memberOf! () * @@ -1894,6 +2556,58 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.nodes.create * @desc Creates a new node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.nodes.create({ + * // Required. The parent resource name where the node is to be created. + * parent: 'customers/my-customer', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.nodes.create * @memberOf! () * @@ -1970,6 +2684,44 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.nodes.delete * @desc Deletes a node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.nodes.delete({ + * // Required. The name of the node. + * name: 'customers/my-customer/nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.nodes.delete * @memberOf! () * @@ -2042,6 +2794,48 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.nodes.get * @desc Returns a requested node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.nodes.get({ + * // Required. The name of the node. + * name: 'customers/my-customer/nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.nodes.get * @memberOf! () * @@ -2114,6 +2908,52 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.nodes.list * @desc Lists nodes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.nodes.list({ + * // The maximum number of nodes to return in the response. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call to ListNodes method + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example, "nodes/1". + * parent: 'customers/my-customer', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "nodes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.nodes.list * @memberOf! () * @@ -2198,6 +3038,59 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.nodes.move * @desc Moves a node under another node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.nodes.move({ + * // Required. The name of the node to + * // move. + * name: 'customers/my-customer/nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destination": "my_destination" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.nodes.move * @memberOf! () * @@ -2274,6 +3167,60 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.nodes.patch * @desc Updates an existing node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.nodes.patch({ + * // Output only. Resource name. + * name: 'customers/my-customer/nodes/my-node', + * // Fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.nodes.patch * @memberOf! () * @@ -2455,6 +3402,58 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.nodes.nodes.create * @desc Creates a new node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.nodes.nodes.create({ + * // Required. The parent resource name where the node is to be created. + * parent: 'customers/my-customer/nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.nodes.nodes.create * @memberOf! () * @@ -2531,6 +3530,52 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.customers.nodes.nodes.list * @desc Lists nodes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.customers.nodes.nodes.list({ + * // The maximum number of nodes to return in the response. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call to ListNodes method + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example, "nodes/1". + * parent: 'customers/my-customer/nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "nodes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.customers.nodes.nodes.list * @memberOf! () * @@ -2660,6 +3705,49 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.installer.generateSecret * @desc Generates a secret to be used with the ValidateInstaller method + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.installer.generateSecret({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "secret": "my_secret" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.installer.generateSecret * @memberOf! () * @@ -2744,6 +3832,51 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.installer.validate * @desc Validates the identity of a Certified Professional Installer (CPI). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.installer.validate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "encodedSecret": "my_encodedSecret", + * // "installerId": "my_installerId", + * // "secret": "my_secret" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.installer.validate * @memberOf! () * @@ -2871,6 +4004,54 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.devices.bulk * @desc Creates a device under a node or customer. Returned devices are unordered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.devices.bulk({ + * // Required. The name of the parent resource. + * parent: 'nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "csv": "my_csv" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "devices": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.devices.bulk * @memberOf! () * @@ -2956,6 +4137,68 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.devices.create * @desc Creates a device under a node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.devices.create({ + * // Required. The name of the parent resource. + * parent: 'nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.devices.create * @memberOf! () * @@ -3032,6 +4275,62 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.devices.createSigned * @desc Creates a signed device under a node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.devices.createSigned({ + * // Required. The name of the parent resource. + * parent: 'nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "encodedDevice": "my_encodedDevice", + * // "installerId": "my_installerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.devices.createSigned * @memberOf! () * @@ -3108,6 +4407,44 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.devices.delete * @desc Deletes a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.devices.delete({ + * // Required. The name of the device. + * name: 'nodes/my-node/devices/my-device', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.devices.delete * @memberOf! () * @@ -3180,6 +4517,53 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.devices.get * @desc Gets details about a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.devices.get({ + * // Required. The name of the device. + * name: 'nodes/my-node/devices/my-device', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.devices.get * @memberOf! () * @@ -3252,6 +4636,58 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.devices.list * @desc Lists devices under a node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.devices.list({ + * // The filter expression. The filter should have one of the following + * // formats: "sn=123454" or "display_name=MyDevice". sn + * // corresponds to serial_number of the device. The filter is case insensitive. + * filter: 'placeholder-value', + * // The maximum number of devices to return in the response. + * // If empty or zero, all devices will be listed. + * // Must be in the range [0, 1000]. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call to ListDevices + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The name of the parent resource. + * parent: 'nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "devices": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.devices.list * @memberOf! () * @@ -3339,6 +4775,58 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.devices.move * @desc Moves a device under another node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.devices.move({ + * // Required. The name of the device to move. + * name: 'nodes/my-node/devices/my-device', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destination": "my_destination" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.devices.move * @memberOf! () * @@ -3415,6 +4903,70 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.devices.patch * @desc Updates a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.devices.patch({ + * // Output only. The resource path name. + * name: 'nodes/my-node/devices/my-device', + * // Fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.devices.patch * @memberOf! () * @@ -3489,6 +5041,52 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.devices.signDevice * @desc Signs a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.devices.signDevice({ + * // Output only. The resource path name. + * name: 'nodes/my-node/devices/my-device', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "device": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.devices.signDevice * @memberOf! () * @@ -3565,6 +5163,62 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.devices.updateSigned * @desc Updates a signed device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.devices.updateSigned({ + * // Required. The name of the device to update. + * name: 'nodes/my-node/devices/my-device', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "encodedDevice": "my_encodedDevice", + * // "installerId": "my_installerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.devices.updateSigned * @memberOf! () * @@ -3824,6 +5478,58 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.nodes.create * @desc Creates a new node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.nodes.create({ + * // Required. The parent resource name where the node is to be created. + * parent: 'nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.nodes.create * @memberOf! () * @@ -3900,6 +5606,44 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.nodes.delete * @desc Deletes a node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.nodes.delete({ + * // Required. The name of the node. + * name: 'nodes/my-node/nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.nodes.delete * @memberOf! () * @@ -3972,6 +5716,48 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.nodes.get * @desc Returns a requested node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.nodes.get({ + * // Required. The name of the node. + * name: 'nodes/my-node/nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.nodes.get * @memberOf! () * @@ -4043,6 +5829,52 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.nodes.list * @desc Lists nodes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.nodes.list({ + * // The maximum number of nodes to return in the response. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call to ListNodes method + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example, "nodes/1". + * parent: 'nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "nodes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.nodes.list * @memberOf! () * @@ -4126,6 +5958,59 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.nodes.move * @desc Moves a node under another node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.nodes.move({ + * // Required. The name of the node to + * // move. + * name: 'nodes/my-node/nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destination": "my_destination" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.nodes.move * @memberOf! () * @@ -4201,6 +6086,60 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.nodes.patch * @desc Updates an existing node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.nodes.patch({ + * // Output only. Resource name. + * name: 'nodes/my-node/nodes/my-node', + * // Fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.nodes.patch * @memberOf! () * @@ -4379,6 +6318,54 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.nodes.devices.bulk * @desc Creates a device under a node or customer. Returned devices are unordered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.nodes.devices.bulk({ + * // Required. The name of the parent resource. + * parent: 'nodes/my-node/nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "csv": "my_csv" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "devices": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.nodes.devices.bulk * @memberOf! () * @@ -4464,6 +6451,68 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.nodes.devices.create * @desc Creates a device under a node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.nodes.devices.create({ + * // Required. The name of the parent resource. + * parent: 'nodes/my-node/nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.nodes.devices.create * @memberOf! () * @@ -4540,6 +6589,62 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.nodes.devices.createSigned * @desc Creates a signed device under a node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.nodes.devices.createSigned({ + * // Required. The name of the parent resource. + * parent: 'nodes/my-node/nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "encodedDevice": "my_encodedDevice", + * // "installerId": "my_installerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.nodes.devices.createSigned * @memberOf! () * @@ -4616,6 +6721,58 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.nodes.devices.list * @desc Lists devices under a node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.nodes.devices.list({ + * // The filter expression. The filter should have one of the following + * // formats: "sn=123454" or "display_name=MyDevice". sn + * // corresponds to serial_number of the device. The filter is case insensitive. + * filter: 'placeholder-value', + * // The maximum number of devices to return in the response. + * // If empty or zero, all devices will be listed. + * // Must be in the range [0, 1000]. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call to ListDevices + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The name of the parent resource. + * parent: 'nodes/my-node/nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "devices": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.nodes.devices.list * @memberOf! () * @@ -4786,6 +6943,58 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.nodes.nodes.create * @desc Creates a new node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.nodes.nodes.create({ + * // Required. The parent resource name where the node is to be created. + * parent: 'nodes/my-node/nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.nodes.nodes.create * @memberOf! () * @@ -4862,6 +7071,52 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.nodes.nodes.nodes.list * @desc Lists nodes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.nodes.nodes.nodes.list({ + * // The maximum number of nodes to return in the response. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call to ListNodes method + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example, "nodes/1". + * parent: 'nodes/my-node/nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "nodes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.nodes.nodes.nodes.list * @memberOf! () * @@ -4991,6 +7246,52 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.policies.get * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.policies.get({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resource": "my_resource" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assignments": [], + * // "etag": "my_etag" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.policies.get * @memberOf! () * @@ -5065,6 +7366,53 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.policies.set * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.policies.set({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "resource": "my_resource" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assignments": [], + * // "etag": "my_etag" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.policies.set * @memberOf! () * @@ -5139,6 +7487,52 @@ export namespace prod_tt_sasportal_v1alpha1 { /** * prod_tt_sasportal.policies.test * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/prod_tt_sasportal.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 prod_tt_sasportal = google.prod_tt_sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 prod_tt_sasportal.policies.test({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [], + * // "resource": "my_resource" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias prod_tt_sasportal.policies.test * @memberOf! () * diff --git a/src/apis/pubsub/v1.ts b/src/apis/pubsub/v1.ts index 947922f8198..9987f781aa5 100644 --- a/src/apis/pubsub/v1.ts +++ b/src/apis/pubsub/v1.ts @@ -607,62 +607,65 @@ export namespace pubsub_v1 { * pubsub.projects.snapshots.create * @desc Creates a snapshot from the requested subscription. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

                          If the snapshot already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the `Snapshot.expire_time` field. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription, conforming to the [resource name format](https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is populated in the returned Snapshot object. Note that for REST API requests, you must specify a name in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Optional user-provided name for this snapshot. - * // If the name is not provided in the request, the server will assign a random - * // name for this snapshot on the same project as the subscription. - * // Note that for REST API requests, you must specify a name. See the - * // - * // resource name rules. - * // Format is `projects/{project}/snapshots/{snap}`. - * name: 'projects/my-project/snapshots/my-snapshot', // TODO: Update placeholder value. + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * // 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 pubsub.projects.snapshots.create({ + * // Required. User-provided name for this snapshot. If the name is not provided in the + * // request, the server will assign a random name for this snapshot on the same + * // project as the subscription. Note that for REST API requests, you must + * // specify a name. See the resource + * // name rules. Format is `projects/{project}/snapshots/{snap}`. + * name: 'projects/my-project/snapshots/my-snapshot', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labels": {}, + * // "subscription": "my_subscription" + * // } * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.snapshots.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "expireTime": "my_expireTime", + * // "labels": {}, + * // "name": "my_name", + * // "topic": "my_topic" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.snapshots.create * @memberOf! () * @@ -734,49 +737,47 @@ export namespace pubsub_v1 { * pubsub.projects.snapshots.delete * @desc Removes an existing snapshot. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

                          When the snapshot is deleted, all messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new one may be created with the same name, but the new one has no association with the old snapshot or its subscription, unless the same subscription is specified. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { - * // The name of the snapshot to delete. + * // Do the magic + * const res = await pubsub.projects.snapshots.delete({ + * // Required. The name of the snapshot to delete. * // Format is `projects/{project}/snapshots/{snap}`. - * snapshot: 'projects/my-project/snapshots/my-snapshot', // TODO: Update placeholder value. + * snapshot: 'projects/my-project/snapshots/my-snapshot', + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * pubsub.projects.snapshots.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.snapshots.delete * @memberOf! () * @@ -847,52 +848,52 @@ export namespace pubsub_v1 { * pubsub.projects.snapshots.get * @desc Gets the configuration details of a snapshot. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the snapshot to get. - * // Format is `projects/{project}/snapshots/{snap}`. - * snapshot: 'projects/my-project/snapshots/my-snapshot', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * pubsub.projects.snapshots.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await pubsub.projects.snapshots.get({ + * // Required. The name of the snapshot to get. + * // Format is `projects/{project}/snapshots/{snap}`. + * snapshot: 'projects/my-project/snapshots/my-snapshot', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "expireTime": "my_expireTime", + * // "labels": {}, + * // "name": "my_name", + * // "topic": "my_topic" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.snapshots.get * @memberOf! () * @@ -963,52 +964,60 @@ export namespace pubsub_v1 { * pubsub.projects.snapshots.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 pubsub.projects.snapshots.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', * // REQUIRED: The resource for which the policy is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/snapshots/my-snapshot', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * pubsub.projects.snapshots.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * resource: 'projects/my-project/snapshots/my-snapshot', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.snapshots.getIamPolicy * @memberOf! () * @@ -1083,65 +1092,56 @@ export namespace pubsub_v1 { * pubsub.projects.snapshots.list * @desc Lists the existing snapshots. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The name of the project in which to list snapshots. + * // 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 pubsub.projects.snapshots.list({ + * // Maximum number of snapshots to return. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListSnapshotsResponse`; indicates that this + * // is a continuation of a prior `ListSnapshots` call, and that the system + * // should return the next page of data. + * pageToken: 'placeholder-value', + * // Required. The name of the project in which to list snapshots. * // Format is `projects/{project-id}`. - * project: 'projects/my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var snapshotsPage = response['snapshots']; - * if (!snapshotsPage) { - * return; - * } - * for (var i = 0; i < snapshotsPage.length; i++) { - * // TODO: Change code below to process each resource in `snapshotsPage`: - * console.log(JSON.stringify(snapshotsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * pubsub.projects.snapshots.list(request, handlePage); - * } - * }; - * - * pubsub.projects.snapshots.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * project: 'projects/my-project', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "snapshots": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.snapshots.list * @memberOf! () * @@ -1221,56 +1221,60 @@ export namespace pubsub_v1 { * pubsub.projects.snapshots.patch * @desc Updates an existing snapshot. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The name of the snapshot. - * name: 'projects/my-project/snapshots/my-snapshot', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * // Do the magic + * const res = await pubsub.projects.snapshots.patch({ + * // The name of the snapshot. + * name: 'projects/my-project/snapshots/my-snapshot', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "snapshot": {}, + * // "updateMask": "my_updateMask" + * // } * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.snapshots.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "expireTime": "my_expireTime", + * // "labels": {}, + * // "name": "my_name", + * // "topic": "my_topic" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.snapshots.patch * @memberOf! () * @@ -1342,56 +1346,59 @@ export namespace pubsub_v1 { * pubsub.projects.snapshots.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await pubsub.projects.snapshots.setIamPolicy({ * // REQUIRED: The resource for which the policy is being specified. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/snapshots/my-snapshot', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'projects/my-project/snapshots/my-snapshot', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.snapshots.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.snapshots.setIamPolicy * @memberOf! () * @@ -1466,56 +1473,57 @@ export namespace pubsub_v1 { * pubsub.projects.snapshots.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 pubsub.projects.snapshots.testIamPermissions({ * // REQUIRED: The resource for which the policy detail is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/snapshots/my-snapshot', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'projects/my-project/snapshots/my-snapshot', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * pubsub.projects.snapshots.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.snapshots.testIamPermissions * @memberOf! () * @@ -1735,53 +1743,55 @@ export namespace pubsub_v1 { * pubsub.projects.subscriptions.acknowledge * @desc Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages from the subscription. Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The subscription whose message is being acknowledged. - * // Format is `projects/{project}/subscriptions/{sub}`. - * subscription: 'projects/my-project/subscriptions/my-subscription', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await pubsub.projects.subscriptions.acknowledge({ + * // Required. The subscription whose message is being acknowledged. + * // Format is `projects/{project}/subscriptions/{sub}`. + * subscription: 'projects/my-project/subscriptions/my-subscription', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ackIds": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * pubsub.projects.subscriptions.acknowledge(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.subscriptions.acknowledge * @memberOf! () * @@ -1856,61 +1866,77 @@ export namespace pubsub_v1 { * pubsub.projects.subscriptions.create * @desc Creates a subscription to a given topic. See the resource name rules. If the subscription already exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns `NOT_FOUND`. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic, conforming to the [resource name format](https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is populated in the returned Subscription object. Note that for REST API requests, you must specify a name in the request. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The name of the subscription. It must have the format + * // 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 pubsub.projects.subscriptions.create({ + * // Required. The name of the subscription. It must have the format * // `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must * // start with a letter, and contain only letters (`[A-Za-z]`), numbers * // (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), * // plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters * // in length, and it must not start with `"goog"`. - * name: 'projects/my-project/subscriptions/my-subscription', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * name: 'projects/my-project/subscriptions/my-subscription', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ackDeadlineSeconds": 0, + * // "deadLetterPolicy": {}, + * // "expirationPolicy": {}, + * // "labels": {}, + * // "messageRetentionDuration": "my_messageRetentionDuration", + * // "name": "my_name", + * // "pushConfig": {}, + * // "retainAckedMessages": false, + * // "topic": "my_topic" + * // } * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.subscriptions.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ackDeadlineSeconds": 0, + * // "deadLetterPolicy": {}, + * // "expirationPolicy": {}, + * // "labels": {}, + * // "messageRetentionDuration": "my_messageRetentionDuration", + * // "name": "my_name", + * // "pushConfig": {}, + * // "retainAckedMessages": false, + * // "topic": "my_topic" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.subscriptions.create * @memberOf! () * @@ -1984,49 +2010,47 @@ export namespace pubsub_v1 { * pubsub.projects.subscriptions.delete * @desc Deletes an existing subscription. All messages retained in the subscription are immediately dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription or its topic unless the same topic is specified. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { - * // The subscription to delete. + * // Do the magic + * const res = await pubsub.projects.subscriptions.delete({ + * // Required. The subscription to delete. * // Format is `projects/{project}/subscriptions/{sub}`. - * subscription: 'projects/my-project/subscriptions/my-subscription', // TODO: Update placeholder value. + * subscription: 'projects/my-project/subscriptions/my-subscription', + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * pubsub.projects.subscriptions.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.subscriptions.delete * @memberOf! () * @@ -2100,52 +2124,57 @@ export namespace pubsub_v1 { * pubsub.projects.subscriptions.get * @desc Gets the configuration details of a subscription. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the subscription to get. - * // Format is `projects/{project}/subscriptions/{sub}`. - * subscription: 'projects/my-project/subscriptions/my-subscription', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * pubsub.projects.subscriptions.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await pubsub.projects.subscriptions.get({ + * // Required. The name of the subscription to get. + * // Format is `projects/{project}/subscriptions/{sub}`. + * subscription: 'projects/my-project/subscriptions/my-subscription', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ackDeadlineSeconds": 0, + * // "deadLetterPolicy": {}, + * // "expirationPolicy": {}, + * // "labels": {}, + * // "messageRetentionDuration": "my_messageRetentionDuration", + * // "name": "my_name", + * // "pushConfig": {}, + * // "retainAckedMessages": false, + * // "topic": "my_topic" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.subscriptions.get * @memberOf! () * @@ -2221,52 +2250,60 @@ export namespace pubsub_v1 { * pubsub.projects.subscriptions.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 pubsub.projects.subscriptions.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', * // REQUIRED: The resource for which the policy is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/subscriptions/my-subscription', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * pubsub.projects.subscriptions.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * resource: 'projects/my-project/subscriptions/my-subscription', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.subscriptions.getIamPolicy * @memberOf! () * @@ -2341,65 +2378,56 @@ export namespace pubsub_v1 { * pubsub.projects.subscriptions.list * @desc Lists matching subscriptions. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The name of the project in which to list subscriptions. + * // 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 pubsub.projects.subscriptions.list({ + * // Maximum number of subscriptions to return. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListSubscriptionsResponse`; indicates that + * // this is a continuation of a prior `ListSubscriptions` call, and that the + * // system should return the next page of data. + * pageToken: 'placeholder-value', + * // Required. The name of the project in which to list subscriptions. * // Format is `projects/{project-id}`. - * project: 'projects/my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var subscriptionsPage = response['subscriptions']; - * if (!subscriptionsPage) { - * return; - * } - * for (var i = 0; i < subscriptionsPage.length; i++) { - * // TODO: Change code below to process each resource in `subscriptionsPage`: - * console.log(JSON.stringify(subscriptionsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * pubsub.projects.subscriptions.list(request, handlePage); - * } - * }; - * - * pubsub.projects.subscriptions.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * project: 'projects/my-project', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "subscriptions": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.subscriptions.list * @memberOf! () * @@ -2484,53 +2512,56 @@ export namespace pubsub_v1 { * pubsub.projects.subscriptions.modifyAckDeadline * @desc Modifies the ack deadline for a specific message. This method is useful to indicate that more time is needed to process a message by the subscriber, or to make the message available for redelivery if the processing was interrupted. Note that this does not modify the subscription-level `ackDeadlineSeconds` used for subsequent messages. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The name of the subscription. - * // Format is `projects/{project}/subscriptions/{sub}`. - * subscription: 'projects/my-project/subscriptions/my-subscription', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await pubsub.projects.subscriptions.modifyAckDeadline({ + * // Required. The name of the subscription. + * // Format is `projects/{project}/subscriptions/{sub}`. + * subscription: 'projects/my-project/subscriptions/my-subscription', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ackDeadlineSeconds": 0, + * // "ackIds": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * pubsub.projects.subscriptions.modifyAckDeadline(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.subscriptions.modifyAckDeadline * @memberOf! () * @@ -2605,53 +2636,55 @@ export namespace pubsub_v1 { * pubsub.projects.subscriptions.modifyPushConfig * @desc Modifies the `PushConfig` for a specified subscription. This may be used to change a push subscription to a pull one (signified by an empty `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will accumulate for delivery continuously through the call regardless of changes to the `PushConfig`. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The name of the subscription. - * // Format is `projects/{project}/subscriptions/{sub}`. - * subscription: 'projects/my-project/subscriptions/my-subscription', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await pubsub.projects.subscriptions.modifyPushConfig({ + * // Required. The name of the subscription. + * // Format is `projects/{project}/subscriptions/{sub}`. + * subscription: 'projects/my-project/subscriptions/my-subscription', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "pushConfig": {} + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * pubsub.projects.subscriptions.modifyPushConfig(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.subscriptions.modifyPushConfig * @memberOf! () * @@ -2726,61 +2759,70 @@ export namespace pubsub_v1 { * pubsub.projects.subscriptions.patch * @desc Updates an existing subscription. Note that certain properties of a subscription, such as its topic, are not modifiable. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The name of the subscription. It must have the format + * // 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 pubsub.projects.subscriptions.patch({ + * // Required. The name of the subscription. It must have the format * // `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must * // start with a letter, and contain only letters (`[A-Za-z]`), numbers * // (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), * // plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters * // in length, and it must not start with `"goog"`. - * name: 'projects/my-project/subscriptions/my-subscription', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * name: 'projects/my-project/subscriptions/my-subscription', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "subscription": {}, + * // "updateMask": "my_updateMask" + * // } * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.subscriptions.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ackDeadlineSeconds": 0, + * // "deadLetterPolicy": {}, + * // "expirationPolicy": {}, + * // "labels": {}, + * // "messageRetentionDuration": "my_messageRetentionDuration", + * // "name": "my_name", + * // "pushConfig": {}, + * // "retainAckedMessages": false, + * // "topic": "my_topic" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.subscriptions.patch * @memberOf! () * @@ -2854,56 +2896,58 @@ export namespace pubsub_v1 { * pubsub.projects.subscriptions.pull * @desc Pulls messages from the server. The server may return `UNAVAILABLE` if there are too many concurrent pull requests pending for the given subscription. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The subscription from which messages should be pulled. - * // Format is `projects/{project}/subscriptions/{sub}`. - * subscription: 'projects/my-project/subscriptions/my-subscription', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await pubsub.projects.subscriptions.pull({ + * // Required. The subscription from which messages should be pulled. + * // Format is `projects/{project}/subscriptions/{sub}`. + * subscription: 'projects/my-project/subscriptions/my-subscription', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "maxMessages": 0, + * // "returnImmediately": false + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * pubsub.projects.subscriptions.pull(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "receivedMessages": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.subscriptions.pull * @memberOf! () * @@ -2980,55 +3024,55 @@ export namespace pubsub_v1 { * pubsub.projects.subscriptions.seek * @desc Seeks an existing subscription to a point in time or to a given snapshot, whichever is provided in the request. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. Note that both the subscription and the snapshot must be on the same topic. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The subscription to affect. - * subscription: 'projects/my-project/subscriptions/my-subscription', // TODO: Update placeholder value. + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 pubsub.projects.subscriptions.seek({ + * // Required. The subscription to affect. + * subscription: 'projects/my-project/subscriptions/my-subscription', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "snapshot": "my_snapshot", + * // "time": "my_time" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * pubsub.projects.subscriptions.seek(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // {} + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.subscriptions.seek * @memberOf! () * @@ -3105,56 +3149,59 @@ export namespace pubsub_v1 { * pubsub.projects.subscriptions.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await pubsub.projects.subscriptions.setIamPolicy({ * // REQUIRED: The resource for which the policy is being specified. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/subscriptions/my-subscription', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'projects/my-project/subscriptions/my-subscription', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.subscriptions.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.subscriptions.setIamPolicy * @memberOf! () * @@ -3229,56 +3276,57 @@ export namespace pubsub_v1 { * pubsub.projects.subscriptions.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await pubsub.projects.subscriptions.testIamPermissions({ * // REQUIRED: The resource for which the policy detail is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/subscriptions/my-subscription', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'projects/my-project/subscriptions/my-subscription', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * pubsub.projects.subscriptions.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.subscriptions.testIamPermissions * @memberOf! () * @@ -3589,61 +3637,67 @@ export namespace pubsub_v1 { * pubsub.projects.topics.create * @desc Creates the given topic with the given name. See the resource name rules. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { - * // The name of the topic. It must have the format + * // Do the magic + * const res = await pubsub.projects.topics.create({ + * // Required. The name of the topic. It must have the format * // `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, * // and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), * // underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent * // signs (`%`). It must be between 3 and 255 characters in length, and it * // must not start with `"goog"`. - * name: 'projects/my-project/topics/my-topic', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * name: 'projects/my-project/topics/my-topic', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kmsKeyName": "my_kmsKeyName", + * // "labels": {}, + * // "messageStoragePolicy": {}, + * // "name": "my_name" + * // } * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.topics.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kmsKeyName": "my_kmsKeyName", + * // "labels": {}, + * // "messageStoragePolicy": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.topics.create * @memberOf! () * @@ -3715,49 +3769,47 @@ export namespace pubsub_v1 { * pubsub.projects.topics.delete * @desc Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted, but their `topic` field is set to `_deleted-topic_`. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Name of the topic to delete. + * // 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 pubsub.projects.topics.delete({ + * // Required. Name of the topic to delete. * // Format is `projects/{project}/topics/{topic}`. - * topic: 'projects/my-project/topics/my-topic', // TODO: Update placeholder value. + * topic: 'projects/my-project/topics/my-topic', + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * pubsub.projects.topics.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.topics.delete * @memberOf! () * @@ -3828,52 +3880,52 @@ export namespace pubsub_v1 { * pubsub.projects.topics.get * @desc Gets the configuration of a topic. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the topic to get. - * // Format is `projects/{project}/topics/{topic}`. - * topic: 'projects/my-project/topics/my-topic', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * pubsub.projects.topics.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await pubsub.projects.topics.get({ + * // Required. The name of the topic to get. + * // Format is `projects/{project}/topics/{topic}`. + * topic: 'projects/my-project/topics/my-topic', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kmsKeyName": "my_kmsKeyName", + * // "labels": {}, + * // "messageStoragePolicy": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.topics.get * @memberOf! () * @@ -3944,52 +3996,60 @@ export namespace pubsub_v1 { * pubsub.projects.topics.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 pubsub.projects.topics.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', * // REQUIRED: The resource for which the policy is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/topics/my-topic', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * pubsub.projects.topics.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * resource: 'projects/my-project/topics/my-topic', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.topics.getIamPolicy * @memberOf! () * @@ -4064,65 +4124,56 @@ export namespace pubsub_v1 { * pubsub.projects.topics.list * @desc Lists matching topics. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The name of the project in which to list topics. + * // 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 pubsub.projects.topics.list({ + * // Maximum number of topics to return. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListTopicsResponse`; indicates that this is + * // a continuation of a prior `ListTopics` call, and that the system should + * // return the next page of data. + * pageToken: 'placeholder-value', + * // Required. The name of the project in which to list topics. * // Format is `projects/{project-id}`. - * project: 'projects/my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var topicsPage = response['topics']; - * if (!topicsPage) { - * return; - * } - * for (var i = 0; i < topicsPage.length; i++) { - * // TODO: Change code below to process each resource in `topicsPage`: - * console.log(JSON.stringify(topicsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * pubsub.projects.topics.list(request, handlePage); - * } - * }; - * - * pubsub.projects.topics.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * project: 'projects/my-project', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "topics": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.topics.list * @memberOf! () * @@ -4200,61 +4251,65 @@ export namespace pubsub_v1 { * pubsub.projects.topics.patch * @desc Updates an existing topic. Note that certain properties of a topic are not modifiable. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The name of the topic. It must have the format + * // 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 pubsub.projects.topics.patch({ + * // Required. The name of the topic. It must have the format * // `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, * // and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), * // underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent * // signs (`%`). It must be between 3 and 255 characters in length, and it * // must not start with `"goog"`. - * name: 'projects/my-project/topics/my-topic', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * name: 'projects/my-project/topics/my-topic', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "topic": {}, + * // "updateMask": "my_updateMask" + * // } * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.topics.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kmsKeyName": "my_kmsKeyName", + * // "labels": {}, + * // "messageStoragePolicy": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.topics.patch * @memberOf! () * @@ -4326,56 +4381,57 @@ export namespace pubsub_v1 { * pubsub.projects.topics.publish * @desc Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The messages in the request will be published on this topic. - * // Format is `projects/{project}/topics/{topic}`. - * topic: 'projects/my-project/topics/my-topic', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await pubsub.projects.topics.publish({ + * // Required. The messages in the request will be published on this topic. + * // Format is `projects/{project}/topics/{topic}`. + * topic: 'projects/my-project/topics/my-topic', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "messages": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * pubsub.projects.topics.publish(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "messageIds": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.topics.publish * @memberOf! () * @@ -4452,56 +4508,59 @@ export namespace pubsub_v1 { * pubsub.projects.topics.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await pubsub.projects.topics.setIamPolicy({ * // REQUIRED: The resource for which the policy is being specified. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/topics/my-topic', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'projects/my-project/topics/my-topic', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.topics.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.topics.setIamPolicy * @memberOf! () * @@ -4576,56 +4635,57 @@ export namespace pubsub_v1 { * pubsub.projects.topics.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await pubsub.projects.topics.testIamPermissions({ * // REQUIRED: The resource for which the policy detail is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'projects/my-project/topics/my-topic', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'projects/my-project/topics/my-topic', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * pubsub.projects.topics.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias pubsub.projects.topics.testIamPermissions * @memberOf! () * @@ -4862,65 +4922,56 @@ export namespace pubsub_v1 { * pubsub.projects.topics.snapshots.list * @desc Lists the names of the snapshots on this topic. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The name of the topic that snapshots are attached to. + * // 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 pubsub.projects.topics.snapshots.list({ + * // Maximum number of snapshot names to return. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListTopicSnapshotsResponse`; indicates + * // that this is a continuation of a prior `ListTopicSnapshots` call, and + * // that the system should return the next page of data. + * pageToken: 'placeholder-value', + * // Required. The name of the topic that snapshots are attached to. * // Format is `projects/{project}/topics/{topic}`. - * topic: 'projects/my-project/topics/my-topic', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var snapshotsPage = response['snapshots']; - * if (!snapshotsPage) { - * return; - * } - * for (var i = 0; i < snapshotsPage.length; i++) { - * // TODO: Change code below to process each resource in `snapshotsPage`: - * console.log(JSON.stringify(snapshotsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * pubsub.projects.topics.snapshots.list(request, handlePage); - * } - * }; - * - * pubsub.projects.topics.snapshots.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * topic: 'projects/my-project/topics/my-topic', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "snapshots": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.topics.snapshots.list * @memberOf! () * @@ -5033,65 +5084,56 @@ export namespace pubsub_v1 { * pubsub.projects.topics.subscriptions.list * @desc Lists the names of the subscriptions on this topic. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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'); - * var pubsub = google.pubsub('v1'); + * const pubsub = google.pubsub('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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The name of the topic that subscriptions are attached to. + * // 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 pubsub.projects.topics.subscriptions.list({ + * // Maximum number of subscription names to return. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListTopicSubscriptionsResponse`; indicates + * // that this is a continuation of a prior `ListTopicSubscriptions` call, and + * // that the system should return the next page of data. + * pageToken: 'placeholder-value', + * // Required. The name of the topic that subscriptions are attached to. * // Format is `projects/{project}/topics/{topic}`. - * topic: 'projects/my-project/topics/my-topic', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var subscriptionsPage = response['subscriptions']; - * if (!subscriptionsPage) { - * return; - * } - * for (var i = 0; i < subscriptionsPage.length; i++) { - * // TODO: Change code below to process each resource in `subscriptionsPage`: - * console.log(JSON.stringify(subscriptionsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * pubsub.projects.topics.subscriptions.list(request, handlePage); - * } - * }; - * - * pubsub.projects.topics.subscriptions.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * topic: 'projects/my-project/topics/my-topic', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "subscriptions": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.topics.subscriptions.list * @memberOf! () * diff --git a/src/apis/pubsub/v1beta1a.ts b/src/apis/pubsub/v1beta1a.ts index 563d9da4c42..5a7db455415 100644 --- a/src/apis/pubsub/v1beta1a.ts +++ b/src/apis/pubsub/v1beta1a.ts @@ -387,6 +387,53 @@ export namespace pubsub_v1beta1a { /** * pubsub.subscriptions.acknowledge * @desc Acknowledges a particular received message: the Pub/Sub system can remove the given message from the subscription. Acknowledging a message whose Ack deadline has expired may succeed, but the message could have been already redelivered. Acknowledging a message more than once will not result in an error. This is only used for messages received via pull. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta1a'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.subscriptions.acknowledge({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ackId": [], + * // "subscription": "my_subscription" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.subscriptions.acknowledge * @memberOf! () * @@ -459,6 +506,60 @@ export namespace pubsub_v1beta1a { /** * pubsub.subscriptions.create * @desc Creates a subscription on a given topic for a given subscriber. If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns NOT_FOUND. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta1a'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.subscriptions.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ackDeadlineSeconds": 0, + * // "name": "my_name", + * // "pushConfig": {}, + * // "topic": "my_topic" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ackDeadlineSeconds": 0, + * // "name": "my_name", + * // "pushConfig": {}, + * // "topic": "my_topic" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.subscriptions.create * @memberOf! () * @@ -533,6 +634,47 @@ export namespace pubsub_v1beta1a { /** * pubsub.subscriptions.delete * @desc Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta1a'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.subscriptions.delete({ + * // The subscription to delete. + * subscription: '.*', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.subscriptions.delete * @memberOf! () * @@ -605,6 +747,52 @@ export namespace pubsub_v1beta1a { /** * pubsub.subscriptions.get * @desc Gets the configuration details of a subscription. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta1a'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.subscriptions.get({ + * // The name of the subscription to get. + * subscription: '.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ackDeadlineSeconds": 0, + * // "name": "my_name", + * // "pushConfig": {}, + * // "topic": "my_topic" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.subscriptions.get * @memberOf! () * @@ -679,6 +867,55 @@ export namespace pubsub_v1beta1a { /** * pubsub.subscriptions.list * @desc Lists matching subscriptions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta1a'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.subscriptions.list({ + * // Maximum number of subscriptions to return. + * maxResults: 'placeholder-value', + * // The value obtained in the last ListSubscriptionsResponse + * // for continuation. + * pageToken: 'placeholder-value', + * // A valid label query expression. + * query: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "subscription": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.subscriptions.list * @memberOf! () * @@ -762,6 +999,55 @@ export namespace pubsub_v1beta1a { /** * pubsub.subscriptions.modifyAckDeadline * @desc Modifies the Ack deadline for a message received from a pull request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta1a'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.subscriptions.modifyAckDeadline({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ackDeadlineSeconds": 0, + * // "ackId": "my_ackId", + * // "ackIds": [], + * // "subscription": "my_subscription" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.subscriptions.modifyAckDeadline * @memberOf! () * @@ -833,6 +1119,53 @@ export namespace pubsub_v1beta1a { /** * pubsub.subscriptions.modifyPushConfig * @desc Modifies the PushConfig for a specified subscription. This method can be used to suspend the flow of messages to an endpoint by clearing the PushConfig field in the request. Messages will be accumulated for delivery even if no push configuration is defined or while the configuration is modified. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta1a'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.subscriptions.modifyPushConfig({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "pushConfig": {}, + * // "subscription": "my_subscription" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.subscriptions.modifyPushConfig * @memberOf! () * @@ -905,6 +1238,56 @@ export namespace pubsub_v1beta1a { /** * pubsub.subscriptions.pull * @desc Pulls a single message from the server. If return_immediately is true, and no messages are available in the subscription, this method returns FAILED_PRECONDITION. The system is free to return an UNAVAILABLE error if no messages are available in a reasonable amount of time (to reduce system load). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta1a'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.subscriptions.pull({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "returnImmediately": false, + * // "subscription": "my_subscription" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ackId": "my_ackId", + * // "pubsubEvent": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.subscriptions.pull * @memberOf! () * @@ -979,6 +1362,56 @@ export namespace pubsub_v1beta1a { /** * pubsub.subscriptions.pullBatch * @desc Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The system is free to return UNAVAILABLE if there are too many pull requests outstanding for the given subscription. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta1a'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.subscriptions.pullBatch({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "maxEvents": 0, + * // "returnImmediately": false, + * // "subscription": "my_subscription" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "pullResponses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.subscriptions.pullBatch * @memberOf! () * @@ -1177,6 +1610,54 @@ export namespace pubsub_v1beta1a { /** * pubsub.topics.create * @desc Creates the given topic with the given name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta1a'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.topics.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.topics.create * @memberOf! () * @@ -1245,6 +1726,47 @@ export namespace pubsub_v1beta1a { /** * pubsub.topics.delete * @desc Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta1a'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.topics.delete({ + * // Name of the topic to delete. + * topic: '.*', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.topics.delete * @memberOf! () * @@ -1316,6 +1838,49 @@ export namespace pubsub_v1beta1a { /** * pubsub.topics.get * @desc Gets the configuration of a topic. Since the topic only has the name attribute, this method is only useful to check the existence of a topic. If other attributes are added in the future, they will be returned here. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta1a'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.topics.get({ + * // The name of the topic to get. + * topic: '.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.topics.get * @memberOf! () * @@ -1387,6 +1952,55 @@ export namespace pubsub_v1beta1a { /** * pubsub.topics.list * @desc Lists matching topics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta1a'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.topics.list({ + * // Maximum number of topics to return. + * maxResults: 'placeholder-value', + * // The value obtained in the last ListTopicsResponse + * // for continuation. + * pageToken: 'placeholder-value', + * // A valid label query expression. + * query: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "topic": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.topics.list * @memberOf! () * @@ -1459,6 +2073,53 @@ export namespace pubsub_v1beta1a { /** * pubsub.topics.publish * @desc Adds a message to the topic. Returns NOT_FOUND if the topic does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta1a'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.topics.publish({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "message": {}, + * // "topic": "my_topic" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.topics.publish * @memberOf! () * @@ -1530,6 +2191,55 @@ export namespace pubsub_v1beta1a { /** * pubsub.topics.publishBatch * @desc Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta1a'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.topics.publishBatch({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "messages": [], + * // "topic": "my_topic" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "messageIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.topics.publishBatch * @memberOf! () * diff --git a/src/apis/pubsub/v1beta2.ts b/src/apis/pubsub/v1beta2.ts index 09b91a72816..6b33f459dd9 100644 --- a/src/apis/pubsub/v1beta2.ts +++ b/src/apis/pubsub/v1beta2.ts @@ -428,6 +428,55 @@ export namespace pubsub_v1beta2 { /** * pubsub.projects.subscriptions.acknowledge * @desc Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages from the subscription. Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.projects.subscriptions.acknowledge({ + * // The subscription whose message is being acknowledged. + * subscription: 'projects/my-project/subscriptions/my-subscription', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ackIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.subscriptions.acknowledge * @memberOf! () * @@ -501,6 +550,68 @@ export namespace pubsub_v1beta2 { /** * pubsub.projects.subscriptions.create * @desc Creates a subscription to a given topic. If the subscription already exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns `NOT_FOUND`. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic. Note that for REST API requests, you must specify a name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.projects.subscriptions.create({ + * // The name of the subscription. It must have the format + * // `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must + * // start with a letter, and contain only letters (`[A-Za-z]`), numbers + * // (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), + * // plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters + * // in length, and it must not start with `"goog"`. + * name: 'projects/my-project/subscriptions/my-subscription', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ackDeadlineSeconds": 0, + * // "name": "my_name", + * // "pushConfig": {}, + * // "topic": "my_topic" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ackDeadlineSeconds": 0, + * // "name": "my_name", + * // "pushConfig": {}, + * // "topic": "my_topic" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.subscriptions.create * @memberOf! () * @@ -573,6 +684,47 @@ export namespace pubsub_v1beta2 { /** * pubsub.projects.subscriptions.delete * @desc Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription, or its topic unless the same topic is specified. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.projects.subscriptions.delete({ + * // The subscription to delete. + * subscription: 'projects/my-project/subscriptions/my-subscription', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.subscriptions.delete * @memberOf! () * @@ -645,6 +797,52 @@ export namespace pubsub_v1beta2 { /** * pubsub.projects.subscriptions.get * @desc Gets the configuration details of a subscription. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.projects.subscriptions.get({ + * // The name of the subscription to get. + * subscription: 'projects/my-project/subscriptions/my-subscription', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ackDeadlineSeconds": 0, + * // "name": "my_name", + * // "pushConfig": {}, + * // "topic": "my_topic" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.subscriptions.get * @memberOf! () * @@ -719,6 +917,61 @@ export namespace pubsub_v1beta2 { /** * pubsub.projects.subscriptions.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.projects.subscriptions.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/subscriptions/my-subscription', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.subscriptions.getIamPolicy * @memberOf! () * @@ -792,6 +1045,56 @@ export namespace pubsub_v1beta2 { /** * pubsub.projects.subscriptions.list * @desc Lists matching subscriptions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.projects.subscriptions.list({ + * // Maximum number of subscriptions to return. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListSubscriptionsResponse`; indicates that + * // this is a continuation of a prior `ListSubscriptions` call, and that the + * // system should return the next page of data. + * pageToken: 'placeholder-value', + * // The name of the cloud project that subscriptions belong to. + * project: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "subscriptions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.subscriptions.list * @memberOf! () * @@ -875,6 +1178,57 @@ export namespace pubsub_v1beta2 { /** * pubsub.projects.subscriptions.modifyAckDeadline * @desc Modifies the ack deadline for a specific message. This method is useful to indicate that more time is needed to process a message by the subscriber, or to make the message available for redelivery if the processing was interrupted. Note that this does not modify the subscription-level `ackDeadlineSeconds` used for subsequent messages. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.projects.subscriptions.modifyAckDeadline({ + * // The name of the subscription. + * subscription: 'projects/my-project/subscriptions/my-subscription', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ackDeadlineSeconds": 0, + * // "ackId": "my_ackId", + * // "ackIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.subscriptions.modifyAckDeadline * @memberOf! () * @@ -947,6 +1301,55 @@ export namespace pubsub_v1beta2 { /** * pubsub.projects.subscriptions.modifyPushConfig * @desc Modifies the `PushConfig` for a specified subscription. This may be used to change a push subscription to a pull one (signified by an empty `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will accumulate for delivery continuously through the call regardless of changes to the `PushConfig`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.projects.subscriptions.modifyPushConfig({ + * // The name of the subscription. + * subscription: 'projects/my-project/subscriptions/my-subscription', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "pushConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.subscriptions.modifyPushConfig * @memberOf! () * @@ -1019,6 +1422,58 @@ export namespace pubsub_v1beta2 { /** * pubsub.projects.subscriptions.pull * @desc Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The server may return `UNAVAILABLE` if there are too many concurrent pull requests pending for the given subscription. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.projects.subscriptions.pull({ + * // The subscription from which messages should be pulled. + * subscription: 'projects/my-project/subscriptions/my-subscription', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "maxMessages": 0, + * // "returnImmediately": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "receivedMessages": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.subscriptions.pull * @memberOf! () * @@ -1094,6 +1549,60 @@ export namespace pubsub_v1beta2 { /** * pubsub.projects.subscriptions.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.projects.subscriptions.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/subscriptions/my-subscription', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.subscriptions.setIamPolicy * @memberOf! () * @@ -1167,6 +1676,58 @@ export namespace pubsub_v1beta2 { /** * pubsub.projects.subscriptions.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.projects.subscriptions.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/subscriptions/my-subscription', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.subscriptions.testIamPermissions * @memberOf! () * @@ -1440,6 +2001,62 @@ export namespace pubsub_v1beta2 { /** * pubsub.projects.topics.create * @desc Creates the given topic with the given name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.projects.topics.create({ + * // The name of the topic. It must have the format + * // `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, + * // and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), + * // underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent + * // signs (`%`). It must be between 3 and 255 characters in length, and it + * // must not start with `"goog"`. + * name: 'projects/my-project/topics/my-topic', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.topics.create * @memberOf! () * @@ -1510,6 +2127,47 @@ export namespace pubsub_v1beta2 { /** * pubsub.projects.topics.delete * @desc Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted, but their `topic` field is set to `_deleted-topic_`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.projects.topics.delete({ + * // Name of the topic to delete. + * topic: 'projects/my-project/topics/my-topic', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.topics.delete * @memberOf! () * @@ -1579,6 +2237,49 @@ export namespace pubsub_v1beta2 { /** * pubsub.projects.topics.get * @desc Gets the configuration of a topic. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.projects.topics.get({ + * // The name of the topic to get. + * topic: 'projects/my-project/topics/my-topic', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.topics.get * @memberOf! () * @@ -1648,6 +2349,61 @@ export namespace pubsub_v1beta2 { /** * pubsub.projects.topics.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.projects.topics.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/topics/my-topic', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.topics.getIamPolicy * @memberOf! () * @@ -1721,6 +2477,56 @@ export namespace pubsub_v1beta2 { /** * pubsub.projects.topics.list * @desc Lists matching topics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.projects.topics.list({ + * // Maximum number of topics to return. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListTopicsResponse`; indicates that this is + * // a continuation of a prior `ListTopics` call, and that the system should + * // return the next page of data. + * pageToken: 'placeholder-value', + * // The name of the cloud project that topics belong to. + * project: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "topics": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.topics.list * @memberOf! () * @@ -1797,6 +2603,57 @@ export namespace pubsub_v1beta2 { /** * pubsub.projects.topics.publish * @desc Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist. The message payload must not be empty; it must contain either a non-empty data field, or at least one attribute. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.projects.topics.publish({ + * // The messages in the request will be published on this topic. + * topic: 'projects/my-project/topics/my-topic', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "messages": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "messageIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.topics.publish * @memberOf! () * @@ -1872,6 +2729,60 @@ export namespace pubsub_v1beta2 { /** * pubsub.projects.topics.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.projects.topics.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/topics/my-topic', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.topics.setIamPolicy * @memberOf! () * @@ -1945,6 +2856,58 @@ export namespace pubsub_v1beta2 { /** * pubsub.projects.topics.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.projects.topics.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/topics/my-topic', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.topics.testIamPermissions * @memberOf! () * @@ -2163,6 +3126,56 @@ export namespace pubsub_v1beta2 { /** * pubsub.projects.topics.subscriptions.list * @desc Lists the name of the subscriptions for this topic. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/pubsub.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 pubsub = google.pubsub('v1beta2'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/pubsub', + * ], + * }); + * + * // 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 pubsub.projects.topics.subscriptions.list({ + * // Maximum number of subscription names to return. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListTopicSubscriptionsResponse`; indicates + * // that this is a continuation of a prior `ListTopicSubscriptions` call, and + * // that the system should return the next page of data. + * pageToken: 'placeholder-value', + * // The name of the topic that subscriptions are attached to. + * topic: 'projects/my-project/topics/my-topic', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "subscriptions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias pubsub.projects.topics.subscriptions.list * @memberOf! () * diff --git a/src/apis/recommender/v1beta1.ts b/src/apis/recommender/v1beta1.ts index 64d1270879d..03183c90f3f 100644 --- a/src/apis/recommender/v1beta1.ts +++ b/src/apis/recommender/v1beta1.ts @@ -491,6 +491,57 @@ export namespace recommender_v1beta1 { /** * recommender.projects.locations.insightTypes.insights.get * @desc Gets the requested insight. Requires the recommender.*.get IAM permission for the specified insight type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/recommender.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 recommender = google.recommender('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 recommender.projects.locations.insightTypes.insights.get({ + * // Required. Name of the insight. + * name: + * 'projects/my-project/locations/my-location/insightTypes/my-insightType/insights/my-insight', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "associatedRecommendations": [], + * // "category": "my_category", + * // "content": {}, + * // "description": "my_description", + * // "etag": "my_etag", + * // "insightSubtype": "my_insightSubtype", + * // "lastRefreshTime": "my_lastRefreshTime", + * // "name": "my_name", + * // "observationPeriod": "my_observationPeriod", + * // "stateInfo": {}, + * // "targetResources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias recommender.projects.locations.insightTypes.insights.get * @memberOf! () * @@ -579,6 +630,68 @@ export namespace recommender_v1beta1 { /** * recommender.projects.locations.insightTypes.insights.list * @desc Lists insights for a Cloud project. Requires the recommender.*.list IAM permission for the specified insight type. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/recommender.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 recommender = google.recommender('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 recommender.projects.locations.insightTypes.insights.list({ + * // Optional. Filter expression to restrict the insights returned. Supported + * // filter fields: state + * // Eg: `state:"DISMISSED" or state:"ACTIVE" + * filter: 'placeholder-value', + * // Optional. The maximum number of results to return from this request. Non-positive + * // values are ignored. If not specified, the server will determine the number + * // of results to return. + * pageSize: 'placeholder-value', + * // Optional. If present, retrieves the next batch of results from the preceding call to + * // this method. `page_token` must be the value of `next_page_token` from the + * // previous response. The values of other method parameters must be identical + * // to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The container resource on which to execute the request. + * // Acceptable formats: + * // + * // 1. + * // "projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]", + * // + * // LOCATION here refers to GCP Locations: + * // https://cloud.google.com/about/locations/ + * parent: + * 'projects/my-project/locations/my-location/insightTypes/my-insightType', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "insights": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias recommender.projects.locations.insightTypes.insights.list * @memberOf! () * @@ -680,6 +793,68 @@ export namespace recommender_v1beta1 { /** * recommender.projects.locations.insightTypes.insights.markAccepted * @desc Marks the Insight State as Accepted. Users can use this method to indicate to the Recommender API that they have applied some action based on the insight. This stops the insight content from being updated. MarkInsightAccepted can be applied to insights in ACTIVE state. Requires the recommender.*.update IAM permission for the specified insight. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/recommender.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 recommender = google.recommender('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 recommender.projects.locations.insightTypes.insights.markAccepted( + * { + * // Required. Name of the insight. + * name: + * 'projects/my-project/locations/my-location/insightTypes/my-insightType/insights/my-insight', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "stateMetadata": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "associatedRecommendations": [], + * // "category": "my_category", + * // "content": {}, + * // "description": "my_description", + * // "etag": "my_etag", + * // "insightSubtype": "my_insightSubtype", + * // "lastRefreshTime": "my_lastRefreshTime", + * // "name": "my_name", + * // "observationPeriod": "my_observationPeriod", + * // "stateInfo": {}, + * // "targetResources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias recommender.projects.locations.insightTypes.insights.markAccepted * @memberOf! () * @@ -844,6 +1019,58 @@ export namespace recommender_v1beta1 { /** * recommender.projects.locations.recommenders.recommendations.get * @desc Gets the requested recommendation. Requires the recommender.*.get IAM permission for the specified recommender. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/recommender.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 recommender = google.recommender('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 recommender.projects.locations.recommenders.recommendations.get( + * { + * // Required. Name of the recommendation. + * name: + * 'projects/my-project/locations/my-location/recommenders/my-recommender/recommendations/my-recommendation', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "additionalImpact": [], + * // "associatedInsights": [], + * // "content": {}, + * // "description": "my_description", + * // "etag": "my_etag", + * // "lastRefreshTime": "my_lastRefreshTime", + * // "name": "my_name", + * // "primaryImpact": {}, + * // "recommenderSubtype": "my_recommenderSubtype", + * // "stateInfo": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias recommender.projects.locations.recommenders.recommendations.get * @memberOf! () * @@ -940,6 +1167,70 @@ export namespace recommender_v1beta1 { /** * recommender.projects.locations.recommenders.recommendations.list * @desc Lists recommendations for a Cloud project. Requires the recommender.*.list IAM permission for the specified recommender. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/recommender.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 recommender = google.recommender('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 recommender.projects.locations.recommenders.recommendations.list( + * { + * // Filter expression to restrict the recommendations returned. Supported + * // filter fields: state_info.state + * // Eg: `state_info.state:"DISMISSED" or state_info.state:"FAILED" + * filter: 'placeholder-value', + * // Optional. The maximum number of results to return from this request. Non-positive + * // values are ignored. If not specified, the server will determine the number + * // of results to return. + * pageSize: 'placeholder-value', + * // Optional. If present, retrieves the next batch of results from the preceding call to + * // this method. `page_token` must be the value of `next_page_token` from the + * // previous response. The values of other method parameters must be identical + * // to those in the previous call. + * pageToken: 'placeholder-value', + * // Required. The container resource on which to execute the request. + * // Acceptable formats: + * // + * // 1. + * // "projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]", + * // + * // LOCATION here refers to GCP Locations: + * // https://cloud.google.com/about/locations/ + * parent: + * 'projects/my-project/locations/my-location/recommenders/my-recommender', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "recommendations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias recommender.projects.locations.recommenders.recommendations.list * @memberOf! () * @@ -1043,6 +1334,67 @@ export namespace recommender_v1beta1 { /** * recommender.projects.locations.recommenders.recommendations.markClaimed * @desc Marks the Recommendation State as Claimed. Users can use this method to indicate to the Recommender API that they are starting to apply the recommendation themselves. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationClaimed can be applied to recommendations in CLAIMED or ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/recommender.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 recommender = google.recommender('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 recommender.projects.locations.recommenders.recommendations.markClaimed( + * { + * // Required. Name of the recommendation. + * name: + * 'projects/my-project/locations/my-location/recommenders/my-recommender/recommendations/my-recommendation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "stateMetadata": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "additionalImpact": [], + * // "associatedInsights": [], + * // "content": {}, + * // "description": "my_description", + * // "etag": "my_etag", + * // "lastRefreshTime": "my_lastRefreshTime", + * // "name": "my_name", + * // "primaryImpact": {}, + * // "recommenderSubtype": "my_recommenderSubtype", + * // "stateInfo": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias recommender.projects.locations.recommenders.recommendations.markClaimed * @memberOf! () * @@ -1143,6 +1495,67 @@ export namespace recommender_v1beta1 { /** * recommender.projects.locations.recommenders.recommendations.markFailed * @desc Marks the Recommendation State as Failed. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation failed. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationFailed can be applied to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/recommender.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 recommender = google.recommender('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 recommender.projects.locations.recommenders.recommendations.markFailed( + * { + * // Required. Name of the recommendation. + * name: + * 'projects/my-project/locations/my-location/recommenders/my-recommender/recommendations/my-recommendation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "stateMetadata": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "additionalImpact": [], + * // "associatedInsights": [], + * // "content": {}, + * // "description": "my_description", + * // "etag": "my_etag", + * // "lastRefreshTime": "my_lastRefreshTime", + * // "name": "my_name", + * // "primaryImpact": {}, + * // "recommenderSubtype": "my_recommenderSubtype", + * // "stateInfo": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias recommender.projects.locations.recommenders.recommendations.markFailed * @memberOf! () * @@ -1243,6 +1656,67 @@ export namespace recommender_v1beta1 { /** * recommender.projects.locations.recommenders.recommendations.markSucceeded * @desc Marks the Recommendation State as Succeeded. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation was successful. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationSucceeded can be applied to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/recommender.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 recommender = google.recommender('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 recommender.projects.locations.recommenders.recommendations.markSucceeded( + * { + * // Required. Name of the recommendation. + * name: + * 'projects/my-project/locations/my-location/recommenders/my-recommender/recommendations/my-recommendation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "stateMetadata": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "additionalImpact": [], + * // "associatedInsights": [], + * // "content": {}, + * // "description": "my_description", + * // "etag": "my_etag", + * // "lastRefreshTime": "my_lastRefreshTime", + * // "name": "my_name", + * // "primaryImpact": {}, + * // "recommenderSubtype": "my_recommenderSubtype", + * // "stateInfo": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias recommender.projects.locations.recommenders.recommendations.markSucceeded * @memberOf! () * diff --git a/src/apis/redis/v1.ts b/src/apis/redis/v1.ts index 9bc9391806f..f0e40465cc0 100644 --- a/src/apis/redis/v1.ts +++ b/src/apis/redis/v1.ts @@ -453,6 +453,50 @@ export namespace redis_v1 { /** * redis.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.get * @memberOf! () * @@ -522,6 +566,53 @@ export namespace redis_v1 { /** * redis.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.list * @memberOf! () * @@ -645,6 +736,87 @@ export namespace redis_v1 { /** * redis.projects.locations.instances.create * @desc Creates a Redis instance based on the specified tier and memory size. By default, the instance is accessible from the project's [default network](/compute/docs/networks-and-firewalls#networks). The creation is executed asynchronously and callers may check the returned operation to track its progress. Once the operation is completed the Redis instance will be fully functional. Completed longrunning.Operation will contain the new instance object in the response field. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.instances.create({ + * // Required. The logical name of the Redis instance in the customer project + * // with the following restrictions: + * // + * // * Must contain only lowercase letters, numbers, and hyphens. + * // * Must start with a letter. + * // * Must be between 1-40 characters. + * // * Must end with a number or a letter. + * // * Must be unique within the customer project / location + * instanceId: 'placeholder-value', + * // Required. The resource name of the instance location using the form: + * // `projects/{project_id}/locations/{location_id}` + * // where `location_id` refers to a GCP region. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternativeLocationId": "my_alternativeLocationId", + * // "authorizedNetwork": "my_authorizedNetwork", + * // "connectMode": "my_connectMode", + * // "createTime": "my_createTime", + * // "currentLocationId": "my_currentLocationId", + * // "displayName": "my_displayName", + * // "host": "my_host", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "memorySizeGb": 0, + * // "name": "my_name", + * // "persistenceIamIdentity": "my_persistenceIamIdentity", + * // "port": 0, + * // "redisConfigs": {}, + * // "redisVersion": "my_redisVersion", + * // "reservedIpRange": "my_reservedIpRange", + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "tier": "my_tier" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.instances.create * @memberOf! () * @@ -721,6 +893,52 @@ export namespace redis_v1 { /** * redis.projects.locations.instances.delete * @desc Deletes a specific Redis instance. Instance stops serving and data is deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.instances.delete({ + * // Required. Redis instance resource name using the form: + * // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * // where `location_id` refers to a GCP region. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.instances.delete * @memberOf! () * @@ -792,6 +1010,60 @@ export namespace redis_v1 { /** * redis.projects.locations.instances.export * @desc Export Redis instance data into a Redis RDB format file in Cloud Storage. Redis will continue serving during this operation. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.instances.export({ + * // Required. Redis instance resource name using the form: + * // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * // where `location_id` refers to a GCP region. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "outputConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.instances.export * @memberOf! () * @@ -864,6 +1136,60 @@ export namespace redis_v1 { /** * redis.projects.locations.instances.failover * @desc Initiates a failover of the master node to current replica node for a specific STANDARD tier Cloud Memorystore for Redis instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.instances.failover({ + * // Required. Redis instance resource name using the form: + * // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * // where `location_id` refers to a GCP region. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dataProtectionMode": "my_dataProtectionMode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.instances.failover * @memberOf! () * @@ -939,6 +1265,66 @@ export namespace redis_v1 { /** * redis.projects.locations.instances.get * @desc Gets the details of a specific Redis instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.instances.get({ + * // Required. Redis instance resource name using the form: + * // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * // where `location_id` refers to a GCP region. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternativeLocationId": "my_alternativeLocationId", + * // "authorizedNetwork": "my_authorizedNetwork", + * // "connectMode": "my_connectMode", + * // "createTime": "my_createTime", + * // "currentLocationId": "my_currentLocationId", + * // "displayName": "my_displayName", + * // "host": "my_host", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "memorySizeGb": 0, + * // "name": "my_name", + * // "persistenceIamIdentity": "my_persistenceIamIdentity", + * // "port": 0, + * // "redisConfigs": {}, + * // "redisVersion": "my_redisVersion", + * // "reservedIpRange": "my_reservedIpRange", + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "tier": "my_tier" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.instances.get * @memberOf! () * @@ -1008,6 +1394,60 @@ export namespace redis_v1 { /** * redis.projects.locations.instances.import * @desc Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. Redis may stop serving during this operation. Instance state will be IMPORTING for entire operation. When complete, the instance will contain only data from the imported file. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.instances.import({ + * // Required. Redis instance resource name using the form: + * // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * // where `location_id` refers to a GCP region. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inputConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.instances.import * @memberOf! () * @@ -1080,6 +1520,61 @@ export namespace redis_v1 { /** * redis.projects.locations.instances.list * @desc Lists all Redis instances owned by a project in either the specified location (region) or all locations. The location should have the following format: * `projects/{project_id}/locations/{location_id}` If `location_id` is specified as `-` (wildcard), then all regions available to the project are queried, and the results are aggregated. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.instances.list({ + * // The maximum number of items to return. + * // + * // If not specified, a default value of 1000 will be used by the service. + * // Regardless of the page_size value, the response may include a partial list + * // and a caller should only rely on response's + * // `next_page_token` + * // to determine if there are more instances left to be queried. + * pageSize: 'placeholder-value', + * // The `next_page_token` value returned from a previous + * // ListInstances request, if any. + * pageToken: 'placeholder-value', + * // Required. The resource name of the instance location using the form: + * // `projects/{project_id}/locations/{location_id}` + * // where `location_id` refers to a GCP region. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "instances": [], + * // "nextPageToken": "my_nextPageToken", + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.instances.list * @memberOf! () * @@ -1158,6 +1653,93 @@ export namespace redis_v1 { /** * redis.projects.locations.instances.patch * @desc Updates the metadata and configuration of a specific Redis instance. Completed longrunning.Operation will contain the new instance object in the response field. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.instances.patch({ + * // Required. Unique name of the resource in this scope including project and + * // location using the form: + * // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * // + * // Note: Redis instances are managed and addressed at regional level so + * // location_id here refers to a GCP region; however, users may choose which + * // specific zone (or collection of zones for cross-zone instances) an instance + * // should be provisioned in. Refer to location_id and + * // alternative_location_id fields for more details. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * // Required. Mask of fields to update. At least one path must be supplied in + * // this field. The elements of the repeated paths field may only include these + * // fields from Instance: + * // + * // * `displayName` + * // * `labels` + * // * `memorySizeGb` + * // * `redisConfig` + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternativeLocationId": "my_alternativeLocationId", + * // "authorizedNetwork": "my_authorizedNetwork", + * // "connectMode": "my_connectMode", + * // "createTime": "my_createTime", + * // "currentLocationId": "my_currentLocationId", + * // "displayName": "my_displayName", + * // "host": "my_host", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "memorySizeGb": 0, + * // "name": "my_name", + * // "persistenceIamIdentity": "my_persistenceIamIdentity", + * // "port": 0, + * // "redisConfigs": {}, + * // "redisVersion": "my_redisVersion", + * // "reservedIpRange": "my_reservedIpRange", + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "tier": "my_tier" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.instances.patch * @memberOf! () * @@ -1231,6 +1813,60 @@ export namespace redis_v1 { /** * redis.projects.locations.instances.upgrade * @desc Upgrades Redis instance to the newer Redis version specified in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.instances.upgrade({ + * // Required. Redis instance resource name using the form: + * // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * // where `location_id` refers to a GCP region. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "redisVersion": "my_redisVersion" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.instances.upgrade * @memberOf! () * @@ -1468,6 +2104,44 @@ export namespace redis_v1 { /** * redis.projects.locations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.operations.cancel * @memberOf! () * @@ -1537,6 +2211,44 @@ export namespace redis_v1 { /** * redis.projects.locations.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.operations.delete * @memberOf! () * @@ -1606,6 +2318,50 @@ export namespace redis_v1 { /** * redis.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.operations.get * @memberOf! () * @@ -1677,6 +2433,53 @@ export namespace redis_v1 { /** * redis.projects.locations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.operations.list * @memberOf! () * diff --git a/src/apis/redis/v1beta1.ts b/src/apis/redis/v1beta1.ts index 705c9e438ea..c5e64186679 100644 --- a/src/apis/redis/v1beta1.ts +++ b/src/apis/redis/v1beta1.ts @@ -453,6 +453,50 @@ export namespace redis_v1beta1 { /** * redis.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.get * @memberOf! () * @@ -522,6 +566,53 @@ export namespace redis_v1beta1 { /** * redis.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.list * @memberOf! () * @@ -645,6 +736,87 @@ export namespace redis_v1beta1 { /** * redis.projects.locations.instances.create * @desc Creates a Redis instance based on the specified tier and memory size. By default, the instance is accessible from the project's [default network](/compute/docs/networks-and-firewalls#networks). The creation is executed asynchronously and callers may check the returned operation to track its progress. Once the operation is completed the Redis instance will be fully functional. Completed longrunning.Operation will contain the new instance object in the response field. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.instances.create({ + * // Required. The logical name of the Redis instance in the customer project + * // with the following restrictions: + * // + * // * Must contain only lowercase letters, numbers, and hyphens. + * // * Must start with a letter. + * // * Must be between 1-40 characters. + * // * Must end with a number or a letter. + * // * Must be unique within the customer project / location + * instanceId: 'placeholder-value', + * // Required. The resource name of the instance location using the form: + * // `projects/{project_id}/locations/{location_id}` + * // where `location_id` refers to a GCP region. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternativeLocationId": "my_alternativeLocationId", + * // "authorizedNetwork": "my_authorizedNetwork", + * // "connectMode": "my_connectMode", + * // "createTime": "my_createTime", + * // "currentLocationId": "my_currentLocationId", + * // "displayName": "my_displayName", + * // "host": "my_host", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "memorySizeGb": 0, + * // "name": "my_name", + * // "persistenceIamIdentity": "my_persistenceIamIdentity", + * // "port": 0, + * // "redisConfigs": {}, + * // "redisVersion": "my_redisVersion", + * // "reservedIpRange": "my_reservedIpRange", + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "tier": "my_tier" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.instances.create * @memberOf! () * @@ -721,6 +893,52 @@ export namespace redis_v1beta1 { /** * redis.projects.locations.instances.delete * @desc Deletes a specific Redis instance. Instance stops serving and data is deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.instances.delete({ + * // Required. Redis instance resource name using the form: + * // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * // where `location_id` refers to a GCP region. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.instances.delete * @memberOf! () * @@ -792,6 +1010,60 @@ export namespace redis_v1beta1 { /** * redis.projects.locations.instances.export * @desc Export Redis instance data into a Redis RDB format file in Cloud Storage. Redis will continue serving during this operation. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.instances.export({ + * // Required. Redis instance resource name using the form: + * // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * // where `location_id` refers to a GCP region. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "outputConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.instances.export * @memberOf! () * @@ -867,6 +1139,60 @@ export namespace redis_v1beta1 { /** * redis.projects.locations.instances.failover * @desc Initiates a failover of the master node to current replica node for a specific STANDARD tier Cloud Memorystore for Redis instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.instances.failover({ + * // Required. Redis instance resource name using the form: + * // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * // where `location_id` refers to a GCP region. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dataProtectionMode": "my_dataProtectionMode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.instances.failover * @memberOf! () * @@ -942,6 +1268,66 @@ export namespace redis_v1beta1 { /** * redis.projects.locations.instances.get * @desc Gets the details of a specific Redis instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.instances.get({ + * // Required. Redis instance resource name using the form: + * // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * // where `location_id` refers to a GCP region. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternativeLocationId": "my_alternativeLocationId", + * // "authorizedNetwork": "my_authorizedNetwork", + * // "connectMode": "my_connectMode", + * // "createTime": "my_createTime", + * // "currentLocationId": "my_currentLocationId", + * // "displayName": "my_displayName", + * // "host": "my_host", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "memorySizeGb": 0, + * // "name": "my_name", + * // "persistenceIamIdentity": "my_persistenceIamIdentity", + * // "port": 0, + * // "redisConfigs": {}, + * // "redisVersion": "my_redisVersion", + * // "reservedIpRange": "my_reservedIpRange", + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "tier": "my_tier" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.instances.get * @memberOf! () * @@ -1011,6 +1397,60 @@ export namespace redis_v1beta1 { /** * redis.projects.locations.instances.import * @desc Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. Redis may stop serving during this operation. Instance state will be IMPORTING for entire operation. When complete, the instance will contain only data from the imported file. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.instances.import({ + * // Required. Redis instance resource name using the form: + * // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * // where `location_id` refers to a GCP region. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inputConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.instances.import * @memberOf! () * @@ -1086,6 +1526,61 @@ export namespace redis_v1beta1 { /** * redis.projects.locations.instances.list * @desc Lists all Redis instances owned by a project in either the specified location (region) or all locations. The location should have the following format: * `projects/{project_id}/locations/{location_id}` If `location_id` is specified as `-` (wildcard), then all regions available to the project are queried, and the results are aggregated. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.instances.list({ + * // The maximum number of items to return. + * // + * // If not specified, a default value of 1000 will be used by the service. + * // Regardless of the page_size value, the response may include a partial list + * // and a caller should only rely on response's + * // `next_page_token` + * // to determine if there are more instances left to be queried. + * pageSize: 'placeholder-value', + * // The `next_page_token` value returned from a previous + * // ListInstances request, if any. + * pageToken: 'placeholder-value', + * // Required. The resource name of the instance location using the form: + * // `projects/{project_id}/locations/{location_id}` + * // where `location_id` refers to a GCP region. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "instances": [], + * // "nextPageToken": "my_nextPageToken", + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.instances.list * @memberOf! () * @@ -1164,6 +1659,93 @@ export namespace redis_v1beta1 { /** * redis.projects.locations.instances.patch * @desc Updates the metadata and configuration of a specific Redis instance. Completed longrunning.Operation will contain the new instance object in the response field. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.instances.patch({ + * // Required. Unique name of the resource in this scope including project and + * // location using the form: + * // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * // + * // Note: Redis instances are managed and addressed at regional level so + * // location_id here refers to a GCP region; however, users may choose which + * // specific zone (or collection of zones for cross-zone instances) an instance + * // should be provisioned in. Refer to location_id and + * // alternative_location_id fields for more details. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * // Required. Mask of fields to update. At least one path must be supplied in + * // this field. The elements of the repeated paths field may only include these + * // fields from Instance: + * // + * // * `displayName` + * // * `labels` + * // * `memorySizeGb` + * // * `redisConfig` + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternativeLocationId": "my_alternativeLocationId", + * // "authorizedNetwork": "my_authorizedNetwork", + * // "connectMode": "my_connectMode", + * // "createTime": "my_createTime", + * // "currentLocationId": "my_currentLocationId", + * // "displayName": "my_displayName", + * // "host": "my_host", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "memorySizeGb": 0, + * // "name": "my_name", + * // "persistenceIamIdentity": "my_persistenceIamIdentity", + * // "port": 0, + * // "redisConfigs": {}, + * // "redisVersion": "my_redisVersion", + * // "reservedIpRange": "my_reservedIpRange", + * // "state": "my_state", + * // "statusMessage": "my_statusMessage", + * // "tier": "my_tier" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.instances.patch * @memberOf! () * @@ -1237,6 +1819,60 @@ export namespace redis_v1beta1 { /** * redis.projects.locations.instances.upgrade * @desc Upgrades Redis instance to the newer Redis version specified in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.instances.upgrade({ + * // Required. Redis instance resource name using the form: + * // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * // where `location_id` refers to a GCP region. + * name: 'projects/my-project/locations/my-location/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "redisVersion": "my_redisVersion" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.instances.upgrade * @memberOf! () * @@ -1474,6 +2110,44 @@ export namespace redis_v1beta1 { /** * redis.projects.locations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.operations.cancel * @memberOf! () * @@ -1546,6 +2220,44 @@ export namespace redis_v1beta1 { /** * redis.projects.locations.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.operations.delete * @memberOf! () * @@ -1615,6 +2327,50 @@ export namespace redis_v1beta1 { /** * redis.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.operations.get * @memberOf! () * @@ -1686,6 +2442,53 @@ export namespace redis_v1beta1 { /** * redis.projects.locations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/redis.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 redis = google.redis('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 redis.projects.locations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias redis.projects.locations.operations.list * @memberOf! () * diff --git a/src/apis/remotebuildexecution/v1.ts b/src/apis/remotebuildexecution/v1.ts index 7c5643b90a3..d73d27cc7b3 100644 --- a/src/apis/remotebuildexecution/v1.ts +++ b/src/apis/remotebuildexecution/v1.ts @@ -1221,6 +1221,47 @@ export namespace remotebuildexecution_v1 { /** * remotebuildexecution.media.download * @desc Downloads media. Download is supported on the URI `/v1/media/{+name}?alt=media`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.media.download({ + * // Name of the media that is being downloaded. See + * // ReadRequest.resource_name. + * resourceName: '.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "resourceName": "my_resourceName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.media.download * @memberOf! () * @@ -1299,6 +1340,59 @@ export namespace remotebuildexecution_v1 { /** * remotebuildexecution.media.upload * @desc Uploads media. Upload is supported on the URI `/upload/v1/media/{+name}`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.media.upload({ + * // Name of the media that is being downloaded. See + * // ReadRequest.resource_name. + * resourceName: '.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resourceName": "my_resourceName" + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "resourceName": "my_resourceName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.media.upload * @memberOf! () * @@ -1433,6 +1527,50 @@ export namespace remotebuildexecution_v1 { /** * remotebuildexecution.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'operations/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.operations.cancel * @memberOf! () * @@ -1506,6 +1644,44 @@ export namespace remotebuildexecution_v1 { /** * remotebuildexecution.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'operations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.operations.delete * @memberOf! () * @@ -1578,6 +1754,53 @@ export namespace remotebuildexecution_v1 { /** * remotebuildexecution.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.operations.list * @memberOf! () * @@ -1738,6 +1961,50 @@ export namespace remotebuildexecution_v1 { /** * remotebuildexecution.projects.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.projects.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.projects.operations.get * @memberOf! () * diff --git a/src/apis/remotebuildexecution/v1alpha.ts b/src/apis/remotebuildexecution/v1alpha.ts index 8aef93a2008..ee0ab1a4ab0 100644 --- a/src/apis/remotebuildexecution/v1alpha.ts +++ b/src/apis/remotebuildexecution/v1alpha.ts @@ -1202,6 +1202,61 @@ export namespace remotebuildexecution_v1alpha { /** * remotebuildexecution.projects.instances.create * @desc Creates a new instance in the specified region. Returns a long running operation which contains an instance on completion. While the long running operation is in progress, any call to `GetInstance` returns an instance in state `CREATING`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.projects.instances.create({ + * // Resource name of the project containing the instance. + * // Format: `projects/[PROJECT_ID]`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instance": {}, + * // "instanceId": "my_instanceId", + * // "parent": "my_parent" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.projects.instances.create * @memberOf! () * @@ -1285,6 +1340,51 @@ export namespace remotebuildexecution_v1alpha { /** * remotebuildexecution.projects.instances.delete * @desc Deletes the specified instance. Returns a long running operation which contains a `google.protobuf.Empty` response on completion. Deleting an instance with worker pools in it will delete these worker pools. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.projects.instances.delete({ + * // Name of the instance to delete. + * // Format: `projects/[PROJECT_ID]/instances/[INSTANCE_ID]`. + * name: 'projects/my-project/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.projects.instances.delete * @memberOf! () * @@ -1364,6 +1464,50 @@ export namespace remotebuildexecution_v1alpha { /** * remotebuildexecution.projects.instances.get * @desc Returns the specified instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.projects.instances.get({ + * // Name of the instance to retrieve. + * // Format: `projects/[PROJECT_ID]/instances/[INSTANCE_ID]`. + * name: 'projects/my-project/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "location": "my_location", + * // "loggingEnabled": false, + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.projects.instances.get * @memberOf! () * @@ -1462,6 +1606,47 @@ export namespace remotebuildexecution_v1alpha { /** * remotebuildexecution.projects.instances.list * @desc Lists instances in a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.projects.instances.list({ + * // Resource name of the project. + * // Format: `projects/[PROJECT_ID]`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "instances": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.projects.instances.list * @memberOf! () * @@ -1624,6 +1809,61 @@ export namespace remotebuildexecution_v1alpha { /** * remotebuildexecution.projects.instances.workerpools.create * @desc Creates a new worker pool with a specified size and configuration. Returns a long running operation which contains a worker pool on completion. While the long running operation is in progress, any call to `GetWorkerPool` returns a worker pool in state `CREATING`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.projects.instances.workerpools.create({ + * // Resource name of the instance in which to create the new worker pool. + * // Format: `projects/[PROJECT_ID]/instances/[INSTANCE_ID]`. + * parent: 'projects/my-project/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "poolId": "my_poolId", + * // "workerPool": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.projects.instances.workerpools.create * @memberOf! () * @@ -1707,6 +1947,52 @@ export namespace remotebuildexecution_v1alpha { /** * remotebuildexecution.projects.instances.workerpools.delete * @desc Deletes the specified worker pool. Returns a long running operation, which contains a `google.protobuf.Empty` response on completion. While the long running operation is in progress, any call to `GetWorkerPool` returns a worker pool in state `DELETING`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.projects.instances.workerpools.delete({ + * // Name of the worker pool to delete. + * // Format: + * // `projects/[PROJECT_ID]/instances/[INSTANCE_ID]/workerpools/[POOL_ID]`. + * name: 'projects/my-project/instances/my-instance/workerpools/my-workerpool', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.projects.instances.workerpools.delete * @memberOf! () * @@ -1786,6 +2072,52 @@ export namespace remotebuildexecution_v1alpha { /** * remotebuildexecution.projects.instances.workerpools.get * @desc Returns the specified worker pool. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.projects.instances.workerpools.get({ + * // Name of the worker pool to retrieve. + * // Format: + * // `projects/[PROJECT_ID]/instances/[INSTANCE_ID]/workerpools/[POOL_ID]`. + * name: 'projects/my-project/instances/my-instance/workerpools/my-workerpool', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "autoscale": {}, + * // "name": "my_name", + * // "state": "my_state", + * // "workerConfig": {}, + * // "workerCount": "my_workerCount" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.projects.instances.workerpools.get * @memberOf! () * @@ -1884,6 +2216,73 @@ export namespace remotebuildexecution_v1alpha { /** * remotebuildexecution.projects.instances.workerpools.list * @desc Lists worker pools in an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.projects.instances.workerpools.list({ + * // Optional. A filter expression that filters resources listed in + * // the response. The expression must specify the field name, a comparison + * // operator, and the value that you want to use for filtering. The value + * // must be a string, a number, or a boolean. String values are + * // case-insensitive. + * // The comparison operator must be either `:`, `=`, `!=`, `>`, `>=`, `<=` or + * // `<`. + * // The `:` operator can be used with string fields to match substrings. + * // For non-string fields it is equivalent to the `=` operator. + * // The `:*` comparison can be used to test whether a key has been defined. + * // + * // You can also filter on nested fields. + * // + * // To filter on multiple expressions, you can separate expression using + * // `AND` and `OR` operators, using parentheses to specify precedence. If + * // neither operator is specified, `AND` is assumed. + * // + * // Examples: + * // + * // Include only pools with more than 100 reserved workers: + * // `(worker_count > 100) (worker_config.reserved = true)` + * // + * // Include only pools with a certain label or machines of the n1-standard + * // family: + * // `worker_config.labels.key1 : * OR worker_config.machine_type: n1-standard` + * filter: 'placeholder-value', + * // Resource name of the instance. + * // Format: `projects/[PROJECT_ID]/instances/[INSTANCE_ID]`. + * parent: 'projects/my-project/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "workerPools": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.projects.instances.workerpools.list * @memberOf! () * @@ -1986,6 +2385,62 @@ export namespace remotebuildexecution_v1alpha { /** * remotebuildexecution.projects.instances.workerpools.patch * @desc Updates an existing worker pool with a specified size and/or configuration. Returns a long running operation, which contains a worker pool on completion. While the long running operation is in progress, any call to `GetWorkerPool` returns a worker pool in state `UPDATING`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.projects.instances.workerpools.patch({ + * // WorkerPool resource name formatted as: + * // `projects/[PROJECT_ID]/instances/[INSTANCE_ID]/workerpools/[POOL_ID]`. + * // name should not be populated when creating a worker pool since it is + * // provided in the `poolId` field. + * name: 'projects/my-project/instances/my-instance/workerpools/my-workerpool', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "updateMask": "my_updateMask", + * // "workerPool": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.projects.instances.workerpools.patch * @memberOf! () * @@ -2148,6 +2603,50 @@ export namespace remotebuildexecution_v1alpha { /** * remotebuildexecution.projects.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.projects.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.projects.operations.get * @memberOf! () * diff --git a/src/apis/remotebuildexecution/v2.ts b/src/apis/remotebuildexecution/v2.ts index 93515696feb..5d680f77718 100644 --- a/src/apis/remotebuildexecution/v2.ts +++ b/src/apis/remotebuildexecution/v2.ts @@ -1459,6 +1459,75 @@ export namespace remotebuildexecution_v2 { /** * remotebuildexecution.actionResults.get * @desc Retrieve a cached execution result. Implementations SHOULD ensure that any blobs referenced from the ContentAddressableStorage are available at the time of returning the ActionResult and will be for some period of time afterwards. The TTLs of the referenced blobs SHOULD be increased if necessary and applicable. Errors: * `NOT_FOUND`: The requested `ActionResult` is not in the cache. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.actionResults.get({ + * // The hash. In the case of SHA-256, it will always be a lowercase hex string + * // exactly 64 characters long. + * hash: 'placeholder-value', + * // A hint to the server to inline the contents of the listed output files. + * // Each path needs to exactly match one path in `output_files` in the + * // Command message. + * inlineOutputFiles: 'placeholder-value', + * // A hint to the server to request inlining stderr in the + * // ActionResult message. + * inlineStderr: 'placeholder-value', + * // A hint to the server to request inlining stdout in the + * // ActionResult message. + * inlineStdout: 'placeholder-value', + * // The instance of the execution system to operate against. A server may + * // support multiple instances of the execution system (with their own workers, + * // storage, caches, etc.). The server MAY require use of this field to select + * // between them in an implementation-defined fashion, otherwise it can be + * // omitted. + * instanceName: '.*', + * // The size of the blob, in bytes. + * sizeBytes: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionMetadata": {}, + * // "exitCode": 0, + * // "outputDirectories": [], + * // "outputDirectorySymlinks": [], + * // "outputFileSymlinks": [], + * // "outputFiles": [], + * // "outputSymlinks": [], + * // "stderrDigest": {}, + * // "stderrRaw": "my_stderrRaw", + * // "stdoutDigest": {}, + * // "stdoutRaw": "my_stdoutRaw" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.actionResults.get * @memberOf! () * @@ -1555,6 +1624,92 @@ export namespace remotebuildexecution_v2 { /** * remotebuildexecution.actionResults.update * @desc Upload a new execution result. In order to allow the server to perform access control based on the type of action, and to assist with client debugging, the client MUST first upload the Action that produced the result, along with its Command, into the `ContentAddressableStorage`. Errors: * `INVALID_ARGUMENT`: One or more arguments are invalid. * `FAILED_PRECONDITION`: One or more errors occurred in updating the action result, such as a missing command or action. * `RESOURCE_EXHAUSTED`: There is insufficient storage space to add the entry to the cache. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.actionResults.update({ + * // The hash. In the case of SHA-256, it will always be a lowercase hex string + * // exactly 64 characters long. + * hash: 'placeholder-value', + * // The instance of the execution system to operate against. A server may + * // support multiple instances of the execution system (with their own workers, + * // storage, caches, etc.). The server MAY require use of this field to select + * // between them in an implementation-defined fashion, otherwise it can be + * // omitted. + * instanceName: '.*', + * // The priority (relative importance) of this content in the overall cache. + * // Generally, a lower value means a longer retention time or other advantage, + * // but the interpretation of a given value is server-dependent. A priority of + * // 0 means a *default* value, decided by the server. + * // + * // The particular semantics of this field is up to the server. In particular, + * // every server will have their own supported range of priorities, and will + * // decide how these map into retention/eviction policy. + * 'resultsCachePolicy.priority': 'placeholder-value', + * // The size of the blob, in bytes. + * sizeBytes: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "executionMetadata": {}, + * // "exitCode": 0, + * // "outputDirectories": [], + * // "outputDirectorySymlinks": [], + * // "outputFileSymlinks": [], + * // "outputFiles": [], + * // "outputSymlinks": [], + * // "stderrDigest": {}, + * // "stderrRaw": "my_stderrRaw", + * // "stdoutDigest": {}, + * // "stdoutRaw": "my_stdoutRaw" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executionMetadata": {}, + * // "exitCode": 0, + * // "outputDirectories": [], + * // "outputDirectorySymlinks": [], + * // "outputFileSymlinks": [], + * // "outputFiles": [], + * // "outputSymlinks": [], + * // "stderrDigest": {}, + * // "stderrRaw": "my_stderrRaw", + * // "stdoutDigest": {}, + * // "stdoutRaw": "my_stdoutRaw" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.actionResults.update * @memberOf! () * @@ -1719,6 +1874,65 @@ export namespace remotebuildexecution_v2 { /** * remotebuildexecution.actions.execute * @desc Execute an action remotely. In order to execute an action, the client must first upload all of the inputs, the Command to run, and the Action into the ContentAddressableStorage. It then calls `Execute` with an `action_digest` referring to them. The server will run the action and eventually return the result. The input `Action`'s fields MUST meet the various canonicalization requirements specified in the documentation for their types so that it has the same digest as other logically equivalent `Action`s. The server MAY enforce the requirements and return errors if a non-canonical input is received. It MAY also proceed without verifying some or all of the requirements, such as for performance reasons. If the server does not verify the requirement, then it will treat the `Action` as distinct from another logically equivalent action if they hash differently. Returns a stream of google.longrunning.Operation messages describing the resulting execution, with eventual `response` ExecuteResponse. The `metadata` on the operation is of type ExecuteOperationMetadata. If the client remains connected after the first response is returned after the server, then updates are streamed as if the client had called WaitExecution until the execution completes or the request reaches an error. The operation can also be queried using Operations API. The server NEED NOT implement other methods or functionality of the Operations API. Errors discovered during creation of the `Operation` will be reported as gRPC Status errors, while errors that occurred while running the action will be reported in the `status` field of the `ExecuteResponse`. The server MUST NOT set the `error` field of the `Operation` proto. The possible errors include: * `INVALID_ARGUMENT`: One or more arguments are invalid. * `FAILED_PRECONDITION`: One or more errors occurred in setting up the action requested, such as a missing input or command or no worker being available. The client may be able to fix the errors and retry. * `RESOURCE_EXHAUSTED`: There is insufficient quota of some resource to run the action. * `UNAVAILABLE`: Due to a transient condition, such as all workers being occupied (and the server does not support a queue), the action could not be started. The client should retry. * `INTERNAL`: An internal error occurred in the execution engine or the worker. * `DEADLINE_EXCEEDED`: The execution timed out. * `CANCELLED`: The operation was cancelled by the client. This status is only possible if the server implements the Operations API CancelOperation method, and it was called for the current execution. In the case of a missing input or command, the server SHOULD additionally send a PreconditionFailure error detail where, for each requested blob not present in the CAS, there is a `Violation` with a `type` of `MISSING` and a `subject` of `"blobs/{hash}/{size}"` indicating the digest of the missing blob. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.actions.execute({ + * // The instance of the execution system to operate against. A server may + * // support multiple instances of the execution system (with their own workers, + * // storage, caches, etc.). The server MAY require use of this field to select + * // between them in an implementation-defined fashion, otherwise it can be + * // omitted. + * instanceName: '.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "actionDigest": {}, + * // "executionPolicy": {}, + * // "resultsCachePolicy": {}, + * // "skipCacheLookup": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.actions.execute * @memberOf! () * @@ -1825,6 +2039,58 @@ export namespace remotebuildexecution_v2 { /** * remotebuildexecution.blobs.batchRead * @desc Download many blobs at once. The server may enforce a limit of the combined total size of blobs to be downloaded using this API. This limit may be obtained using the Capabilities API. Requests exceeding the limit should either be split into smaller chunks or downloaded using the ByteStream API, as appropriate. This request is equivalent to calling a Bytestream `Read` request on each individual blob, in parallel. The requests may succeed or fail independently. Errors: * `INVALID_ARGUMENT`: The client attempted to read more than the server supported limit. Every error on individual read will be returned in the corresponding digest status. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.blobs.batchRead({ + * // The instance of the execution system to operate against. A server may + * // support multiple instances of the execution system (with their own workers, + * // storage, caches, etc.). The server MAY require use of this field to select + * // between them in an implementation-defined fashion, otherwise it can be + * // omitted. + * instanceName: '.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "digests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.blobs.batchRead * @memberOf! () * @@ -1924,6 +2190,58 @@ export namespace remotebuildexecution_v2 { /** * remotebuildexecution.blobs.batchUpdate * @desc Upload many blobs at once. The server may enforce a limit of the combined total size of blobs to be uploaded using this API. This limit may be obtained using the Capabilities API. Requests exceeding the limit should either be split into smaller chunks or uploaded using the ByteStream API, as appropriate. This request is equivalent to calling a Bytestream `Write` request on each individual blob, in parallel. The requests may succeed or fail independently. Errors: * `INVALID_ARGUMENT`: The client attempted to upload more than the server supported limit. Individual requests may return the following errors, additionally: * `RESOURCE_EXHAUSTED`: There is insufficient disk quota to store the blob. * `INVALID_ARGUMENT`: The Digest does not match the provided data. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.blobs.batchUpdate({ + * // The instance of the execution system to operate against. A server may + * // support multiple instances of the execution system (with their own workers, + * // storage, caches, etc.). The server MAY require use of this field to select + * // between them in an implementation-defined fashion, otherwise it can be + * // omitted. + * instanceName: '.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.blobs.batchUpdate * @memberOf! () * @@ -2026,6 +2344,58 @@ export namespace remotebuildexecution_v2 { /** * remotebuildexecution.blobs.findMissing * @desc Determine if blobs are present in the CAS. Clients can use this API before uploading blobs to determine which ones are already present in the CAS and do not need to be uploaded again. Servers SHOULD increase the TTLs of the referenced blobs if necessary and applicable. There are no method-specific errors. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.blobs.findMissing({ + * // The instance of the execution system to operate against. A server may + * // support multiple instances of the execution system (with their own workers, + * // storage, caches, etc.). The server MAY require use of this field to select + * // between them in an implementation-defined fashion, otherwise it can be + * // omitted. + * instanceName: '.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "blobDigests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "missingBlobDigests": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.blobs.findMissing * @memberOf! () * @@ -2128,6 +2498,66 @@ export namespace remotebuildexecution_v2 { /** * remotebuildexecution.blobs.getTree * @desc Fetch the entire directory tree rooted at a node. This request must be targeted at a Directory stored in the ContentAddressableStorage (CAS). The server will enumerate the `Directory` tree recursively and return every node descended from the root. The GetTreeRequest.page_token parameter can be used to skip ahead in the stream (e.g. when retrying a partially completed and aborted request), by setting it to a value taken from GetTreeResponse.next_page_token of the last successfully processed GetTreeResponse). The exact traversal order is unspecified and, unless retrieving subsequent pages from an earlier request, is not guaranteed to be stable across multiple invocations of `GetTree`. If part of the tree is missing from the CAS, the server will return the portion present and omit the rest. Errors: * `NOT_FOUND`: The requested tree root is not present in the CAS. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.blobs.getTree({ + * // The hash. In the case of SHA-256, it will always be a lowercase hex string + * // exactly 64 characters long. + * hash: 'placeholder-value', + * // The instance of the execution system to operate against. A server may + * // support multiple instances of the execution system (with their own workers, + * // storage, caches, etc.). The server MAY require use of this field to select + * // between them in an implementation-defined fashion, otherwise it can be + * // omitted. + * instanceName: '.*', + * // A maximum page size to request. If present, the server will request no more + * // than this many items. Regardless of whether a page size is specified, the + * // server may place its own limit on the number of items to be returned and + * // require the client to retrieve more items using a subsequent request. + * pageSize: 'placeholder-value', + * // A page token, which must be a value received in a previous + * // GetTreeResponse. + * // If present, the server will use that token as an offset, returning only + * // that page and the ones that succeed it. + * pageToken: 'placeholder-value', + * // The size of the blob, in bytes. + * sizeBytes: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "directories": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.blobs.getTree * @memberOf! () * @@ -2313,6 +2743,57 @@ export namespace remotebuildexecution_v2 { /** * remotebuildexecution.operations.waitExecution * @desc Wait for an execution operation to complete. When the client initially makes the request, the server immediately responds with the current status of the execution. The server will leave the request stream open until the operation completes, and then respond with the completed operation. The server MAY choose to stream additional updates as execution progresses, such as to provide an update as to the state of the execution. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.operations.waitExecution({ + * // The name of the Operation + * // returned by Execute. + * name: 'operations/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.operations.waitExecution * @memberOf! () * @@ -2421,6 +2902,54 @@ export namespace remotebuildexecution_v2 { /** * remotebuildexecution.getCapabilities * @desc GetCapabilities returns the server capabilities configuration of the remote endpoint. Only the capabilities of the services supported by the endpoint will be returned: * Execution + CAS + Action Cache endpoints should return both CacheCapabilities and ExecutionCapabilities. * Execution only endpoints should return ExecutionCapabilities. * CAS + Action Cache only endpoints should return CacheCapabilities. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/remotebuildexecution.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 remotebuildexecution = google.remotebuildexecution('v2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 remotebuildexecution.getCapabilities({ + * // The instance of the execution system to operate against. A server may + * // support multiple instances of the execution system (with their own workers, + * // storage, caches, etc.). The server MAY require use of this field to select + * // between them in an implementation-defined fashion, otherwise it can be + * // omitted. + * instanceName: '.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cacheCapabilities": {}, + * // "deprecatedApiVersion": {}, + * // "executionCapabilities": {}, + * // "highApiVersion": {}, + * // "lowApiVersion": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias remotebuildexecution.getCapabilities * @memberOf! () * diff --git a/src/apis/reseller/v1.ts b/src/apis/reseller/v1.ts index 733680d1bb0..945ece6c7f7 100644 --- a/src/apis/reseller/v1.ts +++ b/src/apis/reseller/v1.ts @@ -375,6 +375,56 @@ export namespace reseller_v1 { /** * reseller.customers.get * @desc Get a customer account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/reseller.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 reseller = google.reseller('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/apps.order', + * 'https://www.googleapis.com/auth/apps.order.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 reseller.customers.get({ + * // Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * customerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateEmail": "my_alternateEmail", + * // "customerDomain": "my_customerDomain", + * // "customerDomainVerified": false, + * // "customerId": "my_customerId", + * // "kind": "my_kind", + * // "phoneNumber": "my_phoneNumber", + * // "postalAddress": {}, + * // "resourceUiUrl": "my_resourceUiUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reseller.customers.get * @memberOf! () * @@ -446,6 +496,68 @@ export namespace reseller_v1 { /** * reseller.customers.insert * @desc Order a new customer's account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/reseller.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 reseller = google.reseller('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/apps.order'], + * }); + * + * // 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 reseller.customers.insert({ + * // The customerAuthToken query string is required when creating a resold account that transfers a direct customer's subscription or transfers another reseller customer's subscription to your reseller management. This is a hexadecimal authentication token needed to complete the subscription transfer. For more information, see the administrator help center. + * customerAuthToken: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternateEmail": "my_alternateEmail", + * // "customerDomain": "my_customerDomain", + * // "customerDomainVerified": false, + * // "customerId": "my_customerId", + * // "kind": "my_kind", + * // "phoneNumber": "my_phoneNumber", + * // "postalAddress": {}, + * // "resourceUiUrl": "my_resourceUiUrl" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateEmail": "my_alternateEmail", + * // "customerDomain": "my_customerDomain", + * // "customerDomainVerified": false, + * // "customerId": "my_customerId", + * // "kind": "my_kind", + * // "phoneNumber": "my_phoneNumber", + * // "postalAddress": {}, + * // "resourceUiUrl": "my_resourceUiUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reseller.customers.insert * @memberOf! () * @@ -518,6 +630,68 @@ export namespace reseller_v1 { /** * reseller.customers.patch * @desc Update a customer account's settings. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/reseller.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 reseller = google.reseller('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/apps.order'], + * }); + * + * // 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 reseller.customers.patch({ + * // Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * customerId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternateEmail": "my_alternateEmail", + * // "customerDomain": "my_customerDomain", + * // "customerDomainVerified": false, + * // "customerId": "my_customerId", + * // "kind": "my_kind", + * // "phoneNumber": "my_phoneNumber", + * // "postalAddress": {}, + * // "resourceUiUrl": "my_resourceUiUrl" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateEmail": "my_alternateEmail", + * // "customerDomain": "my_customerDomain", + * // "customerDomainVerified": false, + * // "customerId": "my_customerId", + * // "kind": "my_kind", + * // "phoneNumber": "my_phoneNumber", + * // "postalAddress": {}, + * // "resourceUiUrl": "my_resourceUiUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reseller.customers.patch * @memberOf! () * @@ -590,6 +764,68 @@ export namespace reseller_v1 { /** * reseller.customers.update * @desc Update a customer account's settings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/reseller.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 reseller = google.reseller('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/apps.order'], + * }); + * + * // 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 reseller.customers.update({ + * // Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * customerId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "alternateEmail": "my_alternateEmail", + * // "customerDomain": "my_customerDomain", + * // "customerDomainVerified": false, + * // "customerId": "my_customerId", + * // "kind": "my_kind", + * // "phoneNumber": "my_phoneNumber", + * // "postalAddress": {}, + * // "resourceUiUrl": "my_resourceUiUrl" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternateEmail": "my_alternateEmail", + * // "customerDomain": "my_customerDomain", + * // "customerDomainVerified": false, + * // "customerId": "my_customerId", + * // "kind": "my_kind", + * // "phoneNumber": "my_phoneNumber", + * // "postalAddress": {}, + * // "resourceUiUrl": "my_resourceUiUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reseller.customers.update * @memberOf! () * @@ -729,6 +965,47 @@ export namespace reseller_v1 { /** * reseller.resellernotify.getwatchdetails * @desc Returns all the details of the watch corresponding to the reseller. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/reseller.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 reseller = google.reseller('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/apps.order', + * 'https://www.googleapis.com/auth/apps.order.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 reseller.resellernotify.getwatchdetails({}); + * console.log(res.data); + * + * // Example response + * // { + * // "serviceAccountEmailAddresses": [], + * // "topicName": "my_topicName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reseller.resellernotify.getwatchdetails * @memberOf! () * @@ -818,6 +1095,46 @@ export namespace reseller_v1 { /** * reseller.resellernotify.register * @desc Registers a Reseller for receiving notifications. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/reseller.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 reseller = google.reseller('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/apps.order'], + * }); + * + * // 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 reseller.resellernotify.register({ + * // The service account which will own the created Cloud-PubSub topic. + * serviceAccountEmailAddress: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "topicName": "my_topicName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reseller.resellernotify.register * @memberOf! () * @@ -895,6 +1212,46 @@ export namespace reseller_v1 { /** * reseller.resellernotify.unregister * @desc Unregisters a Reseller for receiving notifications. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/reseller.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 reseller = google.reseller('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/apps.order'], + * }); + * + * // 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 reseller.resellernotify.unregister({ + * // The service account which owns the Cloud-PubSub topic. + * serviceAccountEmailAddress: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "topicName": "my_topicName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reseller.resellernotify.unregister * @memberOf! () * @@ -1011,6 +1368,65 @@ export namespace reseller_v1 { /** * reseller.subscriptions.activate * @desc Activates a subscription previously suspended by the reseller + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/reseller.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 reseller = google.reseller('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/apps.order'], + * }); + * + * // 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 reseller.subscriptions.activate({ + * // Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * customerId: 'placeholder-value', + * // This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. + * subscriptionId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billingMethod": "my_billingMethod", + * // "creationTime": "my_creationTime", + * // "customerDomain": "my_customerDomain", + * // "customerId": "my_customerId", + * // "dealCode": "my_dealCode", + * // "kind": "my_kind", + * // "plan": {}, + * // "purchaseOrderId": "my_purchaseOrderId", + * // "renewalSettings": {}, + * // "resourceUiUrl": "my_resourceUiUrl", + * // "seats": {}, + * // "skuId": "my_skuId", + * // "skuName": "my_skuName", + * // "status": "my_status", + * // "subscriptionId": "my_subscriptionId", + * // "suspensionReasons": [], + * // "transferInfo": {}, + * // "trialSettings": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reseller.subscriptions.activate * @memberOf! () * @@ -1086,6 +1502,77 @@ export namespace reseller_v1 { /** * reseller.subscriptions.changePlan * @desc Update a subscription plan. Use this method to update a plan for a 30-day trial or a flexible plan subscription to an annual commitment plan with monthly or yearly payments. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/reseller.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 reseller = google.reseller('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/apps.order'], + * }); + * + * // 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 reseller.subscriptions.changePlan({ + * // Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * customerId: 'placeholder-value', + * // This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. + * subscriptionId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dealCode": "my_dealCode", + * // "kind": "my_kind", + * // "planName": "my_planName", + * // "purchaseOrderId": "my_purchaseOrderId", + * // "seats": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billingMethod": "my_billingMethod", + * // "creationTime": "my_creationTime", + * // "customerDomain": "my_customerDomain", + * // "customerId": "my_customerId", + * // "dealCode": "my_dealCode", + * // "kind": "my_kind", + * // "plan": {}, + * // "purchaseOrderId": "my_purchaseOrderId", + * // "renewalSettings": {}, + * // "resourceUiUrl": "my_resourceUiUrl", + * // "seats": {}, + * // "skuId": "my_skuId", + * // "skuName": "my_skuName", + * // "status": "my_status", + * // "subscriptionId": "my_subscriptionId", + * // "suspensionReasons": [], + * // "transferInfo": {}, + * // "trialSettings": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reseller.subscriptions.changePlan * @memberOf! () * @@ -1162,6 +1649,74 @@ export namespace reseller_v1 { /** * reseller.subscriptions.changeRenewalSettings * @desc Update a user license's renewal settings. This is applicable for accounts with annual commitment plans only. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/reseller.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 reseller = google.reseller('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/apps.order'], + * }); + * + * // 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 reseller.subscriptions.changeRenewalSettings({ + * // Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * customerId: 'placeholder-value', + * // This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. + * subscriptionId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "renewalType": "my_renewalType" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billingMethod": "my_billingMethod", + * // "creationTime": "my_creationTime", + * // "customerDomain": "my_customerDomain", + * // "customerId": "my_customerId", + * // "dealCode": "my_dealCode", + * // "kind": "my_kind", + * // "plan": {}, + * // "purchaseOrderId": "my_purchaseOrderId", + * // "renewalSettings": {}, + * // "resourceUiUrl": "my_resourceUiUrl", + * // "seats": {}, + * // "skuId": "my_skuId", + * // "skuName": "my_skuName", + * // "status": "my_status", + * // "subscriptionId": "my_subscriptionId", + * // "suspensionReasons": [], + * // "transferInfo": {}, + * // "trialSettings": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reseller.subscriptions.changeRenewalSettings * @memberOf! () * @@ -1240,6 +1795,76 @@ export namespace reseller_v1 { /** * reseller.subscriptions.changeSeats * @desc Update a subscription's user license settings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/reseller.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 reseller = google.reseller('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/apps.order'], + * }); + * + * // 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 reseller.subscriptions.changeSeats({ + * // Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * customerId: 'placeholder-value', + * // This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. + * subscriptionId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "kind": "my_kind", + * // "licensedNumberOfSeats": 0, + * // "maximumNumberOfSeats": 0, + * // "numberOfSeats": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billingMethod": "my_billingMethod", + * // "creationTime": "my_creationTime", + * // "customerDomain": "my_customerDomain", + * // "customerId": "my_customerId", + * // "dealCode": "my_dealCode", + * // "kind": "my_kind", + * // "plan": {}, + * // "purchaseOrderId": "my_purchaseOrderId", + * // "renewalSettings": {}, + * // "resourceUiUrl": "my_resourceUiUrl", + * // "seats": {}, + * // "skuId": "my_skuId", + * // "skuName": "my_skuName", + * // "status": "my_status", + * // "subscriptionId": "my_subscriptionId", + * // "suspensionReasons": [], + * // "transferInfo": {}, + * // "trialSettings": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reseller.subscriptions.changeSeats * @memberOf! () * @@ -1316,6 +1941,45 @@ export namespace reseller_v1 { /** * reseller.subscriptions.delete * @desc Cancel, suspend, or transfer a subscription to direct. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/reseller.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 reseller = google.reseller('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/apps.order'], + * }); + * + * // 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 reseller.subscriptions.delete({ + * // Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * customerId: 'placeholder-value', + * // The deletionType query string enables the cancellation, downgrade, or suspension of a subscription. + * deletionType: 'placeholder-value', + * // This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. + * subscriptionId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reseller.subscriptions.delete * @memberOf! () * @@ -1390,6 +2054,68 @@ export namespace reseller_v1 { /** * reseller.subscriptions.get * @desc Get a specific subscription. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/reseller.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 reseller = google.reseller('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/apps.order', + * 'https://www.googleapis.com/auth/apps.order.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 reseller.subscriptions.get({ + * // Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * customerId: 'placeholder-value', + * // This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. + * subscriptionId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billingMethod": "my_billingMethod", + * // "creationTime": "my_creationTime", + * // "customerDomain": "my_customerDomain", + * // "customerId": "my_customerId", + * // "dealCode": "my_dealCode", + * // "kind": "my_kind", + * // "plan": {}, + * // "purchaseOrderId": "my_purchaseOrderId", + * // "renewalSettings": {}, + * // "resourceUiUrl": "my_resourceUiUrl", + * // "seats": {}, + * // "skuId": "my_skuId", + * // "skuName": "my_skuName", + * // "status": "my_status", + * // "subscriptionId": "my_subscriptionId", + * // "suspensionReasons": [], + * // "transferInfo": {}, + * // "trialSettings": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reseller.subscriptions.get * @memberOf! () * @@ -1465,6 +2191,90 @@ export namespace reseller_v1 { /** * reseller.subscriptions.insert * @desc Create or transfer a subscription. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/reseller.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 reseller = google.reseller('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/apps.order'], + * }); + * + * // 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 reseller.subscriptions.insert({ + * // The customerAuthToken query string is required when creating a resold account that transfers a direct customer's subscription or transfers another reseller customer's subscription to your reseller management. This is a hexadecimal authentication token needed to complete the subscription transfer. For more information, see the administrator help center. + * customerAuthToken: 'placeholder-value', + * // Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * customerId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "billingMethod": "my_billingMethod", + * // "creationTime": "my_creationTime", + * // "customerDomain": "my_customerDomain", + * // "customerId": "my_customerId", + * // "dealCode": "my_dealCode", + * // "kind": "my_kind", + * // "plan": {}, + * // "purchaseOrderId": "my_purchaseOrderId", + * // "renewalSettings": {}, + * // "resourceUiUrl": "my_resourceUiUrl", + * // "seats": {}, + * // "skuId": "my_skuId", + * // "skuName": "my_skuName", + * // "status": "my_status", + * // "subscriptionId": "my_subscriptionId", + * // "suspensionReasons": [], + * // "transferInfo": {}, + * // "trialSettings": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billingMethod": "my_billingMethod", + * // "creationTime": "my_creationTime", + * // "customerDomain": "my_customerDomain", + * // "customerId": "my_customerId", + * // "dealCode": "my_dealCode", + * // "kind": "my_kind", + * // "plan": {}, + * // "purchaseOrderId": "my_purchaseOrderId", + * // "renewalSettings": {}, + * // "resourceUiUrl": "my_resourceUiUrl", + * // "seats": {}, + * // "skuId": "my_skuId", + * // "skuName": "my_skuName", + * // "status": "my_status", + * // "subscriptionId": "my_subscriptionId", + * // "suspensionReasons": [], + * // "transferInfo": {}, + * // "trialSettings": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reseller.subscriptions.insert * @memberOf! () * @@ -1540,6 +2350,61 @@ export namespace reseller_v1 { /** * reseller.subscriptions.list * @desc List of subscriptions managed by the reseller. The list can be all subscriptions, all of a customer's subscriptions, or all of a customer's transferable subscriptions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/reseller.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 reseller = google.reseller('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/apps.order', + * 'https://www.googleapis.com/auth/apps.order.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 reseller.subscriptions.list({ + * // The customerAuthToken query string is required when creating a resold account that transfers a direct customer's subscription or transfers another reseller customer's subscription to your reseller management. This is a hexadecimal authentication token needed to complete the subscription transfer. For more information, see the administrator help center. + * customerAuthToken: 'placeholder-value', + * // Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * customerId: 'placeholder-value', + * // When retrieving all of your subscriptions and filtering for specific customers, you can enter a prefix for a customer name. Using an example customer group that includes exam.com, example20.com and example.com: + * // - exa -- Returns all customer names that start with 'exa' which could include exam.com, example20.com, and example.com. A name prefix is similar to using a regular expression's asterisk, exa*. + * // - example -- Returns example20.com and example.com. + * customerNamePrefix: 'placeholder-value', + * // When retrieving a large list, the maxResults is the maximum number of results per page. The nextPageToken value takes you to the next page. The default is 20. + * maxResults: 'placeholder-value', + * // Token to specify next page in the list + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "subscriptions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reseller.subscriptions.list * @memberOf! () * @@ -1618,6 +2483,65 @@ export namespace reseller_v1 { /** * reseller.subscriptions.startPaidService * @desc Immediately move a 30-day free trial subscription to a paid service subscription. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/reseller.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 reseller = google.reseller('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/apps.order'], + * }); + * + * // 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 reseller.subscriptions.startPaidService({ + * // Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * customerId: 'placeholder-value', + * // This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. + * subscriptionId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billingMethod": "my_billingMethod", + * // "creationTime": "my_creationTime", + * // "customerDomain": "my_customerDomain", + * // "customerId": "my_customerId", + * // "dealCode": "my_dealCode", + * // "kind": "my_kind", + * // "plan": {}, + * // "purchaseOrderId": "my_purchaseOrderId", + * // "renewalSettings": {}, + * // "resourceUiUrl": "my_resourceUiUrl", + * // "seats": {}, + * // "skuId": "my_skuId", + * // "skuName": "my_skuName", + * // "status": "my_status", + * // "subscriptionId": "my_subscriptionId", + * // "suspensionReasons": [], + * // "transferInfo": {}, + * // "trialSettings": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reseller.subscriptions.startPaidService * @memberOf! () * @@ -1693,6 +2617,65 @@ export namespace reseller_v1 { /** * reseller.subscriptions.suspend * @desc Suspends an active subscription. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/reseller.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 reseller = google.reseller('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/apps.order'], + * }); + * + * // 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 reseller.subscriptions.suspend({ + * // Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * customerId: 'placeholder-value', + * // This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. + * subscriptionId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "billingMethod": "my_billingMethod", + * // "creationTime": "my_creationTime", + * // "customerDomain": "my_customerDomain", + * // "customerId": "my_customerId", + * // "dealCode": "my_dealCode", + * // "kind": "my_kind", + * // "plan": {}, + * // "purchaseOrderId": "my_purchaseOrderId", + * // "renewalSettings": {}, + * // "resourceUiUrl": "my_resourceUiUrl", + * // "seats": {}, + * // "skuId": "my_skuId", + * // "skuName": "my_skuName", + * // "status": "my_status", + * // "subscriptionId": "my_subscriptionId", + * // "suspensionReasons": [], + * // "transferInfo": {}, + * // "trialSettings": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias reseller.subscriptions.suspend * @memberOf! () * diff --git a/src/apis/run/v1.ts b/src/apis/run/v1.ts index aefb2635976..14cfbf492ce 100644 --- a/src/apis/run/v1.ts +++ b/src/apis/run/v1.ts @@ -1552,6 +1552,49 @@ export namespace run_v1 { /** * run.api.v1.namespaces.get * @desc Rpc to get information about a namespace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.api.v1.namespaces.get({ + * // Required. The name of the namespace being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'namespaces/my-namespace', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.api.v1.namespaces.get * @memberOf! () * @@ -1623,6 +1666,62 @@ export namespace run_v1 { /** * run.api.v1.namespaces.patch * @desc Rpc to update a namespace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.api.v1.namespaces.patch({ + * // Required. The name of the namespace being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'namespaces/my-namespace', + * // Required. Indicates which fields in the provided namespace to update. + * // This field is currently unused. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.api.v1.namespaces.patch * @memberOf! () * @@ -1737,6 +1836,61 @@ export namespace run_v1 { /** * run.api.v1.namespaces.secrets.create * @desc Creates a new secret. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.api.v1.namespaces.secrets.create({ + * // Required. The project ID or project number in which this secret should + * // be created. + * parent: 'namespaces/my-namespace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "data": {}, + * // "metadata": {}, + * // "stringData": {}, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "data": {}, + * // "metadata": {}, + * // "stringData": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.api.v1.namespaces.secrets.create * @memberOf! () * @@ -1810,6 +1964,50 @@ export namespace run_v1 { /** * run.api.v1.namespaces.secrets.get * @desc Rpc to get information about a secret. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.api.v1.namespaces.secrets.get({ + * // Required. The name of the secret being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'namespaces/my-namespace/secrets/my-secret', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "data": {}, + * // "metadata": {}, + * // "stringData": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.api.v1.namespaces.secrets.get * @memberOf! () * @@ -1879,6 +2077,61 @@ export namespace run_v1 { /** * run.api.v1.namespaces.secrets.replaceSecret * @desc Rpc to replace a secret. Only the spec and metadata labels and annotations are modifiable. After the Update request, Cloud Run will work to make the 'status' match the requested 'spec'. May provide metadata.resourceVersion to enforce update from last read for optimistic concurrency control. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.api.v1.namespaces.secrets.replaceSecret({ + * // Required. The name of the secret being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'namespaces/my-namespace/secrets/my-secret', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "data": {}, + * // "metadata": {}, + * // "stringData": {}, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "data": {}, + * // "metadata": {}, + * // "stringData": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.api.v1.namespaces.secrets.replaceSecret * @memberOf! () * @@ -2028,6 +2281,51 @@ export namespace run_v1 { /** * run.namespaces.authorizeddomains.list * @desc List authorized domains. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.namespaces.authorizeddomains.list({ + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // Name of the parent Application resource. Example: `apps/myapp`. + * parent: 'namespaces/my-namespace', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domains": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.authorizeddomains.list * @memberOf! () * @@ -2141,6 +2439,52 @@ export namespace run_v1 { /** * run.namespaces.configurations.get * @desc Get information about a configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.namespaces.configurations.get({ + * // The name of the configuration to retrieve. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * name: 'namespaces/my-namespace/configurations/my-configuration', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.configurations.get * @memberOf! () * @@ -2215,6 +2559,71 @@ export namespace run_v1 { /** * run.namespaces.configurations.list * @desc List configurations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.namespaces.configurations.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The namespace from which the configurations should be listed. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * parent: 'namespaces/my-namespace', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.configurations.list * @memberOf! () * @@ -2362,6 +2771,64 @@ export namespace run_v1 { /** * run.namespaces.domainmappings.create * @desc Create a new domain mapping. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.namespaces.domainmappings.create({ + * // The namespace in which the domain mapping should be created. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * parent: 'namespaces/my-namespace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.domainmappings.create * @memberOf! () * @@ -2436,6 +2903,62 @@ export namespace run_v1 { /** * run.namespaces.domainmappings.delete * @desc Delete a domain mapping. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.namespaces.domainmappings.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // The name of the domain mapping to delete. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * name: 'namespaces/my-namespace/domainmappings/my-domainmapping', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": 0, + * // "details": {}, + * // "message": "my_message", + * // "metadata": {}, + * // "reason": "my_reason", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.domainmappings.delete * @memberOf! () * @@ -2511,6 +3034,52 @@ export namespace run_v1 { /** * run.namespaces.domainmappings.get * @desc Get information about a domain mapping. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.namespaces.domainmappings.get({ + * // The name of the domain mapping to retrieve. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * name: 'namespaces/my-namespace/domainmappings/my-domainmapping', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.domainmappings.get * @memberOf! () * @@ -2585,6 +3154,71 @@ export namespace run_v1 { /** * run.namespaces.domainmappings.list * @desc List domain mappings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.namespaces.domainmappings.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The namespace from which the domain mappings should be listed. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * parent: 'namespaces/my-namespace', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.domainmappings.list * @memberOf! () * @@ -2773,6 +3407,62 @@ export namespace run_v1 { /** * run.namespaces.revisions.delete * @desc Delete a revision. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.namespaces.revisions.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // The name of the revision to delete. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * name: 'namespaces/my-namespace/revisions/my-revision', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": 0, + * // "details": {}, + * // "message": "my_message", + * // "metadata": {}, + * // "reason": "my_reason", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.revisions.delete * @memberOf! () * @@ -2848,6 +3538,52 @@ export namespace run_v1 { /** * run.namespaces.revisions.get * @desc Get information about a revision. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.namespaces.revisions.get({ + * // The name of the revision to retrieve. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * name: 'namespaces/my-namespace/revisions/my-revision', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.revisions.get * @memberOf! () * @@ -2920,6 +3656,71 @@ export namespace run_v1 { /** * run.namespaces.revisions.list * @desc List revisions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.namespaces.revisions.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The namespace from which the revisions should be listed. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * parent: 'namespaces/my-namespace', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.revisions.list * @memberOf! () * @@ -3086,6 +3887,52 @@ export namespace run_v1 { /** * run.namespaces.routes.get * @desc Get information about a route. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.namespaces.routes.get({ + * // The name of the route to retrieve. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * name: 'namespaces/my-namespace/routes/my-route', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.routes.get * @memberOf! () * @@ -3158,6 +4005,71 @@ export namespace run_v1 { /** * run.namespaces.routes.list * @desc List routes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.namespaces.routes.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The namespace from which the routes should be listed. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * parent: 'namespaces/my-namespace', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.routes.list * @memberOf! () * @@ -3298,6 +4210,64 @@ export namespace run_v1 { /** * run.namespaces.services.create * @desc Create a service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.namespaces.services.create({ + * // The namespace in which the service should be created. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * parent: 'namespaces/my-namespace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.services.create * @memberOf! () * @@ -3370,6 +4340,62 @@ export namespace run_v1 { /** * run.namespaces.services.delete * @desc Delete a service. This will cause the Service to stop serving traffic and will delete the child entities like Routes, Configurations and Revisions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.namespaces.services.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // The name of the service to delete. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * name: 'namespaces/my-namespace/services/my-service', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": 0, + * // "details": {}, + * // "message": "my_message", + * // "metadata": {}, + * // "reason": "my_reason", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.services.delete * @memberOf! () * @@ -3445,6 +4471,52 @@ export namespace run_v1 { /** * run.namespaces.services.get * @desc Get information about a service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.namespaces.services.get({ + * // The name of the service to retrieve. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * name: 'namespaces/my-namespace/services/my-service', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.services.get * @memberOf! () * @@ -3517,6 +4589,71 @@ export namespace run_v1 { /** * run.namespaces.services.list * @desc List services. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.namespaces.services.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The namespace from which the services should be listed. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * parent: 'namespaces/my-namespace', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.services.list * @memberOf! () * @@ -3599,6 +4736,64 @@ export namespace run_v1 { /** * run.namespaces.services.replaceService * @desc Replace a service. Only the spec and metadata labels and annotations are modifiable. After the Update request, Cloud Run will work to make the 'status' match the requested 'spec'. May provide metadata.resourceVersion to enforce update from last read for optimistic concurrency control. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.namespaces.services.replaceService({ + * // The name of the service being replaced. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * name: 'namespaces/my-namespace/services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.services.replaceService * @memberOf! () * @@ -3823,6 +5018,53 @@ export namespace run_v1 { /** * run.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.list * @memberOf! () * @@ -3934,6 +5176,51 @@ export namespace run_v1 { /** * run.projects.locations.authorizeddomains.list * @desc List authorized domains. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.authorizeddomains.list({ + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // Name of the parent Application resource. Example: `apps/myapp`. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domains": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.authorizeddomains.list * @memberOf! () * @@ -4047,6 +5334,53 @@ export namespace run_v1 { /** * run.projects.locations.configurations.get * @desc Get information about a configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.configurations.get({ + * // The name of the configuration to retrieve. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * name: + * 'projects/my-project/locations/my-location/configurations/my-configuration', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.configurations.get * @memberOf! () * @@ -4118,6 +5452,71 @@ export namespace run_v1 { /** * run.projects.locations.configurations.list * @desc List configurations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.configurations.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The namespace from which the configurations should be listed. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * parent: 'projects/my-project/locations/my-location', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.configurations.list * @memberOf! () * @@ -4266,6 +5665,64 @@ export namespace run_v1 { /** * run.projects.locations.domainmappings.create * @desc Create a new domain mapping. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.domainmappings.create({ + * // The namespace in which the domain mapping should be created. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.domainmappings.create * @memberOf! () * @@ -4341,6 +5798,63 @@ export namespace run_v1 { /** * run.projects.locations.domainmappings.delete * @desc Delete a domain mapping. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.domainmappings.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // The name of the domain mapping to delete. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * name: + * 'projects/my-project/locations/my-location/domainmappings/my-domainmapping', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": 0, + * // "details": {}, + * // "message": "my_message", + * // "metadata": {}, + * // "reason": "my_reason", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.domainmappings.delete * @memberOf! () * @@ -4413,6 +5927,53 @@ export namespace run_v1 { /** * run.projects.locations.domainmappings.get * @desc Get information about a domain mapping. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.domainmappings.get({ + * // The name of the domain mapping to retrieve. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * name: + * 'projects/my-project/locations/my-location/domainmappings/my-domainmapping', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.domainmappings.get * @memberOf! () * @@ -4484,6 +6045,71 @@ export namespace run_v1 { /** * run.projects.locations.domainmappings.list * @desc List domain mappings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.domainmappings.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The namespace from which the domain mappings should be listed. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * parent: 'projects/my-project/locations/my-location', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.domainmappings.list * @memberOf! () * @@ -4673,6 +6299,49 @@ export namespace run_v1 { /** * run.projects.locations.namespaces.get * @desc Rpc to get information about a namespace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.namespaces.get({ + * // Required. The name of the namespace being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'projects/my-project/locations/my-location/namespaces/my-namespace', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.namespaces.get * @memberOf! () * @@ -4744,6 +6413,62 @@ export namespace run_v1 { /** * run.projects.locations.namespaces.patch * @desc Rpc to update a namespace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.namespaces.patch({ + * // Required. The name of the namespace being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'projects/my-project/locations/my-location/namespaces/my-namespace', + * // Required. Indicates which fields in the provided namespace to update. + * // This field is currently unused. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.namespaces.patch * @memberOf! () * @@ -4858,6 +6583,62 @@ export namespace run_v1 { /** * run.projects.locations.revisions.delete * @desc Delete a revision. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.revisions.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // The name of the revision to delete. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * name: 'projects/my-project/locations/my-location/revisions/my-revision', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": 0, + * // "details": {}, + * // "message": "my_message", + * // "metadata": {}, + * // "reason": "my_reason", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.revisions.delete * @memberOf! () * @@ -4930,6 +6711,52 @@ export namespace run_v1 { /** * run.projects.locations.revisions.get * @desc Get information about a revision. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.revisions.get({ + * // The name of the revision to retrieve. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * name: 'projects/my-project/locations/my-location/revisions/my-revision', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.revisions.get * @memberOf! () * @@ -4999,6 +6826,71 @@ export namespace run_v1 { /** * run.projects.locations.revisions.list * @desc List revisions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.revisions.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The namespace from which the revisions should be listed. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * parent: 'projects/my-project/locations/my-location', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.revisions.list * @memberOf! () * @@ -5166,6 +7058,52 @@ export namespace run_v1 { /** * run.projects.locations.routes.get * @desc Get information about a route. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.routes.get({ + * // The name of the route to retrieve. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * name: 'projects/my-project/locations/my-location/routes/my-route', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.routes.get * @memberOf! () * @@ -5235,6 +7173,71 @@ export namespace run_v1 { /** * run.projects.locations.routes.list * @desc List routes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.routes.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The namespace from which the routes should be listed. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * parent: 'projects/my-project/locations/my-location', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.routes.list * @memberOf! () * @@ -5376,6 +7379,61 @@ export namespace run_v1 { /** * run.projects.locations.secrets.create * @desc Creates a new secret. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.secrets.create({ + * // Required. The project ID or project number in which this secret should + * // be created. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "data": {}, + * // "metadata": {}, + * // "stringData": {}, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "data": {}, + * // "metadata": {}, + * // "stringData": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.secrets.create * @memberOf! () * @@ -5449,6 +7507,50 @@ export namespace run_v1 { /** * run.projects.locations.secrets.get * @desc Rpc to get information about a secret. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.secrets.get({ + * // Required. The name of the secret being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'projects/my-project/locations/my-location/secrets/my-secret', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "data": {}, + * // "metadata": {}, + * // "stringData": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.secrets.get * @memberOf! () * @@ -5518,6 +7620,61 @@ export namespace run_v1 { /** * run.projects.locations.secrets.replaceSecret * @desc Rpc to replace a secret. Only the spec and metadata labels and annotations are modifiable. After the Update request, Cloud Run will work to make the 'status' match the requested 'spec'. May provide metadata.resourceVersion to enforce update from last read for optimistic concurrency control. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.secrets.replaceSecret({ + * // Required. The name of the secret being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'projects/my-project/locations/my-location/secrets/my-secret', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "data": {}, + * // "metadata": {}, + * // "stringData": {}, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "data": {}, + * // "metadata": {}, + * // "stringData": {}, + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.secrets.replaceSecret * @memberOf! () * @@ -5642,6 +7799,64 @@ export namespace run_v1 { /** * run.projects.locations.services.create * @desc Create a service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.services.create({ + * // The namespace in which the service should be created. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.services.create * @memberOf! () * @@ -5715,6 +7930,62 @@ export namespace run_v1 { /** * run.projects.locations.services.delete * @desc Delete a service. This will cause the Service to stop serving traffic and will delete the child entities like Routes, Configurations and Revisions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.services.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // The name of the service to delete. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * name: 'projects/my-project/locations/my-location/services/my-service', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "code": 0, + * // "details": {}, + * // "message": "my_message", + * // "metadata": {}, + * // "reason": "my_reason", + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.services.delete * @memberOf! () * @@ -5787,6 +8058,52 @@ export namespace run_v1 { /** * run.projects.locations.services.get * @desc Get information about a service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.services.get({ + * // The name of the service to retrieve. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * name: 'projects/my-project/locations/my-location/services/my-service', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.services.get * @memberOf! () * @@ -5856,6 +8173,59 @@ export namespace run_v1 { /** * run.projects.locations.services.getIamPolicy * @desc Get the IAM Access Control policy currently in effect for the given Cloud Run service. This result does not include any inherited policies. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.services.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/my-location/services/my-service', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.services.getIamPolicy * @memberOf! () * @@ -5929,6 +8299,71 @@ export namespace run_v1 { /** * run.projects.locations.services.list * @desc List services. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.services.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The namespace from which the services should be listed. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * parent: 'projects/my-project/locations/my-location', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.services.list * @memberOf! () * @@ -6012,6 +8447,64 @@ export namespace run_v1 { /** * run.projects.locations.services.replaceService * @desc Replace a service. Only the spec and metadata labels and annotations are modifiable. After the Update request, Cloud Run will work to make the 'status' match the requested 'spec'. May provide metadata.resourceVersion to enforce update from last read for optimistic concurrency control. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.services.replaceService({ + * // The name of the service being replaced. + * // For Cloud Run (fully managed), replace {namespace_id} with the project ID + * // or number. + * name: 'projects/my-project/locations/my-location/services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.services.replaceService * @memberOf! () * @@ -6082,6 +8575,59 @@ export namespace run_v1 { /** * run.projects.locations.services.setIamPolicy * @desc Sets the IAM Access control policy for the specified Service. Overwrites any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.services.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/my-location/services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.services.setIamPolicy * @memberOf! () * @@ -6155,6 +8701,55 @@ export namespace run_v1 { /** * run.projects.locations.services.testIamPermissions * @desc Returns permissions that a caller has on the specified Project. There are no permissions required for making this API call. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.services.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/my-location/services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.services.testIamPermissions * @memberOf! () * diff --git a/src/apis/run/v1alpha1.ts b/src/apis/run/v1alpha1.ts index 20c8f9d1d80..7fb3db8715a 100644 --- a/src/apis/run/v1alpha1.ts +++ b/src/apis/run/v1alpha1.ts @@ -2431,6 +2431,51 @@ export namespace run_v1alpha1 { /** * run.namespaces.authorizeddomains.list * @desc RPC to list authorized domains. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.authorizeddomains.list({ + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // Name of the parent Application resource. Example: `apps/myapp`. + * parent: 'namespaces/my-namespace', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domains": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.authorizeddomains.list * @memberOf! () * @@ -2544,6 +2589,63 @@ export namespace run_v1alpha1 { /** * run.namespaces.cloudauditlogssources.create * @desc Creates a new cloudauditlogssource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.cloudauditlogssources.create({ + * // The project ID or project number in which this cloudauditlogssource should + * // be created. + * parent: 'namespaces/my-namespace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.cloudauditlogssources.create * @memberOf! () * @@ -2621,6 +2723,55 @@ export namespace run_v1alpha1 { /** * run.namespaces.cloudauditlogssources.delete * @desc Rpc to delete a cloudauditlogssource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.cloudauditlogssources.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // The name of the cloudauditlogssource being deleted. If needed, replace + * // {namespace_id} with the project ID. + * name: + * 'namespaces/my-namespace/cloudauditlogssources/my-cloudauditlogssource', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.cloudauditlogssources.delete * @memberOf! () * @@ -2695,6 +2846,52 @@ export namespace run_v1alpha1 { /** * run.namespaces.cloudauditlogssources.get * @desc Rpc to get information about a cloudauditlogssource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.cloudauditlogssources.get({ + * // The name of the cloudauditlogssource being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: + * 'namespaces/my-namespace/cloudauditlogssources/my-cloudauditlogssource', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.cloudauditlogssources.get * @memberOf! () * @@ -2770,6 +2967,70 @@ export namespace run_v1alpha1 { /** * run.namespaces.cloudauditlogssources.list * @desc Rpc to list cloudauditlogssources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.cloudauditlogssources.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The project ID or project number from which the cloudauditlogssources + * // should be listed. + * parent: 'namespaces/my-namespace', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.cloudauditlogssources.list * @memberOf! () * @@ -2961,6 +3222,63 @@ export namespace run_v1alpha1 { /** * run.namespaces.cloudpubsubsources.create * @desc Creates a new cloudpubsubsource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.cloudpubsubsources.create({ + * // The project ID or project number in which this cloudpubsubsource should + * // be created. + * parent: 'namespaces/my-namespace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.cloudpubsubsources.create * @memberOf! () * @@ -3036,6 +3354,54 @@ export namespace run_v1alpha1 { /** * run.namespaces.cloudpubsubsources.delete * @desc Rpc to delete a cloudpubsubsource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.cloudpubsubsources.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // The name of the cloudpubsubsource being deleted. If needed, replace + * // {namespace_id} with the project ID. + * name: 'namespaces/my-namespace/cloudpubsubsources/my-cloudpubsubsource', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.cloudpubsubsources.delete * @memberOf! () * @@ -3110,6 +3476,51 @@ export namespace run_v1alpha1 { /** * run.namespaces.cloudpubsubsources.get * @desc Rpc to get information about a cloudpubsubsource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.cloudpubsubsources.get({ + * // The name of the cloudpubsubsource being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'namespaces/my-namespace/cloudpubsubsources/my-cloudpubsubsource', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.cloudpubsubsources.get * @memberOf! () * @@ -3183,6 +3594,70 @@ export namespace run_v1alpha1 { /** * run.namespaces.cloudpubsubsources.list * @desc Rpc to list cloudpubsubsources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.cloudpubsubsources.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The project ID or project number from which the cloudpubsubsources should + * // be listed. + * parent: 'namespaces/my-namespace', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.cloudpubsubsources.list * @memberOf! () * @@ -3374,6 +3849,63 @@ export namespace run_v1alpha1 { /** * run.namespaces.cloudschedulersources.create * @desc Creates a new cloudschedulersource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.cloudschedulersources.create({ + * // Required. The project ID or project number in which this cloudschedulersource should + * // be created. + * parent: 'namespaces/my-namespace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.cloudschedulersources.create * @memberOf! () * @@ -3451,6 +3983,55 @@ export namespace run_v1alpha1 { /** * run.namespaces.cloudschedulersources.delete * @desc Rpc to delete a cloudschedulersource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.cloudschedulersources.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // Required. The name of the cloudschedulersource being deleted. If needed, replace + * // {namespace_id} with the project ID. + * name: + * 'namespaces/my-namespace/cloudschedulersources/my-cloudschedulersource', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.cloudschedulersources.delete * @memberOf! () * @@ -3525,6 +4106,52 @@ export namespace run_v1alpha1 { /** * run.namespaces.cloudschedulersources.get * @desc Rpc to get information about a cloudschedulersource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.cloudschedulersources.get({ + * // Required. The name of the cloudschedulersource being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: + * 'namespaces/my-namespace/cloudschedulersources/my-cloudschedulersource', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.cloudschedulersources.get * @memberOf! () * @@ -3600,6 +4227,70 @@ export namespace run_v1alpha1 { /** * run.namespaces.cloudschedulersources.list * @desc Rpc to list cloudschedulersources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.cloudschedulersources.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // Required. The project ID or project number from which the cloudschedulersources + * // should be listed. + * parent: 'namespaces/my-namespace', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.cloudschedulersources.list * @memberOf! () * @@ -3690,6 +4381,66 @@ export namespace run_v1alpha1 { /** * run.namespaces.cloudschedulersources.replaceCloudSchedulerSource * @desc Rpc to replace a cloudschedulersource. Only the spec and metadata labels and annotations are modifiable. After the Update request, Cloud Run will work to make the 'status' match the requested 'spec'. May provide metadata.resourceVersion to enforce update from last read for optimistic concurrency control. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.cloudschedulersources.replaceCloudSchedulerSource( + * { + * // Required. The name of the cloudschedulersource being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: + * 'namespaces/my-namespace/cloudschedulersources/my-cloudschedulersource', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.cloudschedulersources.replaceCloudSchedulerSource * @memberOf! () * @@ -3886,6 +4637,63 @@ export namespace run_v1alpha1 { /** * run.namespaces.cloudstoragesources.create * @desc Creates a new cloudstoragesource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.cloudstoragesources.create({ + * // Required. The project ID or project number in which this cloudstoragesource should + * // be created. + * parent: 'namespaces/my-namespace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.cloudstoragesources.create * @memberOf! () * @@ -3961,6 +4769,54 @@ export namespace run_v1alpha1 { /** * run.namespaces.cloudstoragesources.delete * @desc Rpc to delete a cloudstoragesource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.cloudstoragesources.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // Required. The name of the cloudstoragesource being deleted. If needed, replace + * // {namespace_id} with the project ID. + * name: 'namespaces/my-namespace/cloudstoragesources/my-cloudstoragesource', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.cloudstoragesources.delete * @memberOf! () * @@ -4035,6 +4891,51 @@ export namespace run_v1alpha1 { /** * run.namespaces.cloudstoragesources.get * @desc Rpc to get information about a cloudstoragesource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.cloudstoragesources.get({ + * // Required. The name of the cloudstoragesource being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'namespaces/my-namespace/cloudstoragesources/my-cloudstoragesource', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.cloudstoragesources.get * @memberOf! () * @@ -4108,6 +5009,70 @@ export namespace run_v1alpha1 { /** * run.namespaces.cloudstoragesources.list * @desc Rpc to list cloudstoragesources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.cloudstoragesources.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // Required. The project ID or project number from which the cloudstoragesources should + * // be listed. + * parent: 'namespaces/my-namespace', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.cloudstoragesources.list * @memberOf! () * @@ -4198,6 +5163,65 @@ export namespace run_v1alpha1 { /** * run.namespaces.cloudstoragesources.replaceCloudStorageSource * @desc Rpc to replace a cloudstoragesource. Only the spec and metadata labels and annotations are modifiable. After the Update request, Cloud Run will work to make the 'status' match the requested 'spec'. May provide metadata.resourceVersion to enforce update from last read for optimistic concurrency control. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.cloudstoragesources.replaceCloudStorageSource( + * { + * // Required. The name of the cloudstoragesource being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'namespaces/my-namespace/cloudstoragesources/my-cloudstoragesource', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.cloudstoragesources.replaceCloudStorageSource * @memberOf! () * @@ -4392,6 +5416,51 @@ export namespace run_v1alpha1 { /** * run.namespaces.configurations.get * @desc Rpc to get information about a configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.configurations.get({ + * // The name of the configuration being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'namespaces/my-namespace/configurations/my-configuration', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.configurations.get * @memberOf! () * @@ -4465,6 +5534,70 @@ export namespace run_v1alpha1 { /** * run.namespaces.configurations.list * @desc Rpc to list configurations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.configurations.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The project ID or project number from which the configurations should be + * // listed. + * parent: 'namespaces/my-namespace', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.configurations.list * @memberOf! () * @@ -4613,6 +5746,63 @@ export namespace run_v1alpha1 { /** * run.namespaces.domainmappings.create * @desc Creates a new domain mapping. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.domainmappings.create({ + * // The project ID or project number in which this domain mapping should be + * // created. + * parent: 'namespaces/my-namespace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.domainmappings.create * @memberOf! () * @@ -4688,6 +5878,60 @@ export namespace run_v1alpha1 { /** * run.namespaces.domainmappings.delete * @desc Rpc to delete a domain mapping. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.domainmappings.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // The name of the domain mapping being deleted. If needed, replace + * // {namespace_id} with the project ID. + * name: 'namespaces/my-namespace/domainmappings/my-domainmapping', + * // Deprecated. + * // Specifies the cascade behavior on delete. + * // Cloud Run only supports cascading behavior, so this must be false. + * // This attribute is deprecated, and is now replaced with PropagationPolicy + * // See https://github.com/kubernetes/kubernetes/issues/46659 for more info. + * orphanDependents: 'placeholder-value', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.domainmappings.delete * @memberOf! () * @@ -4763,6 +6007,51 @@ export namespace run_v1alpha1 { /** * run.namespaces.domainmappings.get * @desc Rpc to get information about a domain mapping. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.domainmappings.get({ + * // The name of the domain mapping being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'namespaces/my-namespace/domainmappings/my-domainmapping', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.domainmappings.get * @memberOf! () * @@ -4836,6 +6125,70 @@ export namespace run_v1alpha1 { /** * run.namespaces.domainmappings.list * @desc Rpc to list domain mappings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.domainmappings.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The project ID or project number from which the domain mappings should be + * // listed. + * parent: 'namespaces/my-namespace', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.domainmappings.list * @memberOf! () * @@ -5029,6 +6382,60 @@ export namespace run_v1alpha1 { /** * run.namespaces.revisions.delete * @desc Rpc to delete a revision. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.revisions.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // The name of the revision being deleted. If needed, replace + * // {namespace_id} with the project ID. + * name: 'namespaces/my-namespace/revisions/my-revision', + * // Deprecated. + * // Specifies the cascade behavior on delete. + * // Cloud Run only supports cascading behavior, so this must be false. + * // This attribute is deprecated, and is now replaced with PropagationPolicy + * // See https://github.com/kubernetes/kubernetes/issues/46659 for more info. + * orphanDependents: 'placeholder-value', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.revisions.delete * @memberOf! () * @@ -5104,6 +6511,51 @@ export namespace run_v1alpha1 { /** * run.namespaces.revisions.get * @desc Rpc to get information about a revision. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.revisions.get({ + * // The name of the revision being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'namespaces/my-namespace/revisions/my-revision', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.revisions.get * @memberOf! () * @@ -5175,6 +6627,69 @@ export namespace run_v1alpha1 { /** * run.namespaces.revisions.list * @desc Rpc to list revisions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.revisions.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The project ID or project number from which the revisions should be listed. + * parent: 'namespaces/my-namespace', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.revisions.list * @memberOf! () * @@ -5345,6 +6860,51 @@ export namespace run_v1alpha1 { /** * run.namespaces.routes.get * @desc Rpc to get information about a route. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.routes.get({ + * // The name of the route being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'namespaces/my-namespace/routes/my-route', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.routes.get * @memberOf! () * @@ -5416,6 +6976,69 @@ export namespace run_v1alpha1 { /** * run.namespaces.routes.list * @desc Rpc to list routes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.routes.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The project ID or project number from which the routes should be listed. + * parent: 'namespaces/my-namespace', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.routes.list * @memberOf! () * @@ -5556,6 +7179,62 @@ export namespace run_v1alpha1 { /** * run.namespaces.services.create * @desc Rpc to create a service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.services.create({ + * // The project ID or project number in which this service should be created. + * parent: 'namespaces/my-namespace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.services.create * @memberOf! () * @@ -5628,6 +7307,60 @@ export namespace run_v1alpha1 { /** * run.namespaces.services.delete * @desc Rpc to delete a service. This will cause the Service to stop serving traffic and will delete the child entities like Routes, Configurations and Revisions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.services.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // The name of the service being deleted. If needed, replace + * // {namespace_id} with the project ID. + * name: 'namespaces/my-namespace/services/my-service', + * // Deprecated. + * // Specifies the cascade behavior on delete. + * // Cloud Run only supports cascading behavior, so this must be false. + * // This attribute is deprecated, and is now replaced with PropagationPolicy + * // See https://github.com/kubernetes/kubernetes/issues/46659 for more info. + * orphanDependents: 'placeholder-value', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.services.delete * @memberOf! () * @@ -5703,6 +7436,51 @@ export namespace run_v1alpha1 { /** * run.namespaces.services.get * @desc Rpc to get information about a service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.services.get({ + * // The name of the service being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'namespaces/my-namespace/services/my-service', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.services.get * @memberOf! () * @@ -5774,6 +7552,69 @@ export namespace run_v1alpha1 { /** * run.namespaces.services.list * @desc Rpc to list services. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.services.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The project ID or project number from which the services should be listed. + * parent: 'namespaces/my-namespace', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.services.list * @memberOf! () * @@ -5856,6 +7697,63 @@ export namespace run_v1alpha1 { /** * run.namespaces.services.replaceService * @desc Rpc to replace a service. Only the spec and metadata labels and annotations are modifiable. After the Update request, Cloud Run will work to make the 'status' match the requested 'spec'. May provide metadata.resourceVersion to enforce update from last read for optimistic concurrency control. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.services.replaceService({ + * // The name of the service being replaced. If needed, replace + * // {namespace_id} with the project ID. + * name: 'namespaces/my-namespace/services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.services.replaceService * @memberOf! () * @@ -6050,8 +7948,65 @@ export namespace run_v1alpha1 { /** * run.namespaces.triggers.create * @desc Creates a new trigger. - * @alias run.namespaces.triggers.create - * @memberOf! () + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.triggers.create({ + * // The project ID or project number in which this trigger should + * // be created. + * parent: 'namespaces/my-namespace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias run.namespaces.triggers.create + * @memberOf! () * * @param {object} params Parameters for request * @param {string} params.parent The project ID or project number in which this trigger should be created. @@ -6122,6 +8077,54 @@ export namespace run_v1alpha1 { /** * run.namespaces.triggers.delete * @desc Rpc to delete a trigger. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.triggers.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // The name of the trigger being deleted. If needed, replace + * // {namespace_id} with the project ID. + * name: 'namespaces/my-namespace/triggers/my-trigger', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.triggers.delete * @memberOf! () * @@ -6196,6 +8199,51 @@ export namespace run_v1alpha1 { /** * run.namespaces.triggers.get * @desc Rpc to get information about a trigger. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.triggers.get({ + * // The name of the trigger being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'namespaces/my-namespace/triggers/my-trigger', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.triggers.get * @memberOf! () * @@ -6267,6 +8315,70 @@ export namespace run_v1alpha1 { /** * run.namespaces.triggers.list * @desc Rpc to list triggers. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.triggers.list({ + * // Optional. Encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The project ID or project number from which the triggers should + * // be listed. + * parent: 'namespaces/my-namespace', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.triggers.list * @memberOf! () * @@ -6495,6 +8607,53 @@ export namespace run_v1alpha1 { /** * run.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.list * @memberOf! () * @@ -6606,6 +8765,51 @@ export namespace run_v1alpha1 { /** * run.projects.locations.authorizeddomains.list * @desc RPC to list authorized domains. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.authorizeddomains.list({ + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // Name of the parent Application resource. Example: `apps/myapp`. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domains": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.authorizeddomains.list * @memberOf! () * @@ -6719,6 +8923,63 @@ export namespace run_v1alpha1 { /** * run.projects.locations.cloudauditlogssources.create * @desc Creates a new cloudauditlogssource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.cloudauditlogssources.create({ + * // The project ID or project number in which this cloudauditlogssource should + * // be created. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.cloudauditlogssources.create * @memberOf! () * @@ -6795,6 +9056,55 @@ export namespace run_v1alpha1 { /** * run.projects.locations.cloudauditlogssources.delete * @desc Rpc to delete a cloudauditlogssource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.cloudauditlogssources.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // The name of the cloudauditlogssource being deleted. If needed, replace + * // {namespace_id} with the project ID. + * name: + * 'projects/my-project/locations/my-location/cloudauditlogssources/my-cloudauditlogssource', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.cloudauditlogssources.delete * @memberOf! () * @@ -6867,6 +9177,52 @@ export namespace run_v1alpha1 { /** * run.projects.locations.cloudauditlogssources.get * @desc Rpc to get information about a cloudauditlogssource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.cloudauditlogssources.get({ + * // The name of the cloudauditlogssource being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: + * 'projects/my-project/locations/my-location/cloudauditlogssources/my-cloudauditlogssource', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.cloudauditlogssources.get * @memberOf! () * @@ -6940,6 +9296,70 @@ export namespace run_v1alpha1 { /** * run.projects.locations.cloudauditlogssources.list * @desc Rpc to list cloudauditlogssources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.cloudauditlogssources.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The project ID or project number from which the cloudauditlogssources + * // should be listed. + * parent: 'projects/my-project/locations/my-location', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.cloudauditlogssources.list * @memberOf! () * @@ -7130,6 +9550,63 @@ export namespace run_v1alpha1 { /** * run.projects.locations.cloudpubsubsources.create * @desc Creates a new cloudpubsubsource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.cloudpubsubsources.create({ + * // The project ID or project number in which this cloudpubsubsource should + * // be created. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.cloudpubsubsources.create * @memberOf! () * @@ -7205,6 +9682,55 @@ export namespace run_v1alpha1 { /** * run.projects.locations.cloudpubsubsources.delete * @desc Rpc to delete a cloudpubsubsource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.cloudpubsubsources.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // The name of the cloudpubsubsource being deleted. If needed, replace + * // {namespace_id} with the project ID. + * name: + * 'projects/my-project/locations/my-location/cloudpubsubsources/my-cloudpubsubsource', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.cloudpubsubsources.delete * @memberOf! () * @@ -7277,6 +9803,52 @@ export namespace run_v1alpha1 { /** * run.projects.locations.cloudpubsubsources.get * @desc Rpc to get information about a cloudpubsubsource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.cloudpubsubsources.get({ + * // The name of the cloudpubsubsource being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: + * 'projects/my-project/locations/my-location/cloudpubsubsources/my-cloudpubsubsource', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.cloudpubsubsources.get * @memberOf! () * @@ -7348,6 +9920,70 @@ export namespace run_v1alpha1 { /** * run.projects.locations.cloudpubsubsources.list * @desc Rpc to list cloudpubsubsources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.cloudpubsubsources.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The project ID or project number from which the cloudpubsubsources should + * // be listed. + * parent: 'projects/my-project/locations/my-location', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.cloudpubsubsources.list * @memberOf! () * @@ -7539,6 +10175,63 @@ export namespace run_v1alpha1 { /** * run.projects.locations.cloudschedulersources.create * @desc Creates a new cloudschedulersource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.cloudschedulersources.create({ + * // Required. The project ID or project number in which this cloudschedulersource should + * // be created. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.cloudschedulersources.create * @memberOf! () * @@ -7615,6 +10308,55 @@ export namespace run_v1alpha1 { /** * run.projects.locations.cloudschedulersources.delete * @desc Rpc to delete a cloudschedulersource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.cloudschedulersources.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // Required. The name of the cloudschedulersource being deleted. If needed, replace + * // {namespace_id} with the project ID. + * name: + * 'projects/my-project/locations/my-location/cloudschedulersources/my-cloudschedulersource', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.cloudschedulersources.delete * @memberOf! () * @@ -7687,6 +10429,52 @@ export namespace run_v1alpha1 { /** * run.projects.locations.cloudschedulersources.get * @desc Rpc to get information about a cloudschedulersource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.cloudschedulersources.get({ + * // Required. The name of the cloudschedulersource being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: + * 'projects/my-project/locations/my-location/cloudschedulersources/my-cloudschedulersource', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.cloudschedulersources.get * @memberOf! () * @@ -7760,6 +10548,70 @@ export namespace run_v1alpha1 { /** * run.projects.locations.cloudschedulersources.list * @desc Rpc to list cloudschedulersources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.cloudschedulersources.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // Required. The project ID or project number from which the cloudschedulersources + * // should be listed. + * parent: 'projects/my-project/locations/my-location', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.cloudschedulersources.list * @memberOf! () * @@ -7849,6 +10701,66 @@ export namespace run_v1alpha1 { /** * run.projects.locations.cloudschedulersources.replaceCloudSchedulerSource * @desc Rpc to replace a cloudschedulersource. Only the spec and metadata labels and annotations are modifiable. After the Update request, Cloud Run will work to make the 'status' match the requested 'spec'. May provide metadata.resourceVersion to enforce update from last read for optimistic concurrency control. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.cloudschedulersources.replaceCloudSchedulerSource( + * { + * // Required. The name of the cloudschedulersource being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: + * 'projects/my-project/locations/my-location/cloudschedulersources/my-cloudschedulersource', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.cloudschedulersources.replaceCloudSchedulerSource * @memberOf! () * @@ -8043,6 +10955,63 @@ export namespace run_v1alpha1 { /** * run.projects.locations.cloudstoragesources.create * @desc Creates a new cloudstoragesource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.cloudstoragesources.create({ + * // Required. The project ID or project number in which this cloudstoragesource should + * // be created. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.cloudstoragesources.create * @memberOf! () * @@ -8118,6 +11087,55 @@ export namespace run_v1alpha1 { /** * run.projects.locations.cloudstoragesources.delete * @desc Rpc to delete a cloudstoragesource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.cloudstoragesources.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // Required. The name of the cloudstoragesource being deleted. If needed, replace + * // {namespace_id} with the project ID. + * name: + * 'projects/my-project/locations/my-location/cloudstoragesources/my-cloudstoragesource', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.cloudstoragesources.delete * @memberOf! () * @@ -8190,6 +11208,52 @@ export namespace run_v1alpha1 { /** * run.projects.locations.cloudstoragesources.get * @desc Rpc to get information about a cloudstoragesource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.cloudstoragesources.get({ + * // Required. The name of the cloudstoragesource being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: + * 'projects/my-project/locations/my-location/cloudstoragesources/my-cloudstoragesource', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.cloudstoragesources.get * @memberOf! () * @@ -8261,6 +11325,70 @@ export namespace run_v1alpha1 { /** * run.projects.locations.cloudstoragesources.list * @desc Rpc to list cloudstoragesources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.cloudstoragesources.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // Required. The project ID or project number from which the cloudstoragesources should + * // be listed. + * parent: 'projects/my-project/locations/my-location', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.cloudstoragesources.list * @memberOf! () * @@ -8351,6 +11479,66 @@ export namespace run_v1alpha1 { /** * run.projects.locations.cloudstoragesources.replaceCloudStorageSource * @desc Rpc to replace a cloudstoragesource. Only the spec and metadata labels and annotations are modifiable. After the Update request, Cloud Run will work to make the 'status' match the requested 'spec'. May provide metadata.resourceVersion to enforce update from last read for optimistic concurrency control. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.cloudstoragesources.replaceCloudStorageSource( + * { + * // Required. The name of the cloudstoragesource being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: + * 'projects/my-project/locations/my-location/cloudstoragesources/my-cloudstoragesource', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.cloudstoragesources.replaceCloudStorageSource * @memberOf! () * @@ -8543,6 +11731,52 @@ export namespace run_v1alpha1 { /** * run.projects.locations.configurations.get * @desc Rpc to get information about a configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.configurations.get({ + * // The name of the configuration being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: + * 'projects/my-project/locations/my-location/configurations/my-configuration', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.configurations.get * @memberOf! () * @@ -8614,6 +11848,70 @@ export namespace run_v1alpha1 { /** * run.projects.locations.configurations.list * @desc Rpc to list configurations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.configurations.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The project ID or project number from which the configurations should be + * // listed. + * parent: 'projects/my-project/locations/my-location', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.configurations.list * @memberOf! () * @@ -8762,6 +12060,63 @@ export namespace run_v1alpha1 { /** * run.projects.locations.domainmappings.create * @desc Creates a new domain mapping. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.domainmappings.create({ + * // The project ID or project number in which this domain mapping should be + * // created. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.domainmappings.create * @memberOf! () * @@ -8837,6 +12192,61 @@ export namespace run_v1alpha1 { /** * run.projects.locations.domainmappings.delete * @desc Rpc to delete a domain mapping. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.domainmappings.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // The name of the domain mapping being deleted. If needed, replace + * // {namespace_id} with the project ID. + * name: + * 'projects/my-project/locations/my-location/domainmappings/my-domainmapping', + * // Deprecated. + * // Specifies the cascade behavior on delete. + * // Cloud Run only supports cascading behavior, so this must be false. + * // This attribute is deprecated, and is now replaced with PropagationPolicy + * // See https://github.com/kubernetes/kubernetes/issues/46659 for more info. + * orphanDependents: 'placeholder-value', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.domainmappings.delete * @memberOf! () * @@ -8910,6 +12320,52 @@ export namespace run_v1alpha1 { /** * run.projects.locations.domainmappings.get * @desc Rpc to get information about a domain mapping. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.domainmappings.get({ + * // The name of the domain mapping being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: + * 'projects/my-project/locations/my-location/domainmappings/my-domainmapping', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.domainmappings.get * @memberOf! () * @@ -8981,6 +12437,70 @@ export namespace run_v1alpha1 { /** * run.projects.locations.domainmappings.list * @desc Rpc to list domain mappings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.domainmappings.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The project ID or project number from which the domain mappings should be + * // listed. + * parent: 'projects/my-project/locations/my-location', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.domainmappings.list * @memberOf! () * @@ -9174,6 +12694,60 @@ export namespace run_v1alpha1 { /** * run.projects.locations.revisions.delete * @desc Rpc to delete a revision. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.revisions.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // The name of the revision being deleted. If needed, replace + * // {namespace_id} with the project ID. + * name: 'projects/my-project/locations/my-location/revisions/my-revision', + * // Deprecated. + * // Specifies the cascade behavior on delete. + * // Cloud Run only supports cascading behavior, so this must be false. + * // This attribute is deprecated, and is now replaced with PropagationPolicy + * // See https://github.com/kubernetes/kubernetes/issues/46659 for more info. + * orphanDependents: 'placeholder-value', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.revisions.delete * @memberOf! () * @@ -9247,6 +12821,51 @@ export namespace run_v1alpha1 { /** * run.projects.locations.revisions.get * @desc Rpc to get information about a revision. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.revisions.get({ + * // The name of the revision being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'projects/my-project/locations/my-location/revisions/my-revision', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.revisions.get * @memberOf! () * @@ -9316,6 +12935,69 @@ export namespace run_v1alpha1 { /** * run.projects.locations.revisions.list * @desc Rpc to list revisions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.revisions.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The project ID or project number from which the revisions should be listed. + * parent: 'projects/my-project/locations/my-location', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.revisions.list * @memberOf! () * @@ -9487,6 +13169,51 @@ export namespace run_v1alpha1 { /** * run.projects.locations.routes.get * @desc Rpc to get information about a route. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.routes.get({ + * // The name of the route being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'projects/my-project/locations/my-location/routes/my-route', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.routes.get * @memberOf! () * @@ -9556,6 +13283,69 @@ export namespace run_v1alpha1 { /** * run.projects.locations.routes.list * @desc Rpc to list routes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.routes.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The project ID or project number from which the routes should be listed. + * parent: 'projects/my-project/locations/my-location', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.routes.list * @memberOf! () * @@ -9697,6 +13487,62 @@ export namespace run_v1alpha1 { /** * run.projects.locations.services.create * @desc Rpc to create a service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.services.create({ + * // The project ID or project number in which this service should be created. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.services.create * @memberOf! () * @@ -9770,6 +13616,60 @@ export namespace run_v1alpha1 { /** * run.projects.locations.services.delete * @desc Rpc to delete a service. This will cause the Service to stop serving traffic and will delete the child entities like Routes, Configurations and Revisions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.services.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // The name of the service being deleted. If needed, replace + * // {namespace_id} with the project ID. + * name: 'projects/my-project/locations/my-location/services/my-service', + * // Deprecated. + * // Specifies the cascade behavior on delete. + * // Cloud Run only supports cascading behavior, so this must be false. + * // This attribute is deprecated, and is now replaced with PropagationPolicy + * // See https://github.com/kubernetes/kubernetes/issues/46659 for more info. + * orphanDependents: 'placeholder-value', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.services.delete * @memberOf! () * @@ -9843,6 +13743,51 @@ export namespace run_v1alpha1 { /** * run.projects.locations.services.get * @desc Rpc to get information about a service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.services.get({ + * // The name of the service being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'projects/my-project/locations/my-location/services/my-service', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.services.get * @memberOf! () * @@ -9912,6 +13857,59 @@ export namespace run_v1alpha1 { /** * run.projects.locations.services.getIamPolicy * @desc Get the IAM Access Control policy currently in effect for the given Cloud Run service. This result does not include any inherited policies. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.services.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/my-location/services/my-service', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.services.getIamPolicy * @memberOf! () * @@ -9985,6 +13983,69 @@ export namespace run_v1alpha1 { /** * run.projects.locations.services.list * @desc Rpc to list services. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.services.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The project ID or project number from which the services should be listed. + * parent: 'projects/my-project/locations/my-location', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.services.list * @memberOf! () * @@ -10068,6 +14129,63 @@ export namespace run_v1alpha1 { /** * run.projects.locations.services.replaceService * @desc Rpc to replace a service. Only the spec and metadata labels and annotations are modifiable. After the Update request, Cloud Run will work to make the 'status' match the requested 'spec'. May provide metadata.resourceVersion to enforce update from last read for optimistic concurrency control. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.services.replaceService({ + * // The name of the service being replaced. If needed, replace + * // {namespace_id} with the project ID. + * name: 'projects/my-project/locations/my-location/services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.services.replaceService * @memberOf! () * @@ -10138,6 +14256,59 @@ export namespace run_v1alpha1 { /** * run.projects.locations.services.setIamPolicy * @desc Sets the IAM Access control policy for the specified Service. Overwrites any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.services.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/my-location/services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.services.setIamPolicy * @memberOf! () * @@ -10211,6 +14382,55 @@ export namespace run_v1alpha1 { /** * run.projects.locations.services.testIamPermissions * @desc Returns permissions that a caller has on the specified Project. There are no permissions required for making this API call. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.services.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/locations/my-location/services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.services.testIamPermissions * @memberOf! () * @@ -10465,6 +14685,63 @@ export namespace run_v1alpha1 { /** * run.projects.locations.triggers.create * @desc Creates a new trigger. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.triggers.create({ + * // The project ID or project number in which this trigger should + * // be created. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.triggers.create * @memberOf! () * @@ -10538,6 +14815,54 @@ export namespace run_v1alpha1 { /** * run.projects.locations.triggers.delete * @desc Rpc to delete a trigger. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.triggers.delete({ + * // Cloud Run currently ignores this parameter. + * apiVersion: 'placeholder-value', + * // Cloud Run currently ignores this parameter. + * kind: 'placeholder-value', + * // The name of the trigger being deleted. If needed, replace + * // {namespace_id} with the project ID. + * name: 'projects/my-project/locations/my-location/triggers/my-trigger', + * // Specifies the propagation policy of delete. Cloud Run currently ignores + * // this setting, and deletes in the background. Please see + * // kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + * // more information. + * propagationPolicy: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.triggers.delete * @memberOf! () * @@ -10610,6 +14935,51 @@ export namespace run_v1alpha1 { /** * run.projects.locations.triggers.get * @desc Rpc to get information about a trigger. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.triggers.get({ + * // The name of the trigger being retrieved. If needed, replace + * // {namespace_id} with the project ID. + * name: 'projects/my-project/locations/my-location/triggers/my-trigger', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.triggers.get * @memberOf! () * @@ -10679,6 +15049,70 @@ export namespace run_v1alpha1 { /** * run.projects.locations.triggers.list * @desc Rpc to list triggers. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.triggers.list({ + * // Optional. Encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * // The maximum number of records that should be returned. + * limit: 'placeholder-value', + * // The project ID or project number from which the triggers should + * // be listed. + * parent: 'projects/my-project/locations/my-location', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.triggers.list * @memberOf! () * diff --git a/src/apis/run/v1beta1.ts b/src/apis/run/v1beta1.ts index 0eb94265538..b39d240f2ab 100644 --- a/src/apis/run/v1beta1.ts +++ b/src/apis/run/v1beta1.ts @@ -510,6 +510,70 @@ export namespace run_v1beta1 { /** * run.customresourcedefinitions.list * @desc Rpc to list custom resource definitions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.customresourcedefinitions.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * + * limit: 'placeholder-value', + * // The project ID or project number from which the storages should + * // be listed. + * parent: 'placeholder-value', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.customresourcedefinitions.list * @memberOf! () * @@ -667,6 +731,51 @@ export namespace run_v1beta1 { /** * run.namespaces.customresourcedefinitions.get * @desc Rpc to get information about a CustomResourceDefinition. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.namespaces.customresourcedefinitions.get({ + * // The name of the CustomResourceDefinition being retrieved. If needed, + * // replace {namespace_id} with the project ID. + * name: + * 'namespaces/my-namespace/customresourcedefinitions/my-customresourcedefinition', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.namespaces.customresourcedefinitions.get * @memberOf! () * @@ -782,6 +891,51 @@ export namespace run_v1beta1 { /** * run.projects.locations.customresourcedefinitions.get * @desc Rpc to get information about a CustomResourceDefinition. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.customresourcedefinitions.get({ + * // The name of the CustomResourceDefinition being retrieved. If needed, + * // replace {namespace_id} with the project ID. + * name: + * 'projects/my-project/locations/my-location/customresourcedefinitions/my-customresourcedefinition', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "kind": "my_kind", + * // "metadata": {}, + * // "spec": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.customresourcedefinitions.get * @memberOf! () * @@ -855,6 +1009,70 @@ export namespace run_v1beta1 { /** * run.projects.locations.customresourcedefinitions.list * @desc Rpc to list custom resource definitions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.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 run = google.run('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 run.projects.locations.customresourcedefinitions.list({ + * // Optional encoded string to continue paging. + * continue: 'placeholder-value', + * // Allows to filter resources based on a specific value for a field name. + * // Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + * // Not currently used by Cloud Run. + * fieldSelector: 'placeholder-value', + * // Not currently used by Cloud Run. + * includeUninitialized: 'placeholder-value', + * // Allows to filter resources based on a label. Supported operations are + * // =, !=, exists, in, and notIn. + * labelSelector: 'placeholder-value', + * + * limit: 'placeholder-value', + * // The project ID or project number from which the storages should + * // be listed. + * parent: 'projects/my-project/locations/my-location', + * // The baseline resource version from which the list or watch operation should + * // start. Not currently used by Cloud Run. + * resourceVersion: 'placeholder-value', + * // Flag that indicates that the client expects to watch this resource as well. + * // Not currently used by Cloud Run. + * watch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apiVersion": "my_apiVersion", + * // "items": [], + * // "kind": "my_kind", + * // "metadata": {}, + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias run.projects.locations.customresourcedefinitions.list * @memberOf! () * diff --git a/src/apis/runtimeconfig/v1.ts b/src/apis/runtimeconfig/v1.ts index 895d064538d..501a707ba79 100644 --- a/src/apis/runtimeconfig/v1.ts +++ b/src/apis/runtimeconfig/v1.ts @@ -186,6 +186,53 @@ export namespace runtimeconfig_v1 { /** * runtimeconfig.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'operations/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.operations.cancel * @memberOf! () * @@ -257,6 +304,47 @@ export namespace runtimeconfig_v1 { /** * runtimeconfig.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'operations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.operations.delete * @memberOf! () * @@ -327,6 +415,56 @@ export namespace runtimeconfig_v1 { /** * runtimeconfig.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.operations.list * @memberOf! () * diff --git a/src/apis/runtimeconfig/v1beta1.ts b/src/apis/runtimeconfig/v1beta1.ts index ce9743783a6..adc5a02fb1f 100644 --- a/src/apis/runtimeconfig/v1beta1.ts +++ b/src/apis/runtimeconfig/v1beta1.ts @@ -407,6 +407,72 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.create * @desc Creates a new RuntimeConfig resource. The configuration name must be unique within project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.create({ + * // The [project + * // ID](https://support.google.com/cloud/answer/6158840?hl=en&ref_topic=6158848) + * // for this request, in the format `projects/[PROJECT_ID]`. + * parent: 'projects/my-project', + * // An optional but recommended unique `request_id`. If the server + * // receives two `create()` requests with the same + * // `request_id`, then the second request will be ignored and the + * // first resource created and stored in the backend is returned. + * // Empty `request_id` fields are ignored. + * // + * // It is responsibility of the client to ensure uniqueness of the + * // `request_id` strings. + * // + * // `request_id` strings are limited to 64 characters. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.create * @memberOf! () * @@ -484,6 +550,49 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.delete * @desc Deletes a RuntimeConfig resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.delete({ + * // The RuntimeConfig resource to delete, in the format: + * // + * // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + * name: 'projects/my-project/configs/my-config', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.delete * @memberOf! () * @@ -554,6 +663,52 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.get * @desc Gets information about a RuntimeConfig resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.get({ + * // The name of the RuntimeConfig resource to retrieve, in the format: + * // + * // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + * name: 'projects/my-project/configs/my-config', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.get * @memberOf! () * @@ -626,6 +781,61 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/configs/my-config', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.getIamPolicy * @memberOf! () * @@ -700,6 +910,58 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.list * @desc Lists all the RuntimeConfig resources within project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.list({ + * // Specifies the number of results to return per page. If there are fewer + * // elements than the specified number, returns all elements. + * pageSize: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to a `nextPageToken` + * // returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The [project + * // ID](https://support.google.com/cloud/answer/6158840?hl=en&ref_topic=6158848) + * // for this request, in the format `projects/[PROJECT_ID]`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "configs": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.list * @memberOf! () * @@ -777,6 +1039,60 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/configs/my-config', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.setIamPolicy * @memberOf! () * @@ -851,6 +1167,58 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/configs/my-config', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.testIamPermissions * @memberOf! () * @@ -934,6 +1302,61 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.update * @desc Updates a RuntimeConfig resource. The configuration must exist beforehand. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.update({ + * // The name of the RuntimeConfig resource to update, in the format: + * // + * // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + * name: 'projects/my-project/configs/my-config', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.update * @memberOf! () * @@ -1147,6 +1570,53 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/configs/my-config/operations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.operations.get * @memberOf! () * @@ -1219,6 +1689,60 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.operations.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.operations.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/configs/my-config/operations/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.operations.testIamPermissions * @memberOf! () * @@ -1339,6 +1863,79 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.variables.create * @desc Creates a variable within the given configuration. You cannot create a variable with a name that is a prefix of an existing variable name, or a name that has an existing variable name as a prefix. To learn more about creating a variable, read the [Setting and Getting Data](/deployment-manager/runtime-configurator/set-and-get-variables) documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.variables.create({ + * // The path to the RutimeConfig resource that this variable should belong to. + * // The configuration must exist beforehand; the path must be in the format: + * // + * // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + * parent: 'projects/my-project/configs/my-config', + * // An optional but recommended unique `request_id`. If the server + * // receives two `create()` requests with the same + * // `request_id`, then the second request will be ignored and the + * // first resource created and stored in the backend is returned. + * // Empty `request_id` fields are ignored. + * // + * // It is responsibility of the client to ensure uniqueness of the + * // `request_id` strings. + * // + * // `request_id` strings are limited to 64 characters. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name", + * // "state": "my_state", + * // "text": "my_text", + * // "updateTime": "my_updateTime", + * // "value": "my_value" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "state": "my_state", + * // "text": "my_text", + * // "updateTime": "my_updateTime", + * // "value": "my_value" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.variables.create * @memberOf! () * @@ -1414,6 +2011,52 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.variables.delete * @desc Deletes a variable or multiple variables. If you specify a variable name, then that variable is deleted. If you specify a prefix and `recursive` is true, then all variables with that prefix are deleted. You must set a `recursive` to true if you delete variables by prefix. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.variables.delete({ + * // The name of the variable to delete, in the format: + * // + * // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]` + * name: 'projects/my-project/configs/my-config/variables/.*', + * // Set to `true` to recursively delete multiple variables with the same + * // prefix. + * recursive: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.variables.delete * @memberOf! () * @@ -1485,6 +2128,55 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.variables.get * @desc Gets information about a single variable. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.variables.get({ + * // The name of the variable to return, in the format: + * // + * // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIBLE_NAME]` + * name: 'projects/my-project/configs/my-config/variables/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "state": "my_state", + * // "text": "my_text", + * // "updateTime": "my_updateTime", + * // "value": "my_value" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.variables.get * @memberOf! () * @@ -1555,6 +2247,68 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.variables.list * @desc Lists variables within given a configuration, matching any provided filters. This only lists variable names, not the values, unless `return_values` is true, in which case only variables that user has IAM permission to GetVariable will be returned. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.variables.list({ + * // Filters variables by matching the specified filter. For example: + * // + * // `projects/example-project/config/[CONFIG_NAME]/variables/example-variable`. + * filter: 'placeholder-value', + * // Specifies the number of results to return per page. If there are fewer + * // elements than the specified number, returns all elements. + * pageSize: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to a `nextPageToken` + * // returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The path to the RuntimeConfig resource for which you want to list + * // variables. The configuration must exist beforehand; the path must be in the + * // format: + * // + * // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + * parent: 'projects/my-project/configs/my-config', + * // The flag indicates whether the user wants to return values of variables. + * // If true, then only those variables that user has IAM GetVariable permission + * // will be returned along with their values. + * returnValues: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "variables": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.variables.list * @memberOf! () * @@ -1636,6 +2390,60 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.variables.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.variables.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/configs/my-config/variables/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.variables.testIamPermissions * @memberOf! () * @@ -1719,6 +2527,67 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.variables.update * @desc Updates an existing variable with a new value. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.variables.update({ + * // The name of the variable to update, in the format: + * // + * // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]` + * name: 'projects/my-project/configs/my-config/variables/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name", + * // "state": "my_state", + * // "text": "my_text", + * // "updateTime": "my_updateTime", + * // "value": "my_value" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "state": "my_state", + * // "text": "my_text", + * // "updateTime": "my_updateTime", + * // "value": "my_value" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.variables.update * @memberOf! () * @@ -1790,6 +2659,63 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.variables.watch * @desc Watches a specific variable and waits for a change in the variable's value. When there is a change, this method returns the new value or times out. If a variable is deleted while being watched, the `variableState` state is set to `DELETED` and the method returns the last known variable `value`. If you set the deadline for watching to a larger value than internal timeout (60 seconds), the current variable value is returned and the `variableState` will be `VARIABLE_STATE_UNSPECIFIED`. To learn more about creating a watcher, read the [Watching a Variable for Changes](/deployment-manager/runtime-configurator/watching-a-variable) documentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.variables.watch({ + * // The name of the variable to watch, in the format: + * // + * // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + * name: 'projects/my-project/configs/my-config/variables/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "newerThan": "my_newerThan" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "state": "my_state", + * // "text": "my_text", + * // "updateTime": "my_updateTime", + * // "value": "my_value" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.variables.watch * @memberOf! () * @@ -2000,6 +2926,81 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.waiters.create * @desc Creates a Waiter resource. This operation returns a long-running Operation resource which can be polled for completion. However, a waiter with the given name will exist (and can be retrieved) prior to the operation completing. If the operation fails, the failed Waiter resource will still exist and must be deleted prior to subsequent creation attempts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.waiters.create({ + * // The path to the configuration that will own the waiter. + * // The configuration must exist beforehand; the path must be in the format: + * // + * // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]`. + * parent: 'projects/my-project/configs/my-config', + * // An optional but recommended unique `request_id`. If the server + * // receives two `create()` requests with the same + * // `request_id`, then the second request will be ignored and the + * // first resource created and stored in the backend is returned. + * // Empty `request_id` fields are ignored. + * // + * // It is responsibility of the client to ensure uniqueness of the + * // `request_id` strings. + * // + * // `request_id` strings are limited to 64 characters. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "done": false, + * // "error": {}, + * // "failure": {}, + * // "name": "my_name", + * // "success": {}, + * // "timeout": "my_timeout" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.waiters.create * @memberOf! () * @@ -2077,6 +3078,49 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.waiters.delete * @desc Deletes the waiter with the specified name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.waiters.delete({ + * // The Waiter resource to delete, in the format: + * // + * // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]` + * name: 'projects/my-project/configs/my-config/waiters/my-waiter', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.waiters.delete * @memberOf! () * @@ -2147,6 +3191,58 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.waiters.get * @desc Gets information about a single waiter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.waiters.get({ + * // The fully-qualified name of the Waiter resource object to retrieve, in the + * // format: + * // + * // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]` + * name: 'projects/my-project/configs/my-config/waiters/my-waiter', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "done": false, + * // "error": {}, + * // "failure": {}, + * // "name": "my_name", + * // "success": {}, + * // "timeout": "my_timeout" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.waiters.get * @memberOf! () * @@ -2217,6 +3313,59 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.waiters.list * @desc List waiters within the given configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.waiters.list({ + * // Specifies the number of results to return per page. If there are fewer + * // elements than the specified number, returns all elements. + * pageSize: 'placeholder-value', + * // Specifies a page token to use. Set `pageToken` to a `nextPageToken` + * // returned by a previous list request to get the next page of results. + * pageToken: 'placeholder-value', + * // The path to the configuration for which you want to get a list of waiters. + * // The configuration must exist beforehand; the path must be in the format: + * // + * // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + * parent: 'projects/my-project/configs/my-config', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "waiters": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.waiters.list * @memberOf! () * @@ -2294,6 +3443,58 @@ export namespace runtimeconfig_v1beta1 { /** * runtimeconfig.projects.configs.waiters.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/runtimeconfig.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 runtimeconfig = google.runtimeconfig('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloudruntimeconfig', + * ], + * }); + * + * // 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 runtimeconfig.projects.configs.waiters.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/configs/my-config/waiters/my-waiter', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias runtimeconfig.projects.configs.waiters.testIamPermissions * @memberOf! () * diff --git a/src/apis/safebrowsing/v4.ts b/src/apis/safebrowsing/v4.ts index 57cf0800001..a34d2efda19 100644 --- a/src/apis/safebrowsing/v4.ts +++ b/src/apis/safebrowsing/v4.ts @@ -568,6 +568,53 @@ export namespace safebrowsing_v4 { /** * safebrowsing.encodedFullHashes.get + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/safebrowsing.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 safebrowsing = google.safebrowsing('v4'); + * + * 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: [], + * }); + * + * // 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 safebrowsing.encodedFullHashes.get({ + * // A client ID that (hopefully) uniquely identifies the client implementation + * // of the Safe Browsing API. + * clientId: 'placeholder-value', + * // The version of the client implementation. + * clientVersion: 'placeholder-value', + * // A serialized FindFullHashesRequest proto. + * encodedRequest: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "matches": [], + * // "minimumWaitDuration": "my_minimumWaitDuration", + * // "negativeCacheDuration": "my_negativeCacheDuration" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias safebrowsing.encodedFullHashes.get * @memberOf! () * @@ -673,6 +720,52 @@ export namespace safebrowsing_v4 { /** * safebrowsing.encodedUpdates.get + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/safebrowsing.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 safebrowsing = google.safebrowsing('v4'); + * + * 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: [], + * }); + * + * // 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 safebrowsing.encodedUpdates.get({ + * // A client ID that uniquely identifies the client implementation of the Safe + * // Browsing API. + * clientId: 'placeholder-value', + * // The version of the client implementation. + * clientVersion: 'placeholder-value', + * // A serialized FetchThreatListUpdatesRequest proto. + * encodedRequest: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "listUpdateResponses": [], + * // "minimumWaitDuration": "my_minimumWaitDuration" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias safebrowsing.encodedUpdates.get * @memberOf! () * @@ -786,6 +879,56 @@ export namespace safebrowsing_v4 { /** * safebrowsing.fullHashes.find * @desc Finds the full hashes that match the requested hash prefixes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/safebrowsing.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 safebrowsing = google.safebrowsing('v4'); + * + * 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: [], + * }); + * + * // 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 safebrowsing.fullHashes.find({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apiClient": {}, + * // "client": {}, + * // "clientStates": [], + * // "threatInfo": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "matches": [], + * // "minimumWaitDuration": "my_minimumWaitDuration", + * // "negativeCacheDuration": "my_negativeCacheDuration" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias safebrowsing.fullHashes.find * @memberOf! () * @@ -880,6 +1023,54 @@ export namespace safebrowsing_v4 { /** * safebrowsing.threatHits.create * @desc Reports a Safe Browsing threat list hit to Google. Only projects with TRUSTED_REPORTER visibility can use this method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/safebrowsing.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 safebrowsing = google.safebrowsing('v4'); + * + * 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: [], + * }); + * + * // 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 safebrowsing.threatHits.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clientInfo": {}, + * // "entry": {}, + * // "platformType": "my_platformType", + * // "resources": [], + * // "threatType": "my_threatType", + * // "userInfo": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias safebrowsing.threatHits.create * @memberOf! () * @@ -969,6 +1160,43 @@ export namespace safebrowsing_v4 { /** * safebrowsing.threatLists.list * @desc Lists the Safe Browsing threat lists available for download. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/safebrowsing.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 safebrowsing = google.safebrowsing('v4'); + * + * 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: [], + * }); + * + * // 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 safebrowsing.threatLists.list({}); + * console.log(res.data); + * + * // Example response + * // { + * // "threatLists": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias safebrowsing.threatLists.list * @memberOf! () * @@ -1054,6 +1282,53 @@ export namespace safebrowsing_v4 { /** * safebrowsing.threatListUpdates.fetch * @desc Fetches the most recent threat list updates. A client can request updates for multiple lists at once. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/safebrowsing.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 safebrowsing = google.safebrowsing('v4'); + * + * 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: [], + * }); + * + * // 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 safebrowsing.threatListUpdates.fetch({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "client": {}, + * // "listUpdateRequests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "listUpdateResponses": [], + * // "minimumWaitDuration": "my_minimumWaitDuration" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias safebrowsing.threatListUpdates.fetch * @memberOf! () * @@ -1157,6 +1432,52 @@ export namespace safebrowsing_v4 { /** * safebrowsing.threatMatches.find * @desc Finds the threat entries that match the Safe Browsing lists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/safebrowsing.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 safebrowsing = google.safebrowsing('v4'); + * + * 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: [], + * }); + * + * // 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 safebrowsing.threatMatches.find({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "client": {}, + * // "threatInfo": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "matches": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias safebrowsing.threatMatches.find * @memberOf! () * diff --git a/src/apis/sasportal/v1alpha1.ts b/src/apis/sasportal/v1alpha1.ts index 0ff1b56e11f..974b78abc75 100644 --- a/src/apis/sasportal/v1alpha1.ts +++ b/src/apis/sasportal/v1alpha1.ts @@ -661,6 +661,48 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.get * @desc Returns a requested customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.get({ + * // Required. The name of the customer. + * name: 'customers/my-customer', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.get * @memberOf! () * @@ -731,6 +773,51 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.list * @desc Returns a list of requested customers. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.list({ + * // The maximum number of customers + * // to return in the response. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call to ListCustomers method that indicates where + * // this listing should continue from. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "customers": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.list * @memberOf! () * @@ -814,6 +901,60 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.patch * @desc Updates an existing customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.patch({ + * // Output only. Resource name of the customer. + * name: 'customers/my-customer', + * // Fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.patch * @memberOf! () * @@ -940,6 +1081,54 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.devices.bulk * @desc Creates a device under a node or customer. Returned devices are unordered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.devices.bulk({ + * // Required. The name of the parent resource. + * parent: 'customers/my-customer', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "csv": "my_csv" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "devices": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.devices.bulk * @memberOf! () * @@ -1024,6 +1213,68 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.devices.create * @desc Creates a device under a node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.devices.create({ + * // Required. The name of the parent resource. + * parent: 'customers/my-customer', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.devices.create * @memberOf! () * @@ -1099,6 +1350,62 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.devices.createSigned * @desc Creates a signed device under a node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.devices.createSigned({ + * // Required. The name of the parent resource. + * parent: 'customers/my-customer', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "encodedDevice": "my_encodedDevice", + * // "installerId": "my_installerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.devices.createSigned * @memberOf! () * @@ -1174,6 +1481,44 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.devices.delete * @desc Deletes a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.devices.delete({ + * // Required. The name of the device. + * name: 'customers/my-customer/devices/my-device', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.devices.delete * @memberOf! () * @@ -1245,6 +1590,53 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.devices.get * @desc Gets details about a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.devices.get({ + * // Required. The name of the device. + * name: 'customers/my-customer/devices/my-device', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.devices.get * @memberOf! () * @@ -1316,6 +1708,58 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.devices.list * @desc Lists devices under a node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.devices.list({ + * // The filter expression. The filter should have one of the following + * // formats: "sn=123454" or "display_name=MyDevice". sn + * // corresponds to serial_number of the device. The filter is case insensitive. + * filter: 'placeholder-value', + * // The maximum number of devices to return in the response. + * // If empty or zero, all devices will be listed. + * // Must be in the range [0, 1000]. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call to ListDevices + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The name of the parent resource. + * parent: 'customers/my-customer', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "devices": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.devices.list * @memberOf! () * @@ -1402,6 +1846,58 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.devices.move * @desc Moves a device under another node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.devices.move({ + * // Required. The name of the device to move. + * name: 'customers/my-customer/devices/my-device', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destination": "my_destination" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.devices.move * @memberOf! () * @@ -1477,6 +1973,70 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.devices.patch * @desc Updates a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.devices.patch({ + * // Output only. The resource path name. + * name: 'customers/my-customer/devices/my-device', + * // Fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.devices.patch * @memberOf! () * @@ -1550,6 +2110,52 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.devices.signDevice * @desc Signs a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.devices.signDevice({ + * // Output only. The resource path name. + * name: 'customers/my-customer/devices/my-device', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "device": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.devices.signDevice * @memberOf! () * @@ -1625,6 +2231,62 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.devices.updateSigned * @desc Updates a signed device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.devices.updateSigned({ + * // Required. The name of the device to update. + * name: 'customers/my-customer/devices/my-device', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "encodedDevice": "my_encodedDevice", + * // "installerId": "my_installerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.devices.updateSigned * @memberOf! () * @@ -1881,6 +2543,58 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.nodes.create * @desc Creates a new node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.nodes.create({ + * // Required. The parent resource name where the node is to be created. + * parent: 'customers/my-customer', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.nodes.create * @memberOf! () * @@ -1956,6 +2670,44 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.nodes.delete * @desc Deletes a node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.nodes.delete({ + * // Required. The name of the node. + * name: 'customers/my-customer/nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.nodes.delete * @memberOf! () * @@ -2027,6 +2779,48 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.nodes.get * @desc Returns a requested node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.nodes.get({ + * // Required. The name of the node. + * name: 'customers/my-customer/nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.nodes.get * @memberOf! () * @@ -2098,6 +2892,52 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.nodes.list * @desc Lists nodes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.nodes.list({ + * // The maximum number of nodes to return in the response. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call to ListNodes method + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example, "nodes/1". + * parent: 'customers/my-customer', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "nodes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.nodes.list * @memberOf! () * @@ -2181,6 +3021,59 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.nodes.move * @desc Moves a node under another node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.nodes.move({ + * // Required. The name of the node to + * // move. + * name: 'customers/my-customer/nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destination": "my_destination" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.nodes.move * @memberOf! () * @@ -2256,6 +3149,60 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.nodes.patch * @desc Updates an existing node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.nodes.patch({ + * // Output only. Resource name. + * name: 'customers/my-customer/nodes/my-node', + * // Fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.nodes.patch * @memberOf! () * @@ -2436,6 +3383,58 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.nodes.nodes.create * @desc Creates a new node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.nodes.nodes.create({ + * // Required. The parent resource name where the node is to be created. + * parent: 'customers/my-customer/nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.nodes.nodes.create * @memberOf! () * @@ -2511,6 +3510,52 @@ export namespace sasportal_v1alpha1 { /** * sasportal.customers.nodes.nodes.list * @desc Lists nodes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.customers.nodes.nodes.list({ + * // The maximum number of nodes to return in the response. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call to ListNodes method + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example, "nodes/1". + * parent: 'customers/my-customer/nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "nodes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.customers.nodes.nodes.list * @memberOf! () * @@ -2639,6 +3684,49 @@ export namespace sasportal_v1alpha1 { /** * sasportal.installer.generateSecret * @desc Generates a secret to be used with the ValidateInstaller method + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.installer.generateSecret({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "secret": "my_secret" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.installer.generateSecret * @memberOf! () * @@ -2722,6 +3810,51 @@ export namespace sasportal_v1alpha1 { /** * sasportal.installer.validate * @desc Validates the identity of a Certified Professional Installer (CPI). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.installer.validate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "encodedSecret": "my_encodedSecret", + * // "installerId": "my_installerId", + * // "secret": "my_secret" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.installer.validate * @memberOf! () * @@ -2848,6 +3981,54 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.devices.bulk * @desc Creates a device under a node or customer. Returned devices are unordered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.devices.bulk({ + * // Required. The name of the parent resource. + * parent: 'nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "csv": "my_csv" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "devices": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.devices.bulk * @memberOf! () * @@ -2932,6 +4113,68 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.devices.create * @desc Creates a device under a node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.devices.create({ + * // Required. The name of the parent resource. + * parent: 'nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.devices.create * @memberOf! () * @@ -3007,6 +4250,62 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.devices.createSigned * @desc Creates a signed device under a node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.devices.createSigned({ + * // Required. The name of the parent resource. + * parent: 'nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "encodedDevice": "my_encodedDevice", + * // "installerId": "my_installerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.devices.createSigned * @memberOf! () * @@ -3082,6 +4381,44 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.devices.delete * @desc Deletes a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.devices.delete({ + * // Required. The name of the device. + * name: 'nodes/my-node/devices/my-device', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.devices.delete * @memberOf! () * @@ -3153,6 +4490,53 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.devices.get * @desc Gets details about a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.devices.get({ + * // Required. The name of the device. + * name: 'nodes/my-node/devices/my-device', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.devices.get * @memberOf! () * @@ -3224,6 +4608,58 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.devices.list * @desc Lists devices under a node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.devices.list({ + * // The filter expression. The filter should have one of the following + * // formats: "sn=123454" or "display_name=MyDevice". sn + * // corresponds to serial_number of the device. The filter is case insensitive. + * filter: 'placeholder-value', + * // The maximum number of devices to return in the response. + * // If empty or zero, all devices will be listed. + * // Must be in the range [0, 1000]. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call to ListDevices + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The name of the parent resource. + * parent: 'nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "devices": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.devices.list * @memberOf! () * @@ -3310,6 +4746,58 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.devices.move * @desc Moves a device under another node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.devices.move({ + * // Required. The name of the device to move. + * name: 'nodes/my-node/devices/my-device', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destination": "my_destination" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.devices.move * @memberOf! () * @@ -3385,6 +4873,70 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.devices.patch * @desc Updates a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.devices.patch({ + * // Output only. The resource path name. + * name: 'nodes/my-node/devices/my-device', + * // Fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.devices.patch * @memberOf! () * @@ -3458,6 +5010,52 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.devices.signDevice * @desc Signs a device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.devices.signDevice({ + * // Output only. The resource path name. + * name: 'nodes/my-node/devices/my-device', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "device": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.devices.signDevice * @memberOf! () * @@ -3533,6 +5131,62 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.devices.updateSigned * @desc Updates a signed device. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.devices.updateSigned({ + * // Required. The name of the device to update. + * name: 'nodes/my-node/devices/my-device', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "encodedDevice": "my_encodedDevice", + * // "installerId": "my_installerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.devices.updateSigned * @memberOf! () * @@ -3791,6 +5445,58 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.nodes.create * @desc Creates a new node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.nodes.create({ + * // Required. The parent resource name where the node is to be created. + * parent: 'nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.nodes.create * @memberOf! () * @@ -3866,6 +5572,44 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.nodes.delete * @desc Deletes a node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.nodes.delete({ + * // Required. The name of the node. + * name: 'nodes/my-node/nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.nodes.delete * @memberOf! () * @@ -3937,6 +5681,48 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.nodes.get * @desc Returns a requested node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.nodes.get({ + * // Required. The name of the node. + * name: 'nodes/my-node/nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.nodes.get * @memberOf! () * @@ -4007,6 +5793,52 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.nodes.list * @desc Lists nodes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.nodes.list({ + * // The maximum number of nodes to return in the response. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call to ListNodes method + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example, "nodes/1". + * parent: 'nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "nodes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.nodes.list * @memberOf! () * @@ -4089,6 +5921,59 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.nodes.move * @desc Moves a node under another node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.nodes.move({ + * // Required. The name of the node to + * // move. + * name: 'nodes/my-node/nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destination": "my_destination" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.nodes.move * @memberOf! () * @@ -4163,6 +6048,60 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.nodes.patch * @desc Updates an existing node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.nodes.patch({ + * // Output only. Resource name. + * name: 'nodes/my-node/nodes/my-node', + * // Fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.nodes.patch * @memberOf! () * @@ -4340,6 +6279,54 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.nodes.devices.bulk * @desc Creates a device under a node or customer. Returned devices are unordered. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.nodes.devices.bulk({ + * // Required. The name of the parent resource. + * parent: 'nodes/my-node/nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "csv": "my_csv" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "devices": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.nodes.devices.bulk * @memberOf! () * @@ -4424,6 +6411,68 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.nodes.devices.create * @desc Creates a device under a node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.nodes.devices.create({ + * // Required. The name of the parent resource. + * parent: 'nodes/my-node/nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.nodes.devices.create * @memberOf! () * @@ -4499,6 +6548,62 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.nodes.devices.createSigned * @desc Creates a signed device under a node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.nodes.devices.createSigned({ + * // Required. The name of the parent resource. + * parent: 'nodes/my-node/nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "encodedDevice": "my_encodedDevice", + * // "installerId": "my_installerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeConfig": {}, + * // "displayName": "my_displayName", + * // "fccId": "my_fccId", + * // "grants": [], + * // "name": "my_name", + * // "preloadedConfig": {}, + * // "serialNumber": "my_serialNumber", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.nodes.devices.createSigned * @memberOf! () * @@ -4574,6 +6679,58 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.nodes.devices.list * @desc Lists devices under a node or customer. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.nodes.devices.list({ + * // The filter expression. The filter should have one of the following + * // formats: "sn=123454" or "display_name=MyDevice". sn + * // corresponds to serial_number of the device. The filter is case insensitive. + * filter: 'placeholder-value', + * // The maximum number of devices to return in the response. + * // If empty or zero, all devices will be listed. + * // Must be in the range [0, 1000]. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call to ListDevices + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The name of the parent resource. + * parent: 'nodes/my-node/nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "devices": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.nodes.devices.list * @memberOf! () * @@ -4743,6 +6900,58 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.nodes.nodes.create * @desc Creates a new node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.nodes.nodes.create({ + * // Required. The parent resource name where the node is to be created. + * parent: 'nodes/my-node/nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "sasUserIds": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.nodes.nodes.create * @memberOf! () * @@ -4818,6 +7027,52 @@ export namespace sasportal_v1alpha1 { /** * sasportal.nodes.nodes.nodes.list * @desc Lists nodes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.nodes.nodes.nodes.list({ + * // The maximum number of nodes to return in the response. + * pageSize: 'placeholder-value', + * // A pagination token returned from a previous call to ListNodes method + * // that indicates where this listing should continue from. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, for example, "nodes/1". + * parent: 'nodes/my-node/nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "nodes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.nodes.nodes.nodes.list * @memberOf! () * @@ -4946,6 +7201,52 @@ export namespace sasportal_v1alpha1 { /** * sasportal.policies.get * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.policies.get({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "resource": "my_resource" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assignments": [], + * // "etag": "my_etag" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.policies.get * @memberOf! () * @@ -5019,6 +7320,53 @@ export namespace sasportal_v1alpha1 { /** * sasportal.policies.set * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.policies.set({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "resource": "my_resource" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assignments": [], + * // "etag": "my_etag" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.policies.set * @memberOf! () * @@ -5092,6 +7440,52 @@ export namespace sasportal_v1alpha1 { /** * sasportal.policies.test * @desc Returns permissions that a caller has on the specified resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sasportal.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 sasportal = google.sasportal('v1alpha1'); + * + * 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/userinfo.email'], + * }); + * + * // 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 sasportal.policies.test({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [], + * // "resource": "my_resource" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sasportal.policies.test * @memberOf! () * diff --git a/src/apis/script/v1.ts b/src/apis/script/v1.ts index 72d868bd166..6335866d573 100644 --- a/src/apis/script/v1.ts +++ b/src/apis/script/v1.ts @@ -718,6 +718,78 @@ export namespace script_v1 { /** * script.processes.list * @desc List information about processes made by or on behalf of a user, such as process type and current status. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/script.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 script = google.script('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/script.processes'], + * }); + * + * // 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 script.processes.list({ + * // The maximum number of returned processes per page of results. Defaults to + * // 50. + * pageSize: 'placeholder-value', + * // The token for continuing a previous list request on the next page. This + * // should be set to the value of `nextPageToken` from a previous response. + * pageToken: 'placeholder-value', + * // Optional field used to limit returned processes to those originating from + * // projects with a specific deployment ID. + * 'userProcessFilter.deploymentId': 'placeholder-value', + * // Optional field used to limit returned processes to those that completed + * // on or before the given timestamp. + * 'userProcessFilter.endTime': 'placeholder-value', + * // Optional field used to limit returned processes to those originating from + * // a script function with the given function name. + * 'userProcessFilter.functionName': 'placeholder-value', + * // Optional field used to limit returned processes to those originating from + * // projects with project names containing a specific string. + * 'userProcessFilter.projectName': 'placeholder-value', + * // Optional field used to limit returned processes to those originating from + * // projects with a specific script ID. + * 'userProcessFilter.scriptId': 'placeholder-value', + * // Optional field used to limit returned processes to those that were + * // started on or after the given timestamp. + * 'userProcessFilter.startTime': 'placeholder-value', + * // Optional field used to limit returned processes to those having one of + * // the specified process statuses. + * 'userProcessFilter.statuses': 'placeholder-value', + * // Optional field used to limit returned processes to those having one of + * // the specified process types. + * 'userProcessFilter.types': 'placeholder-value', + * // Optional field used to limit returned processes to those having one of + * // the specified user access levels. + * 'userProcessFilter.userAccessLevels': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "processes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias script.processes.list * @memberOf! () * @@ -805,6 +877,74 @@ export namespace script_v1 { /** * script.processes.listScriptProcesses * @desc List information about a script's executed processes, such as process type and current status. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/script.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 script = google.script('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/script.processes'], + * }); + * + * // 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 script.processes.listScriptProcesses({ + * // The maximum number of returned processes per page of results. Defaults to + * // 50. + * pageSize: 'placeholder-value', + * // The token for continuing a previous list request on the next page. This + * // should be set to the value of `nextPageToken` from a previous response. + * pageToken: 'placeholder-value', + * // The script ID of the project whose processes are listed. + * scriptId: 'placeholder-value', + * // Optional field used to limit returned processes to those originating from + * // projects with a specific deployment ID. + * 'scriptProcessFilter.deploymentId': 'placeholder-value', + * // Optional field used to limit returned processes to those that completed + * // on or before the given timestamp. + * 'scriptProcessFilter.endTime': 'placeholder-value', + * // Optional field used to limit returned processes to those originating from + * // a script function with the given function name. + * 'scriptProcessFilter.functionName': 'placeholder-value', + * // Optional field used to limit returned processes to those that were + * // started on or after the given timestamp. + * 'scriptProcessFilter.startTime': 'placeholder-value', + * // Optional field used to limit returned processes to those having one of + * // the specified process statuses. + * 'scriptProcessFilter.statuses': 'placeholder-value', + * // Optional field used to limit returned processes to those having one of + * // the specified process types. + * 'scriptProcessFilter.types': 'placeholder-value', + * // Optional field used to limit returned processes to those having one of + * // the specified user access levels. + * 'scriptProcessFilter.userAccessLevels': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "processes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias script.processes.listScriptProcesses * @memberOf! () * @@ -1006,6 +1146,58 @@ export namespace script_v1 { /** * script.projects.create * @desc Creates a new, empty script project with no script files and a base manifest file. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/script.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 script = google.script('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/script.projects'], + * }); + * + * // 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 script.projects.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parentId": "my_parentId", + * // "title": "my_title" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "creator": {}, + * // "lastModifyUser": {}, + * // "parentId": "my_parentId", + * // "scriptId": "my_scriptId", + * // "title": "my_title", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias script.projects.create * @memberOf! () * @@ -1074,6 +1266,55 @@ export namespace script_v1 { /** * script.projects.get * @desc Gets a script project's metadata. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/script.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 script = google.script('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/script.projects', + * 'https://www.googleapis.com/auth/script.projects.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 script.projects.get({ + * // The script project's Drive ID. + * scriptId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "creator": {}, + * // "lastModifyUser": {}, + * // "parentId": "my_parentId", + * // "scriptId": "my_scriptId", + * // "title": "my_title", + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias script.projects.get * @memberOf! () * @@ -1145,6 +1386,53 @@ export namespace script_v1 { /** * script.projects.getContent * @desc Gets the content of the script project, including the code source and metadata for each script file. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/script.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 script = google.script('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/script.projects', + * 'https://www.googleapis.com/auth/script.projects.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 script.projects.getContent({ + * // The script project's Drive ID. + * scriptId: 'placeholder-value', + * // The version number of the project to retrieve. If not provided, the + * // project's HEAD version is returned. + * versionNumber: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "files": [], + * // "scriptId": "my_scriptId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias script.projects.getContent * @memberOf! () * @@ -1218,6 +1506,52 @@ export namespace script_v1 { /** * script.projects.getMetrics * @desc Get metrics data for scripts, such as number of executions and active users. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/script.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 script = google.script('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/script.metrics'], + * }); + * + * // 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 script.projects.getMetrics({ + * // Optional field indicating a specific deployment to retrieve metrics from. + * 'metricsFilter.deploymentId': 'placeholder-value', + * // Required field indicating what granularity of metrics are returned. + * metricsGranularity: 'placeholder-value', + * // Required field indicating the script to get metrics for. + * scriptId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeUsers": [], + * // "failedExecutions": [], + * // "totalExecutions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias script.projects.getMetrics * @memberOf! () * @@ -1292,6 +1626,56 @@ export namespace script_v1 { /** * script.projects.updateContent * @desc Updates the content of the specified script project. This content is stored as the HEAD version, and is used when the script is executed as a trigger, in the script editor, in add-on preview mode, or as a web app or Apps Script API in development mode. This clears all the existing files in the project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/script.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 script = google.script('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/script.projects'], + * }); + * + * // 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 script.projects.updateContent({ + * // The script project's Drive ID. + * scriptId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "files": [], + * // "scriptId": "my_scriptId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "files": [], + * // "scriptId": "my_scriptId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias script.projects.updateContent * @memberOf! () * @@ -1448,6 +1832,60 @@ export namespace script_v1 { /** * script.projects.deployments.create * @desc Creates a deployment of an Apps Script project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/script.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 script = google.script('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/script.deployments'], + * }); + * + * // 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 script.projects.deployments.create({ + * // The script project's Drive ID. + * scriptId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "manifestFileName": "my_manifestFileName", + * // "scriptId": "my_scriptId", + * // "versionNumber": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deploymentConfig": {}, + * // "deploymentId": "my_deploymentId", + * // "entryPoints": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias script.projects.deployments.create * @memberOf! () * @@ -1523,6 +1961,46 @@ export namespace script_v1 { /** * script.projects.deployments.delete * @desc Deletes a deployment of an Apps Script project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/script.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 script = google.script('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/script.deployments'], + * }); + * + * // 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 script.projects.deployments.delete({ + * // The deployment ID to be undeployed. + * deploymentId: 'placeholder-value', + * // The script project's Drive ID. + * scriptId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias script.projects.deployments.delete * @memberOf! () * @@ -1595,6 +2073,54 @@ export namespace script_v1 { /** * script.projects.deployments.get * @desc Gets a deployment of an Apps Script project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/script.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 script = google.script('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/script.deployments', + * 'https://www.googleapis.com/auth/script.deployments.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 script.projects.deployments.get({ + * // The deployment ID. + * deploymentId: 'placeholder-value', + * // The script project's Drive ID. + * scriptId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deploymentConfig": {}, + * // "deploymentId": "my_deploymentId", + * // "entryPoints": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias script.projects.deployments.get * @memberOf! () * @@ -1669,6 +2195,55 @@ export namespace script_v1 { /** * script.projects.deployments.list * @desc Lists the deployments of an Apps Script project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/script.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 script = google.script('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/script.deployments', + * 'https://www.googleapis.com/auth/script.deployments.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 script.projects.deployments.list({ + * // The maximum number of deployments on each returned page. Defaults to 50. + * pageSize: 'placeholder-value', + * // The token for continuing a previous list request on the next page. This + * // should be set to the value of `nextPageToken` from a previous response. + * pageToken: 'placeholder-value', + * // The script project's Drive ID. + * scriptId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deployments": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias script.projects.deployments.list * @memberOf! () * @@ -1747,6 +2322,59 @@ export namespace script_v1 { /** * script.projects.deployments.update * @desc Updates a deployment of an Apps Script project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/script.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 script = google.script('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/script.deployments'], + * }); + * + * // 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 script.projects.deployments.update({ + * // The deployment ID for this deployment. + * deploymentId: 'placeholder-value', + * // The script project's Drive ID. + * scriptId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deploymentConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deploymentConfig": {}, + * // "deploymentId": "my_deploymentId", + * // "entryPoints": [], + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias script.projects.deployments.update * @memberOf! () * @@ -1920,6 +2548,60 @@ export namespace script_v1 { /** * script.projects.versions.create * @desc Creates a new immutable version using the current code, with a unique version number. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/script.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 script = google.script('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/script.projects'], + * }); + * + * // 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 script.projects.versions.create({ + * // The script project's Drive ID. + * scriptId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "scriptId": "my_scriptId", + * // "versionNumber": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "scriptId": "my_scriptId", + * // "versionNumber": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias script.projects.versions.create * @memberOf! () * @@ -1993,6 +2675,54 @@ export namespace script_v1 { /** * script.projects.versions.get * @desc Gets a version of a script project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/script.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 script = google.script('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/script.projects', + * 'https://www.googleapis.com/auth/script.projects.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 script.projects.versions.get({ + * // The script project's Drive ID. + * scriptId: 'placeholder-value', + * // The version number. + * versionNumber: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "scriptId": "my_scriptId", + * // "versionNumber": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias script.projects.versions.get * @memberOf! () * @@ -2065,6 +2795,55 @@ export namespace script_v1 { /** * script.projects.versions.list * @desc List the versions of a script project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/script.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 script = google.script('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/script.projects', + * 'https://www.googleapis.com/auth/script.projects.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 script.projects.versions.list({ + * // The maximum number of versions on each returned page. Defaults to 50. + * pageSize: 'placeholder-value', + * // The token for continuing a previous list request on the next page. This + * // should be set to the value of `nextPageToken` from a previous response. + * pageToken: 'placeholder-value', + * // The script project's Drive ID. + * scriptId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "versions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias script.projects.versions.list * @memberOf! () * @@ -2204,6 +2983,73 @@ export namespace script_v1 { /** * script.scripts.run * @desc Runs a function in an Apps Script project. The script project must be deployed for use with the Apps Script API and the calling application must share the same Cloud Platform project. This method requires authorization with an OAuth 2.0 token that includes at least one of the scopes listed in the [Authorization](#authorization-scopes) section; script projects that do not require authorization cannot be executed through this API. To find the correct scopes to include in the authentication token, open the project in the script editor, then select **File > Project properties** and click the **Scopes** tab. The error `403, PERMISSION_DENIED: The caller does not have permission` indicates that the Cloud Platform project used to authorize the request is not the same as the one used by the script. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/script.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 script = google.script('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://mail.google.com/', + * 'https://www.google.com/calendar/feeds', + * 'https://www.google.com/m8/feeds', + * 'https://www.googleapis.com/auth/admin.directory.group', + * 'https://www.googleapis.com/auth/admin.directory.user', + * 'https://www.googleapis.com/auth/documents', + * 'https://www.googleapis.com/auth/drive', + * 'https://www.googleapis.com/auth/forms', + * 'https://www.googleapis.com/auth/forms.currentonly', + * 'https://www.googleapis.com/auth/groups', + * 'https://www.googleapis.com/auth/spreadsheets', + * 'https://www.googleapis.com/auth/userinfo.email', + * ], + * }); + * + * // 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 script.scripts.run({ + * // The script ID of the script to be executed. To find the script ID, open + * // the project in the script editor and select **File > Project properties**. + * scriptId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "devMode": false, + * // "function": "my_function", + * // "parameters": [], + * // "sessionState": "my_sessionState" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias script.scripts.run * @memberOf! () * diff --git a/src/apis/searchconsole/v1.ts b/src/apis/searchconsole/v1.ts index 95aae0fa3da..8f9b2280f9c 100644 --- a/src/apis/searchconsole/v1.ts +++ b/src/apis/searchconsole/v1.ts @@ -225,6 +225,56 @@ export namespace searchconsole_v1 { /** * searchconsole.urlTestingTools.mobileFriendlyTest.run * @desc Runs Mobile-Friendly Test for a given URL. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/searchconsole.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 searchconsole = google.searchconsole('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: [], + * }); + * + * // 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 searchconsole.urlTestingTools.mobileFriendlyTest.run({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "requestScreenshot": false, + * // "url": "my_url" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "mobileFriendliness": "my_mobileFriendliness", + * // "mobileFriendlyIssues": [], + * // "resourceIssues": [], + * // "screenshot": {}, + * // "testStatus": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias searchconsole.urlTestingTools.mobileFriendlyTest.run * @memberOf! () * diff --git a/src/apis/secretmanager/v1.ts b/src/apis/secretmanager/v1.ts index daf784f3540..7d56a4b96cb 100644 --- a/src/apis/secretmanager/v1.ts +++ b/src/apis/secretmanager/v1.ts @@ -446,6 +446,50 @@ export namespace secretmanager_v1 { /** * secretmanager.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.locations.get * @memberOf! () * @@ -516,6 +560,53 @@ export namespace secretmanager_v1 { /** * secretmanager.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.locations.list * @memberOf! () * @@ -642,6 +733,58 @@ export namespace secretmanager_v1 { /** * secretmanager.projects.secrets.addVersion * @desc Creates a new SecretVersion containing secret data and attaches it to an existing Secret. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.addVersion({ + * // Required. The resource name of the Secret to associate with the + * // SecretVersion in the format `projects/x/secrets/x`. + * parent: 'projects/my-project/secrets/my-secret', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "payload": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "destroyTime": "my_destroyTime", + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.addVersion * @memberOf! () * @@ -718,6 +861,67 @@ export namespace secretmanager_v1 { /** * secretmanager.projects.secrets.create * @desc Creates a new Secret containing no SecretVersions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.create({ + * // Required. The resource name of the project to associate with the + * // Secret, in the format `projects/x`. + * parent: 'projects/my-project', + * // Required. This must be unique within the project. + * // + * // A secret ID is a string with a maximum length of 255 characters and can + * // contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and + * // underscore (`_`) characters. + * secretId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "replication": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "replication": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.create * @memberOf! () * @@ -793,6 +997,45 @@ export namespace secretmanager_v1 { /** * secretmanager.projects.secrets.delete * @desc Deletes a Secret. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.delete({ + * // Required. The resource name of the Secret to delete in the format + * // `projects/x/secrets/x`. + * name: 'projects/my-project/secrets/my-secret', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.delete * @memberOf! () * @@ -863,6 +1106,49 @@ export namespace secretmanager_v1 { /** * secretmanager.projects.secrets.get * @desc Gets metadata for a given Secret. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.get({ + * // Required. The resource name of the Secret, in the format `projects/x/secrets/x`. + * name: 'projects/my-project/secrets/my-secret', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "replication": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.get * @memberOf! () * @@ -933,6 +1219,59 @@ export namespace secretmanager_v1 { /** * secretmanager.projects.secrets.getIamPolicy * @desc Gets the access control policy for a secret. Returns empty policy if the secret exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/secrets/my-secret', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.getIamPolicy * @memberOf! () * @@ -1007,6 +1346,56 @@ export namespace secretmanager_v1 { /** * secretmanager.projects.secrets.list * @desc Lists Secrets. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.list({ + * // Optional. The maximum number of results to be returned in a single page. If + * // set to 0, the server decides the number of results to return. If the + * // number is greater than 25000, it is capped at 25000. + * pageSize: 'placeholder-value', + * // Optional. Pagination token, returned earlier via + * // ListSecretsResponse.next_page_token. + * pageToken: 'placeholder-value', + * // Required. The resource name of the project associated with the + * // Secrets, in the format `projects/x`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "secrets": [], + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.list * @memberOf! () * @@ -1084,6 +1473,62 @@ export namespace secretmanager_v1 { /** * secretmanager.projects.secrets.patch * @desc Updates metadata of an existing Secret. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.patch({ + * // Output only. The resource name of the Secret in the format `projects/x/secrets/x`. + * name: 'projects/my-project/secrets/my-secret', + * // Required. Specifies the fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "replication": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "replication": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.patch * @memberOf! () * @@ -1156,6 +1601,59 @@ export namespace secretmanager_v1 { /** * secretmanager.projects.secrets.setIamPolicy * @desc Sets the access control policy on the specified secret. Replaces any existing policy. Permissions on SecretVersions are enforced according to the policy set on the associated Secret. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/secrets/my-secret', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.setIamPolicy * @memberOf! () * @@ -1230,6 +1728,55 @@ export namespace secretmanager_v1 { /** * secretmanager.projects.secrets.testIamPermissions * @desc Returns permissions that a caller has for the specified secret. If the secret does not exist, this call returns an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/secrets/my-secret', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.testIamPermissions * @memberOf! () * @@ -1474,6 +2021,48 @@ export namespace secretmanager_v1 { /** * secretmanager.projects.secrets.versions.access * @desc Accesses a SecretVersion. This call returns the secret data. `projects/x/secrets/x/versions/latest` is an alias to the `latest` SecretVersion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.versions.access({ + * // Required. The resource name of the SecretVersion in the format + * // `projects/x/secrets/x/versions/x`. + * name: 'projects/my-project/secrets/my-secret/versions/my-version', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "payload": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.versions.access * @memberOf! () * @@ -1553,6 +2142,56 @@ export namespace secretmanager_v1 { /** * secretmanager.projects.secrets.versions.destroy * @desc Destroys a SecretVersion. Sets the state of the SecretVersion to DESTROYED and irrevocably destroys the secret data. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.versions.destroy({ + * // Required. The resource name of the SecretVersion to destroy in the format + * // `projects/x/secrets/x/versions/x`. + * name: 'projects/my-project/secrets/my-secret/versions/my-version', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "destroyTime": "my_destroyTime", + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.versions.destroy * @memberOf! () * @@ -1629,6 +2268,56 @@ export namespace secretmanager_v1 { /** * secretmanager.projects.secrets.versions.disable * @desc Disables a SecretVersion. Sets the state of the SecretVersion to DISABLED. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.versions.disable({ + * // Required. The resource name of the SecretVersion to disable in the format + * // `projects/x/secrets/x/versions/x`. + * name: 'projects/my-project/secrets/my-secret/versions/my-version', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "destroyTime": "my_destroyTime", + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.versions.disable * @memberOf! () * @@ -1705,6 +2394,56 @@ export namespace secretmanager_v1 { /** * secretmanager.projects.secrets.versions.enable * @desc Enables a SecretVersion. Sets the state of the SecretVersion to ENABLED. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.versions.enable({ + * // Required. The resource name of the SecretVersion to enable in the format + * // `projects/x/secrets/x/versions/x`. + * name: 'projects/my-project/secrets/my-secret/versions/my-version', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "destroyTime": "my_destroyTime", + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.versions.enable * @memberOf! () * @@ -1778,6 +2517,52 @@ export namespace secretmanager_v1 { /** * secretmanager.projects.secrets.versions.get * @desc Gets metadata for a SecretVersion. `projects/x/secrets/x/versions/latest` is an alias to the `latest` SecretVersion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.versions.get({ + * // Required. The resource name of the SecretVersion in the format + * // `projects/x/secrets/x/versions/x`. + * // `projects/x/secrets/x/versions/latest` is an alias to the `latest` + * // SecretVersion. + * name: 'projects/my-project/secrets/my-secret/versions/my-version', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "destroyTime": "my_destroyTime", + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.versions.get * @memberOf! () * @@ -1850,6 +2635,57 @@ export namespace secretmanager_v1 { /** * secretmanager.projects.secrets.versions.list * @desc Lists SecretVersions. This call does not return secret data. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.versions.list({ + * // Optional. The maximum number of results to be returned in a single page. If + * // set to 0, the server decides the number of results to return. If the + * // number is greater than 25000, it is capped at 25000. + * pageSize: 'placeholder-value', + * // Optional. Pagination token, returned earlier via + * // ListSecretVersionsResponse.next_page_token][]. + * pageToken: 'placeholder-value', + * // Required. The resource name of the Secret associated with the + * // SecretVersions to list, in the format + * // `projects/x/secrets/x`. + * parent: 'projects/my-project/secrets/my-secret', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "totalSize": 0, + * // "versions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.versions.list * @memberOf! () * diff --git a/src/apis/secretmanager/v1beta1.ts b/src/apis/secretmanager/v1beta1.ts index 4b5c2ac8718..421127f591b 100644 --- a/src/apis/secretmanager/v1beta1.ts +++ b/src/apis/secretmanager/v1beta1.ts @@ -446,6 +446,50 @@ export namespace secretmanager_v1beta1 { /** * secretmanager.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.locations.get * @memberOf! () * @@ -516,6 +560,53 @@ export namespace secretmanager_v1beta1 { /** * secretmanager.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.locations.list * @memberOf! () * @@ -642,6 +733,58 @@ export namespace secretmanager_v1beta1 { /** * secretmanager.projects.secrets.addVersion * @desc Creates a new SecretVersion containing secret data and attaches it to an existing Secret. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.addVersion({ + * // Required. The resource name of the Secret to associate with the + * // SecretVersion in the format `projects/x/secrets/x`. + * parent: 'projects/my-project/secrets/my-secret', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "payload": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "destroyTime": "my_destroyTime", + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.addVersion * @memberOf! () * @@ -718,6 +861,67 @@ export namespace secretmanager_v1beta1 { /** * secretmanager.projects.secrets.create * @desc Creates a new Secret containing no SecretVersions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.create({ + * // Required. The resource name of the project to associate with the + * // Secret, in the format `projects/x`. + * parent: 'projects/my-project', + * // Required. This must be unique within the project. + * // + * // A secret ID is a string with a maximum length of 255 characters and can + * // contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and + * // underscore (`_`) characters. + * secretId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "replication": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "replication": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.create * @memberOf! () * @@ -793,6 +997,45 @@ export namespace secretmanager_v1beta1 { /** * secretmanager.projects.secrets.delete * @desc Deletes a Secret. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.delete({ + * // Required. The resource name of the Secret to delete in the format + * // `projects/x/secrets/x`. + * name: 'projects/my-project/secrets/my-secret', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.delete * @memberOf! () * @@ -863,6 +1106,49 @@ export namespace secretmanager_v1beta1 { /** * secretmanager.projects.secrets.get * @desc Gets metadata for a given Secret. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.get({ + * // Required. The resource name of the Secret, in the format `projects/x/secrets/x`. + * name: 'projects/my-project/secrets/my-secret', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "replication": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.get * @memberOf! () * @@ -933,6 +1219,59 @@ export namespace secretmanager_v1beta1 { /** * secretmanager.projects.secrets.getIamPolicy * @desc Gets the access control policy for a secret. Returns empty policy if the secret exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/secrets/my-secret', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.getIamPolicy * @memberOf! () * @@ -1007,6 +1346,56 @@ export namespace secretmanager_v1beta1 { /** * secretmanager.projects.secrets.list * @desc Lists Secrets. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.list({ + * // Optional. The maximum number of results to be returned in a single page. If + * // set to 0, the server decides the number of results to return. If the + * // number is greater than 25000, it is capped at 25000. + * pageSize: 'placeholder-value', + * // Optional. Pagination token, returned earlier via + * // ListSecretsResponse.next_page_token. + * pageToken: 'placeholder-value', + * // Required. The resource name of the project associated with the + * // Secrets, in the format `projects/x`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "secrets": [], + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.list * @memberOf! () * @@ -1084,6 +1473,62 @@ export namespace secretmanager_v1beta1 { /** * secretmanager.projects.secrets.patch * @desc Updates metadata of an existing Secret. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.patch({ + * // Output only. The resource name of the Secret in the format `projects/x/secrets/x`. + * name: 'projects/my-project/secrets/my-secret', + * // Required. Specifies the fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "replication": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name", + * // "replication": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.patch * @memberOf! () * @@ -1156,6 +1601,59 @@ export namespace secretmanager_v1beta1 { /** * secretmanager.projects.secrets.setIamPolicy * @desc Sets the access control policy on the specified secret. Replaces any existing policy. Permissions on SecretVersions are enforced according to the policy set on the associated Secret. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/secrets/my-secret', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.setIamPolicy * @memberOf! () * @@ -1230,6 +1728,55 @@ export namespace secretmanager_v1beta1 { /** * secretmanager.projects.secrets.testIamPermissions * @desc Returns permissions that a caller has for the specified secret. If the secret does not exist, this call returns an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/secrets/my-secret', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.testIamPermissions * @memberOf! () * @@ -1474,6 +2021,48 @@ export namespace secretmanager_v1beta1 { /** * secretmanager.projects.secrets.versions.access * @desc Accesses a SecretVersion. This call returns the secret data. `projects/x/secrets/x/versions/latest` is an alias to the `latest` SecretVersion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.versions.access({ + * // Required. The resource name of the SecretVersion in the format + * // `projects/x/secrets/x/versions/x`. + * name: 'projects/my-project/secrets/my-secret/versions/my-version', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "payload": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.versions.access * @memberOf! () * @@ -1556,6 +2145,56 @@ export namespace secretmanager_v1beta1 { /** * secretmanager.projects.secrets.versions.destroy * @desc Destroys a SecretVersion. Sets the state of the SecretVersion to DESTROYED and irrevocably destroys the secret data. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.versions.destroy({ + * // Required. The resource name of the SecretVersion to destroy in the format + * // `projects/x/secrets/x/versions/x`. + * name: 'projects/my-project/secrets/my-secret/versions/my-version', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "destroyTime": "my_destroyTime", + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.versions.destroy * @memberOf! () * @@ -1632,6 +2271,56 @@ export namespace secretmanager_v1beta1 { /** * secretmanager.projects.secrets.versions.disable * @desc Disables a SecretVersion. Sets the state of the SecretVersion to DISABLED. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.versions.disable({ + * // Required. The resource name of the SecretVersion to disable in the format + * // `projects/x/secrets/x/versions/x`. + * name: 'projects/my-project/secrets/my-secret/versions/my-version', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "destroyTime": "my_destroyTime", + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.versions.disable * @memberOf! () * @@ -1708,6 +2397,56 @@ export namespace secretmanager_v1beta1 { /** * secretmanager.projects.secrets.versions.enable * @desc Enables a SecretVersion. Sets the state of the SecretVersion to ENABLED. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.versions.enable({ + * // Required. The resource name of the SecretVersion to enable in the format + * // `projects/x/secrets/x/versions/x`. + * name: 'projects/my-project/secrets/my-secret/versions/my-version', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "destroyTime": "my_destroyTime", + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.versions.enable * @memberOf! () * @@ -1784,6 +2523,52 @@ export namespace secretmanager_v1beta1 { /** * secretmanager.projects.secrets.versions.get * @desc Gets metadata for a SecretVersion. `projects/x/secrets/x/versions/latest` is an alias to the `latest` SecretVersion. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.versions.get({ + * // Required. The resource name of the SecretVersion in the format + * // `projects/x/secrets/x/versions/x`. + * // `projects/x/secrets/x/versions/latest` is an alias to the `latest` + * // SecretVersion. + * name: 'projects/my-project/secrets/my-secret/versions/my-version', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "destroyTime": "my_destroyTime", + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.versions.get * @memberOf! () * @@ -1856,6 +2641,57 @@ export namespace secretmanager_v1beta1 { /** * secretmanager.projects.secrets.versions.list * @desc Lists SecretVersions. This call does not return secret data. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/secretmanager.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 secretmanager = google.secretmanager('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 secretmanager.projects.secrets.versions.list({ + * // Optional. The maximum number of results to be returned in a single page. If + * // set to 0, the server decides the number of results to return. If the + * // number is greater than 25000, it is capped at 25000. + * pageSize: 'placeholder-value', + * // Optional. Pagination token, returned earlier via + * // ListSecretVersionsResponse.next_page_token][]. + * pageToken: 'placeholder-value', + * // Required. The resource name of the Secret associated with the + * // SecretVersions to list, in the format + * // `projects/x/secrets/x`. + * parent: 'projects/my-project/secrets/my-secret', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "totalSize": 0, + * // "versions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias secretmanager.projects.secrets.versions.list * @memberOf! () * diff --git a/src/apis/securitycenter/v1.ts b/src/apis/securitycenter/v1.ts index 225806b0b81..ffe502479c5 100644 --- a/src/apis/securitycenter/v1.ts +++ b/src/apis/securitycenter/v1.ts @@ -1017,52 +1017,48 @@ export namespace securitycenter_v1 { * securitycenter.organizations.getOrganizationSettings * @desc Gets the settings for an organization. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); + * const securitycenter = google.securitycenter('v1'); * - * authorize(function(authClient) { - * var request = { - * // Name of the organization to get organization settings for. Its format is - * // "organizations/[organization_id]/organizationSettings". - * name: 'organizations/my-organization/organizationSettings', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * securityCommandCenter.organizations.getOrganizationSettings(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await securitycenter.organizations.getOrganizationSettings({ + * // Required. Name of the organization to get organization settings for. Its format is + * // "organizations/[organization_id]/organizationSettings". + * name: 'organizations/my-organization/organizationSettings', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assetDiscoveryConfig": {}, + * // "enableAssetDiscovery": false, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.getOrganizationSettings * @memberOf! () * @@ -1140,59 +1136,64 @@ export namespace securitycenter_v1 { * securitycenter.organizations.updateOrganizationSettings * @desc Updates an organization's settings. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); + * const securitycenter = google.securitycenter('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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 securitycenter.organizations.updateOrganizationSettings({ * // The relative resource name of the settings. See: * // https://cloud.google.com/apis/design/resource_names#relative_resource_name * // Example: - * // "organizations/123/organizationSettings". - * name: 'organizations/my-organization/organizationSettings', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * // "organizations/{organization_id}/organizationSettings". + * name: 'organizations/my-organization/organizationSettings', + * // The FieldMask to use when updating the settings resource. + * // + * // If empty all mutable fields will be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "assetDiscoveryConfig": {}, + * // "enableAssetDiscovery": false, + * // "name": "my_name" + * // } * }, - * - * auth: authClient, - * }; - * - * securityCommandCenter.organizations.updateOrganizationSettings(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assetDiscoveryConfig": {}, + * // "enableAssetDiscovery": false, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.updateOrganizationSettings * @memberOf! () * @@ -1313,69 +1314,62 @@ export namespace securitycenter_v1 { * securitycenter.organizations.assets.group * @desc Filters an organization's assets and groups them by their specified properties. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); + * const securitycenter = google.securitycenter('v1'); * - * authorize(function(authClient) { - * var request = { - * // Name of the organization to groupBy. Its format is - * // "organizations/[organization_id]". - * parent: 'organizations/my-organization', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * 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/cloud-platform'], + * }); * - * var groupByResultsPage = response['groupByResults']; - * if (!groupByResultsPage) { - * return; - * } - * for (var i = 0; i < groupByResultsPage.length; i++) { - * // TODO: Change code below to process each resource in `groupByResultsPage`: - * console.log(JSON.stringify(groupByResultsPage[i], null, 2)); - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * securityCommandCenter.organizations.assets.group(request, handlePage); - * } - * }; + * // Do the magic + * const res = await securitycenter.organizations.assets.group({ + * // Required. Name of the organization to groupBy. Its format is + * // "organizations/[organization_id]". + * parent: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "compareDuration": "my_compareDuration", + * // "filter": "my_filter", + * // "groupBy": "my_groupBy", + * // "pageSize": 0, + * // "pageToken": "my_pageToken", + * // "readTime": "my_readTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "groupByResults": [], + * // "nextPageToken": "my_nextPageToken", + * // "readTime": "my_readTime", + * // "totalSize": 0 + * // } + * } * - * securityCommandCenter.organizations.assets.group(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.assets.group * @memberOf! () * @@ -1453,65 +1447,175 @@ export namespace securitycenter_v1 { * securitycenter.organizations.assets.list * @desc Lists an organization's assets. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the organization assets should belong to. Its format is - * // "organizations/[organization_id]". - * parent: 'organizations/my-organization', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * const securitycenter = google.securitycenter('v1'); * - * var listAssetsResultsPage = response['listAssetsResults']; - * if (!listAssetsResultsPage) { - * return; - * } - * for (var i = 0; i < listAssetsResultsPage.length; i++) { - * // TODO: Change code below to process each resource in `listAssetsResultsPage`: - * console.log(JSON.stringify(listAssetsResultsPage[i], null, 2)); - * } + * 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/cloud-platform'], + * }); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * securityCommandCenter.organizations.assets.list(request, handlePage); - * } - * }; + * // 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 securitycenter.organizations.assets.list({ + * // When compare_duration is set, the ListAssetsResult's "state_change" + * // attribute is updated to indicate whether the asset was added, removed, or + * // remained present during the compare_duration period of time that precedes + * // the read_time. This is the time between (read_time - compare_duration) and + * // read_time. + * // + * // The state_change value is derived based on the presence of the asset at the + * // two points in time. Intermediate state changes between the two times don't + * // affect the result. For example, the results aren't affected if the asset is + * // removed and re-created again. + * // + * // Possible "state_change" values when compare_duration is specified: + * // + * // * "ADDED": indicates that the asset was not present at the start of + * // compare_duration, but present at read_time. + * // * "REMOVED": indicates that the asset was present at the start of + * // compare_duration, but not present at read_time. + * // * "ACTIVE": indicates that the asset was present at both the + * // start and the end of the time period defined by + * // compare_duration and read_time. + * // + * // If compare_duration is not specified, then the only possible state_change + * // is "UNUSED", which will be the state_change set for all assets present at + * // read_time. + * compareDuration: 'placeholder-value', + * // Optional. A field mask to specify the ListAssetsResult fields to be listed in the + * // response. + * // An empty field mask will list all fields. + * fieldMask: 'placeholder-value', + * // Expression that defines the filter to apply across assets. + * // The expression is a list of zero or more restrictions combined via logical + * // operators `AND` and `OR`. + * // Parentheses are supported, and `OR` has higher precedence than `AND`. + * // + * // Restrictions have the form ` ` and may have a `-` + * // character in front of them to indicate negation. The fields map to those + * // defined in the Asset resource. Examples include: + * // + * // * name + * // * security_center_properties.resource_name + * // * resource_properties.a_property + * // * security_marks.marks.marka + * // + * // The supported operators are: + * // + * // * `=` for all value types. + * // * `>`, `<`, `>=`, `<=` for integer values. + * // * `:`, meaning substring matching, for strings. + * // + * // The supported value types are: + * // + * // * string literals in quotes. + * // * integer literals without quotes. + * // * boolean literals `true` and `false` without quotes. + * // + * // The following are the allowed field and operator combinations: + * // + * // * name: `=` + * // * update_time: `=`, `>`, `<`, `>=`, `<=` + * // + * // Usage: This should be milliseconds since epoch or an RFC3339 string. + * // Examples: + * // "update_time = \"2019-06-10T16:07:18-07:00\"" + * // "update_time = 1560208038000" + * // + * // * create_time: `=`, `>`, `<`, `>=`, `<=` + * // + * // Usage: This should be milliseconds since epoch or an RFC3339 string. + * // Examples: + * // "create_time = \"2019-06-10T16:07:18-07:00\"" + * // "create_time = 1560208038000" + * // + * // * iam_policy.policy_blob: `=`, `:` + * // * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * // * security_marks.marks: `=`, `:` + * // * security_center_properties.resource_name: `=`, `:` + * // * security_center_properties.resource_display_name: `=`, `:` + * // * security_center_properties.resource_type: `=`, `:` + * // * security_center_properties.resource_parent: `=`, `:` + * // * security_center_properties.resource_parent_display_name: `=`, `:` + * // * security_center_properties.resource_project: `=`, `:` + * // * security_center_properties.resource_project_display_name: `=`, `:` + * // * security_center_properties.resource_owners: `=`, `:` + * // + * // For example, `resource_properties.size = 100` is a valid filter string. + * // + * // Use a partial match on the empty string to filter based on a property + * // existing: "resource_properties.my_property : \"\"" + * // + * // Use a negated partial match on the empty string to filter based on a + * // property not existing: "-resource_properties.my_property : \"\"" + * filter: 'placeholder-value', + * // Expression that defines what fields and order to use for sorting. The + * // string value should follow SQL syntax: comma separated list of fields. For + * // example: "name,resource_properties.a_property". The default sorting order + * // is ascending. To specify descending order for a field, a suffix " desc" + * // should be appended to the field name. For example: "name + * // desc,resource_properties.a_property". Redundant space characters in the + * // syntax are insignificant. "name desc,resource_properties.a_property" and " + * // name desc , resource_properties.a_property " are equivalent. + * // + * // The following fields are supported: + * // name + * // update_time + * // resource_properties + * // security_marks.marks + * // security_center_properties.resource_name + * // security_center_properties.resource_display_name + * // security_center_properties.resource_parent + * // security_center_properties.resource_parent_display_name + * // security_center_properties.resource_project + * // security_center_properties.resource_project_display_name + * // security_center_properties.resource_type + * orderBy: 'placeholder-value', + * // The maximum number of results to return in a single response. Default is + * // 10, minimum is 1, maximum is 1000. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListAssetsResponse`; indicates + * // that this is a continuation of a prior `ListAssets` call, and + * // that the system should return the next page of data. + * pageToken: 'placeholder-value', + * // Required. Name of the organization assets should belong to. Its format is + * // "organizations/[organization_id]". + * parent: 'organizations/my-organization', + * // Time used as a reference point when filtering assets. The filter is limited + * // to assets existing at the supplied time and their values are those at that + * // specific time. Absence of this field will default to the API's version of + * // NOW. + * readTime: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "listAssetsResults": [], + * // "nextPageToken": "my_nextPageToken", + * // "readTime": "my_readTime", + * // "totalSize": 0 + * // } + * } * - * securityCommandCenter.organizations.assets.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.assets.list * @memberOf! () * @@ -1595,56 +1699,56 @@ export namespace securitycenter_v1 { * securitycenter.organizations.assets.runDiscovery * @desc Runs asset discovery. The discovery is tracked with a long-running operation. This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the organization to run asset discovery for. Its format is - * // "organizations/[organization_id]". - * parent: 'organizations/my-organization', // TODO: Update placeholder value. + * const securitycenter = google.securitycenter('v1'); * - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * securityCommandCenter.organizations.assets.runDiscovery(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await securitycenter.organizations.assets.runDiscovery({ + * // Required. Name of the organization to run asset discovery for. Its format is + * // "organizations/[organization_id]". + * parent: 'organizations/my-organization', * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.assets.runDiscovery * @memberOf! () * @@ -1722,60 +1826,69 @@ export namespace securitycenter_v1 { * securitycenter.organizations.assets.updateSecurityMarks * @desc Updates security marks. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); + * const securitycenter = google.securitycenter('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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await securitycenter.organizations.assets.updateSecurityMarks({ * // The relative resource name of the SecurityMarks. See: * // https://cloud.google.com/apis/design/resource_names#relative_resource_name * // Examples: - * // "organizations/123/assets/456/securityMarks" - * // "organizations/123/sources/456/findings/789/securityMarks". - * name: 'organizations/my-organization/assets/my-asset/securityMarks', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * // "organizations/{organization_id}/assets/{asset_id}/securityMarks" + * // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". + * name: 'organizations/my-organization/assets/my-asset/securityMarks', + * // The time at which the updated SecurityMarks take effect. + * // If not set uses current server time. Updates will be applied to the + * // SecurityMarks that are active immediately preceding this time. + * startTime: 'placeholder-value', + * // The FieldMask to use when updating the security marks resource. + * // + * // The field mask must not contain duplicate fields. + * // If empty or set to "marks", all marks will be replaced. Individual + * // marks can be updated using "marks.". + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "marks": {}, + * // "name": "my_name" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * securityCommandCenter.organizations.assets.updateSecurityMarks(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "marks": {}, + * // "name": "my_name" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.assets.updateSecurityMarks * @memberOf! () * @@ -1960,6 +2073,68 @@ export namespace securitycenter_v1 { /** * securitycenter.organizations.notificationConfigs.create * @desc Creates a notification config. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.notificationConfigs.create({ + * // Required. + * // Unique identifier provided by the client within the parent scope. + * // It must be between 1 and 128 characters, and contains alphanumeric + * // characters, underscores or hyphens only. + * configId: 'placeholder-value', + * // Required. Resource name of the new notification config's parent. Its format is + * // "organizations/[organization_id]". + * parent: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "pubsubTopic": "my_pubsubTopic", + * // "serviceAccount": "my_serviceAccount", + * // "streamingConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "pubsubTopic": "my_pubsubTopic", + * // "serviceAccount": "my_serviceAccount", + * // "streamingConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.notificationConfigs.create * @memberOf! () * @@ -2037,6 +2212,46 @@ export namespace securitycenter_v1 { /** * securitycenter.organizations.notificationConfigs.delete * @desc Deletes a notification config. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.notificationConfigs.delete({ + * // Required. Name of the notification config to delete. Its format is + * // "organizations/[organization_id]/notificationConfigs/[config_id]". + * name: + * 'organizations/my-organization/notificationConfigs/my-notificationConfig', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.notificationConfigs.delete * @memberOf! () * @@ -2107,6 +2322,52 @@ export namespace securitycenter_v1 { /** * securitycenter.organizations.notificationConfigs.get * @desc Gets a notification config. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.notificationConfigs.get({ + * // Required. Name of the notification config to get. Its format is + * // "organizations/[organization_id]/notificationConfigs/[config_id]". + * name: + * 'organizations/my-organization/notificationConfigs/my-notificationConfig', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "pubsubTopic": "my_pubsubTopic", + * // "serviceAccount": "my_serviceAccount", + * // "streamingConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.notificationConfigs.get * @memberOf! () * @@ -2179,6 +2440,55 @@ export namespace securitycenter_v1 { /** * securitycenter.organizations.notificationConfigs.list * @desc Lists notification configs. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.notificationConfigs.list({ + * // The maximum number of results to return in a single response. Default is + * // 10, minimum is 1, maximum is 1000. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListNotificationConfigsResponse`; indicates + * // that this is a continuation of a prior `ListNotificationConfigs` call, and + * // that the system should return the next page of data. + * pageToken: 'placeholder-value', + * // Required. Name of the organization to list notification configs. + * // Its format is "organizations/[organization_id]". + * parent: 'organizations/my-organization', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "notificationConfigs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.notificationConfigs.list * @memberOf! () * @@ -2265,6 +2575,70 @@ export namespace securitycenter_v1 { /** * securitycenter.organizations.notificationConfigs.patch * @desc Updates a notification config. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.notificationConfigs.patch({ + * // The relative resource name of this notification config. See: + * // https://cloud.google.com/apis/design/resource_names#relative_resource_name + * // Example: + * // "organizations/{organization_id}/notificationConfigs/notify_public_bucket". + * name: + * 'organizations/my-organization/notificationConfigs/my-notificationConfig', + * // The FieldMask to use when updating the notification config. + * // + * // If empty all mutable fields will be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "pubsubTopic": "my_pubsubTopic", + * // "serviceAccount": "my_serviceAccount", + * // "streamingConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "name": "my_name", + * // "pubsubTopic": "my_pubsubTopic", + * // "serviceAccount": "my_serviceAccount", + * // "streamingConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.notificationConfigs.patch * @memberOf! () * @@ -2434,48 +2808,43 @@ export namespace securitycenter_v1 { * securitycenter.organizations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); + * const securitycenter = google.securitycenter('v1'); * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource to be cancelled. - * name: 'organizations/my-organization/operations/my-operation', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * securityCommandCenter.organizations.operations.cancel(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await securitycenter.organizations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'organizations/my-organization/operations/my-operation', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.operations.cancel * @memberOf! () * @@ -2547,48 +2916,43 @@ export namespace securitycenter_v1 { * securitycenter.organizations.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); + * const securitycenter = google.securitycenter('v1'); * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource to be deleted. - * name: 'organizations/my-organization/operations/my-operation', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * securityCommandCenter.organizations.operations.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await securitycenter.organizations.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'organizations/my-organization/operations/my-operation', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.operations.delete * @memberOf! () * @@ -2660,51 +3024,49 @@ export namespace securitycenter_v1 { * securitycenter.organizations.operations.get * @desc 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. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource. - * name: 'organizations/my-organization/operations/my-operation', // TODO: Update placeholder value. + * const securitycenter = google.securitycenter('v1'); * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * securityCommandCenter.organizations.operations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await securitycenter.organizations.operations.get({ + * // The name of the operation resource. + * name: 'organizations/my-organization/operations/my-operation', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.operations.get * @memberOf! () * @@ -2778,64 +3140,52 @@ export namespace securitycenter_v1 { * securitycenter.organizations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation's parent resource. - * name: 'organizations/my-organization/operations', // TODO: Update placeholder value. + * const securitycenter = google.securitycenter('v1'); * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * var operationsPage = response['operations']; - * if (!operationsPage) { - * return; - * } - * for (var i = 0; i < operationsPage.length; i++) { - * // TODO: Change code below to process each resource in `operationsPage`: - * console.log(JSON.stringify(operationsPage[i], null, 2)); - * } + * // Do the magic + * const res = await securitycenter.organizations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'organizations/my-organization/operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * securityCommandCenter.organizations.operations.list(request, handlePage); - * } - * }; + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } * - * securityCommandCenter.organizations.operations.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.operations.list * @memberOf! () * @@ -2984,56 +3334,58 @@ export namespace securitycenter_v1 { * securitycenter.organizations.sources.create * @desc Creates a source. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); + * const securitycenter = google.securitycenter('v1'); * - * authorize(function(authClient) { - * var request = { - * // Resource name of the new source's parent. Its format should be - * // "organizations/[organization_id]". - * parent: 'organizations/my-organization', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * securityCommandCenter.organizations.sources.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await securitycenter.organizations.sources.create({ + * // Required. Resource name of the new source's parent. Its format should be + * // "organizations/[organization_id]". + * parent: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.sources.create * @memberOf! () * @@ -3109,52 +3461,48 @@ export namespace securitycenter_v1 { * securitycenter.organizations.sources.get * @desc Gets a source. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Relative resource name of the source. Its format is - * // "organizations/[organization_id]/source/[source_id]". - * name: 'organizations/my-organization/sources/my-source', // TODO: Update placeholder value. + * const securitycenter = google.securitycenter('v1'); * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * securityCommandCenter.organizations.sources.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await securitycenter.organizations.sources.get({ + * // Required. Relative resource name of the source. Its format is + * // "organizations/[organization_id]/source/[source_id]". + * name: 'organizations/my-organization/sources/my-source', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.sources.get * @memberOf! () * @@ -3226,56 +3574,57 @@ export namespace securitycenter_v1 { * securitycenter.organizations.sources.getIamPolicy * @desc Gets the access control policy on the specified Source. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); + * const securitycenter = google.securitycenter('v1'); * - * authorize(function(authClient) { - * var request = { + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.getIamPolicy({ * // REQUIRED: The resource for which the policy is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'organizations/my-organization/sources/my-source', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'organizations/my-organization/sources/my-source', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } * }, - * - * auth: authClient, - * }; - * - * securityCommandCenter.organizations.sources.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.sources.getIamPolicy * @memberOf! () * @@ -3351,65 +3700,54 @@ export namespace securitycenter_v1 { * securitycenter.organizations.sources.list * @desc Lists all sources belonging to an organization. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Resource name of the parent of sources to list. Its format should be - * // "organizations/[organization_id]". - * parent: 'organizations/my-organization', // TODO: Update placeholder value. + * const securitycenter = google.securitycenter('v1'); * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * 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/cloud-platform'], + * }); * - * var sourcesPage = response['sources']; - * if (!sourcesPage) { - * return; - * } - * for (var i = 0; i < sourcesPage.length; i++) { - * // TODO: Change code below to process each resource in `sourcesPage`: - * console.log(JSON.stringify(sourcesPage[i], null, 2)); - * } + * // 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 securitycenter.organizations.sources.list({ + * // The maximum number of results to return in a single response. Default is + * // 10, minimum is 1, maximum is 1000. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListSourcesResponse`; indicates + * // that this is a continuation of a prior `ListSources` call, and + * // that the system should return the next page of data. + * pageToken: 'placeholder-value', + * // Required. Resource name of the parent of sources to list. Its format should be + * // "organizations/[organization_id]". + * parent: 'organizations/my-organization', + * }); + * console.log(res.data); * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * securityCommandCenter.organizations.sources.list(request, handlePage); - * } - * }; + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "sources": [] + * // } + * } * - * securityCommandCenter.organizations.sources.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.sources.list * @memberOf! () * @@ -3488,59 +3826,64 @@ export namespace securitycenter_v1 { * securitycenter.organizations.sources.patch * @desc Updates a source. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); + * const securitycenter = google.securitycenter('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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 securitycenter.organizations.sources.patch({ * // The relative resource name of this source. See: * // https://cloud.google.com/apis/design/resource_names#relative_resource_name * // Example: - * // "organizations/123/sources/456" - * name: 'organizations/my-organization/sources/my-source', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * // "organizations/{organization_id}/sources/{source_id}" + * name: 'organizations/my-organization/sources/my-source', + * // The FieldMask to use when updating the source resource. + * // + * // If empty all mutable fields will be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } * }, - * - * auth: authClient, - * }; - * - * securityCommandCenter.organizations.sources.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.sources.patch * @memberOf! () * @@ -3614,56 +3957,58 @@ export namespace securitycenter_v1 { * securitycenter.organizations.sources.setIamPolicy * @desc Sets the access control policy on the specified Source. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); + * const securitycenter = google.securitycenter('v1'); * - * authorize(function(authClient) { - * var request = { + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.setIamPolicy({ * // REQUIRED: The resource for which the policy is being specified. * // See the operation documentation for the appropriate value for this field. - * resource_: 'organizations/my-organization/sources/my-source', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'organizations/my-organization/sources/my-source', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } * }, - * - * auth: authClient, - * }; - * - * securityCommandCenter.organizations.sources.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.sources.setIamPolicy * @memberOf! () * @@ -3739,56 +4084,54 @@ export namespace securitycenter_v1 { * securitycenter.organizations.sources.testIamPermissions * @desc Returns the permissions that a caller has on the specified source. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); + * const securitycenter = google.securitycenter('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/cloud-platform'], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 securitycenter.organizations.sources.testIamPermissions({ * // REQUIRED: The resource for which the policy detail is being requested. * // See the operation documentation for the appropriate value for this field. - * resource_: 'organizations/my-organization/sources/my-source', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * resource: 'organizations/my-organization/sources/my-source', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * securityCommandCenter.organizations.sources.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.sources.testIamPermissions * @memberOf! () * @@ -4002,56 +4345,76 @@ export namespace securitycenter_v1 { * securitycenter.organizations.sources.findings.create * @desc Creates a finding. The corresponding source must exist for finding creation to succeed. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); + * const securitycenter = google.securitycenter('v1'); * - * authorize(function(authClient) { - * var request = { - * // Resource name of the new finding's parent. Its format should be - * // "organizations/[organization_id]/sources/[source_id]". - * parent: 'organizations/my-organization/sources/my-source', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 securitycenter.organizations.sources.findings.create({ + * // Required. Unique identifier provided by the client within the parent scope. + * // It must be alphanumeric and less than or equal to 32 characters and + * // greater than 0 characters in length. + * findingId: 'placeholder-value', + * // Required. Resource name of the new finding's parent. Its format should be + * // "organizations/[organization_id]/sources/[source_id]". + * parent: 'organizations/my-organization/sources/my-source', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "category": "my_category", + * // "createTime": "my_createTime", + * // "eventTime": "my_eventTime", + * // "externalUri": "my_externalUri", + * // "name": "my_name", + * // "parent": "my_parent", + * // "resourceName": "my_resourceName", + * // "securityMarks": {}, + * // "sourceProperties": {}, + * // "state": "my_state" + * // } * }, - * - * auth: authClient, - * }; - * - * securityCommandCenter.organizations.sources.findings.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "category": "my_category", + * // "createTime": "my_createTime", + * // "eventTime": "my_eventTime", + * // "externalUri": "my_externalUri", + * // "name": "my_name", + * // "parent": "my_parent", + * // "resourceName": "my_resourceName", + * // "securityMarks": {}, + * // "sourceProperties": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.sources.findings.create * @memberOf! () * @@ -4128,71 +4491,64 @@ export namespace securitycenter_v1 { * securitycenter.organizations.sources.findings.group * @desc Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); + * const securitycenter = google.securitycenter('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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { - * // Name of the source to groupBy. Its format is + * // Do the magic + * const res = await securitycenter.organizations.sources.findings.group({ + * // Required. Name of the source to groupBy. Its format is * // "organizations/[organization_id]/sources/[source_id]". To groupBy across * // all sources provide a source_id of `-`. For example: - * // organizations/123/sources/- - * parent: 'organizations/my-organization/sources/my-source', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // organizations/{organization_id}/sources/- + * parent: 'organizations/my-organization/sources/my-source', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "compareDuration": "my_compareDuration", + * // "filter": "my_filter", + * // "groupBy": "my_groupBy", + * // "pageSize": 0, + * // "pageToken": "my_pageToken", + * // "readTime": "my_readTime" + * // } * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "groupByResults": [], + * // "nextPageToken": "my_nextPageToken", + * // "readTime": "my_readTime", + * // "totalSize": 0 + * // } + * } * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var groupByResultsPage = response['groupByResults']; - * if (!groupByResultsPage) { - * return; - * } - * for (var i = 0; i < groupByResultsPage.length; i++) { - * // TODO: Change code below to process each resource in `groupByResultsPage`: - * console.log(JSON.stringify(groupByResultsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * securityCommandCenter.organizations.sources.findings.group(request, handlePage); - * } - * }; - * - * securityCommandCenter.organizations.sources.findings.group(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.sources.findings.group * @memberOf! () * @@ -4272,67 +4628,166 @@ export namespace securitycenter_v1 { * securitycenter.organizations.sources.findings.list * @desc Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); + * const securitycenter = google.securitycenter('v1'); * - * authorize(function(authClient) { - * var request = { - * // Name of the source the findings belong to. Its format is + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.findings.list({ + * // When compare_duration is set, the ListFindingsResult's "state_change" + * // attribute is updated to indicate whether the finding had its state changed, + * // the finding's state remained unchanged, or if the finding was added in any + * // state during the compare_duration period of time that precedes the + * // read_time. This is the time between (read_time - compare_duration) and + * // read_time. + * // + * // The state_change value is derived based on the presence and state of the + * // finding at the two points in time. Intermediate state changes between the + * // two times don't affect the result. For example, the results aren't affected + * // if the finding is made inactive and then active again. + * // + * // Possible "state_change" values when compare_duration is specified: + * // + * // * "CHANGED": indicates that the finding was present and matched the given + * // filter at the start of compare_duration, but changed its + * // state at read_time. + * // * "UNCHANGED": indicates that the finding was present and matched the given + * // filter at the start of compare_duration and did not change + * // state at read_time. + * // * "ADDED": indicates that the finding did not match the given filter or + * // was not present at the start of compare_duration, but was + * // present at read_time. + * // * "REMOVED": indicates that the finding was present and matched the + * // filter at the start of compare_duration, but did not match + * // the filter at read_time. + * // + * // If compare_duration is not specified, then the only possible state_change + * // is "UNUSED", which will be the state_change set for all findings present at + * // read_time. + * compareDuration: 'placeholder-value', + * // Optional. A field mask to specify the Finding fields to be listed in the response. + * // An empty field mask will list all fields. + * fieldMask: 'placeholder-value', + * // Expression that defines the filter to apply across findings. + * // The expression is a list of one or more restrictions combined via logical + * // operators `AND` and `OR`. + * // Parentheses are supported, and `OR` has higher precedence than `AND`. + * // + * // Restrictions have the form ` ` and may have a `-` + * // character in front of them to indicate negation. Examples include: + * // + * // * name + * // * source_properties.a_property + * // * security_marks.marks.marka + * // + * // The supported operators are: + * // + * // * `=` for all value types. + * // * `>`, `<`, `>=`, `<=` for integer values. + * // * `:`, meaning substring matching, for strings. + * // + * // The supported value types are: + * // + * // * string literals in quotes. + * // * integer literals without quotes. + * // * boolean literals `true` and `false` without quotes. + * // + * // The following field and operator combinations are supported: + * // + * // name: `=` + * // parent: `=`, `:` + * // resource_name: `=`, `:` + * // state: `=`, `:` + * // category: `=`, `:` + * // external_uri: `=`, `:` + * // event_time: `=`, `>`, `<`, `>=`, `<=` + * // + * // Usage: This should be milliseconds since epoch or an RFC3339 string. + * // Examples: + * // "event_time = \"2019-06-10T16:07:18-07:00\"" + * // "event_time = 1560208038000" + * // + * // security_marks.marks: `=`, `:` + * // source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * // + * // For example, `source_properties.size = 100` is a valid filter string. + * // + * // Use a partial match on the empty string to filter based on a property + * // existing: "source_properties.my_property : \"\"" + * // + * // Use a negated partial match on the empty string to filter based on a + * // property not existing: "-source_properties.my_property : \"\"" + * filter: 'placeholder-value', + * // Expression that defines what fields and order to use for sorting. The + * // string value should follow SQL syntax: comma separated list of fields. For + * // example: "name,resource_properties.a_property". The default sorting order + * // is ascending. To specify descending order for a field, a suffix " desc" + * // should be appended to the field name. For example: "name + * // desc,source_properties.a_property". Redundant space characters in the + * // syntax are insignificant. "name desc,source_properties.a_property" and " + * // name desc , source_properties.a_property " are equivalent. + * // + * // The following fields are supported: + * // name + * // parent + * // state + * // category + * // resource_name + * // event_time + * // source_properties + * // security_marks.marks + * orderBy: 'placeholder-value', + * // The maximum number of results to return in a single response. Default is + * // 10, minimum is 1, maximum is 1000. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListFindingsResponse`; indicates + * // that this is a continuation of a prior `ListFindings` call, and + * // that the system should return the next page of data. + * pageToken: 'placeholder-value', + * // Required. Name of the source the findings belong to. Its format is * // "organizations/[organization_id]/sources/[source_id]". To list across all * // sources provide a source_id of `-`. For example: - * // organizations/123/sources/- - * parent: 'organizations/my-organization/sources/my-source', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var listFindingsResultsPage = response['listFindingsResults']; - * if (!listFindingsResultsPage) { - * return; - * } - * for (var i = 0; i < listFindingsResultsPage.length; i++) { - * // TODO: Change code below to process each resource in `listFindingsResultsPage`: - * console.log(JSON.stringify(listFindingsResultsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * securityCommandCenter.organizations.sources.findings.list(request, handlePage); - * } - * }; + * // organizations/{organization_id}/sources/- + * parent: 'organizations/my-organization/sources/my-source', + * // Time used as a reference point when filtering findings. The filter is + * // limited to findings existing at the supplied time and their values are + * // those at that specific time. Absence of this field will default to the + * // API's version of NOW. + * readTime: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "listFindingsResults": [], + * // "nextPageToken": "my_nextPageToken", + * // "readTime": "my_readTime", + * // "totalSize": 0 + * // } + * } * - * securityCommandCenter.organizations.sources.findings.list(request, handlePage); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.sources.findings.list * @memberOf! () * @@ -4418,59 +4873,82 @@ export namespace securitycenter_v1 { * securitycenter.organizations.sources.findings.patch * @desc Creates or updates a finding. The corresponding source must exist for a finding creation to succeed. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); + * const securitycenter = google.securitycenter('v1'); * - * authorize(function(authClient) { - * var request = { + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.findings.patch({ * // The relative resource name of this finding. See: * // https://cloud.google.com/apis/design/resource_names#relative_resource_name * // Example: - * // "organizations/123/sources/456/findings/789" - * name: 'organizations/my-organization/sources/my-source/findings/my-finding', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}" + * name: 'organizations/my-organization/sources/my-source/findings/my-finding', + * // The FieldMask to use when updating the finding resource. This field should + * // not be specified when creating a finding. + * // + * // When updating a finding, an empty mask is treated as updating all mutable + * // fields and replacing source_properties. Individual source_properties can + * // be added/updated by using "source_properties." in the field + * // mask. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "category": "my_category", + * // "createTime": "my_createTime", + * // "eventTime": "my_eventTime", + * // "externalUri": "my_externalUri", + * // "name": "my_name", + * // "parent": "my_parent", + * // "resourceName": "my_resourceName", + * // "securityMarks": {}, + * // "sourceProperties": {}, + * // "state": "my_state" + * // } * }, - * - * auth: authClient, - * }; - * - * securityCommandCenter.organizations.sources.findings.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "category": "my_category", + * // "createTime": "my_createTime", + * // "eventTime": "my_eventTime", + * // "externalUri": "my_externalUri", + * // "name": "my_name", + * // "parent": "my_parent", + * // "resourceName": "my_resourceName", + * // "securityMarks": {}, + * // "sourceProperties": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.sources.findings.patch * @memberOf! () * @@ -4544,58 +5022,66 @@ export namespace securitycenter_v1 { * securitycenter.organizations.sources.findings.setState * @desc Updates the state of a finding. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); + * const securitycenter = google.securitycenter('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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { - * // The relative resource name of the finding. See: + * // Do the magic + * const res = await securitycenter.organizations.sources.findings.setState({ + * // Required. The relative resource name of the finding. See: * // https://cloud.google.com/apis/design/resource_names#relative_resource_name * // Example: - * // "organizations/123/sources/456/finding/789". - * name: 'organizations/my-organization/sources/my-source/findings/my-finding', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * // "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + * name: 'organizations/my-organization/sources/my-source/findings/my-finding', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "startTime": "my_startTime", + * // "state": "my_state" + * // } * }, - * - * auth: authClient, - * }; - * - * securityCommandCenter.organizations.sources.findings.setState(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "category": "my_category", + * // "createTime": "my_createTime", + * // "eventTime": "my_eventTime", + * // "externalUri": "my_externalUri", + * // "name": "my_name", + * // "parent": "my_parent", + * // "resourceName": "my_resourceName", + * // "securityMarks": {}, + * // "sourceProperties": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.sources.findings.setState * @memberOf! () * @@ -4671,60 +5157,72 @@ export namespace securitycenter_v1 { * securitycenter.organizations.sources.findings.updateSecurityMarks * @desc Updates security marks. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Security Command Center API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/securitycenter - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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'); - * var securityCommandCenter = google.securitycommandcenter('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The relative resource name of the SecurityMarks. See: - * // https://cloud.google.com/apis/design/resource_names#relative_resource_name - * // Examples: - * // "organizations/123/assets/456/securityMarks" - * // "organizations/123/sources/456/findings/789/securityMarks". - * name: 'organizations/my-organization/sources/my-source/findings/my-finding/securityMarks', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. - * }, + * const securitycenter = google.securitycenter('v1'); * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * securityCommandCenter.organizations.sources.findings.updateSecurityMarks(request, function(err, response) { - * if (err) { - * console.error(err); - * return; + * // 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 securitycenter.organizations.sources.findings.updateSecurityMarks( + * { + * // The relative resource name of the SecurityMarks. See: + * // https://cloud.google.com/apis/design/resource_names#relative_resource_name + * // Examples: + * // "organizations/{organization_id}/assets/{asset_id}/securityMarks" + * // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". + * name: + * 'organizations/my-organization/sources/my-source/findings/my-finding/securityMarks', + * // The time at which the updated SecurityMarks take effect. + * // If not set uses current server time. Updates will be applied to the + * // SecurityMarks that are active immediately preceding this time. + * startTime: 'placeholder-value', + * // The FieldMask to use when updating the security marks resource. + * // + * // The field mask must not contain duplicate fields. + * // If empty or set to "marks", all marks will be replaced. Individual + * // marks can be updated using "marks.". + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "marks": {}, + * // "name": "my_name" + * // } + * }, * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "marks": {}, + * // "name": "my_name" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias securitycenter.organizations.sources.findings.updateSecurityMarks * @memberOf! () * diff --git a/src/apis/securitycenter/v1beta1.ts b/src/apis/securitycenter/v1beta1.ts index 3056f901cb0..3356a02aeb5 100644 --- a/src/apis/securitycenter/v1beta1.ts +++ b/src/apis/securitycenter/v1beta1.ts @@ -948,6 +948,49 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.getOrganizationSettings * @desc Gets the settings for an organization. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.getOrganizationSettings({ + * // Required. Name of the organization to get organization settings for. Its format is + * // "organizations/[organization_id]/organizationSettings". + * name: 'organizations/my-organization/organizationSettings', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assetDiscoveryConfig": {}, + * // "enableAssetDiscovery": false, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.getOrganizationSettings * @memberOf! () * @@ -1024,6 +1067,63 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.updateOrganizationSettings * @desc Updates an organization's settings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.updateOrganizationSettings({ + * // The relative resource name of the settings. See: + * // https://cloud.google.com/apis/design/resource_names#relative_resource_name + * // Example: + * // "organizations/{organization_id}/organizationSettings". + * name: 'organizations/my-organization/organizationSettings', + * // The FieldMask to use when updating the settings resource. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "assetDiscoveryConfig": {}, + * // "enableAssetDiscovery": false, + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assetDiscoveryConfig": {}, + * // "enableAssetDiscovery": false, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.updateOrganizationSettings * @memberOf! () * @@ -1143,6 +1243,62 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.assets.group * @desc Filters an organization's assets and groups them by their specified properties. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.assets.group({ + * // Required. Name of the organization to groupBy. Its format is + * // "organizations/[organization_id]". + * parent: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "compareDuration": "my_compareDuration", + * // "filter": "my_filter", + * // "groupBy": "my_groupBy", + * // "pageSize": 0, + * // "pageToken": "my_pageToken", + * // "readTime": "my_readTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "groupByResults": [], + * // "nextPageToken": "my_nextPageToken", + * // "readTime": "my_readTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.assets.group * @memberOf! () * @@ -1219,6 +1375,127 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.assets.list * @desc Lists an organization's assets. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.assets.list({ + * // When compare_duration is set, the ListAssetResult's "state" attribute is + * // updated to indicate whether the asset was added, removed, or remained + * // present during the compare_duration period of time that precedes the + * // read_time. This is the time between (read_time - + * // compare_duration) and read_time. + * // + * // The state value is derived based on the presence of the asset at the two + * // points in time. Intermediate state changes between the two times don't + * // affect the result. For example, the results aren't affected if the asset is + * // removed and re-created again. + * // + * // Possible "state" values when compare_duration is specified: + * // + * // * "ADDED": indicates that the asset was not present before + * // compare_duration, but present at read_time. + * // * "REMOVED": indicates that the asset was present at the start of + * // compare_duration, but not present at read_time. + * // * "ACTIVE": indicates that the asset was present at both the + * // start and the end of the time period defined by + * // compare_duration and read_time. + * // + * // If compare_duration is not specified, then the only possible state is + * // "UNUSED", which indicates that the asset is present at read_time. + * compareDuration: 'placeholder-value', + * // Optional. A field mask to specify the ListAssetsResult fields to be listed in the + * // response. + * // An empty field mask will list all fields. + * fieldMask: 'placeholder-value', + * // Expression that defines the filter to apply across assets. + * // The expression is a list of zero or more restrictions combined via logical + * // operators `AND` and `OR`. + * // Parentheses are not supported, and `OR` has higher precedence than `AND`. + * // + * // Restrictions have the form ` ` and may have a `-` + * // character in front of them to indicate negation. The fields map to those + * // defined in the Asset resource. Examples include: + * // + * // * name + * // * security_center_properties.resource_name + * // * resource_properties.a_property + * // * security_marks.marks.marka + * // + * // The supported operators are: + * // + * // * `=` for all value types. + * // * `>`, `<`, `>=`, `<=` for integer values. + * // * `:`, meaning substring matching, for strings. + * // + * // The supported value types are: + * // + * // * string literals in quotes. + * // * integer literals without quotes. + * // * boolean literals `true` and `false` without quotes. + * // + * // For example, `resource_properties.size = 100` is a valid filter string. + * filter: 'placeholder-value', + * // Expression that defines what fields and order to use for sorting. The + * // string value should follow SQL syntax: comma separated list of fields. For + * // example: "name,resource_properties.a_property". The default sorting order + * // is ascending. To specify descending order for a field, a suffix " desc" + * // should be appended to the field name. For example: "name + * // desc,resource_properties.a_property". Redundant space characters in the + * // syntax are insignificant. "name desc,resource_properties.a_property" and " + * // name desc , resource_properties.a_property " are equivalent. + * orderBy: 'placeholder-value', + * // The maximum number of results to return in a single response. Default is + * // 10, minimum is 1, maximum is 1000. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListAssetsResponse`; indicates + * // that this is a continuation of a prior `ListAssets` call, and + * // that the system should return the next page of data. + * pageToken: 'placeholder-value', + * // Required. Name of the organization assets should belong to. Its format is + * // "organizations/[organization_id]". + * parent: 'organizations/my-organization', + * // Time used as a reference point when filtering assets. The filter is limited + * // to assets existing at the supplied time and their values are those at that + * // specific time. Absence of this field will default to the API's version of + * // NOW. + * readTime: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "listAssetsResults": [], + * // "nextPageToken": "my_nextPageToken", + * // "readTime": "my_readTime", + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.assets.list * @memberOf! () * @@ -1301,6 +1578,57 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.assets.runDiscovery * @desc Runs asset discovery. The discovery is tracked with a long-running operation. This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.assets.runDiscovery({ + * // Required. Name of the organization to run asset discovery for. Its format is + * // "organizations/[organization_id]". + * parent: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.assets.runDiscovery * @memberOf! () * @@ -1377,6 +1705,64 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.assets.updateSecurityMarks * @desc Updates security marks. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.assets.updateSecurityMarks({ + * // The relative resource name of the SecurityMarks. See: + * // https://cloud.google.com/apis/design/resource_names#relative_resource_name + * // Examples: + * // "organizations/{organization_id}/assets/{asset_id}/securityMarks" + * // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". + * name: 'organizations/my-organization/assets/my-asset/securityMarks', + * // The time at which the updated SecurityMarks take effect. + * startTime: 'placeholder-value', + * // The FieldMask to use when updating the security marks resource. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "marks": {}, + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "marks": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.assets.updateSecurityMarks * @memberOf! () * @@ -1584,6 +1970,50 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'organizations/my-organization/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.operations.cancel * @memberOf! () * @@ -1658,6 +2088,44 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'organizations/my-organization/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.operations.delete * @memberOf! () * @@ -1728,6 +2196,50 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.operations.get({ + * // The name of the operation resource. + * name: 'organizations/my-organization/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.operations.get * @memberOf! () * @@ -1800,6 +2312,53 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'organizations/my-organization/operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.operations.list * @memberOf! () * @@ -1952,6 +2511,59 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.sources.create * @desc Creates a source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.create({ + * // Required. Resource name of the new source's parent. Its format should be + * // "organizations/[organization_id]". + * parent: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.create * @memberOf! () * @@ -2026,6 +2638,49 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.sources.get * @desc Gets a source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.get({ + * // Required. Relative resource name of the source. Its format is + * // "organizations/[organization_id]/source/[source_id]". + * name: 'organizations/my-organization/sources/my-source', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.get * @memberOf! () * @@ -2096,6 +2751,58 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.sources.getIamPolicy * @desc Gets the access control policy on the specified Source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'organizations/my-organization/sources/my-source', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.getIamPolicy * @memberOf! () * @@ -2170,6 +2877,55 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.sources.list * @desc Lists all sources belonging to an organization. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.list({ + * // The maximum number of results to return in a single response. Default is + * // 10, minimum is 1, maximum is 1000. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListSourcesResponse`; indicates + * // that this is a continuation of a prior `ListSources` call, and + * // that the system should return the next page of data. + * pageToken: 'placeholder-value', + * // Required. Resource name of the parent of sources to list. Its format should be + * // "organizations/[organization_id]". + * parent: 'organizations/my-organization', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "sources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.list * @memberOf! () * @@ -2247,6 +3003,63 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.sources.patch * @desc Updates a source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.patch({ + * // The relative resource name of this source. See: + * // https://cloud.google.com/apis/design/resource_names#relative_resource_name + * // Example: + * // "organizations/{organization_id}/sources/{source_id}" + * name: 'organizations/my-organization/sources/my-source', + * // The FieldMask to use when updating the source resource. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.patch * @memberOf! () * @@ -2319,6 +3132,59 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.sources.setIamPolicy * @desc Sets the access control policy on the specified Source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'organizations/my-organization/sources/my-source', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.setIamPolicy * @memberOf! () * @@ -2393,6 +3259,55 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.sources.testIamPermissions * @desc Returns the permissions that a caller has on the specified source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'organizations/my-organization/sources/my-source', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.testIamPermissions * @memberOf! () * @@ -2605,6 +3520,77 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.sources.findings.create * @desc Creates a finding. The corresponding source must exist for finding creation to succeed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.findings.create({ + * // Required. Unique identifier provided by the client within the parent scope. + * // It must be alphanumeric and less than or equal to 32 characters and + * // greater than 0 characters in length. + * findingId: 'placeholder-value', + * // Required. Resource name of the new finding's parent. Its format should be + * // "organizations/[organization_id]/sources/[source_id]". + * parent: 'organizations/my-organization/sources/my-source', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "category": "my_category", + * // "createTime": "my_createTime", + * // "eventTime": "my_eventTime", + * // "externalUri": "my_externalUri", + * // "name": "my_name", + * // "parent": "my_parent", + * // "resourceName": "my_resourceName", + * // "securityMarks": {}, + * // "sourceProperties": {}, + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "category": "my_category", + * // "createTime": "my_createTime", + * // "eventTime": "my_eventTime", + * // "externalUri": "my_externalUri", + * // "name": "my_name", + * // "parent": "my_parent", + * // "resourceName": "my_resourceName", + * // "securityMarks": {}, + * // "sourceProperties": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.findings.create * @memberOf! () * @@ -2699,6 +3685,63 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.sources.findings.group * @desc Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1beta1/organizations/{organization_id}/sources/-/findings + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.findings.group({ + * // Required. Name of the source to groupBy. Its format is + * // "organizations/[organization_id]/sources/[source_id]". To groupBy across + * // all sources provide a source_id of `-`. For example: + * // organizations/{organization_id}/sources/- + * parent: 'organizations/my-organization/sources/my-source', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "filter": "my_filter", + * // "groupBy": "my_groupBy", + * // "pageSize": 0, + * // "pageToken": "my_pageToken", + * // "readTime": "my_readTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "groupByResults": [], + * // "nextPageToken": "my_nextPageToken", + * // "readTime": "my_readTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.findings.group * @memberOf! () * @@ -2777,6 +3820,102 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.sources.findings.list * @desc Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1beta1/organizations/{organization_id}/sources/-/findings + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.findings.list({ + * // Optional. A field mask to specify the Finding fields to be listed in the response. + * // An empty field mask will list all fields. + * fieldMask: 'placeholder-value', + * // Expression that defines the filter to apply across findings. + * // The expression is a list of one or more restrictions combined via logical + * // operators `AND` and `OR`. + * // Parentheses are not supported, and `OR` has higher precedence than `AND`. + * // + * // Restrictions have the form ` ` and may have a `-` + * // character in front of them to indicate negation. Examples include: + * // + * // * name + * // * source_properties.a_property + * // * security_marks.marks.marka + * // + * // The supported operators are: + * // + * // * `=` for all value types. + * // * `>`, `<`, `>=`, `<=` for integer values. + * // * `:`, meaning substring matching, for strings. + * // + * // The supported value types are: + * // + * // * string literals in quotes. + * // * integer literals without quotes. + * // * boolean literals `true` and `false` without quotes. + * // + * // For example, `source_properties.size = 100` is a valid filter string. + * filter: 'placeholder-value', + * // Expression that defines what fields and order to use for sorting. The + * // string value should follow SQL syntax: comma separated list of fields. For + * // example: "name,resource_properties.a_property". The default sorting order + * // is ascending. To specify descending order for a field, a suffix " desc" + * // should be appended to the field name. For example: "name + * // desc,source_properties.a_property". Redundant space characters in the + * // syntax are insignificant. "name desc,source_properties.a_property" and " + * // name desc , source_properties.a_property " are equivalent. + * orderBy: 'placeholder-value', + * // The maximum number of results to return in a single response. Default is + * // 10, minimum is 1, maximum is 1000. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListFindingsResponse`; indicates + * // that this is a continuation of a prior `ListFindings` call, and + * // that the system should return the next page of data. + * pageToken: 'placeholder-value', + * // Required. Name of the source the findings belong to. Its format is + * // "organizations/[organization_id]/sources/[source_id]". To list across all + * // sources provide a source_id of `-`. For example: + * // organizations/{organization_id}/sources/- + * parent: 'organizations/my-organization/sources/my-source', + * // Time used as a reference point when filtering findings. The filter is + * // limited to findings existing at the supplied time and their values are + * // those at that specific time. Absence of this field will default to the + * // API's version of NOW. + * readTime: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "findings": [], + * // "nextPageToken": "my_nextPageToken", + * // "readTime": "my_readTime", + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.findings.list * @memberOf! () * @@ -2860,6 +3999,78 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.sources.findings.patch * @desc Creates or updates a finding. The corresponding source must exist for a finding creation to succeed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.findings.patch({ + * // The relative resource name of this finding. See: + * // https://cloud.google.com/apis/design/resource_names#relative_resource_name + * // Example: + * // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}" + * name: 'organizations/my-organization/sources/my-source/findings/my-finding', + * // The FieldMask to use when updating the finding resource. This field should + * // not be specified when creating a finding. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "category": "my_category", + * // "createTime": "my_createTime", + * // "eventTime": "my_eventTime", + * // "externalUri": "my_externalUri", + * // "name": "my_name", + * // "parent": "my_parent", + * // "resourceName": "my_resourceName", + * // "securityMarks": {}, + * // "sourceProperties": {}, + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "category": "my_category", + * // "createTime": "my_createTime", + * // "eventTime": "my_eventTime", + * // "externalUri": "my_externalUri", + * // "name": "my_name", + * // "parent": "my_parent", + * // "resourceName": "my_resourceName", + * // "securityMarks": {}, + * // "sourceProperties": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.findings.patch * @memberOf! () * @@ -2951,6 +4162,67 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.sources.findings.setState * @desc Updates the state of a finding. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.findings.setState({ + * // Required. The relative resource name of the finding. See: + * // https://cloud.google.com/apis/design/resource_names#relative_resource_name + * // Example: + * // "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + * name: 'organizations/my-organization/sources/my-source/findings/my-finding', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "startTime": "my_startTime", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "category": "my_category", + * // "createTime": "my_createTime", + * // "eventTime": "my_eventTime", + * // "externalUri": "my_externalUri", + * // "name": "my_name", + * // "parent": "my_parent", + * // "resourceName": "my_resourceName", + * // "securityMarks": {}, + * // "sourceProperties": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.findings.setState * @memberOf! () * @@ -3044,6 +4316,67 @@ export namespace securitycenter_v1beta1 { /** * securitycenter.organizations.sources.findings.updateSecurityMarks * @desc Updates security marks. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.findings.updateSecurityMarks( + * { + * // The relative resource name of the SecurityMarks. See: + * // https://cloud.google.com/apis/design/resource_names#relative_resource_name + * // Examples: + * // "organizations/{organization_id}/assets/{asset_id}/securityMarks" + * // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". + * name: + * 'organizations/my-organization/sources/my-source/findings/my-finding/securityMarks', + * // The time at which the updated SecurityMarks take effect. + * startTime: 'placeholder-value', + * // The FieldMask to use when updating the security marks resource. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "marks": {}, + * // "name": "my_name" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "marks": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.findings.updateSecurityMarks * @memberOf! () * diff --git a/src/apis/securitycenter/v1p1alpha1.ts b/src/apis/securitycenter/v1p1alpha1.ts index 4126d62824c..1d611059912 100644 --- a/src/apis/securitycenter/v1p1alpha1.ts +++ b/src/apis/securitycenter/v1p1alpha1.ts @@ -468,6 +468,44 @@ export namespace securitycenter_v1p1alpha1 { /** * securitycenter.organizations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'organizations/my-organization/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.operations.cancel * @memberOf! () * @@ -541,6 +579,44 @@ export namespace securitycenter_v1p1alpha1 { /** * securitycenter.organizations.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'organizations/my-organization/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.operations.delete * @memberOf! () * @@ -614,6 +690,50 @@ export namespace securitycenter_v1p1alpha1 { /** * securitycenter.organizations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.operations.get({ + * // The name of the operation resource. + * name: 'organizations/my-organization/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.operations.get * @memberOf! () * @@ -689,6 +809,53 @@ export namespace securitycenter_v1p1alpha1 { /** * securitycenter.organizations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'organizations/my-organization/operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.operations.list * @memberOf! () * diff --git a/src/apis/securitycenter/v1p1beta1.ts b/src/apis/securitycenter/v1p1beta1.ts index 79e74f1c74e..6956d1b0bed 100644 --- a/src/apis/securitycenter/v1p1beta1.ts +++ b/src/apis/securitycenter/v1p1beta1.ts @@ -941,6 +941,49 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.getOrganizationSettings * @desc Gets the settings for an organization. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.getOrganizationSettings({ + * // Required. Name of the organization to get organization settings for. Its format is + * // "organizations/[organization_id]/organizationSettings". + * name: 'organizations/my-organization/organizationSettings', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assetDiscoveryConfig": {}, + * // "enableAssetDiscovery": false, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.getOrganizationSettings * @memberOf! () * @@ -1017,6 +1060,65 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.updateOrganizationSettings * @desc Updates an organization's settings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.updateOrganizationSettings({ + * // The relative resource name of the settings. See: + * // https://cloud.google.com/apis/design/resource_names#relative_resource_name + * // Example: + * // "organizations/{organization_id}/organizationSettings". + * name: 'organizations/my-organization/organizationSettings', + * // The FieldMask to use when updating the settings resource. + * // + * // If empty all mutable fields will be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "assetDiscoveryConfig": {}, + * // "enableAssetDiscovery": false, + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "assetDiscoveryConfig": {}, + * // "enableAssetDiscovery": false, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.updateOrganizationSettings * @memberOf! () * @@ -1136,6 +1238,63 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.assets.group * @desc Filters an organization's assets and groups them by their specified properties. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.assets.group({ + * // Required. Name of the organization to groupBy. Its format is + * // "organizations/[organization_id]". + * parent: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "compareDuration": "my_compareDuration", + * // "filter": "my_filter", + * // "groupBy": "my_groupBy", + * // "pageSize": 0, + * // "pageToken": "my_pageToken", + * // "readTime": "my_readTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "groupByResults": [], + * // "nextPageToken": "my_nextPageToken", + * // "readTime": "my_readTime", + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.assets.group * @memberOf! () * @@ -1212,6 +1371,177 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.assets.list * @desc Lists an organization's assets. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.assets.list({ + * // When compare_duration is set, the ListAssetsResult's "state_change" + * // attribute is updated to indicate whether the asset was added, removed, or + * // remained present during the compare_duration period of time that precedes + * // the read_time. This is the time between (read_time - compare_duration) and + * // read_time. + * // + * // The state_change value is derived based on the presence of the asset at the + * // two points in time. Intermediate state changes between the two times don't + * // affect the result. For example, the results aren't affected if the asset is + * // removed and re-created again. + * // + * // Possible "state_change" values when compare_duration is specified: + * // + * // * "ADDED": indicates that the asset was not present at the start of + * // compare_duration, but present at read_time. + * // * "REMOVED": indicates that the asset was present at the start of + * // compare_duration, but not present at read_time. + * // * "ACTIVE": indicates that the asset was present at both the + * // start and the end of the time period defined by + * // compare_duration and read_time. + * // + * // If compare_duration is not specified, then the only possible state_change + * // is "UNUSED", which will be the state_change set for all assets present at + * // read_time. + * compareDuration: 'placeholder-value', + * // Optional. + * // A field mask to specify the ListAssetsResult fields to be listed in the + * // response. + * // An empty field mask will list all fields. + * fieldMask: 'placeholder-value', + * // Expression that defines the filter to apply across assets. + * // The expression is a list of zero or more restrictions combined via logical + * // operators `AND` and `OR`. + * // Parentheses are supported, and `OR` has higher precedence than `AND`. + * // + * // Restrictions have the form ` ` and may have a `-` + * // character in front of them to indicate negation. The fields map to those + * // defined in the Asset resource. Examples include: + * // + * // * name + * // * security_center_properties.resource_name + * // * resource_properties.a_property + * // * security_marks.marks.marka + * // + * // The supported operators are: + * // + * // * `=` for all value types. + * // * `>`, `<`, `>=`, `<=` for integer values. + * // * `:`, meaning substring matching, for strings. + * // + * // The supported value types are: + * // + * // * string literals in quotes. + * // * integer literals without quotes. + * // * boolean literals `true` and `false` without quotes. + * // + * // The following are the allowed field and operator combinations: + * // + * // * name: `=` + * // * update_time: `=`, `>`, `<`, `>=`, `<=` + * // + * // Usage: This should be milliseconds since epoch or an RFC3339 string. + * // Examples: + * // "update_time = \"2019-06-10T16:07:18-07:00\"" + * // "update_time = 1560208038000" + * // + * // * create_time: `=`, `>`, `<`, `>=`, `<=` + * // + * // Usage: This should be milliseconds since epoch or an RFC3339 string. + * // Examples: + * // "create_time = \"2019-06-10T16:07:18-07:00\"" + * // "create_time = 1560208038000" + * // + * // * iam_policy.policy_blob: `=`, `:` + * // * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * // * security_marks.marks: `=`, `:` + * // * security_center_properties.resource_name: `=`, `:` + * // * security_center_properties.resource_display_name: `=`, `:` + * // * security_center_properties.resource_type: `=`, `:` + * // * security_center_properties.resource_parent: `=`, `:` + * // * security_center_properties.resource_parent_display_name: `=`, `:` + * // * security_center_properties.resource_project: `=`, `:` + * // * security_center_properties.resource_project_display_name: `=`, `:` + * // * security_center_properties.resource_owners: `=`, `:` + * // + * // For example, `resource_properties.size = 100` is a valid filter string. + * // + * // Use a partial match on the empty string to filter based on a property + * // existing: "resource_properties.my_property : \"\"" + * // + * // Use a negated partial match on the empty string to filter based on a + * // property not existing: "-resource_properties.my_property : \"\"" + * filter: 'placeholder-value', + * // Expression that defines what fields and order to use for sorting. The + * // string value should follow SQL syntax: comma separated list of fields. For + * // example: "name,resource_properties.a_property". The default sorting order + * // is ascending. To specify descending order for a field, a suffix " desc" + * // should be appended to the field name. For example: "name + * // desc,resource_properties.a_property". Redundant space characters in the + * // syntax are insignificant. "name desc,resource_properties.a_property" and " + * // name desc , resource_properties.a_property " are equivalent. + * // + * // The following fields are supported: + * // name + * // update_time + * // resource_properties + * // security_marks.marks + * // security_center_properties.resource_name + * // security_center_properties.resource_display_name + * // security_center_properties.resource_parent + * // security_center_properties.resource_parent_display_name + * // security_center_properties.resource_project + * // security_center_properties.resource_project_display_name + * // security_center_properties.resource_type + * orderBy: 'placeholder-value', + * // The maximum number of results to return in a single response. Default is + * // 10, minimum is 1, maximum is 1000. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListAssetsResponse`; indicates + * // that this is a continuation of a prior `ListAssets` call, and + * // that the system should return the next page of data. + * pageToken: 'placeholder-value', + * // Required. Name of the organization assets should belong to. Its format is + * // "organizations/[organization_id]". + * parent: 'organizations/my-organization', + * // Time used as a reference point when filtering assets. The filter is limited + * // to assets existing at the supplied time and their values are those at that + * // specific time. Absence of this field will default to the API's version of + * // NOW. + * readTime: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "listAssetsResults": [], + * // "nextPageToken": "my_nextPageToken", + * // "readTime": "my_readTime", + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.assets.list * @memberOf! () * @@ -1294,6 +1624,57 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.assets.runDiscovery * @desc Runs asset discovery. The discovery is tracked with a long-running operation. // This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.assets.runDiscovery({ + * // Required. Name of the organization to run asset discovery for. Its format is + * // "organizations/[organization_id]". + * parent: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.assets.runDiscovery * @memberOf! () * @@ -1370,6 +1751,70 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.assets.updateSecurityMarks * @desc Updates security marks. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.assets.updateSecurityMarks({ + * // The relative resource name of the SecurityMarks. See: + * // https://cloud.google.com/apis/design/resource_names#relative_resource_name + * // Examples: + * // "organizations/{organization_id}/assets/{asset_id}/securityMarks" + * // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". + * name: 'organizations/my-organization/assets/my-asset/securityMarks', + * // The time at which the updated SecurityMarks take effect. + * // If not set uses current server time. Updates will be applied to the + * // SecurityMarks that are active immediately preceding this time. + * startTime: 'placeholder-value', + * // The FieldMask to use when updating the security marks resource. + * // + * // The field mask must not contain duplicate fields. + * // If empty or set to "marks", all marks will be replaced. Individual + * // marks can be updated using "marks.". + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "marks": {}, + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "marks": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.assets.updateSecurityMarks * @memberOf! () * @@ -1576,6 +2021,70 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.notificationConfigs.create * @desc Creates a notification config. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.notificationConfigs.create({ + * // Required. + * // Unique identifier provided by the client within the parent scope. + * // It must be between 1 and 128 characters, and contains alphanumeric + * // characters, underscores or hyphens only. + * configId: 'placeholder-value', + * // Required. Resource name of the new notification config's parent. Its format is + * // "organizations/[organization_id]". + * parent: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "eventType": "my_eventType", + * // "name": "my_name", + * // "pubsubTopic": "my_pubsubTopic", + * // "serviceAccount": "my_serviceAccount", + * // "streamingConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "eventType": "my_eventType", + * // "name": "my_name", + * // "pubsubTopic": "my_pubsubTopic", + * // "serviceAccount": "my_serviceAccount", + * // "streamingConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.notificationConfigs.create * @memberOf! () * @@ -1653,6 +2162,46 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.notificationConfigs.delete * @desc Deletes a notification config. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.notificationConfigs.delete({ + * // Required. Name of the notification config to delete. Its format is + * // "organizations/[organization_id]/notificationConfigs/[config_id]". + * name: + * 'organizations/my-organization/notificationConfigs/my-notificationConfig', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.notificationConfigs.delete * @memberOf! () * @@ -1723,6 +2272,53 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.notificationConfigs.get * @desc Gets a notification config. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.notificationConfigs.get({ + * // Required. Name of the notification config to get. Its format is + * // "organizations/[organization_id]/notificationConfigs/[config_id]". + * name: + * 'organizations/my-organization/notificationConfigs/my-notificationConfig', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "eventType": "my_eventType", + * // "name": "my_name", + * // "pubsubTopic": "my_pubsubTopic", + * // "serviceAccount": "my_serviceAccount", + * // "streamingConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.notificationConfigs.get * @memberOf! () * @@ -1795,6 +2391,55 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.notificationConfigs.list * @desc Lists notification configs. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.notificationConfigs.list({ + * // The maximum number of results to return in a single response. Default is + * // 10, minimum is 1, maximum is 1000. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListNotificationConfigsResponse`; indicates + * // that this is a continuation of a prior `ListNotificationConfigs` call, and + * // that the system should return the next page of data. + * pageToken: 'placeholder-value', + * // Required. Name of the organization to list notification configs. + * // Its format is "organizations/[organization_id]". + * parent: 'organizations/my-organization', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "notificationConfigs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.notificationConfigs.list * @memberOf! () * @@ -1881,6 +2526,72 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.notificationConfigs.patch * @desc Updates a notification config. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.notificationConfigs.patch({ + * // The relative resource name of this notification config. See: + * // https://cloud.google.com/apis/design/resource_names#relative_resource_name + * // Example: + * // "organizations/{organization_id}/notificationConfigs/notify_public_bucket". + * name: + * 'organizations/my-organization/notificationConfigs/my-notificationConfig', + * // The FieldMask to use when updating the notification config. + * // + * // If empty all mutable fields will be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "eventType": "my_eventType", + * // "name": "my_name", + * // "pubsubTopic": "my_pubsubTopic", + * // "serviceAccount": "my_serviceAccount", + * // "streamingConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "eventType": "my_eventType", + * // "name": "my_name", + * // "pubsubTopic": "my_pubsubTopic", + * // "serviceAccount": "my_serviceAccount", + * // "streamingConfig": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.notificationConfigs.patch * @memberOf! () * @@ -2049,6 +2760,44 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'organizations/my-organization/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.operations.cancel * @memberOf! () * @@ -2122,6 +2871,44 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'organizations/my-organization/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.operations.delete * @memberOf! () * @@ -2192,6 +2979,50 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.operations.get({ + * // The name of the operation resource. + * name: 'organizations/my-organization/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.operations.get * @memberOf! () * @@ -2264,6 +3095,53 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'organizations/my-organization/operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.operations.list * @memberOf! () * @@ -2411,6 +3289,59 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.sources.create * @desc Creates a source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.create({ + * // Required. Resource name of the new source's parent. Its format should be + * // "organizations/[organization_id]". + * parent: 'organizations/my-organization', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.create * @memberOf! () * @@ -2485,6 +3416,49 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.sources.get * @desc Gets a source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.get({ + * // Required. Relative resource name of the source. Its format is + * // "organizations/[organization_id]/source/[source_id]". + * name: 'organizations/my-organization/sources/my-source', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.get * @memberOf! () * @@ -2555,6 +3529,58 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.sources.getIamPolicy * @desc Gets the access control policy on the specified Source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'organizations/my-organization/sources/my-source', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.getIamPolicy * @memberOf! () * @@ -2629,6 +3655,55 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.sources.list * @desc Lists all sources belonging to an organization. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.list({ + * // The maximum number of results to return in a single response. Default is + * // 10, minimum is 1, maximum is 1000. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListSourcesResponse`; indicates + * // that this is a continuation of a prior `ListSources` call, and + * // that the system should return the next page of data. + * pageToken: 'placeholder-value', + * // Required. Resource name of the parent of sources to list. Its format should be + * // "organizations/[organization_id]". + * parent: 'organizations/my-organization', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "sources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.list * @memberOf! () * @@ -2706,6 +3781,65 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.sources.patch * @desc Updates a source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.patch({ + * // The relative resource name of this source. See: + * // https://cloud.google.com/apis/design/resource_names#relative_resource_name + * // Example: + * // "organizations/{organization_id}/sources/{source_id}" + * name: 'organizations/my-organization/sources/my-source', + * // The FieldMask to use when updating the source resource. + * // + * // If empty all mutable fields will be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.patch * @memberOf! () * @@ -2778,6 +3912,59 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.sources.setIamPolicy * @desc Sets the access control policy on the specified Source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'organizations/my-organization/sources/my-source', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.setIamPolicy * @memberOf! () * @@ -2852,6 +4039,55 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.sources.testIamPermissions * @desc Returns the permissions that a caller has on the specified source. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'organizations/my-organization/sources/my-source', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.testIamPermissions * @memberOf! () * @@ -3063,6 +4299,77 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.sources.findings.create * @desc Creates a finding. The corresponding source must exist for finding creation to succeed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.findings.create({ + * // Required. Unique identifier provided by the client within the parent scope. + * // It must be alphanumeric and less than or equal to 32 characters and + * // greater than 0 characters in length. + * findingId: 'placeholder-value', + * // Required. Resource name of the new finding's parent. Its format should be + * // "organizations/[organization_id]/sources/[source_id]". + * parent: 'organizations/my-organization/sources/my-source', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "category": "my_category", + * // "createTime": "my_createTime", + * // "eventTime": "my_eventTime", + * // "externalUri": "my_externalUri", + * // "name": "my_name", + * // "parent": "my_parent", + * // "resourceName": "my_resourceName", + * // "securityMarks": {}, + * // "sourceProperties": {}, + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "category": "my_category", + * // "createTime": "my_createTime", + * // "eventTime": "my_eventTime", + * // "externalUri": "my_externalUri", + * // "name": "my_name", + * // "parent": "my_parent", + * // "resourceName": "my_resourceName", + * // "securityMarks": {}, + * // "sourceProperties": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.findings.create * @memberOf! () * @@ -3163,6 +4470,65 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.sources.findings.group * @desc Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.findings.group({ + * // Required. Name of the source to groupBy. Its format is + * // "organizations/[organization_id]/sources/[source_id]". To groupBy across + * // all sources provide a source_id of `-`. For example: + * // organizations/{organization_id}/sources/- + * parent: 'organizations/my-organization/sources/my-source', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "compareDuration": "my_compareDuration", + * // "filter": "my_filter", + * // "groupBy": "my_groupBy", + * // "pageSize": 0, + * // "pageToken": "my_pageToken", + * // "readTime": "my_readTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "groupByResults": [], + * // "nextPageToken": "my_nextPageToken", + * // "readTime": "my_readTime", + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.findings.group * @memberOf! () * @@ -3241,6 +4607,168 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.sources.findings.list * @desc Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.findings.list({ + * // When compare_duration is set, the ListFindingsResult's "state_change" + * // attribute is updated to indicate whether the finding had its state changed, + * // the finding's state remained unchanged, or if the finding was added in any + * // state during the compare_duration period of time that precedes the + * // read_time. This is the time between (read_time - compare_duration) and + * // read_time. + * // + * // The state_change value is derived based on the presence and state of the + * // finding at the two points in time. Intermediate state changes between the + * // two times don't affect the result. For example, the results aren't affected + * // if the finding is made inactive and then active again. + * // + * // Possible "state_change" values when compare_duration is specified: + * // + * // * "CHANGED": indicates that the finding was present and matched the given + * // filter at the start of compare_duration, but changed its + * // state at read_time. + * // * "UNCHANGED": indicates that the finding was present and matched the given + * // filter at the start of compare_duration and did not change + * // state at read_time. + * // * "ADDED": indicates that the finding did not match the given filter or + * // was not present at the start of compare_duration, but was + * // present at read_time. + * // * "REMOVED": indicates that the finding was present and matched the + * // filter at the start of compare_duration, but did not match + * // the filter at read_time. + * // + * // If compare_duration is not specified, then the only possible state_change + * // is "UNUSED", which will be the state_change set for all findings present at + * // read_time. + * compareDuration: 'placeholder-value', + * // Optional. + * // A field mask to specify the Finding fields to be listed in the response. + * // An empty field mask will list all fields. + * fieldMask: 'placeholder-value', + * // Expression that defines the filter to apply across findings. + * // The expression is a list of one or more restrictions combined via logical + * // operators `AND` and `OR`. + * // Parentheses are supported, and `OR` has higher precedence than `AND`. + * // + * // Restrictions have the form ` ` and may have a `-` + * // character in front of them to indicate negation. Examples include: + * // + * // * name + * // * source_properties.a_property + * // * security_marks.marks.marka + * // + * // The supported operators are: + * // + * // * `=` for all value types. + * // * `>`, `<`, `>=`, `<=` for integer values. + * // * `:`, meaning substring matching, for strings. + * // + * // The supported value types are: + * // + * // * string literals in quotes. + * // * integer literals without quotes. + * // * boolean literals `true` and `false` without quotes. + * // + * // The following field and operator combinations are supported: + * // + * // name: `=` + * // parent: `=`, `:` + * // resource_name: `=`, `:` + * // state: `=`, `:` + * // category: `=`, `:` + * // external_uri: `=`, `:` + * // event_time: `=`, `>`, `<`, `>=`, `<=` + * // + * // Usage: This should be milliseconds since epoch or an RFC3339 string. + * // Examples: + * // "event_time = \"2019-06-10T16:07:18-07:00\"" + * // "event_time = 1560208038000" + * // + * // security_marks.marks: `=`, `:` + * // source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + * // + * // For example, `source_properties.size = 100` is a valid filter string. + * // + * // Use a partial match on the empty string to filter based on a property + * // existing: "source_properties.my_property : \"\"" + * // + * // Use a negated partial match on the empty string to filter based on a + * // property not existing: "-source_properties.my_property : \"\"" + * filter: 'placeholder-value', + * // Expression that defines what fields and order to use for sorting. The + * // string value should follow SQL syntax: comma separated list of fields. For + * // example: "name,resource_properties.a_property". The default sorting order + * // is ascending. To specify descending order for a field, a suffix " desc" + * // should be appended to the field name. For example: "name + * // desc,source_properties.a_property". Redundant space characters in the + * // syntax are insignificant. "name desc,source_properties.a_property" and " + * // name desc , source_properties.a_property " are equivalent. + * // + * // The following fields are supported: + * // name + * // parent + * // state + * // category + * // resource_name + * // event_time + * // source_properties + * // security_marks.marks + * orderBy: 'placeholder-value', + * // The maximum number of results to return in a single response. Default is + * // 10, minimum is 1, maximum is 1000. + * pageSize: 'placeholder-value', + * // The value returned by the last `ListFindingsResponse`; indicates + * // that this is a continuation of a prior `ListFindings` call, and + * // that the system should return the next page of data. + * pageToken: 'placeholder-value', + * // Required. Name of the source the findings belong to. Its format is + * // "organizations/[organization_id]/sources/[source_id]". To list across all + * // sources provide a source_id of `-`. For example: + * // organizations/{organization_id}/sources/- + * parent: 'organizations/my-organization/sources/my-source', + * // Time used as a reference point when filtering findings. The filter is + * // limited to findings existing at the supplied time and their values are + * // those at that specific time. Absence of this field will default to the + * // API's version of NOW. + * readTime: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "listFindingsResults": [], + * // "nextPageToken": "my_nextPageToken", + * // "readTime": "my_readTime", + * // "totalSize": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.findings.list * @memberOf! () * @@ -3325,6 +4853,83 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.sources.findings.patch * @desc Creates or updates a finding. The corresponding source must exist for a finding creation to succeed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.findings.patch({ + * // The relative resource name of this finding. See: + * // https://cloud.google.com/apis/design/resource_names#relative_resource_name + * // Example: + * // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}" + * name: 'organizations/my-organization/sources/my-source/findings/my-finding', + * // The FieldMask to use when updating the finding resource. This field should + * // not be specified when creating a finding. + * // + * // When updating a finding, an empty mask is treated as updating all mutable + * // fields and replacing source_properties. Individual source_properties can + * // be added/updated by using "source_properties." in the field + * // mask. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "category": "my_category", + * // "createTime": "my_createTime", + * // "eventTime": "my_eventTime", + * // "externalUri": "my_externalUri", + * // "name": "my_name", + * // "parent": "my_parent", + * // "resourceName": "my_resourceName", + * // "securityMarks": {}, + * // "sourceProperties": {}, + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "category": "my_category", + * // "createTime": "my_createTime", + * // "eventTime": "my_eventTime", + * // "externalUri": "my_externalUri", + * // "name": "my_name", + * // "parent": "my_parent", + * // "resourceName": "my_resourceName", + * // "securityMarks": {}, + * // "sourceProperties": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.findings.patch * @memberOf! () * @@ -3422,6 +5027,67 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.sources.findings.setState * @desc Updates the state of a finding. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.findings.setState({ + * // Required. The relative resource name of the finding. See: + * // https://cloud.google.com/apis/design/resource_names#relative_resource_name + * // Example: + * // "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + * name: 'organizations/my-organization/sources/my-source/findings/my-finding', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "startTime": "my_startTime", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "category": "my_category", + * // "createTime": "my_createTime", + * // "eventTime": "my_eventTime", + * // "externalUri": "my_externalUri", + * // "name": "my_name", + * // "parent": "my_parent", + * // "resourceName": "my_resourceName", + * // "securityMarks": {}, + * // "sourceProperties": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.findings.setState * @memberOf! () * @@ -3521,6 +5187,73 @@ export namespace securitycenter_v1p1beta1 { /** * securitycenter.organizations.sources.findings.updateSecurityMarks * @desc Updates security marks. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/securitycenter.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 securitycenter = google.securitycenter('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 securitycenter.organizations.sources.findings.updateSecurityMarks( + * { + * // The relative resource name of the SecurityMarks. See: + * // https://cloud.google.com/apis/design/resource_names#relative_resource_name + * // Examples: + * // "organizations/{organization_id}/assets/{asset_id}/securityMarks" + * // "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". + * name: + * 'organizations/my-organization/sources/my-source/findings/my-finding/securityMarks', + * // The time at which the updated SecurityMarks take effect. + * // If not set uses current server time. Updates will be applied to the + * // SecurityMarks that are active immediately preceding this time. + * startTime: 'placeholder-value', + * // The FieldMask to use when updating the security marks resource. + * // + * // The field mask must not contain duplicate fields. + * // If empty or set to "marks", all marks will be replaced. Individual + * // marks can be updated using "marks.". + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "marks": {}, + * // "name": "my_name" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "marks": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias securitycenter.organizations.sources.findings.updateSecurityMarks * @memberOf! () * diff --git a/src/apis/serviceconsumermanagement/v1.ts b/src/apis/serviceconsumermanagement/v1.ts index ad92c5a8ffa..ebf2e86ce1c 100644 --- a/src/apis/serviceconsumermanagement/v1.ts +++ b/src/apis/serviceconsumermanagement/v1.ts @@ -1687,6 +1687,50 @@ export namespace serviceconsumermanagement_v1 { /** * serviceconsumermanagement.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'operations/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.operations.cancel * @memberOf! () * @@ -1758,6 +1802,44 @@ export namespace serviceconsumermanagement_v1 { /** * serviceconsumermanagement.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'operations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.operations.delete * @memberOf! () * @@ -1828,6 +1910,50 @@ export namespace serviceconsumermanagement_v1 { /** * serviceconsumermanagement.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.operations.get({ + * // The name of the operation resource. + * name: 'operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.operations.get * @memberOf! () * @@ -1899,6 +2025,53 @@ export namespace serviceconsumermanagement_v1 { /** * serviceconsumermanagement.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.operations.list * @memberOf! () * @@ -2048,6 +2221,78 @@ export namespace serviceconsumermanagement_v1 { /** * serviceconsumermanagement.services.search * @desc Search tenancy units for a managed service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.services.search({ + * // The maximum number of results returned by this request. Currently, the + * // default maximum is set to 1000. If `page_size` isn't provided or the size + * // provided is a number larger than 1000, it's automatically set to 1000. + * // + * // Optional. + * pageSize: 'placeholder-value', + * // The continuation token, which is used to page through large result sets. + * // To get the next page of results, set this parameter to the value of + * // `nextPageToken` from the previous response. + * // + * // Optional. + * pageToken: 'placeholder-value', + * // Service for which search is performed. + * // services/{service} + * // {service} the name of a service, for example 'service.googleapis.com'. + * parent: 'services/my-service', + * // Set a query `{expression}` for querying tenancy units. Your `{expression}` + * // must be in the format: `field_name=literal_string`. The `field_name` is the + * // name of the field you want to compare. Supported fields are + * // `tenant_resources.tag` and `tenant_resources.resource`. + * // + * // For example, to search tenancy units that contain at least one tenant + * // resource with a given tag 'xyz', use the query `tenant_resources.tag=xyz`. + * // To search tenancy units that contain at least one tenant resource with + * // a given resource name 'projects/123456', use the query + * // `tenant_resources.resource=projects/123456`. + * // + * // Multiple expressions can be joined with `AND`s. Tenancy units must match + * // all expressions to be included in the result set. For example, + * // `tenant_resources.tag=xyz AND tenant_resources.resource=projects/123456` + * // + * // Optional. + * query: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "tenancyUnits": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.services.search * @memberOf! () * @@ -2163,6 +2408,60 @@ export namespace serviceconsumermanagement_v1 { /** * serviceconsumermanagement.services.tenancyUnits.addProject * @desc Add a new tenant project to the tenancy unit. There can be a maximum of 512 tenant projects in a tenancy unit. If there are previously failed `AddTenantProject` calls, you might need to call `RemoveTenantProject` first to resolve them before you can make another call to `AddTenantProject` with the same tag. Operation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.services.tenancyUnits.addProject({ + * // Name of the tenancy unit. + * // Such as 'services/service.googleapis.com/projects/12345/tenancyUnits/abcd'. + * parent: 'services/my-service/[^/]+/[^/]+/tenancyUnits/my-tenancyUnit', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "projectConfig": {}, + * // "tag": "my_tag" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.services.tenancyUnits.addProject * @memberOf! () * @@ -2239,6 +2538,62 @@ export namespace serviceconsumermanagement_v1 { /** * serviceconsumermanagement.services.tenancyUnits.applyProjectConfig * @desc Apply a configuration to an existing tenant project. This project must exist in an active state and have the original owner account. The caller must have permission to add a project to the given tenancy unit. The configuration is applied, but any existing settings on the project aren't modified. Specified policy bindings are applied. Existing bindings aren't modified. Specified services are activated. No service is deactivated. If specified, new billing configuration is applied. Omit a billing configuration to keep the existing one. A service account in the project is created if previously non existed. Specified labels will be appended to tenant project, note that the value of existing label key will be updated if the same label key is requested. The specified folder is ignored, as moving a tenant project to a different folder isn't supported. The operation fails if any of the steps fail, but no rollback of already applied configuration changes is attempted. Operation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.services.tenancyUnits.applyProjectConfig( + * { + * // Name of the tenancy unit. + * // Such as 'services/service.googleapis.com/projects/12345/tenancyUnits/abcd'. + * name: 'services/my-service/[^/]+/[^/]+/tenancyUnits/my-tenancyUnit', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "projectConfig": {}, + * // "tag": "my_tag" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.services.tenancyUnits.applyProjectConfig * @memberOf! () * @@ -2315,6 +2670,63 @@ export namespace serviceconsumermanagement_v1 { /** * serviceconsumermanagement.services.tenancyUnits.attachProject * @desc Attach an existing project to the tenancy unit as a new tenant resource. The project could either be the tenant project reserved by calling `AddTenantProject` under a tenancy unit of a service producer's project of a managed service, or from a separate project. The caller is checked against a set of permissions as if calling `AddTenantProject` on the same service consumer. To trigger the attachment, the targeted tenant project must be in a folder. Make sure the ServiceConsumerManagement service account is the owner of that project. These two requirements are already met if the project is reserved by calling `AddTenantProject`. Operation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.services.tenancyUnits.attachProject( + * { + * // Name of the tenancy unit that the project will be attached to. + * // Such as 'services/service.googleapis.com/projects/12345/tenancyUnits/abcd'. + * name: 'services/my-service/[^/]+/[^/]+/tenancyUnits/my-tenancyUnit', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "externalResource": "my_externalResource", + * // "reservedResource": "my_reservedResource", + * // "tag": "my_tag" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.services.tenancyUnits.attachProject * @memberOf! () * @@ -2391,6 +2803,63 @@ export namespace serviceconsumermanagement_v1 { /** * serviceconsumermanagement.services.tenancyUnits.create * @desc Creates a tenancy unit with no tenant resources. If tenancy unit already exists, it will be returned, however, in this case, returned TenancyUnit does not have tenant_resources field set and ListTenancyUnit has to be used to get a complete TenancyUnit with all fields populated. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.services.tenancyUnits.create({ + * // services/{service}/{collection id}/{resource id} + * // {collection id} is the cloud resource collection type representing the + * // service consumer, for example 'projects', or 'organizations'. + * // {resource id} is the consumer numeric id, such as project number: '123456'. + * // {service} the name of a managed service, such as 'service.googleapis.com'. + * // Enables service binding using the new tenancy unit. + * parent: 'services/my-service/[^/]+/[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "tenancyUnitId": "my_tenancyUnitId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "consumer": "my_consumer", + * // "createTime": "my_createTime", + * // "name": "my_name", + * // "service": "my_service", + * // "tenantResources": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.services.tenancyUnits.create * @memberOf! () * @@ -2467,6 +2936,50 @@ export namespace serviceconsumermanagement_v1 { /** * serviceconsumermanagement.services.tenancyUnits.delete * @desc Delete a tenancy unit. Before you delete the tenancy unit, there should be no tenant resources in it that aren't in a DELETED state. Operation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.services.tenancyUnits.delete({ + * // Name of the tenancy unit to be deleted. + * name: 'services/my-service/[^/]+/[^/]+/tenancyUnits/my-tenancyUnit', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.services.tenancyUnits.delete * @memberOf! () * @@ -2539,6 +3052,61 @@ export namespace serviceconsumermanagement_v1 { /** * serviceconsumermanagement.services.tenancyUnits.deleteProject * @desc Deletes the specified project resource identified by a tenant resource tag. The mothod removes a project lien with a 'TenantManager' origin if that was added. It will then attempt to delete the project. If that operation fails, this method also fails. After the project has been deleted, the tenant resource state is set to DELETED. To permanently remove resource metadata, call the `RemoveTenantProject` method. New resources with the same tag can't be added if there are existing resources in a DELETED state. Operation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.services.tenancyUnits.deleteProject( + * { + * // Name of the tenancy unit. + * // Such as 'services/service.googleapis.com/projects/12345/tenancyUnits/abcd'. + * name: 'services/my-service/[^/]+/[^/]+/tenancyUnits/my-tenancyUnit', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "tag": "my_tag" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.services.tenancyUnits.deleteProject * @memberOf! () * @@ -2615,6 +3183,60 @@ export namespace serviceconsumermanagement_v1 { /** * serviceconsumermanagement.services.tenancyUnits.list * @desc Find the tenancy unit for a managed service and service consumer. This method shouldn't be used in a service producer's runtime path, for example to find the tenant project number when creating VMs. Service producers must persist the tenant project's information after the project is created. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.services.tenancyUnits.list({ + * // Filter expression over tenancy resources field. Optional. + * filter: 'placeholder-value', + * // The maximum number of results returned by this request. + * pageSize: 'placeholder-value', + * // The continuation token, which is used to page through large result sets. + * // To get the next page of results, set this parameter to the value of + * // `nextPageToken` from the previous response. + * pageToken: 'placeholder-value', + * // Managed service and service consumer. Required. + * // services/{service}/{collection id}/{resource id} + * // {collection id} is the cloud resource collection type representing the + * // service consumer, for example 'projects', or 'organizations'. + * // {resource id} is the consumer numeric id, such as project number: '123456'. + * // {service} the name of a service, such as 'service.googleapis.com'. + * parent: 'services/my-service/[^/]+/[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "tenancyUnits": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.services.tenancyUnits.list * @memberOf! () * @@ -2695,6 +3317,61 @@ export namespace serviceconsumermanagement_v1 { /** * serviceconsumermanagement.services.tenancyUnits.removeProject * @desc Removes the specified project resource identified by a tenant resource tag. The method removes the project lien with 'TenantManager' origin if that was added. It then attempts to delete the project. If that operation fails, this method also fails. Calls to remove already removed or non-existent tenant project succeed. After the project has been deleted, or if was already in a DELETED state, resource metadata is permanently removed from the tenancy unit. Operation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.services.tenancyUnits.removeProject( + * { + * // Name of the tenancy unit. + * // Such as 'services/service.googleapis.com/projects/12345/tenancyUnits/abcd'. + * name: 'services/my-service/[^/]+/[^/]+/tenancyUnits/my-tenancyUnit', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "tag": "my_tag" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.services.tenancyUnits.removeProject * @memberOf! () * @@ -2771,6 +3448,61 @@ export namespace serviceconsumermanagement_v1 { /** * serviceconsumermanagement.services.tenancyUnits.undeleteProject * @desc Attempts to undelete a previously deleted tenant project. The project must be in a DELETED state. There are no guarantees that an undeleted project will be in a fully restored and functional state. Call the `ApplyTenantProjectConfig` method to update its configuration and then validate all managed service resources. Operation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.services.tenancyUnits.undeleteProject( + * { + * // Name of the tenancy unit. + * // Such as 'services/service.googleapis.com/projects/12345/tenancyUnits/abcd'. + * name: 'services/my-service/[^/]+/[^/]+/tenancyUnits/my-tenancyUnit', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "tag": "my_tag" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.services.tenancyUnits.undeleteProject * @memberOf! () * diff --git a/src/apis/serviceconsumermanagement/v1beta1.ts b/src/apis/serviceconsumermanagement/v1beta1.ts index 6d031e77111..746505c6ae1 100644 --- a/src/apis/serviceconsumermanagement/v1beta1.ts +++ b/src/apis/serviceconsumermanagement/v1beta1.ts @@ -1573,6 +1573,50 @@ export namespace serviceconsumermanagement_v1beta1 { /** * serviceconsumermanagement.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.operations.get({ + * // The name of the operation resource. + * name: 'operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.operations.get * @memberOf! () * @@ -1678,6 +1722,58 @@ export namespace serviceconsumermanagement_v1beta1 { /** * serviceconsumermanagement.services.consumerQuotaMetrics.get * @desc Retrieves a summary of quota information for a specific quota metric. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.services.consumerQuotaMetrics.get( + * { + * // The resource name of the quota metric, returned by a + * // ListConsumerQuotaMetrics call. + * // + * // An example name would be: + * // `services/compute.googleapis.com/projects/123/consumerQuotaMetrics/compute.googleapis.com%2Fcpus` + * name: + * 'services/my-service/[^/]+/[^/]+/consumerQuotaMetrics/my-consumerQuotaMetric', + * // Specifies the level of detail for quota information in the response. + * view: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "consumerQuotaLimits": [], + * // "displayName": "my_displayName", + * // "metric": "my_metric", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.services.consumerQuotaMetrics.get * @memberOf! () * @@ -1758,6 +1854,64 @@ export namespace serviceconsumermanagement_v1beta1 { /** * serviceconsumermanagement.services.consumerQuotaMetrics.importProducerOverrides * @desc Create or update multiple producer overrides atomically, all on the same consumer, but on many different metrics or limits. The name field in the quota override message should not be set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.services.consumerQuotaMetrics.importProducerOverrides( + * { + * // The resource name of the consumer. + * // + * // An example name would be: + * // `services/compute.googleapis.com/projects/123` + * parent: 'services/my-service/[^/]+/[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "force": false, + * // "inlineSource": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.services.consumerQuotaMetrics.importProducerOverrides * @memberOf! () * @@ -1836,6 +1990,59 @@ export namespace serviceconsumermanagement_v1beta1 { /** * serviceconsumermanagement.services.consumerQuotaMetrics.list * @desc Retrieves a summary of all quota information about this consumer that is visible to the service producer, for each quota metric defined by the service. Each metric includes information about all of its defined limits. Each limit includes the limit configuration (quota unit, preciseness, default value), the current effective limit value, and all of the overrides applied to the limit. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.services.consumerQuotaMetrics.list( + * { + * // Requested size of the next page of data. + * pageSize: 'placeholder-value', + * // Token identifying which result to start with; returned by a previous list + * // call. + * pageToken: 'placeholder-value', + * // Parent of the quotas resource. + * // + * // An example parent would be: + * // `services/serviceconsumermanagement.googleapis.com/projects/123` + * parent: 'services/my-service/[^/]+/[^/]+', + * // Specifies the level of detail for quota information in the response. + * view: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "metrics": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.services.consumerQuotaMetrics.list * @memberOf! () * @@ -2000,6 +2207,59 @@ export namespace serviceconsumermanagement_v1beta1 { /** * serviceconsumermanagement.services.consumerQuotaMetrics.limits.get * @desc Retrieves a summary of quota information for a specific quota limit. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.services.consumerQuotaMetrics.limits.get( + * { + * // The resource name of the quota limit, returned by a + * // ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. + * // + * // An example name would be: + * // `services/compute.googleapis.com/projects/123/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion` + * name: + * 'services/my-service/[^/]+/[^/]+/consumerQuotaMetrics/my-consumerQuotaMetric/limits/my-limit', + * // Specifies the level of detail for quota information in the response. + * view: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "isPrecise": false, + * // "metric": "my_metric", + * // "name": "my_name", + * // "quotaBuckets": [], + * // "unit": "my_unit" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.services.consumerQuotaMetrics.limits.get * @memberOf! () * @@ -2102,6 +2362,75 @@ export namespace serviceconsumermanagement_v1beta1 { /** * serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerOverrides.create * @desc Creates a producer override. A producer override is applied by the owner or administrator of a service to increase or decrease the amount of quota a consumer of the service is allowed to use. To create multiple overrides at once, use ImportProducerOverrides instead. If an override with the specified dimensions already exists, this call will fail. To overwrite an existing override if one is already present ("upsert" semantics), use ImportProducerOverrides instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerOverrides.create( + * { + * // Whether to force the creation of the quota override. + * // If creating an override would cause the effective quota for the consumer to + * // decrease by more than 10 percent, the call is rejected, as a safety measure + * // to avoid accidentally decreasing quota too quickly. Setting the force + * // parameter to true ignores this restriction. + * force: 'placeholder-value', + * // The resource name of the parent quota limit, returned by a + * // ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. + * // + * // An example name would be: + * // `services/compute.googleapis.com/projects/123/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion` + * parent: + * 'services/my-service/[^/]+/[^/]+/consumerQuotaMetrics/my-consumerQuotaMetric/limits/my-limit', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dimensions": {}, + * // "metric": "my_metric", + * // "name": "my_name", + * // "overrideValue": "my_overrideValue", + * // "unit": "my_unit" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerOverrides.create * @memberOf! () * @@ -2179,6 +2508,62 @@ export namespace serviceconsumermanagement_v1beta1 { /** * serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerOverrides.delete * @desc Deletes a producer override. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerOverrides.delete( + * { + * // Whether to force the deletion of the quota override. + * // If deleting an override would cause the effective quota for the consumer to + * // decrease by more than 10 percent, the call is rejected, as a safety measure + * // to avoid accidentally decreasing quota too quickly. Setting the force + * // parameter to true ignores this restriction. + * force: 'placeholder-value', + * // The resource name of the override to delete. + * // + * // An example name would be: + * // `services/compute.googleapis.com/projects/123/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerOverrides/4a3f2c1d` + * name: + * 'services/my-service/[^/]+/[^/]+/consumerQuotaMetrics/my-consumerQuotaMetric/limits/my-limit/producerOverrides/my-producerOverride', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerOverrides.delete * @memberOf! () * @@ -2252,6 +2637,59 @@ export namespace serviceconsumermanagement_v1beta1 { /** * serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerOverrides.list * @desc Lists all producer overrides on this limit. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerOverrides.list( + * { + * // Requested size of the next page of data. + * pageSize: 'placeholder-value', + * // Token identifying which result to start with; returned by a previous list + * // call. + * pageToken: 'placeholder-value', + * // The resource name of the parent quota limit, returned by a + * // ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. + * // + * // An example name would be: + * // `services/compute.googleapis.com/projects/123/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion` + * parent: + * 'services/my-service/[^/]+/[^/]+/consumerQuotaMetrics/my-consumerQuotaMetric/limits/my-limit', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "overrides": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerOverrides.list * @memberOf! () * @@ -2346,6 +2784,77 @@ export namespace serviceconsumermanagement_v1beta1 { /** * serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerOverrides.patch * @desc Updates a producer override. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceconsumermanagement.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 serviceconsumermanagement = google.serviceconsumermanagement('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerOverrides.patch( + * { + * // Whether to force the update of the quota override. + * // If updating an override would cause the effective quota for the consumer to + * // decrease by more than 10 percent, the call is rejected, as a safety measure + * // to avoid accidentally decreasing quota too quickly. Setting the force + * // parameter to true ignores this restriction. + * force: 'placeholder-value', + * // The resource name of the override to update. + * // + * // An example name would be: + * // `services/compute.googleapis.com/projects/123/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerOverrides/4a3f2c1d` + * name: + * 'services/my-service/[^/]+/[^/]+/consumerQuotaMetrics/my-consumerQuotaMetric/limits/my-limit/producerOverrides/my-producerOverride', + * // Update only the specified fields. If unset, all modifiable fields will be + * // updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dimensions": {}, + * // "metric": "my_metric", + * // "name": "my_name", + * // "overrideValue": "my_overrideValue", + * // "unit": "my_unit" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerOverrides.patch * @memberOf! () * diff --git a/src/apis/servicecontrol/v1.ts b/src/apis/servicecontrol/v1.ts index e0f850b146e..a1df2ada357 100644 --- a/src/apis/servicecontrol/v1.ts +++ b/src/apis/servicecontrol/v1.ts @@ -1232,6 +1232,65 @@ export namespace servicecontrol_v1 { /** * servicecontrol.services.allocateQuota * @desc Attempts to allocate quota for the specified consumer. It should be called before the operation is executed. This method requires the `servicemanagement.services.quota` permission on the specified service. For more information, see [Cloud IAM](https://cloud.google.com/iam). **NOTE:** The client **must** fail-open on server errors `INTERNAL`, `UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system reliability, the server may inject these errors to prohibit any hard dependency on the quota functionality. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicecontrol.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 servicecontrol = google.servicecontrol('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/cloud-platform', + * 'https://www.googleapis.com/auth/servicecontrol', + * ], + * }); + * + * // 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 servicecontrol.services.allocateQuota({ + * // Name of the service as specified in the service configuration. For example, + * // `"pubsub.googleapis.com"`. + * // + * // See google.api.Service for the definition of a service name. + * serviceName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "allocateOperation": {}, + * // "serviceConfigId": "my_serviceConfigId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "allocateErrors": [], + * // "allocateInfo": {}, + * // "operationId": "my_operationId", + * // "quotaMetrics": [], + * // "serviceConfigId": "my_serviceConfigId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicecontrol.services.allocateQuota * @memberOf! () * @@ -1312,6 +1371,70 @@ export namespace servicecontrol_v1 { /** * servicecontrol.services.check * @desc Checks whether an operation on a service should be allowed to proceed based on the configuration of the service and related policies. It must be called before the operation is executed. If feasible, the client should cache the check results and reuse them for 60 seconds. In case of any server errors, the client should rely on the cached results for much longer time to avoid outage. WARNING: There is general 60s delay for the configuration and policy propagation, therefore callers MUST NOT depend on the `Check` method having the latest policy information. NOTE: the CheckRequest has the size limit of 64KB. This method requires the `servicemanagement.services.check` permission on the specified service. For more information, see [Cloud IAM](https://cloud.google.com/iam). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicecontrol.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 servicecontrol = google.servicecontrol('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/cloud-platform', + * 'https://www.googleapis.com/auth/servicecontrol', + * ], + * }); + * + * // 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 servicecontrol.services.check({ + * // The service name as specified in its service configuration. For example, + * // `"pubsub.googleapis.com"`. + * // + * // See + * // [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) + * // for the definition of a service name. + * serviceName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "operation": {}, + * // "requestProjectSettings": false, + * // "serviceConfigId": "my_serviceConfigId", + * // "skipActivationCheck": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "checkErrors": [], + * // "checkInfo": {}, + * // "operationId": "my_operationId", + * // "quotaInfo": {}, + * // "serviceConfigId": "my_serviceConfigId", + * // "serviceRolloutId": "my_serviceRolloutId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicecontrol.services.check * @memberOf! () * @@ -1387,6 +1510,66 @@ export namespace servicecontrol_v1 { /** * servicecontrol.services.report * @desc Reports operation results to Google Service Control, such as logs and metrics. It should be called after an operation is completed. If feasible, the client should aggregate reporting data for up to 5 seconds to reduce API traffic. Limiting aggregation to 5 seconds is to reduce data loss during client crashes. Clients should carefully choose the aggregation time window to avoid data loss risk more than 0.01% for business and compliance reasons. NOTE: the ReportRequest has the size limit (wire-format byte size) of 1MB. This method requires the `servicemanagement.services.report` permission on the specified service. For more information, see [Google Cloud IAM](https://cloud.google.com/iam). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicecontrol.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 servicecontrol = google.servicecontrol('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/cloud-platform', + * 'https://www.googleapis.com/auth/servicecontrol', + * ], + * }); + * + * // 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 servicecontrol.services.report({ + * // The service name as specified in its service configuration. For example, + * // `"pubsub.googleapis.com"`. + * // + * // See + * // [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) + * // for the definition of a service name. + * serviceName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "operations": [], + * // "serviceConfigId": "my_serviceConfigId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "reportErrors": [], + * // "reportInfos": [], + * // "serviceConfigId": "my_serviceConfigId", + * // "serviceRolloutId": "my_serviceRolloutId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicecontrol.services.report * @memberOf! () * diff --git a/src/apis/servicedirectory/v1beta1.ts b/src/apis/servicedirectory/v1beta1.ts index 9cffe897af9..3c0863ad425 100644 --- a/src/apis/servicedirectory/v1beta1.ts +++ b/src/apis/servicedirectory/v1beta1.ts @@ -387,6 +387,50 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.get * @memberOf! () * @@ -457,6 +501,53 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.list * @memberOf! () * @@ -585,6 +676,65 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.create * @desc Creates a namespace, and returns the new Namespace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.create({ + * // Required. The Resource ID must be 1-63 characters long, and comply with + * // RFC1035. + * // Specifically, the name must be 1-63 characters long and match the regular + * // expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * // character must be a lowercase letter, and all following characters must + * // be a dash, lowercase letter, or digit, except the last character, which + * // cannot be a dash. + * namespaceId: 'placeholder-value', + * // Required. The resource name of the project and location the namespace + * // will be created in. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labels": {}, + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "labels": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.create * @memberOf! () * @@ -662,6 +812,44 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.delete * @desc Deletes a namespace. This also deletes all services and endpoints in the namespace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.delete({ + * // Required. The name of the namespace to delete. + * name: 'projects/my-project/locations/my-location/namespaces/my-namespace', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.delete * @memberOf! () * @@ -732,6 +920,47 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.get * @desc Gets a namespace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.get({ + * // Required. The name of the namespace to retrieve. + * name: 'projects/my-project/locations/my-location/namespaces/my-namespace', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "labels": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.get * @memberOf! () * @@ -804,6 +1033,60 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.getIamPolicy * @desc Gets the IAM Policy for a resource (namespace or service only). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.getIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/namespaces/my-namespace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.getIamPolicy * @memberOf! () * @@ -878,6 +1161,86 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.list * @desc Lists all namespaces. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.list({ + * // Optional. The filter to list result by. + * // + * // General filter string syntax: + * // () + * // can be "name", or "labels." for map field. + * // can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and + * // is roughly the same as "=". + * // must be the same data type as field. + * // can be "AND, OR, NOT". + * // + * // Examples of valid filters: + * // * "labels.owner" returns Namespaces that have a label with the key "owner" + * // this is the same as "labels:owner". + * // * "labels.protocol=gRPC" returns Namespaces that have key/value + * // "protocol=gRPC". + * // * "name>projects/my-project/locations/us-east/namespaces/namespace-c" + * // returns Namespaces that have name that is alphabetically later than the + * // string, so "namespace-e" will be returned but "namespace-a" will not be. + * // * "labels.owner!=sd AND labels.foo=bar" returns Namespaces that have + * // "owner" in label key but value is not "sd" AND have key/value foo=bar. + * // * "doesnotexist.foo=bar" returns an empty list. Note that Namespace doesn't + * // have a field called "doesnotexist". Since the filter does not match any + * // Namespaces, it returns no results. + * filter: 'placeholder-value', + * // Optional. The order to list result by. + * // + * // General order by string syntax: + * // () (,) + * // allows values {"name"} + * // ascending or descending order by . If this is left + * // blank, "asc" is used. + * // Note that an empty order_by string result in default order, which is order + * // by name in ascending order. + * orderBy: 'placeholder-value', + * // Optional. The maximum number of items to return. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // Required. The resource name of the project and location whose namespaces we'd like to + * // list. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "namespaces": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.list * @memberOf! () * @@ -959,6 +1322,59 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.patch * @desc Updates a namespace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.patch({ + * // Immutable. The resource name for the namespace in the format + * // 'projects/x/locations/x/namespaces/x'. + * name: 'projects/my-project/locations/my-location/namespaces/my-namespace', + * // Required. List of fields to be updated in this request. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "labels": {}, + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "labels": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.patch * @memberOf! () * @@ -1033,6 +1449,60 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.setIamPolicy * @desc Sets the IAM Policy for a resource (namespace or service only). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/namespaces/my-namespace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.setIamPolicy * @memberOf! () * @@ -1107,6 +1577,58 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.testIamPermissions * @desc Tests IAM permissions for a resource (namespace or service only). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/namespaces/my-namespace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.testIamPermissions * @memberOf! () * @@ -1347,6 +1869,69 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.services.create * @desc Creates a service, and returns the new Service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.services.create( + * { + * // Required. The resource name of the namespace this service will belong to. + * parent: + * 'projects/my-project/locations/my-location/namespaces/my-namespace', + * // Required. The Resource ID must be 1-63 characters long, and comply with + * // RFC1035. + * // Specifically, the name must be 1-63 characters long and match the regular + * // expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * // character must be a lowercase letter, and all following characters must + * // be a dash, lowercase letter, or digit, except the last character, which + * // cannot be a dash. + * serviceId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "endpoints": [], + * // "metadata": {}, + * // "name": "my_name" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "endpoints": [], + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.services.create * @memberOf! () * @@ -1422,6 +2007,47 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.services.delete * @desc Deletes a service. This also deletes all endpoints associated with the service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.services.delete( + * { + * // Required. The name of the service to delete. + * name: + * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.services.delete * @memberOf! () * @@ -1492,6 +2118,51 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.services.get * @desc Gets a service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.services.get( + * { + * // Required. The name of the service to get. + * name: + * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "endpoints": [], + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.services.get * @memberOf! () * @@ -1562,6 +2233,60 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.services.getIamPolicy * @desc Gets the IAM Policy for a resource (namespace or service only). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.services.getIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.services.getIamPolicy * @memberOf! () * @@ -1636,6 +2361,82 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.services.list * @desc Lists all services belonging to a namespace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.services.list( + * { + * // Optional. The filter to list result by. + * // + * // General filter string syntax: + * // () + * // can be "name", or "metadata." for map field. + * // can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and + * // is roughly the same as "=". + * // must be the same data type as field. + * // can be "AND, OR, NOT". + * // + * // Examples of valid filters: + * // * "metadata.owner" returns Services that have a label with the key "owner" + * // this is the same as "metadata:owner". + * // * "metadata.protocol=gRPC" returns Services that have key/value + * // "protocol=gRPC". + * // * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c" + * // returns Services that have name that is alphabetically later than the + * // string, so "service-e" will be returned but "service-a" will not be. + * // * "metadata.owner!=sd AND metadata.foo=bar" returns Services that have + * // "owner" in label key but value is not "sd" AND have key/value foo=bar. + * // * "doesnotexist.foo=bar" returns an empty list. Note that Service doesn't + * // have a field called "doesnotexist". Since the filter does not match any + * // Services, it returns no results. + * filter: 'placeholder-value', + * // Optional. The order to list result by. + * orderBy: 'placeholder-value', + * // Optional. The maximum number of items to return. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous List request, + * // if any. + * pageToken: 'placeholder-value', + * // Required. The resource name of the namespace whose services we'd + * // like to list. + * parent: + * 'projects/my-project/locations/my-location/namespaces/my-namespace', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "services": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.services.list * @memberOf! () * @@ -1717,6 +2518,64 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.services.patch * @desc Updates a service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.services.patch( + * { + * // Immutable. The resource name for the service in the format + * // 'projects/x/locations/x/namespaces/x/services/x'. + * name: + * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service', + * // Required. List of fields to be updated in this request. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "endpoints": [], + * // "metadata": {}, + * // "name": "my_name" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "endpoints": [], + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.services.patch * @memberOf! () * @@ -1789,6 +2648,58 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.services.resolve * @desc Returns a service and its associated endpoints. Resolving a service is not considered an active developer method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.services.resolve( + * { + * // Required. The name of the service to resolve. + * name: + * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "endpointFilter": "my_endpointFilter", + * // "maxEndpoints": 0 + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "service": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.services.resolve * @memberOf! () * @@ -1869,6 +2780,60 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.services.setIamPolicy * @desc Sets the IAM Policy for a resource (namespace or service only). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.services.setIamPolicy( + * { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.services.setIamPolicy * @memberOf! () * @@ -1943,6 +2908,58 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.services.testIamPermissions * @desc Tests IAM permissions for a resource (namespace or service only). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.services.testIamPermissions( + * { + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: + * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.services.testIamPermissions * @memberOf! () * @@ -2196,6 +3213,71 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.services.endpoints.create * @desc Creates a endpoint, and returns the new Endpoint. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.services.endpoints.create( + * { + * // Required. The Resource ID must be 1-63 characters long, and comply with + * // RFC1035. + * // Specifically, the name must be 1-63 characters long and match the regular + * // expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + * // character must be a lowercase letter, and all following characters must + * // be a dash, lowercase letter, or digit, except the last character, which + * // cannot be a dash. + * endpointId: 'placeholder-value', + * // Required. The resource name of the service that this endpoint provides. + * parent: + * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "metadata": {}, + * // "name": "my_name", + * // "port": 0 + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "metadata": {}, + * // "name": "my_name", + * // "port": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.services.endpoints.create * @memberOf! () * @@ -2271,6 +3353,47 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.services.endpoints.delete * @desc Deletes a endpoint. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.services.endpoints.delete( + * { + * // Required. The name of the endpoint to delete. + * name: + * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service/endpoints/my-endpoint', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.services.endpoints.delete * @memberOf! () * @@ -2341,6 +3464,52 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.services.endpoints.get * @desc Gets a endpoint. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.services.endpoints.get( + * { + * // Required. The name of the endpoint to get. + * name: + * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service/endpoints/my-endpoint', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "metadata": {}, + * // "name": "my_name", + * // "port": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.services.endpoints.get * @memberOf! () * @@ -2411,6 +3580,84 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.services.endpoints.list * @desc Lists all endpoints. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.services.endpoints.list( + * { + * // Optional. The filter to list result by. + * // + * // General filter string syntax: + * // () + * // can be "name", "address", "port" or "metadata." for map field. + * // can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and + * // is roughly the same as "=". + * // must be the same data type as field. + * // can be "AND, OR, NOT". + * // + * // Examples of valid filters: + * // * "metadata.owner" returns Endpoints that have a label with the key "owner" + * // this is the same as "metadata:owner". + * // * "metadata.protocol=gRPC" returns Endpoints that have key/value + * // "protocol=gRPC". + * // * "address=192.108.1.105" returns Endpoints that have this address. + * // * "port>8080" returns Endpoints that have port number larger than 8080. + * // * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c" + * // returns Endpoints that have name that is alphabetically later than the + * // string, so "endpoint-e" will be returned but "endpoint-a" will not be. + * // * "metadata.owner!=sd AND metadata.foo=bar" returns Endpoints that have + * // "owner" in label key but value is not "sd" AND have key/value foo=bar. + * // * "doesnotexist.foo=bar" returns an empty list. Note that Endpoint doesn't + * // have a field called "doesnotexist". Since the filter does not match any + * // Endpoints, it returns no results. + * filter: 'placeholder-value', + * // Optional. The order to list result by. + * orderBy: 'placeholder-value', + * // Optional. The maximum number of items to return. + * pageSize: 'placeholder-value', + * // Optional. The next_page_token value returned from a previous List request, + * // if any. + * pageToken: 'placeholder-value', + * // Required. The resource name of the service whose endpoints we'd like to + * // list. + * parent: + * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "endpoints": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.services.endpoints.list * @memberOf! () * @@ -2492,6 +3739,66 @@ export namespace servicedirectory_v1beta1 { /** * servicedirectory.projects.locations.namespaces.services.endpoints.patch * @desc Updates a endpoint. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicedirectory.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 servicedirectory = google.servicedirectory('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 servicedirectory.projects.locations.namespaces.services.endpoints.patch( + * { + * // Immutable. The resource name for the endpoint in the format + * // 'projects/x/locations/x/namespaces/x/services/x/endpoints/x'. + * name: + * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service/endpoints/my-endpoint', + * // Required. List of fields to be updated in this request. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "metadata": {}, + * // "name": "my_name", + * // "port": 0 + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "metadata": {}, + * // "name": "my_name", + * // "port": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicedirectory.projects.locations.namespaces.services.endpoints.patch * @memberOf! () * diff --git a/src/apis/servicemanagement/v1.ts b/src/apis/servicemanagement/v1.ts index b965d1cde26..6d159b31bee 100644 --- a/src/apis/servicemanagement/v1.ts +++ b/src/apis/servicemanagement/v1.ts @@ -1745,6 +1745,53 @@ export namespace servicemanagement_v1 { /** * servicemanagement.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicemanagement.operations.get({ + * // The name of the operation resource. + * name: 'operations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.operations.get * @memberOf! () * @@ -1816,6 +1863,76 @@ export namespace servicemanagement_v1 { /** * servicemanagement.operations.list * @desc Lists service operations that match the specified filter in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicemanagement.operations.list({ + * // A string for filtering Operations. + * // The following filter fields are supported: + * // + * // * serviceName: Required. Only `=` operator is allowed. + * // * startTime: The time this job was started, in ISO 8601 format. + * // Allowed operators are `>=`, `>`, `<=`, and `<`. + * // * status: Can be `done`, `in_progress`, or `failed`. Allowed + * // operators are `=`, and `!=`. + * // + * // Filter expression supports conjunction (AND) and disjunction (OR) + * // logical operators. However, the serviceName restriction must be at the + * // top-level and can only be combined with other restrictions via the AND + * // logical operator. + * // + * // Examples: + * // + * // * `serviceName={some-service}.googleapis.com` + * // * `serviceName={some-service}.googleapis.com AND startTime>="2017-02-01"` + * // * `serviceName={some-service}.googleapis.com AND status=done` + * // * `serviceName={some-service}.googleapis.com AND (status=done OR startTime>="2017-02-01")` + * filter: 'placeholder-value', + * // Not used. + * name: 'placeholder-value', + * // The maximum number of operations to return. If unspecified, defaults to + * // 50. The maximum value is 100. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.operations.list * @memberOf! () * @@ -1940,6 +2057,59 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.create * @desc Creates a new managed service. A managed service is immutable, and is subject to mandatory 30-day data retention. You cannot move a service or recreate it within 30 days after deletion. One producer project can own no more than 500 services. For security and reliability purposes, a production service should be hosted in a dedicated producer project. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicemanagement.services.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "producerProjectId": "my_producerProjectId", + * // "serviceName": "my_serviceName" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.create * @memberOf! () * @@ -2011,6 +2181,54 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.delete * @desc Deletes a managed service. This method will change the service to the `Soft-Delete` state for 30 days. Within this period, service producers may call UndeleteService to restore the service. After 30 days, the service will be permanently deleted. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicemanagement.services.delete({ + * // Required. The name of the service. See the [overview](/service-management/overview) + * // for naming requirements. For example: `example.googleapis.com`. + * serviceName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.delete * @memberOf! () * @@ -2085,6 +2303,62 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.disable * @desc Disables a service for a project, so it can no longer be be used for the project. It prevents accidental usage that may cause unexpected billing charges or security leaks. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicemanagement.services.disable({ + * // Required. Name of the service to disable. Specifying an unknown service name + * // will cause the request to fail. + * serviceName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "consumerId": "my_consumerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.disable * @memberOf! () * @@ -2160,6 +2434,62 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.enable * @desc Enables a service for a project, so it can be used for the project. See [Cloud Auth Guide](https://cloud.google.com/docs/authentication) for more information. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicemanagement.services.enable({ + * // Required. Name of the service to enable. Specifying an unknown service name will + * // cause the request to fail. + * serviceName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "consumerId": "my_consumerId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.enable * @memberOf! () * @@ -2235,6 +2565,58 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.generateConfigReport * @desc Generates and returns a report (errors, warnings and changes from existing configurations) associated with GenerateConfigReportRequest.new_value If GenerateConfigReportRequest.old_value is specified, GenerateConfigReportRequest will contain a single ChangeReport based on the comparison between GenerateConfigReportRequest.new_value and GenerateConfigReportRequest.old_value. If GenerateConfigReportRequest.old_value is not specified, this method will compare GenerateConfigReportRequest.new_value with the last pushed service configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicemanagement.services.generateConfigReport({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "newConfig": {}, + * // "oldConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "changeReports": [], + * // "diagnostics": [], + * // "id": "my_id", + * // "serviceName": "my_serviceName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.generateConfigReport * @memberOf! () * @@ -2319,6 +2701,53 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.get * @desc Gets a managed service. Authentication is required unless the service is public. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/service.management', + * 'https://www.googleapis.com/auth/service.management.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 servicemanagement.services.get({ + * // Required. The name of the service. See the `ServiceManager` overview for naming + * // requirements. For example: `example.googleapis.com`. + * serviceName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "producerProjectId": "my_producerProjectId", + * // "serviceName": "my_serviceName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.get * @memberOf! () * @@ -2393,6 +2822,86 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.getConfig * @desc Gets a service configuration (version) for a managed service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/service.management', + * 'https://www.googleapis.com/auth/service.management.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 servicemanagement.services.getConfig({ + * // Required. The id of the service configuration resource. + * // + * // This field must be specified for the server to return all fields, including + * // `SourceInfo`. + * configId: 'placeholder-value', + * // Required. The name of the service. See the [overview](/service-management/overview) + * // for naming requirements. For example: `example.googleapis.com`. + * serviceName: 'placeholder-value', + * // Specifies which parts of the Service Config should be returned in the + * // response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apis": [], + * // "authentication": {}, + * // "backend": {}, + * // "billing": {}, + * // "configVersion": 0, + * // "context": {}, + * // "control": {}, + * // "customError": {}, + * // "documentation": {}, + * // "endpoints": [], + * // "enums": [], + * // "http": {}, + * // "id": "my_id", + * // "logging": {}, + * // "logs": [], + * // "metrics": [], + * // "monitoredResources": [], + * // "monitoring": {}, + * // "name": "my_name", + * // "producerProjectId": "my_producerProjectId", + * // "quota": {}, + * // "sourceInfo": {}, + * // "systemParameters": {}, + * // "systemTypes": [], + * // "title": "my_title", + * // "types": [], + * // "usage": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.getConfig * @memberOf! () * @@ -2468,6 +2977,63 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/service.management', + * 'https://www.googleapis.com/auth/service.management.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 servicemanagement.services.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.getIamPolicy * @memberOf! () * @@ -2542,6 +3108,64 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.list * @desc Lists managed services. Returns all public services. For authenticated users, also returns all services the calling user has "servicemanagement.services.get" permission for. **BETA:** If the caller specifies the `consumer_id`, it returns only the services enabled on the consumer. The `consumer_id` must have the format of "project:{PROJECT-ID}". + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/service.management', + * 'https://www.googleapis.com/auth/service.management.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 servicemanagement.services.list({ + * // Include services consumed by the specified consumer. + * // + * // The Google Service Management implementation accepts the following + * // forms: + * // - project: + * consumerId: 'placeholder-value', + * // The max number of items to include in the response list. Page size is 50 + * // if not specified. Maximum value is 100. + * pageSize: 'placeholder-value', + * // Token identifying which result to start with; returned by a previous list + * // call. + * pageToken: 'placeholder-value', + * // Include services produced by the specified project. + * producerProjectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "services": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.list * @memberOf! () * @@ -2618,6 +3242,62 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicemanagement.services.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.setIamPolicy * @memberOf! () * @@ -2692,6 +3372,60 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/service.management', + * 'https://www.googleapis.com/auth/service.management.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 servicemanagement.services.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.testIamPermissions * @memberOf! () * @@ -2775,6 +3509,54 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.undelete * @desc Revives a previously deleted managed service. The method restores the service using the configuration at the time the service was deleted. The target service must exist and must have been deleted within the last 30 days. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicemanagement.services.undelete({ + * // Required. The name of the service. See the [overview](/service-management/overview) + * // for naming requirements. For example: `example.googleapis.com`. + * serviceName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.undelete * @memberOf! () * @@ -3041,6 +3823,110 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.configs.create * @desc Creates a new service configuration (version) for a managed service. This method only stores the service configuration. To roll out the service configuration to backend systems please call CreateServiceRollout. Only the 100 most recent service configurations and ones referenced by existing rollouts are kept for each service. The rest will be deleted eventually. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicemanagement.services.configs.create({ + * // Required. The name of the service. See the [overview](/service-management/overview) + * // for naming requirements. For example: `example.googleapis.com`. + * serviceName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "apis": [], + * // "authentication": {}, + * // "backend": {}, + * // "billing": {}, + * // "configVersion": 0, + * // "context": {}, + * // "control": {}, + * // "customError": {}, + * // "documentation": {}, + * // "endpoints": [], + * // "enums": [], + * // "http": {}, + * // "id": "my_id", + * // "logging": {}, + * // "logs": [], + * // "metrics": [], + * // "monitoredResources": [], + * // "monitoring": {}, + * // "name": "my_name", + * // "producerProjectId": "my_producerProjectId", + * // "quota": {}, + * // "sourceInfo": {}, + * // "systemParameters": {}, + * // "systemTypes": [], + * // "title": "my_title", + * // "types": [], + * // "usage": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apis": [], + * // "authentication": {}, + * // "backend": {}, + * // "billing": {}, + * // "configVersion": 0, + * // "context": {}, + * // "control": {}, + * // "customError": {}, + * // "documentation": {}, + * // "endpoints": [], + * // "enums": [], + * // "http": {}, + * // "id": "my_id", + * // "logging": {}, + * // "logs": [], + * // "metrics": [], + * // "monitoredResources": [], + * // "monitoring": {}, + * // "name": "my_name", + * // "producerProjectId": "my_producerProjectId", + * // "quota": {}, + * // "sourceInfo": {}, + * // "systemParameters": {}, + * // "systemTypes": [], + * // "title": "my_title", + * // "types": [], + * // "usage": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.configs.create * @memberOf! () * @@ -3115,6 +4001,86 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.configs.get * @desc Gets a service configuration (version) for a managed service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/service.management', + * 'https://www.googleapis.com/auth/service.management.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 servicemanagement.services.configs.get({ + * // Required. The id of the service configuration resource. + * // + * // This field must be specified for the server to return all fields, including + * // `SourceInfo`. + * configId: 'placeholder-value', + * // Required. The name of the service. See the [overview](/service-management/overview) + * // for naming requirements. For example: `example.googleapis.com`. + * serviceName: 'placeholder-value', + * // Specifies which parts of the Service Config should be returned in the + * // response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apis": [], + * // "authentication": {}, + * // "backend": {}, + * // "billing": {}, + * // "configVersion": 0, + * // "context": {}, + * // "control": {}, + * // "customError": {}, + * // "documentation": {}, + * // "endpoints": [], + * // "enums": [], + * // "http": {}, + * // "id": "my_id", + * // "logging": {}, + * // "logs": [], + * // "metrics": [], + * // "monitoredResources": [], + * // "monitoring": {}, + * // "name": "my_name", + * // "producerProjectId": "my_producerProjectId", + * // "quota": {}, + * // "sourceInfo": {}, + * // "systemParameters": {}, + * // "systemTypes": [], + * // "title": "my_title", + * // "types": [], + * // "usage": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.configs.get * @memberOf! () * @@ -3189,6 +4155,58 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.configs.list * @desc Lists the history of the service configuration for a managed service, from the newest to the oldest. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/service.management', + * 'https://www.googleapis.com/auth/service.management.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 servicemanagement.services.configs.list({ + * // The max number of items to include in the response list. Page size is 50 + * // if not specified. Maximum value is 100. + * pageSize: 'placeholder-value', + * // The token of the page to retrieve. + * pageToken: 'placeholder-value', + * // Required. The name of the service. See the [overview](/service-management/overview) + * // for naming requirements. For example: `example.googleapis.com`. + * serviceName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "serviceConfigs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.configs.list * @memberOf! () * @@ -3273,6 +4291,63 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.configs.submit * @desc Creates a new service configuration (version) for a managed service based on user-supplied configuration source files (for example: OpenAPI Specification). This method stores the source configurations as well as the generated service configuration. To rollout the service configuration to other services, please call CreateServiceRollout. Only the 100 most recent configuration sources and ones referenced by existing service configurtions are kept for each service. The rest will be deleted eventually. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicemanagement.services.configs.submit({ + * // Required. The name of the service. See the [overview](/service-management/overview) + * // for naming requirements. For example: `example.googleapis.com`. + * serviceName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "configSource": {}, + * // "validateOnly": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.configs.submit * @memberOf! () * @@ -3430,6 +4505,63 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.consumers.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/service.management', + * 'https://www.googleapis.com/auth/service.management.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 servicemanagement.services.consumers.getIamPolicy({ + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'services/my-service/consumers/my-consumer', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.consumers.getIamPolicy * @memberOf! () * @@ -3504,6 +4636,62 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.consumers.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicemanagement.services.consumers.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'services/my-service/consumers/my-consumer', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.consumers.setIamPolicy * @memberOf! () * @@ -3578,6 +4766,60 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.consumers.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/service.management', + * 'https://www.googleapis.com/auth/service.management.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 servicemanagement.services.consumers.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'services/my-service/consumers/my-consumer', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.consumers.testIamPermissions * @memberOf! () * @@ -3720,6 +4962,68 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.rollouts.create * @desc Creates a new service configuration rollout. Based on rollout, the Google Service Management will roll out the service configurations to different backend services. For example, the logging configuration will be pushed to Google Cloud Logging. Please note that any previous pending and running Rollouts and associated Operations will be automatically cancelled so that the latest Rollout will not be blocked by previous Rollouts. Only the 100 most recent (in any state) and the last 10 successful (if not already part of the set of 100 most recent) rollouts are kept for each service. The rest will be deleted eventually. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicemanagement.services.rollouts.create({ + * // Required. The name of the service. See the [overview](/service-management/overview) + * // for naming requirements. For example: `example.googleapis.com`. + * serviceName: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "createdBy": "my_createdBy", + * // "deleteServiceStrategy": {}, + * // "rolloutId": "my_rolloutId", + * // "serviceName": "my_serviceName", + * // "status": "my_status", + * // "trafficPercentStrategy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.rollouts.create * @memberOf! () * @@ -3796,6 +5100,60 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.rollouts.get * @desc Gets a service configuration rollout. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/service.management', + * 'https://www.googleapis.com/auth/service.management.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 servicemanagement.services.rollouts.get({ + * // Required. The id of the rollout resource. + * rolloutId: 'placeholder-value', + * // Required. The name of the service. See the [overview](/service-management/overview) + * // for naming requirements. For example: `example.googleapis.com`. + * serviceName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "createdBy": "my_createdBy", + * // "deleteServiceStrategy": {}, + * // "rolloutId": "my_rolloutId", + * // "serviceName": "my_serviceName", + * // "status": "my_status", + * // "trafficPercentStrategy": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.rollouts.get * @memberOf! () * @@ -3869,6 +5227,67 @@ export namespace servicemanagement_v1 { /** * servicemanagement.services.rollouts.list * @desc Lists the history of the service configuration rollouts for a managed service, from the newest to the oldest. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicemanagement.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 servicemanagement = google.servicemanagement('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/service.management', + * 'https://www.googleapis.com/auth/service.management.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 servicemanagement.services.rollouts.list({ + * // Required. Use `filter` to return subset of rollouts. + * // The following filters are supported: + * // -- To limit the results to only those in + * // [status](google.api.servicemanagement.v1.RolloutStatus) 'SUCCESS', + * // use filter='status=SUCCESS' + * // -- To limit the results to those in + * // [status](google.api.servicemanagement.v1.RolloutStatus) 'CANCELLED' + * // or 'FAILED', use filter='status=CANCELLED OR status=FAILED' + * filter: 'placeholder-value', + * // The max number of items to include in the response list. Page size is 50 + * // if not specified. Maximum value is 100. + * pageSize: 'placeholder-value', + * // The token of the page to retrieve. + * pageToken: 'placeholder-value', + * // Required. The name of the service. See the [overview](/service-management/overview) + * // for naming requirements. For example: `example.googleapis.com`. + * serviceName: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "rollouts": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicemanagement.services.rollouts.list * @memberOf! () * diff --git a/src/apis/servicenetworking/v1.ts b/src/apis/servicenetworking/v1.ts index 4689b961886..d6f6883bc6f 100644 --- a/src/apis/servicenetworking/v1.ts +++ b/src/apis/servicenetworking/v1.ts @@ -1545,6 +1545,53 @@ export namespace servicenetworking_v1 { /** * servicenetworking.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicenetworking.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 servicenetworking = google.servicenetworking('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicenetworking.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'operations/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicenetworking.operations.cancel * @memberOf! () * @@ -1616,6 +1663,47 @@ export namespace servicenetworking_v1 { /** * servicenetworking.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicenetworking.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 servicenetworking = google.servicenetworking('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicenetworking.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'operations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicenetworking.operations.delete * @memberOf! () * @@ -1686,6 +1774,53 @@ export namespace servicenetworking_v1 { /** * servicenetworking.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicenetworking.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 servicenetworking = google.servicenetworking('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicenetworking.operations.get({ + * // The name of the operation resource. + * name: 'operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicenetworking.operations.get * @memberOf! () * @@ -1757,6 +1892,56 @@ export namespace servicenetworking_v1 { /** * servicenetworking.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicenetworking.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 servicenetworking = google.servicenetworking('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicenetworking.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicenetworking.operations.list * @memberOf! () * @@ -1908,6 +2093,76 @@ export namespace servicenetworking_v1 { /** * servicenetworking.services.addSubnetwork * @desc For service producers, provisions a new subnet in a peered service's shared VPC network in the requested region and with the requested size that's expressed as a CIDR range (number of leading bits of ipV4 network mask). The method checks against the assigned allocated ranges to find a non-conflicting IP address range. The method will reuse a subnet if subsequent calls contain the same subnet name, region, and prefix length. This method will make producer's tenant project to be a shared VPC service project as needed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicenetworking.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 servicenetworking = google.servicenetworking('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicenetworking.services.addSubnetwork({ + * // Required. A tenant project in the service producer organization, in the + * // following format: services/{service}/{collection-id}/{resource-id}. + * // {collection-id} is the cloud resource collection type that represents the + * // tenant project. Only `projects` are supported. + * // {resource-id} is the tenant project numeric id, such as + * // `123456`. {service} the name of the peering service, such as + * // `service-peering.example.com`. This service must already be + * // enabled in the service consumer's project. + * parent: 'services/my-service/[^/]+/[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "consumer": "my_consumer", + * // "consumerNetwork": "my_consumerNetwork", + * // "description": "my_description", + * // "ipPrefixLength": 0, + * // "privateIpv6GoogleAccess": "my_privateIpv6GoogleAccess", + * // "region": "my_region", + * // "requestedAddress": "my_requestedAddress", + * // "subnetwork": "my_subnetwork", + * // "subnetworkUsers": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicenetworking.services.addSubnetwork * @memberOf! () * @@ -1984,6 +2239,63 @@ export namespace servicenetworking_v1 { /** * servicenetworking.services.disableVpcServiceControls * @desc Disables VPC service controls for a connection. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicenetworking.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 servicenetworking = google.servicenetworking('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicenetworking.services.disableVpcServiceControls({ + * // The service that is managing peering connectivity for a service producer's + * // organization. For Google services that support this functionality, this + * // value is `services/servicenetworking.googleapis.com`. + * parent: 'services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "consumerNetwork": "my_consumerNetwork" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicenetworking.services.disableVpcServiceControls * @memberOf! () * @@ -2062,6 +2374,63 @@ export namespace servicenetworking_v1 { /** * servicenetworking.services.enableVpcServiceControls * @desc Enables VPC service controls for a connection. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicenetworking.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 servicenetworking = google.servicenetworking('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicenetworking.services.enableVpcServiceControls({ + * // The service that is managing peering connectivity for a service producer's + * // organization. For Google services that support this functionality, this + * // value is `services/servicenetworking.googleapis.com`. + * parent: 'services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "consumerNetwork": "my_consumerNetwork" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicenetworking.services.enableVpcServiceControls * @memberOf! () * @@ -2140,6 +2509,63 @@ export namespace servicenetworking_v1 { /** * servicenetworking.services.searchRange * @desc Service producers can use this method to find a currently unused range within consumer allocated ranges. This returned range is not reserved, and not guaranteed to remain unused. It will validate previously provided allocated ranges, find non-conflicting sub-range of requested size (expressed in number of leading bits of ipv4 network mask, as in CIDR range notation). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicenetworking.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 servicenetworking = google.servicenetworking('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicenetworking.services.searchRange({ + * // Required. This is in a form services/{service}. {service} the name of the private + * // access management service, for example 'service-peering.example.com'. + * parent: 'services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ipPrefixLength": 0, + * // "network": "my_network" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicenetworking.services.searchRange * @memberOf! () * @@ -2216,6 +2642,63 @@ export namespace servicenetworking_v1 { /** * servicenetworking.services.validate * @desc Service producers use this method to validate if the consumer provided network, project and requested range are valid. This allows them to use a fail-fast mechanism for consumer requests, and not have to wait for AddSubnetwork operation completion to determine if user request is invalid. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicenetworking.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 servicenetworking = google.servicenetworking('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicenetworking.services.validate({ + * // Required. This is in a form services/{service} where {service} is the name of the + * // private access management service. For example + * // 'service-peering.example.com'. + * parent: 'services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "consumerNetwork": "my_consumerNetwork", + * // "consumerProject": {}, + * // "rangeReservation": {}, + * // "validateNetwork": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "isValid": false, + * // "validationError": "my_validationError" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicenetworking.services.validate * @memberOf! () * @@ -2394,6 +2877,66 @@ export namespace servicenetworking_v1 { /** * servicenetworking.services.connections.create * @desc Creates a private connection that establishes a VPC Network Peering connection to a VPC network in the service producer's organization. The administrator of the service consumer's VPC network invokes this method. The administrator must assign one or more allocated IP ranges for provisioning subnetworks in the service producer's VPC network. This connection is used for all supported services in the service producer's organization, so it only needs to be invoked once. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicenetworking.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 servicenetworking = google.servicenetworking('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicenetworking.services.connections.create({ + * // The service that is managing peering connectivity for a service producer's + * // organization. For Google services that support this functionality, this + * // value is `services/servicenetworking.googleapis.com`. + * parent: 'services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "network": "my_network", + * // "peering": "my_peering", + * // "reservedPeeringRanges": [], + * // "service": "my_service" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicenetworking.services.connections.create * @memberOf! () * @@ -2470,6 +3013,61 @@ export namespace servicenetworking_v1 { /** * servicenetworking.services.connections.list * @desc List the private connections that are configured in a service consumer's VPC network. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicenetworking.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 servicenetworking = google.servicenetworking('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicenetworking.services.connections.list({ + * // The name of service consumer's VPC network that's connected with service + * // producer network through a private connection. The network name must be in + * // the following format: + * // `projects/{project}/global/networks/{network}`. {project} is a + * // project number, such as in `12345` that includes the VPC service + * // consumer's VPC network. {network} is the name of the service consumer's VPC + * // network. + * network: 'placeholder-value', + * // The service that is managing peering connectivity for a service producer's + * // organization. For Google services that support this functionality, this + * // value is `services/servicenetworking.googleapis.com`. + * // If you specify `services/-` as the parameter value, all configured peering + * // services are listed. + * parent: 'services/my-service', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "connections": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicenetworking.services.connections.list * @memberOf! () * @@ -2548,6 +3146,75 @@ export namespace servicenetworking_v1 { /** * servicenetworking.services.connections.patch * @desc Updates the allocated ranges that are assigned to a connection. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicenetworking.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 servicenetworking = google.servicenetworking('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicenetworking.services.connections.patch({ + * // If a previously defined allocated range is removed, force flag must be + * // set to true. + * force: 'placeholder-value', + * // The private service connection that connects to a service producer + * // organization. The name includes both the private service name and the VPC + * // network peering name in the format of + * // `services/{peering_service_name}/connections/{vpc_peering_name}`. For + * // Google services that support this functionality, this is + * // `services/servicenetworking.googleapis.com/connections/servicenetworking-googleapis-com`. + * name: 'services/my-service/connections/my-connection', + * // The update mask. If this is omitted, it defaults to "*". You can only + * // update the listed peering ranges. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "network": "my_network", + * // "peering": "my_peering", + * // "reservedPeeringRanges": [], + * // "service": "my_service" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicenetworking.services.connections.patch * @memberOf! () * @@ -2689,6 +3356,64 @@ export namespace servicenetworking_v1 { /** * servicenetworking.services.roles.add * @desc Service producers can use this method to add roles in the shared VPC host project. Each role is bound to the provided member. Each role must be selected from within a whitelisted set of roles. Each role is applied at only the granularity specified in the whitelist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicenetworking.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 servicenetworking = google.servicenetworking('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicenetworking.services.roles.add({ + * // Required. This is in a form services/{service} where {service} is the name of the + * // private access management service. For example + * // 'service-peering.example.com'. + * parent: 'services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "consumerNetwork": "my_consumerNetwork", + * // "policyBinding": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicenetworking.services.roles.add * @memberOf! () * diff --git a/src/apis/servicenetworking/v1beta.ts b/src/apis/servicenetworking/v1beta.ts index 75c8ca0a136..bc0542f79fa 100644 --- a/src/apis/servicenetworking/v1beta.ts +++ b/src/apis/servicenetworking/v1beta.ts @@ -1445,6 +1445,53 @@ export namespace servicenetworking_v1beta { /** * servicenetworking.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicenetworking.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 servicenetworking = google.servicenetworking('v1beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicenetworking.operations.get({ + * // The name of the operation resource. + * name: 'operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicenetworking.operations.get * @memberOf! () * @@ -1537,6 +1584,75 @@ export namespace servicenetworking_v1beta { /** * servicenetworking.services.addSubnetwork * @desc For service producers, provisions a new subnet in a peered service's shared VPC network in the requested region and with the requested size that's expressed as a CIDR range (number of leading bits of ipV4 network mask). The method checks against the assigned allocated ranges to find a non-conflicting IP address range. The method will reuse a subnet if subsequent calls contain the same subnet name, region, and prefix length. This method will make producer's tenant project to be a shared VPC service project as needed. The response from the `get` operation will be of type `Subnetwork` if the operation successfully completes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicenetworking.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 servicenetworking = google.servicenetworking('v1beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicenetworking.services.addSubnetwork({ + * // Required. A tenant project in the service producer organization, in the + * // following format: services/{service}/{collection-id}/{resource-id}. + * // {collection-id} is the cloud resource collection type that represents the + * // tenant project. Only `projects` are supported. + * // {resource-id} is the tenant project numeric id, such as + * // `123456`. {service} the name of the peering service, such as + * // `service-peering.example.com`. This service must already be + * // enabled in the service consumer's project. + * parent: 'services/my-service/[^/]+/[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "consumer": "my_consumer", + * // "consumerNetwork": "my_consumerNetwork", + * // "description": "my_description", + * // "ipPrefixLength": 0, + * // "region": "my_region", + * // "requestedAddress": "my_requestedAddress", + * // "subnetwork": "my_subnetwork", + * // "subnetworkUsers": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicenetworking.services.addSubnetwork * @memberOf! () * @@ -1613,6 +1729,64 @@ export namespace servicenetworking_v1beta { /** * servicenetworking.services.searchRange * @desc Service producers can use this method to find a currently unused range within consumer allocated ranges. This returned range is not reserved, and not guaranteed to remain unused. It will validate previously provided allocated ranges, find non-conflicting sub-range of requested size (expressed in number of leading bits of ipv4 network mask, as in CIDR range notation). Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicenetworking.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 servicenetworking = google.servicenetworking('v1beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicenetworking.services.searchRange({ + * // Required. This is in a form services/{service}. + * // {service} the name of the private access management service, for example + * // 'service-peering.example.com'. + * parent: 'services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ipPrefixLength": 0, + * // "network": "my_network" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicenetworking.services.searchRange * @memberOf! () * @@ -1689,6 +1863,73 @@ export namespace servicenetworking_v1beta { /** * servicenetworking.services.updateConnections * @desc Updates the allocated ranges that are assigned to a connection. The response from the `get` operation will be of type `Connection` if the operation successfully completes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicenetworking.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 servicenetworking = google.servicenetworking('v1beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicenetworking.services.updateConnections({ + * // If a previously defined allocated range is removed, force flag must be + * // set to true. + * force: 'placeholder-value', + * // The service producer peering service that is managing peering connectivity + * // for a service producer organization. + * // For Google services that support this functionality, this is + * // `services/servicenetworking.googleapis.com`. + * name: 'services/my-service', + * // The update mask. If this is omitted, it defaults to "*". You can only + * // update the listed peering ranges. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "network": "my_network", + * // "peering": "my_peering", + * // "reservedPeeringRanges": [], + * // "service": "my_service" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicenetworking.services.updateConnections * @memberOf! () * @@ -1834,6 +2075,66 @@ export namespace servicenetworking_v1beta { /** * servicenetworking.services.connections.create * @desc Creates a private connection that establishes a VPC Network Peering connection to a VPC network in the service producer's organization. The administrator of the service consumer's VPC network invokes this method. The administrator must assign one or more allocated IP ranges for provisioning subnetworks in the service producer's VPC network. This connection is used for all supported services in the service producer's organization, so it only needs to be invoked once. The response from the `get` operation will be of type `Connection` if the operation successfully completes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicenetworking.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 servicenetworking = google.servicenetworking('v1beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicenetworking.services.connections.create({ + * // The service that is managing peering connectivity for a service producer's + * // organization. For Google services that support this functionality, this + * // value is `services/servicenetworking.googleapis.com`. + * parent: 'services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "network": "my_network", + * // "peering": "my_peering", + * // "reservedPeeringRanges": [], + * // "service": "my_service" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicenetworking.services.connections.create * @memberOf! () * @@ -1910,6 +2211,61 @@ export namespace servicenetworking_v1beta { /** * servicenetworking.services.connections.list * @desc List the private connections that are configured in a service consumer's VPC network. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/servicenetworking.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 servicenetworking = google.servicenetworking('v1beta'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 servicenetworking.services.connections.list({ + * // The name of service consumer's VPC network that's connected with service + * // producer network through a private connection. The network name must be in + * // the following format: + * // `projects/{project}/global/networks/{network}`. {project} is a + * // project number, such as in `12345` that includes the VPC service + * // consumer's VPC network. {network} is the name of the service consumer's VPC + * // network. + * network: 'placeholder-value', + * // The service that is managing peering connectivity for a service producer's + * // organization. For Google services that support this functionality, this + * // value is `services/servicenetworking.googleapis.com`. + * // If you specify `-` as the parameter value, all configured public peering + * // services are listed. + * parent: 'services/my-service', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "connections": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias servicenetworking.services.connections.list * @memberOf! () * diff --git a/src/apis/serviceusage/v1.ts b/src/apis/serviceusage/v1.ts index a90cdc79e2d..0d1c78522a1 100644 --- a/src/apis/serviceusage/v1.ts +++ b/src/apis/serviceusage/v1.ts @@ -1561,6 +1561,53 @@ export namespace serviceusage_v1 { /** * serviceusage.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 serviceusage.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'operations/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.operations.cancel * @memberOf! () * @@ -1631,6 +1678,47 @@ export namespace serviceusage_v1 { /** * serviceusage.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 serviceusage.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'operations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.operations.delete * @memberOf! () * @@ -1700,6 +1788,53 @@ export namespace serviceusage_v1 { /** * serviceusage.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 serviceusage.operations.get({ + * // The name of the operation resource. + * name: 'operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.operations.get * @memberOf! () * @@ -1770,6 +1905,56 @@ export namespace serviceusage_v1 { /** * serviceusage.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 serviceusage.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'placeholder-value', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.operations.list * @memberOf! () * @@ -1916,6 +2101,66 @@ export namespace serviceusage_v1 { /** * serviceusage.services.batchEnable * @desc Enable multiple services on a project. The operation is atomic: if enabling any service fails, then the entire batch fails, and no state changes occur. To enable a single service, use the `EnableService` method instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 serviceusage.services.batchEnable({ + * // Parent to enable services on. + * // + * // An example name would be: + * // `projects/123` where `123` is the project number. + * // + * // The `BatchEnableServices` method currently only supports projects. + * parent: '[^/]+/[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "serviceIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.batchEnable * @memberOf! () * @@ -1991,6 +2236,60 @@ export namespace serviceusage_v1 { /** * serviceusage.services.batchGet * @desc Returns the service configurations and enabled states for a given list of services. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 serviceusage.services.batchGet({ + * // Names of the services to retrieve. + * // + * // An example name would be: + * // `projects/123/services/serviceusage.googleapis.com` where `123` is the + * // project number. + * // A single request can get a maximum of 20 services at a time. + * names: 'placeholder-value', + * // Parent to retrieve services from. + * // If this is set, the parent of all of the services specified in `names` must + * // match this field. An example name would be: `projects/123` where `123` is + * // the project number. The `BatchGetServices` method currently only supports + * // projects. + * parent: '[^/]+/[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "services": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.batchGet * @memberOf! () * @@ -2070,6 +2369,67 @@ export namespace serviceusage_v1 { /** * serviceusage.services.disable * @desc Disable a service so that it can no longer be used with a project. This prevents unintended usage that may cause unexpected billing charges or security leaks. It is not valid to call the disable method on a service that is not currently enabled. Callers will receive a `FAILED_PRECONDITION` status if the target service is not currently enabled. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 serviceusage.services.disable({ + * // Name of the consumer and service to disable the service on. + * // + * // The enable and disable methods currently only support projects. + * // + * // An example name would be: + * // `projects/123/services/serviceusage.googleapis.com` where `123` is the + * // project number. + * name: '[^/]+/[^/]+/services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "disableDependentServices": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.disable * @memberOf! () * @@ -2144,6 +2504,69 @@ export namespace serviceusage_v1 { /** * serviceusage.services.enable * @desc Enable a service so that it can be used with a project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 serviceusage.services.enable({ + * // Name of the consumer and service to enable the service on. + * // + * // The `EnableService` and `DisableService` methods currently only support + * // projects. + * // + * // Enabling a service requires that the service is public or is shared with + * // the user enabling the service. + * // + * // An example name would be: + * // `projects/123/services/serviceusage.googleapis.com` where `123` is the + * // project number. + * name: '[^/]+/[^/]+/services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.enable * @memberOf! () * @@ -2215,6 +2638,56 @@ export namespace serviceusage_v1 { /** * serviceusage.services.get * @desc Returns the service configuration and enabled state for a given service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 serviceusage.services.get({ + * // Name of the consumer and service to get the `ConsumerState` for. + * // + * // An example name would be: + * // `projects/123/services/serviceusage.googleapis.com` where `123` is the + * // project number. + * name: '[^/]+/[^/]+/services/my-service', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "config": {}, + * // "name": "my_name", + * // "parent": "my_parent", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.get * @memberOf! () * @@ -2294,6 +2767,63 @@ export namespace serviceusage_v1 { /** * serviceusage.services.list * @desc List all services available to the specified project, and the current state of those services with respect to the project. The list includes all public services, all services for which the calling user has the `servicemanagement.services.bind` permission, and all services that have already been enabled on the project. The list can be filtered to only include services in a specific state, for example to only include services enabled on the project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 serviceusage.services.list({ + * // Only list services that conform to the given filter. + * // The allowed filter strings are `state:ENABLED` and `state:DISABLED`. + * filter: 'placeholder-value', + * // Requested size of the next page of data. + * // Requested page size cannot exceed 200. + * // If not set, the default page size is 50. + * pageSize: 'placeholder-value', + * // Token identifying which result to start with, which is returned by a + * // previous list call. + * pageToken: 'placeholder-value', + * // Parent to search for services on. + * // + * // An example name would be: + * // `projects/123` where `123` is the project number. + * parent: '[^/]+/[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "services": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.list * @memberOf! () * diff --git a/src/apis/serviceusage/v1beta1.ts b/src/apis/serviceusage/v1beta1.ts index 21375f54e80..e7c7478d378 100644 --- a/src/apis/serviceusage/v1beta1.ts +++ b/src/apis/serviceusage/v1beta1.ts @@ -1719,6 +1719,53 @@ export namespace serviceusage_v1beta1 { /** * serviceusage.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 serviceusage.operations.get({ + * // The name of the operation resource. + * name: 'operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.operations.get * @memberOf! () * @@ -1789,6 +1836,56 @@ export namespace serviceusage_v1beta1 { /** * serviceusage.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 serviceusage.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'placeholder-value', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.operations.list * @memberOf! () * @@ -1913,6 +2010,67 @@ export namespace serviceusage_v1beta1 { /** * serviceusage.services.batchEnable * @desc Enable multiple services on a project. The operation is atomic: if enabling any service fails, then the entire batch fails, and no state changes occur. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 serviceusage.services.batchEnable({ + * // Parent to enable services on. + * // + * // An example name would be: + * // `projects/123` + * // where `123` is the project number (not project ID). + * // + * // The `BatchEnableServices` method currently only supports projects. + * parent: '[^/]+/[^/]+', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "serviceIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.batchEnable * @memberOf! () * @@ -1988,6 +2146,65 @@ export namespace serviceusage_v1beta1 { /** * serviceusage.services.disable * @desc Disable a service so that it can no longer be used with a project. This prevents unintended usage that may cause unexpected billing charges or security leaks. It is not valid to call the disable method on a service that is not currently enabled. Callers will receive a `FAILED_PRECONDITION` status if the target service is not currently enabled. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 serviceusage.services.disable({ + * // Name of the consumer and service to disable the service on. + * // + * // The enable and disable methods currently only support projects. + * // + * // An example name would be: + * // `projects/123/services/serviceusage.googleapis.com` + * // where `123` is the project number (not project ID). + * name: '[^/]+/[^/]+/services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.disable * @memberOf! () * @@ -2062,6 +2279,69 @@ export namespace serviceusage_v1beta1 { /** * serviceusage.services.enable * @desc Enable a service so that it can be used with a project. Operation + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 serviceusage.services.enable({ + * // Name of the consumer and service to enable the service on. + * // + * // The `EnableService` and `DisableService` methods currently only support + * // projects. + * // + * // Enabling a service requires that the service is public or is shared with + * // the user enabling the service. + * // + * // An example name would be: + * // `projects/123/services/serviceusage.googleapis.com` + * // where `123` is the project number (not project ID). + * name: '[^/]+/[^/]+/services/my-service', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.enable * @memberOf! () * @@ -2136,6 +2416,56 @@ export namespace serviceusage_v1beta1 { /** * serviceusage.services.get * @desc Returns the service configuration and enabled state for a given service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 serviceusage.services.get({ + * // Name of the consumer and service to get the `ConsumerState` for. + * // + * // An example name would be: + * // `projects/123/services/serviceusage.googleapis.com` + * // where `123` is the project number (not project ID). + * name: '[^/]+/[^/]+/services/my-service', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "config": {}, + * // "name": "my_name", + * // "parent": "my_parent", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.get * @memberOf! () * @@ -2204,6 +2534,64 @@ export namespace serviceusage_v1beta1 { /** * serviceusage.services.list * @desc List all services available to the specified project, and the current state of those services with respect to the project. The list includes all public services, all services for which the calling user has the `servicemanagement.services.bind` permission, and all services that have already been enabled on the project. The list can be filtered to only include services in a specific state, for example to only include services enabled on the project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 serviceusage.services.list({ + * // Only list services that conform to the given filter. + * // The allowed filter strings are `state:ENABLED` and `state:DISABLED`. + * filter: 'placeholder-value', + * // Requested size of the next page of data. + * // Requested page size cannot exceed 200. + * // If not set, the default page size is 50. + * pageSize: 'placeholder-value', + * // Token identifying which result to start with, which is returned by a + * // previous list call. + * pageToken: 'placeholder-value', + * // Parent to search for services on. + * // + * // An example name would be: + * // `projects/123` + * // where `123` is the project number (not project ID). + * parent: '[^/]+/[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "services": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.list * @memberOf! () * @@ -2377,6 +2765,58 @@ export namespace serviceusage_v1beta1 { /** * serviceusage.services.consumerQuotaMetrics.get * @desc Retrieves a summary of quota information for a specific quota metric + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 serviceusage.services.consumerQuotaMetrics.get({ + * // The resource name of the quota limit. + * // + * // An example name would be: + * // projects/123/services/serviceusage.googleapis.com/quotas/metrics/serviceusage.googleapis.com%2Fmutate_requests + * name: + * '[^/]+/[^/]+/services/my-service/consumerQuotaMetrics/my-consumerQuotaMetric', + * // Specifies the level of detail for quota information in the response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "consumerQuotaLimits": [], + * // "displayName": "my_displayName", + * // "metric": "my_metric", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.consumerQuotaMetrics.get * @memberOf! () * @@ -2449,6 +2889,62 @@ export namespace serviceusage_v1beta1 { /** * serviceusage.services.consumerQuotaMetrics.list * @desc Retrieves a summary of all quota information visible to the service consumer, organized by service metric. Each metric includes information about all of its defined limits. Each limit includes the limit configuration (quota unit, preciseness, default value), the current effective limit value, and all of the overrides applied to the limit. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 serviceusage.services.consumerQuotaMetrics.list({ + * // Requested size of the next page of data. + * pageSize: 'placeholder-value', + * // Token identifying which result to start with; returned by a previous list + * // call. + * pageToken: 'placeholder-value', + * // Parent of the quotas resource. + * // + * // Some example names would be: + * // projects/123/services/serviceconsumermanagement.googleapis.com + * // folders/345/services/serviceconsumermanagement.googleapis.com + * // organizations/456/services/serviceconsumermanagement.googleapis.com + * parent: '[^/]+/[^/]+/services/my-service', + * // Specifies the level of detail for quota information in the response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "metrics": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.consumerQuotaMetrics.list * @memberOf! () * @@ -2591,6 +3087,60 @@ export namespace serviceusage_v1beta1 { /** * serviceusage.services.consumerQuotaMetrics.limits.get * @desc Retrieves a summary of quota information for a specific quota limit. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 serviceusage.services.consumerQuotaMetrics.limits.get({ + * // The resource name of the quota limit. + * // + * // Use the quota limit resource name returned by previous + * // ListConsumerQuotaMetrics and GetConsumerQuotaMetric API calls. + * name: + * '[^/]+/[^/]+/services/my-service/consumerQuotaMetrics/my-consumerQuotaMetric/limits/my-limit', + * // Specifies the level of detail for quota information in the response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "allowsAdminOverrides": false, + * // "isPrecise": false, + * // "metric": "my_metric", + * // "name": "my_name", + * // "quotaBuckets": [], + * // "unit": "my_unit" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.consumerQuotaMetrics.limits.get * @memberOf! () * @@ -2687,6 +3237,78 @@ export namespace serviceusage_v1beta1 { /** * serviceusage.services.consumerQuotaMetrics.limits.adminOverrides.create * @desc Creates an admin override. An admin override is applied by an administrator of a parent folder or parent organization of the consumer receiving the override. An admin override is intended to limit the amount of quota the consumer can use out of the total quota pool allocated to all children of the folder or organization. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 serviceusage.services.consumerQuotaMetrics.limits.adminOverrides.create( + * { + * // Whether to force the creation of the quota override. + * // If creating an override would cause the effective quota for the consumer to + * // decrease by more than 10 percent, the call is rejected, as a safety measure + * // to avoid accidentally decreasing quota too quickly. Setting the force + * // parameter to true ignores this restriction. + * force: 'placeholder-value', + * // The resource name of the parent quota limit, returned by a + * // ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. + * // + * // An example name would be: + * // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion` + * parent: + * '[^/]+/[^/]+/services/my-service/consumerQuotaMetrics/my-consumerQuotaMetric/limits/my-limit', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dimensions": {}, + * // "metric": "my_metric", + * // "name": "my_name", + * // "overrideValue": "my_overrideValue", + * // "unit": "my_unit" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.consumerQuotaMetrics.limits.adminOverrides.create * @memberOf! () * @@ -2763,6 +3385,65 @@ export namespace serviceusage_v1beta1 { /** * serviceusage.services.consumerQuotaMetrics.limits.adminOverrides.delete * @desc Deletes an admin override. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 serviceusage.services.consumerQuotaMetrics.limits.adminOverrides.delete( + * { + * // Whether to force the deletion of the quota override. + * // If deleting an override would cause the effective quota for the consumer to + * // decrease by more than 10 percent, the call is rejected, as a safety measure + * // to avoid accidentally decreasing quota too quickly. Setting the force + * // parameter to true ignores this restriction. + * force: 'placeholder-value', + * // The resource name of the override to delete. + * // + * // An example name would be: + * // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/adminOverrides/4a3f2c1d` + * name: + * '[^/]+/[^/]+/services/my-service/consumerQuotaMetrics/my-consumerQuotaMetric/limits/my-limit/adminOverrides/my-adminOverride', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.consumerQuotaMetrics.limits.adminOverrides.delete * @memberOf! () * @@ -2835,6 +3516,62 @@ export namespace serviceusage_v1beta1 { /** * serviceusage.services.consumerQuotaMetrics.limits.adminOverrides.list * @desc Lists all admin overrides on this limit. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 serviceusage.services.consumerQuotaMetrics.limits.adminOverrides.list( + * { + * // Requested size of the next page of data. + * pageSize: 'placeholder-value', + * // Token identifying which result to start with; returned by a previous list + * // call. + * pageToken: 'placeholder-value', + * // The resource name of the parent quota limit, returned by a + * // ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. + * // + * // An example name would be: + * // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion` + * parent: + * '[^/]+/[^/]+/services/my-service/consumerQuotaMetrics/my-consumerQuotaMetric/limits/my-limit', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "overrides": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.consumerQuotaMetrics.limits.adminOverrides.list * @memberOf! () * @@ -2918,6 +3655,80 @@ export namespace serviceusage_v1beta1 { /** * serviceusage.services.consumerQuotaMetrics.limits.adminOverrides.patch * @desc Updates an admin override. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 serviceusage.services.consumerQuotaMetrics.limits.adminOverrides.patch( + * { + * // Whether to force the update of the quota override. + * // If updating an override would cause the effective quota for the consumer to + * // decrease by more than 10 percent, the call is rejected, as a safety measure + * // to avoid accidentally decreasing quota too quickly. Setting the force + * // parameter to true ignores this restriction. + * force: 'placeholder-value', + * // The resource name of the override to update. + * // + * // An example name would be: + * // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/adminOverrides/4a3f2c1d` + * name: + * '[^/]+/[^/]+/services/my-service/consumerQuotaMetrics/my-consumerQuotaMetric/limits/my-limit/adminOverrides/my-adminOverride', + * // Update only the specified fields of the override. + * // If unset, all fields will be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dimensions": {}, + * // "metric": "my_metric", + * // "name": "my_name", + * // "overrideValue": "my_overrideValue", + * // "unit": "my_unit" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.consumerQuotaMetrics.limits.adminOverrides.patch * @memberOf! () * @@ -3082,6 +3893,78 @@ export namespace serviceusage_v1beta1 { /** * serviceusage.services.consumerQuotaMetrics.limits.consumerOverrides.create * @desc Creates a consumer override. A consumer override is applied to the consumer on its own authority to limit its own quota usage. Consumer overrides cannot be used to grant more quota than would be allowed by admin overrides, producer overrides, or the default limit of the service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 serviceusage.services.consumerQuotaMetrics.limits.consumerOverrides.create( + * { + * // Whether to force the creation of the quota override. + * // If creating an override would cause the effective quota for the consumer to + * // decrease by more than 10 percent, the call is rejected, as a safety measure + * // to avoid accidentally decreasing quota too quickly. Setting the force + * // parameter to true ignores this restriction. + * force: 'placeholder-value', + * // The resource name of the parent quota limit, returned by a + * // ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. + * // + * // An example name would be: + * // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion` + * parent: + * '[^/]+/[^/]+/services/my-service/consumerQuotaMetrics/my-consumerQuotaMetric/limits/my-limit', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dimensions": {}, + * // "metric": "my_metric", + * // "name": "my_name", + * // "overrideValue": "my_overrideValue", + * // "unit": "my_unit" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.consumerQuotaMetrics.limits.consumerOverrides.create * @memberOf! () * @@ -3158,6 +4041,65 @@ export namespace serviceusage_v1beta1 { /** * serviceusage.services.consumerQuotaMetrics.limits.consumerOverrides.delete * @desc Deletes a consumer override. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 serviceusage.services.consumerQuotaMetrics.limits.consumerOverrides.delete( + * { + * // Whether to force the deletion of the quota override. + * // If deleting an override would cause the effective quota for the consumer to + * // decrease by more than 10 percent, the call is rejected, as a safety measure + * // to avoid accidentally decreasing quota too quickly. Setting the force + * // parameter to true ignores this restriction. + * force: 'placeholder-value', + * // The resource name of the override to delete. + * // + * // An example name would be: + * // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/consumerOverrides/4a3f2c1d` + * name: + * '[^/]+/[^/]+/services/my-service/consumerQuotaMetrics/my-consumerQuotaMetric/limits/my-limit/consumerOverrides/my-consumerOverride', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.consumerQuotaMetrics.limits.consumerOverrides.delete * @memberOf! () * @@ -3230,6 +4172,62 @@ export namespace serviceusage_v1beta1 { /** * serviceusage.services.consumerQuotaMetrics.limits.consumerOverrides.list * @desc Lists all consumer overrides on this limit. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 serviceusage.services.consumerQuotaMetrics.limits.consumerOverrides.list( + * { + * // Requested size of the next page of data. + * pageSize: 'placeholder-value', + * // Token identifying which result to start with; returned by a previous list + * // call. + * pageToken: 'placeholder-value', + * // The resource name of the parent quota limit, returned by a + * // ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. + * // + * // An example name would be: + * // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion` + * parent: + * '[^/]+/[^/]+/services/my-service/consumerQuotaMetrics/my-consumerQuotaMetric/limits/my-limit', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "overrides": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.consumerQuotaMetrics.limits.consumerOverrides.list * @memberOf! () * @@ -3315,6 +4313,80 @@ export namespace serviceusage_v1beta1 { /** * serviceusage.services.consumerQuotaMetrics.limits.consumerOverrides.patch * @desc Updates a consumer override. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/serviceusage.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 serviceusage = google.serviceusage('v1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/service.management', + * ], + * }); + * + * // 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 serviceusage.services.consumerQuotaMetrics.limits.consumerOverrides.patch( + * { + * // Whether to force the update of the quota override. + * // If updating an override would cause the effective quota for the consumer to + * // decrease by more than 10 percent, the call is rejected, as a safety measure + * // to avoid accidentally decreasing quota too quickly. Setting the force + * // parameter to true ignores this restriction. + * force: 'placeholder-value', + * // The resource name of the override to update. + * // + * // An example name would be: + * // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/consumerOverrides/4a3f2c1d` + * name: + * '[^/]+/[^/]+/services/my-service/consumerQuotaMetrics/my-consumerQuotaMetric/limits/my-limit/consumerOverrides/my-consumerOverride', + * // Update only the specified fields of the override. + * // If unset, all fields will be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dimensions": {}, + * // "metric": "my_metric", + * // "name": "my_name", + * // "overrideValue": "my_overrideValue", + * // "unit": "my_unit" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias serviceusage.services.consumerQuotaMetrics.limits.consumerOverrides.patch * @memberOf! () * diff --git a/src/apis/sheets/v4.ts b/src/apis/sheets/v4.ts index 3a024818522..8608690bc3a 100644 --- a/src/apis/sheets/v4.ts +++ b/src/apis/sheets/v4.ts @@ -4130,61 +4130,62 @@ export namespace sheets_v4 { * sheets.spreadsheets.batchUpdate * @desc Applies one or more updates to the spreadsheet. Each request is validated before being applied. If any request is not valid then the entire request will fail and nothing will be applied. Some requests have replies to give you some information about how they are applied. The replies will mirror the requests. For example, if you applied 4 updates and the 3rd one had a reply, then the response will have 2 empty replies, the actual reply, and another empty reply, in that order. Due to the collaborative nature of spreadsheets, it is not guaranteed that the spreadsheet will reflect exactly your changes after this completes, however it is guaranteed that the updates in the request will be applied together atomically. Your changes may be altered with respect to collaborator changes. If there are no collaborators, the spreadsheet should reflect your changes. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sheets.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'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The spreadsheet to apply the updates to. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. + * const sheets = google.sheets('v4'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/spreadsheets', + * ], + * }); * - * resource: { - * // A list of updates to apply to the spreadsheet. - * // Requests will be applied in the order they are specified. - * // If any request is not valid, no requests will be applied. - * requests: [], // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await sheets.spreadsheets.batchUpdate({ + * // The spreadsheet to apply the updates to. + * spreadsheetId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "includeSpreadsheetInResponse": false, + * // "requests": [], + * // "responseIncludeGridData": false, + * // "responseRanges": [] + * // } * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.batchUpdate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "replies": [], + * // "spreadsheetId": "my_spreadsheetId", + * // "updatedSpreadsheet": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. See - * // https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } * @alias sheets.spreadsheets.batchUpdate * @memberOf! () * @@ -4269,53 +4270,64 @@ export namespace sheets_v4 { * sheets.spreadsheets.create * @desc Creates a spreadsheet, returning the newly created spreadsheet. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sheets.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'); - * var sheets = google.sheets('v4'); + * const sheets = google.sheets('v4'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/spreadsheets', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 sheets.spreadsheets.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "developerMetadata": [], + * // "namedRanges": [], + * // "properties": {}, + * // "sheets": [], + * // "spreadsheetId": "my_spreadsheetId", + * // "spreadsheetUrl": "my_spreadsheetUrl" + * // } * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "developerMetadata": [], + * // "namedRanges": [], + * // "properties": {}, + * // "sheets": [], + * // "spreadsheetId": "my_spreadsheetId", + * // "spreadsheetUrl": "my_spreadsheetUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. See - * // https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } * @alias sheets.spreadsheets.create * @memberOf! () * @@ -4388,61 +4400,61 @@ export namespace sheets_v4 { * sheets.spreadsheets.get * @desc Returns the spreadsheet at the given ID. The caller must specify the spreadsheet ID. By default, data within grids will not be returned. You can include grid data one of two ways: * Specify a field mask listing your desired fields using the `fields` URL parameter in HTTP * Set the includeGridData URL parameter to true. If a field mask is set, the `includeGridData` parameter is ignored For large spreadsheets, it is recommended to retrieve only the specific fields of the spreadsheet that you want. To retrieve only subsets of the spreadsheet, use the ranges URL parameter. Multiple ranges can be specified. Limiting the range will return only the portions of the spreadsheet that intersect the requested ranges. Ranges are specified using A1 notation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sheets.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'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The spreadsheet to request. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. + * const sheets = google.sheets('v4'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.readonly', + * 'https://www.googleapis.com/auth/spreadsheets', + * 'https://www.googleapis.com/auth/spreadsheets.readonly', + * ], + * }); * - * // The ranges to retrieve from the spreadsheet. - * ranges: [], // TODO: Update placeholder value. + * // 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 sheets.spreadsheets.get({ * // True if grid data should be returned. * // This parameter is ignored if a field mask was set in the request. - * includeGridData: false, // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * includeGridData: 'placeholder-value', + * // The ranges to retrieve from the spreadsheet. + * ranges: 'placeholder-value', + * // The spreadsheet to request. + * spreadsheetId: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "developerMetadata": [], + * // "namedRanges": [], + * // "properties": {}, + * // "sheets": [], + * // "spreadsheetId": "my_spreadsheetId", + * // "spreadsheetUrl": "my_spreadsheetUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. See - * // https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/drive.readonly' - * // 'https://www.googleapis.com/auth/spreadsheets' - * // 'https://www.googleapis.com/auth/spreadsheets.readonly' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } * @alias sheets.spreadsheets.get * @memberOf! () * @@ -4519,64 +4531,63 @@ export namespace sheets_v4 { * sheets.spreadsheets.getByDataFilter * @desc Returns the spreadsheet at the given ID. The caller must specify the spreadsheet ID. This method differs from GetSpreadsheet in that it allows selecting which subsets of spreadsheet data to return by specifying a dataFilters parameter. Multiple DataFilters can be specified. Specifying one or more data filters will return the portions of the spreadsheet that intersect ranges matched by any of the filters. By default, data within grids will not be returned. You can include grid data one of two ways: * Specify a field mask listing your desired fields using the `fields` URL parameter in HTTP * Set the includeGridData parameter to true. If a field mask is set, the `includeGridData` parameter is ignored For large spreadsheets, it is recommended to retrieve only the specific fields of the spreadsheet that you want. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sheets.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'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The spreadsheet to request. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * resource: { - * // The DataFilters used to select which ranges to retrieve from - * // the spreadsheet. - * dataFilters: [], // TODO: Update placeholder value. + * const sheets = google.sheets('v4'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/spreadsheets', + * ], + * }); * - * // True if grid data should be returned. - * // This parameter is ignored if a field mask was set in the request. - * includeGridData: false, // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await sheets.spreadsheets.getByDataFilter({ + * // The spreadsheet to request. + * spreadsheetId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dataFilters": [], + * // "includeGridData": false + * // } * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.getByDataFilter(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "developerMetadata": [], + * // "namedRanges": [], + * // "properties": {}, + * // "sheets": [], + * // "spreadsheetId": "my_spreadsheetId", + * // "spreadsheetUrl": "my_spreadsheetUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. See - * // https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } * @alias sheets.spreadsheets.getByDataFilter * @memberOf! () * @@ -4725,55 +4736,55 @@ export namespace sheets_v4 { * sheets.spreadsheets.developerMetadata.get * @desc Returns the developer metadata with the specified ID. The caller must specify the spreadsheet ID and the developer metadata's unique metadataId. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sheets.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'); - * var sheets = google.sheets('v4'); + * const sheets = google.sheets('v4'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/spreadsheets', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to retrieve metadata from. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. + * // 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 sheets.spreadsheets.developerMetadata.get({ * // The ID of the developer metadata to retrieve. - * metadataId: 0, // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.developerMetadata.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * metadataId: 'placeholder-value', + * // The ID of the spreadsheet to retrieve metadata from. + * spreadsheetId: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "location": {}, + * // "metadataId": 0, + * // "metadataKey": "my_metadataKey", + * // "metadataValue": "my_metadataValue", + * // "visibility": "my_visibility" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. See - * // https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } * @alias sheets.spreadsheets.developerMetadata.get * @memberOf! () * @@ -4850,56 +4861,57 @@ export namespace sheets_v4 { * sheets.spreadsheets.developerMetadata.search * @desc Returns all developer metadata matching the specified DataFilter. If the provided DataFilter represents a DeveloperMetadataLookup object, this will return all DeveloperMetadata entries selected by it. If the DataFilter represents a location in a spreadsheet, this will return all developer metadata associated with locations intersecting that region. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sheets.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'); - * var sheets = google.sheets('v4'); + * const sheets = google.sheets('v4'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/spreadsheets', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to retrieve metadata from. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await sheets.spreadsheets.developerMetadata.search({ + * // The ID of the spreadsheet to retrieve metadata from. + * spreadsheetId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dataFilters": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * sheets.spreadsheets.developerMetadata.search(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "matchedDeveloperMetadata": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. See - * // https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } * @alias sheets.spreadsheets.developerMetadata.search * @memberOf! () * @@ -5026,62 +5038,67 @@ export namespace sheets_v4 { * sheets.spreadsheets.sheets.copyTo * @desc Copies a single sheet from a spreadsheet to another spreadsheet. Returns the properties of the newly created sheet. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sheets.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'); - * var sheets = google.sheets('v4'); + * const sheets = google.sheets('v4'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/spreadsheets', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet containing the sheet to copy. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. + * // 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 sheets.spreadsheets.sheets.copyTo({ * // The ID of the sheet to copy. - * sheetId: 0, // TODO: Update placeholder value. - * - * resource: { - * // The ID of the spreadsheet to copy the sheet to. - * destinationSpreadsheetId: '', // TODO: Update placeholder value. - * - * // TODO: Add desired properties to the request body. + * sheetId: 'placeholder-value', + * // The ID of the spreadsheet containing the sheet to copy. + * spreadsheetId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destinationSpreadsheetId": "my_destinationSpreadsheetId" + * // } * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.sheets.copyTo(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "gridProperties": {}, + * // "hidden": false, + * // "index": 0, + * // "rightToLeft": false, + * // "sheetId": 0, + * // "sheetType": "my_sheetType", + * // "tabColor": {}, + * // "tabColorStyle": {}, + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. See - * // https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } * @alias sheets.spreadsheets.sheets.copyTo * @memberOf! () * @@ -5188,66 +5205,80 @@ export namespace sheets_v4 { * sheets.spreadsheets.values.append * @desc Appends values to a spreadsheet. The input range is used to search for existing data and find a "table" within that range. Values will be appended to the next row of the table, starting with the first column of the table. See the [guide](/sheets/api/guides/values#appending_values) and [sample code](/sheets/api/samples/writing#append_values) for specific details of how tables are detected and data is appended. The caller must specify the spreadsheet ID, range, and a valueInputOption. The `valueInputOption` only controls how the input data will be added to the sheet (column-wise or row-wise), it does not influence what cell the data starts being written to. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sheets.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'); - * var sheets = google.sheets('v4'); + * const sheets = google.sheets('v4'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/spreadsheets', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to update. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. + * // 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 sheets.spreadsheets.values.append({ + * // Determines if the update response should include the values + * // of the cells that were appended. By default, responses + * // do not include the updated values. + * includeValuesInResponse: 'placeholder-value', + * // How the input data should be inserted. + * insertDataOption: 'placeholder-value', * // The A1 notation of a range to search for a logical table of data. - * // Values will be appended after the last row of the table. - * range: 'my-range', // TODO: Update placeholder value. - * + * // Values are appended after the last row of the table. + * range: 'placeholder-value', + * // Determines how dates, times, and durations in the response should be + * // rendered. This is ignored if response_value_render_option is + * // FORMATTED_VALUE. + * // The default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER]. + * responseDateTimeRenderOption: 'placeholder-value', + * // Determines how values in the response should be rendered. + * // The default render option is ValueRenderOption.FORMATTED_VALUE. + * responseValueRenderOption: 'placeholder-value', + * // The ID of the spreadsheet to update. + * spreadsheetId: 'placeholder-value', * // How the input data should be interpreted. - * valueInputOption: '', // TODO: Update placeholder value. - * - * // How the input data should be inserted. - * insertDataOption: '', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * valueInputOption: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "majorDimension": "my_majorDimension", + * // "range": "my_range", + * // "values": [] + * // } * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.values.append(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "spreadsheetId": "my_spreadsheetId", + * // "tableRange": "my_tableRange", + * // "updates": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. See - * // https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } * @alias sheets.spreadsheets.values.append * @memberOf! () * @@ -5331,59 +5362,58 @@ export namespace sheets_v4 { * sheets.spreadsheets.values.batchClear * @desc Clears one or more ranges of values from a spreadsheet. The caller must specify the spreadsheet ID and one or more ranges. Only values are cleared -- all other properties of the cell (such as formatting, data validation, etc..) are kept. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sheets.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'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to update. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. + * const sheets = google.sheets('v4'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/spreadsheets', + * ], + * }); * - * resource: { - * // The ranges to clear, in A1 notation. - * ranges: [], // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await sheets.spreadsheets.values.batchClear({ + * // The ID of the spreadsheet to update. + * spreadsheetId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ranges": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * sheets.spreadsheets.values.batchClear(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "clearedRanges": [], + * // "spreadsheetId": "my_spreadsheetId" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. See - * // https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } * @alias sheets.spreadsheets.values.batchClear * @memberOf! () * @@ -5463,59 +5493,58 @@ export namespace sheets_v4 { * sheets.spreadsheets.values.batchClearByDataFilter * @desc Clears one or more ranges of values from a spreadsheet. The caller must specify the spreadsheet ID and one or more DataFilters. Ranges matching any of the specified data filters will be cleared. Only values are cleared -- all other properties of the cell (such as formatting, data validation, etc..) are kept. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sheets.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'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to update. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. + * const sheets = google.sheets('v4'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/spreadsheets', + * ], + * }); * - * resource: { - * // The DataFilters used to determine which ranges to clear. - * dataFilters: [], // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await sheets.spreadsheets.values.batchClearByDataFilter({ + * // The ID of the spreadsheet to update. + * spreadsheetId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dataFilters": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * sheets.spreadsheets.values.batchClearByDataFilter(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "clearedRanges": [], + * // "spreadsheetId": "my_spreadsheetId" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. See - * // https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } * @alias sheets.spreadsheets.values.batchClearByDataFilter * @memberOf! () * @@ -5609,67 +5638,69 @@ export namespace sheets_v4 { * sheets.spreadsheets.values.batchGet * @desc Returns one or more ranges of values from a spreadsheet. The caller must specify the spreadsheet ID and one or more ranges. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sheets.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'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to retrieve data from. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * // The A1 notation of the values to retrieve. - * ranges: [], // TODO: Update placeholder value. + * const sheets = google.sheets('v4'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.readonly', + * 'https://www.googleapis.com/auth/spreadsheets', + * 'https://www.googleapis.com/auth/spreadsheets.readonly', + * ], + * }); * - * // How values should be represented in the output. - * // The default render option is ValueRenderOption.FORMATTED_VALUE. - * valueRenderOption: '', // TODO: Update placeholder value. + * // 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 sheets.spreadsheets.values.batchGet({ * // How dates, times, and durations should be represented in the output. * // This is ignored if value_render_option is * // FORMATTED_VALUE. * // The default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER]. - * dateTimeRenderOption: '', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * dateTimeRenderOption: 'placeholder-value', + * // The major dimension that results should use. + * // + * // For example, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, + * // then requesting `range=A1:B2,majorDimension=ROWS` returns `[[1,2],[3,4]]`, + * // whereas requesting `range=A1:B2,majorDimension=COLUMNS` returns + * // `[[1,3],[2,4]]`. + * majorDimension: 'placeholder-value', + * // The A1 notation of the values to retrieve. + * ranges: 'placeholder-value', + * // The ID of the spreadsheet to retrieve data from. + * spreadsheetId: 'placeholder-value', + * // How values should be represented in the output. + * // The default render option is ValueRenderOption.FORMATTED_VALUE. + * valueRenderOption: 'placeholder-value', + * }); + * console.log(res.data); * - * sheets.spreadsheets.values.batchGet(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "spreadsheetId": "my_spreadsheetId", + * // "valueRanges": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. See - * // https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/drive.readonly' - * // 'https://www.googleapis.com/auth/spreadsheets' - * // 'https://www.googleapis.com/auth/spreadsheets.readonly' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } * @alias sheets.spreadsheets.values.batchGet * @memberOf! () * @@ -5752,71 +5783,61 @@ export namespace sheets_v4 { * sheets.spreadsheets.values.batchGetByDataFilter * @desc Returns one or more ranges of values that match the specified data filters. The caller must specify the spreadsheet ID and one or more DataFilters. Ranges that match any of the data filters in the request will be returned. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sheets.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'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to retrieve data from. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * resource: { - * // How values should be represented in the output. - * // The default render option is ValueRenderOption.FORMATTED_VALUE. - * valueRenderOption: '', // TODO: Update placeholder value. - * - * // The data filters used to match the ranges of values to retrieve. Ranges - * // that match any of the specified data filters will be included in the - * // response. - * dataFilters: [], // TODO: Update placeholder value. + * const sheets = google.sheets('v4'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/spreadsheets', + * ], + * }); * - * // How dates, times, and durations should be represented in the output. - * // This is ignored if value_render_option is - * // FORMATTED_VALUE. - * // The default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER]. - * dateTimeRenderOption: '', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await sheets.spreadsheets.values.batchGetByDataFilter({ + * // The ID of the spreadsheet to retrieve data from. + * spreadsheetId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "dataFilters": [], + * // "dateTimeRenderOption": "my_dateTimeRenderOption", + * // "majorDimension": "my_majorDimension", + * // "valueRenderOption": "my_valueRenderOption" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * sheets.spreadsheets.values.batchGetByDataFilter(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "spreadsheetId": "my_spreadsheetId", + * // "valueRanges": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. See - * // https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } * @alias sheets.spreadsheets.values.batchGetByDataFilter * @memberOf! () * @@ -5902,62 +5923,66 @@ export namespace sheets_v4 { * sheets.spreadsheets.values.batchUpdate * @desc Sets values in one or more ranges of a spreadsheet. The caller must specify the spreadsheet ID, a valueInputOption, and one or more ValueRanges. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sheets.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'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to update. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * resource: { - * // How the input data should be interpreted. - * valueInputOption: '', // TODO: Update placeholder value. + * const sheets = google.sheets('v4'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/spreadsheets', + * ], + * }); * - * // The new values to apply to the spreadsheet. - * data: [], // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await sheets.spreadsheets.values.batchUpdate({ + * // The ID of the spreadsheet to update. + * spreadsheetId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "data": [], + * // "includeValuesInResponse": false, + * // "responseDateTimeRenderOption": "my_responseDateTimeRenderOption", + * // "responseValueRenderOption": "my_responseValueRenderOption", + * // "valueInputOption": "my_valueInputOption" + * // } * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.values.batchUpdate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [], + * // "spreadsheetId": "my_spreadsheetId", + * // "totalUpdatedCells": 0, + * // "totalUpdatedColumns": 0, + * // "totalUpdatedRows": 0, + * // "totalUpdatedSheets": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. See - * // https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } * @alias sheets.spreadsheets.values.batchUpdate * @memberOf! () * @@ -6040,64 +6065,66 @@ export namespace sheets_v4 { * sheets.spreadsheets.values.batchUpdateByDataFilter * @desc Sets values in one or more ranges of a spreadsheet. The caller must specify the spreadsheet ID, a valueInputOption, and one or more DataFilterValueRanges. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sheets.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'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to update. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * resource: { - * // How the input data should be interpreted. - * valueInputOption: '', // TODO: Update placeholder value. + * const sheets = google.sheets('v4'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/spreadsheets', + * ], + * }); * - * // The new values to apply to the spreadsheet. If more than one range is - * // matched by the specified DataFilter the specified values will be - * // applied to all of those ranges. - * data: [], // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await sheets.spreadsheets.values.batchUpdateByDataFilter({ + * // The ID of the spreadsheet to update. + * spreadsheetId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "data": [], + * // "includeValuesInResponse": false, + * // "responseDateTimeRenderOption": "my_responseDateTimeRenderOption", + * // "responseValueRenderOption": "my_responseValueRenderOption", + * // "valueInputOption": "my_valueInputOption" + * // } * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.values.batchUpdateByDataFilter(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [], + * // "spreadsheetId": "my_spreadsheetId", + * // "totalUpdatedCells": 0, + * // "totalUpdatedColumns": 0, + * // "totalUpdatedRows": 0, + * // "totalUpdatedSheets": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. See - * // https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } * @alias sheets.spreadsheets.values.batchUpdateByDataFilter * @memberOf! () * @@ -6191,59 +6218,58 @@ export namespace sheets_v4 { * sheets.spreadsheets.values.clear * @desc Clears values from a spreadsheet. The caller must specify the spreadsheet ID and range. Only values are cleared -- all other properties of the cell (such as formatting, data validation, etc..) are kept. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sheets.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'); - * var sheets = google.sheets('v4'); + * const sheets = google.sheets('v4'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/spreadsheets', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to update. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. + * // 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 sheets.spreadsheets.values.clear({ * // The A1 notation of the values to clear. - * range: 'my-range', // TODO: Update placeholder value. + * range: 'placeholder-value', + * // The ID of the spreadsheet to update. + * spreadsheetId: 'placeholder-value', * - * resource: { - * // TODO: Add desired properties to the request body. + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * sheets.spreadsheets.values.clear(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "clearedRange": "my_clearedRange", + * // "spreadsheetId": "my_spreadsheetId" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. See - * // https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } * @alias sheets.spreadsheets.values.clear * @memberOf! () * @@ -6320,67 +6346,70 @@ export namespace sheets_v4 { * sheets.spreadsheets.values.get * @desc Returns a range of values from a spreadsheet. The caller must specify the spreadsheet ID and a range. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sheets.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'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to retrieve data from. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * // The A1 notation of the values to retrieve. - * range: 'my-range', // TODO: Update placeholder value. + * const sheets = google.sheets('v4'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.readonly', + * 'https://www.googleapis.com/auth/spreadsheets', + * 'https://www.googleapis.com/auth/spreadsheets.readonly', + * ], + * }); * - * // How values should be represented in the output. - * // The default render option is ValueRenderOption.FORMATTED_VALUE. - * valueRenderOption: '', // TODO: Update placeholder value. + * // 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 sheets.spreadsheets.values.get({ * // How dates, times, and durations should be represented in the output. * // This is ignored if value_render_option is * // FORMATTED_VALUE. * // The default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER]. - * dateTimeRenderOption: '', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.values.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * dateTimeRenderOption: 'placeholder-value', + * // The major dimension that results should use. + * // + * // For example, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, then + * // requesting `range=A1:B2,majorDimension=ROWS` returns `[[1,2],[3,4]]`, + * // whereas requesting `range=A1:B2,majorDimension=COLUMNS` returns + * // `[[1,3],[2,4]]`. + * majorDimension: 'placeholder-value', + * // The A1 notation of the values to retrieve. + * range: 'placeholder-value', + * // The ID of the spreadsheet to retrieve data from. + * spreadsheetId: 'placeholder-value', + * // How values should be represented in the output. + * // The default render option is ValueRenderOption.FORMATTED_VALUE. + * valueRenderOption: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "majorDimension": "my_majorDimension", + * // "range": "my_range", + * // "values": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. See - * // https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/drive.readonly' - * // 'https://www.googleapis.com/auth/spreadsheets' - * // 'https://www.googleapis.com/auth/spreadsheets.readonly' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } * @alias sheets.spreadsheets.values.get * @memberOf! () * @@ -6459,63 +6488,84 @@ export namespace sheets_v4 { * sheets.spreadsheets.values.update * @desc Sets values in a range of a spreadsheet. The caller must specify the spreadsheet ID, range, and a valueInputOption. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sheets.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'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to update. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. + * const sheets = google.sheets('v4'); + * + * 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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/spreadsheets', + * ], + * }); * + * // 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 sheets.spreadsheets.values.update({ + * // Determines if the update response should include the values + * // of the cells that were updated. By default, responses + * // do not include the updated values. + * // If the range to write was larger than the range actually written, the + * // response includes all values in the requested range (excluding trailing + * // empty rows and columns). + * includeValuesInResponse: 'placeholder-value', * // The A1 notation of the values to update. - * range: 'my-range', // TODO: Update placeholder value. - * + * range: 'placeholder-value', + * // Determines how dates, times, and durations in the response should be + * // rendered. This is ignored if response_value_render_option is + * // FORMATTED_VALUE. + * // The default dateTime render option is + * // DateTimeRenderOption.SERIAL_NUMBER. + * responseDateTimeRenderOption: 'placeholder-value', + * // Determines how values in the response should be rendered. + * // The default render option is ValueRenderOption.FORMATTED_VALUE. + * responseValueRenderOption: 'placeholder-value', + * // The ID of the spreadsheet to update. + * spreadsheetId: 'placeholder-value', * // How the input data should be interpreted. - * valueInputOption: '', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * valueInputOption: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "majorDimension": "my_majorDimension", + * // "range": "my_range", + * // "values": [] + * // } * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.values.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "spreadsheetId": "my_spreadsheetId", + * // "updatedCells": 0, + * // "updatedColumns": 0, + * // "updatedData": {}, + * // "updatedRange": "my_updatedRange", + * // "updatedRows": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. See - * // https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } * @alias sheets.spreadsheets.values.update * @memberOf! () * diff --git a/src/apis/siteVerification/v1.ts b/src/apis/siteVerification/v1.ts index f32a1a26f5a..4a5277f328f 100644 --- a/src/apis/siteVerification/v1.ts +++ b/src/apis/siteVerification/v1.ts @@ -147,6 +147,41 @@ export namespace siteVerification_v1 { /** * siteVerification.webResource.delete * @desc Relinquish ownership of a website or domain. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/siteVerification.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 siteVerification = google.siteVerification('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/siteverification'], + * }); + * + * // 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 siteVerification.webResource.delete({ + * // The id of a verified site or domain. + * id: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias siteVerification.webResource.delete * @memberOf! () * @@ -219,6 +254,48 @@ export namespace siteVerification_v1 { /** * siteVerification.webResource.get * @desc Get the most current data for a website or domain. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/siteVerification.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 siteVerification = google.siteVerification('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/siteverification'], + * }); + * + * // 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 siteVerification.webResource.get({ + * // The id of a verified site or domain. + * id: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "owners": [], + * // "site": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias siteVerification.webResource.get * @memberOf! () * @@ -303,6 +380,56 @@ export namespace siteVerification_v1 { /** * siteVerification.webResource.getToken * @desc Get a verification token for placing on a website or domain. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/siteVerification.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 siteVerification = google.siteVerification('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/siteverification', + * 'https://www.googleapis.com/auth/siteverification.verify_only', + * ], + * }); + * + * // 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 siteVerification.webResource.getToken({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "site": {}, + * // "verificationMethod": "my_verificationMethod" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "method": "my_method", + * // "token": "my_token" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias siteVerification.webResource.getToken * @memberOf! () * @@ -402,6 +529,61 @@ export namespace siteVerification_v1 { /** * siteVerification.webResource.insert * @desc Attempt verification of a website or domain. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/siteVerification.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 siteVerification = google.siteVerification('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/siteverification', + * 'https://www.googleapis.com/auth/siteverification.verify_only', + * ], + * }); + * + * // 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 siteVerification.webResource.insert({ + * // The method to use for verifying a site or domain. + * verificationMethod: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "owners": [], + * // "site": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "owners": [], + * // "site": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias siteVerification.webResource.insert * @memberOf! () * @@ -488,6 +670,43 @@ export namespace siteVerification_v1 { /** * siteVerification.webResource.list * @desc Get the list of your verified websites and domains. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/siteVerification.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 siteVerification = google.siteVerification('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/siteverification'], + * }); + * + * // 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 siteVerification.webResource.list({}); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias siteVerification.webResource.list * @memberOf! () * @@ -577,6 +796,58 @@ export namespace siteVerification_v1 { /** * siteVerification.webResource.patch * @desc Modify the list of owners for your website or domain. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/siteVerification.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 siteVerification = google.siteVerification('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/siteverification'], + * }); + * + * // 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 siteVerification.webResource.patch({ + * // The id of a verified site or domain. + * id: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "owners": [], + * // "site": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "owners": [], + * // "site": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias siteVerification.webResource.patch * @memberOf! () * @@ -663,6 +934,58 @@ export namespace siteVerification_v1 { /** * siteVerification.webResource.update * @desc Modify the list of owners for your website or domain. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/siteVerification.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 siteVerification = google.siteVerification('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/siteverification'], + * }); + * + * // 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 siteVerification.webResource.update({ + * // The id of a verified site or domain. + * id: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "id": "my_id", + * // "owners": [], + * // "site": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "owners": [], + * // "site": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias siteVerification.webResource.update * @memberOf! () * diff --git a/src/apis/slides/v1.ts b/src/apis/slides/v1.ts index 7d7bea9a266..b68ae0c7a13 100644 --- a/src/apis/slides/v1.ts +++ b/src/apis/slides/v1.ts @@ -2585,6 +2585,64 @@ export namespace slides_v1 { /** * slides.presentations.batchUpdate * @desc Applies one or more updates to the presentation. Each request is validated before being applied. If any request is not valid, then the entire request will fail and nothing will be applied. Some requests have replies to give you some information about how they are applied. Other requests do not need to return information; these each return an empty reply. The order of replies matches that of the requests. For example, suppose you call batchUpdate with four updates, and only the third one returns information. The response would have two empty replies: the reply to the third request, and another empty reply, in that order. Because other users may be editing the presentation, the presentation might not exactly reflect your changes: your changes may be altered with respect to collaborator changes. If there are no collaborators, the presentation should reflect your changes. In any case, the updates in your request are guaranteed to be applied together atomically. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/slides.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 slides = google.slides('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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.readonly', + * 'https://www.googleapis.com/auth/presentations', + * 'https://www.googleapis.com/auth/spreadsheets', + * 'https://www.googleapis.com/auth/spreadsheets.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 slides.presentations.batchUpdate({ + * // The presentation to apply the updates to. + * presentationId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "requests": [], + * // "writeControl": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "presentationId": "my_presentationId", + * // "replies": [], + * // "writeControl": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias slides.presentations.batchUpdate * @memberOf! () * @@ -2668,6 +2726,71 @@ export namespace slides_v1 { /** * slides.presentations.create * @desc Creates a blank presentation using the title given in the request. If a `presentationId` is provided, it is used as the ID of the new presentation. Otherwise, a new ID is generated. Other fields in the request, including any provided content, are ignored. Returns the created presentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/slides.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 slides = google.slides('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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/presentations', + * ], + * }); + * + * // 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 slides.presentations.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "layouts": [], + * // "locale": "my_locale", + * // "masters": [], + * // "notesMaster": {}, + * // "pageSize": {}, + * // "presentationId": "my_presentationId", + * // "revisionId": "my_revisionId", + * // "slides": [], + * // "title": "my_title" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "layouts": [], + * // "locale": "my_locale", + * // "masters": [], + * // "notesMaster": {}, + * // "pageSize": {}, + * // "presentationId": "my_presentationId", + * // "revisionId": "my_revisionId", + * // "slides": [], + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias slides.presentations.create * @memberOf! () * @@ -2739,6 +2862,60 @@ export namespace slides_v1 { /** * slides.presentations.get * @desc Gets the latest version of the specified presentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/slides.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 slides = google.slides('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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.readonly', + * 'https://www.googleapis.com/auth/presentations', + * 'https://www.googleapis.com/auth/presentations.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 slides.presentations.get({ + * // The ID of the presentation to retrieve. + * presentationId: '[^/]+', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "layouts": [], + * // "locale": "my_locale", + * // "masters": [], + * // "notesMaster": {}, + * // "pageSize": {}, + * // "presentationId": "my_presentationId", + * // "revisionId": "my_revisionId", + * // "slides": [], + * // "title": "my_title" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias slides.presentations.get * @memberOf! () * @@ -2862,6 +3039,62 @@ export namespace slides_v1 { /** * slides.presentations.pages.get * @desc Gets the latest version of the specified page in the presentation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/slides.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 slides = google.slides('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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.readonly', + * 'https://www.googleapis.com/auth/presentations', + * 'https://www.googleapis.com/auth/presentations.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 slides.presentations.pages.get({ + * // The object ID of the page to retrieve. + * pageObjectId: 'placeholder-value', + * // The ID of the presentation to retrieve. + * presentationId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "layoutProperties": {}, + * // "masterProperties": {}, + * // "notesProperties": {}, + * // "objectId": "my_objectId", + * // "pageElements": [], + * // "pageProperties": {}, + * // "pageType": "my_pageType", + * // "revisionId": "my_revisionId", + * // "slideProperties": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias slides.presentations.pages.get * @memberOf! () * @@ -2935,6 +3168,65 @@ export namespace slides_v1 { /** * slides.presentations.pages.getThumbnail * @desc Generates a thumbnail of the latest version of the specified page in the presentation and returns a URL to the thumbnail image. This request counts as an [expensive read request](/slides/limits) for quota purposes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/slides.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 slides = google.slides('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/drive', + * 'https://www.googleapis.com/auth/drive.file', + * 'https://www.googleapis.com/auth/drive.readonly', + * 'https://www.googleapis.com/auth/presentations', + * 'https://www.googleapis.com/auth/presentations.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 slides.presentations.pages.getThumbnail({ + * // The object ID of the page whose thumbnail to retrieve. + * pageObjectId: 'placeholder-value', + * // The ID of the presentation to retrieve. + * presentationId: 'placeholder-value', + * // The optional mime type of the thumbnail image. + * // + * // If you don't specify the mime type, the mime type defaults to PNG. + * 'thumbnailProperties.mimeType': 'placeholder-value', + * // The optional thumbnail image size. + * // + * // If you don't specify the size, the server chooses a default size of the + * // image. + * 'thumbnailProperties.thumbnailSize': 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentUrl": "my_contentUrl", + * // "height": 0, + * // "width": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias slides.presentations.pages.getThumbnail * @memberOf! () * diff --git a/src/apis/sourcerepo/v1.ts b/src/apis/sourcerepo/v1.ts index 5b373bb33aa..8356c5b76bd 100644 --- a/src/apis/sourcerepo/v1.ts +++ b/src/apis/sourcerepo/v1.ts @@ -427,6 +427,49 @@ export namespace sourcerepo_v1 { /** * sourcerepo.projects.getConfig * @desc Returns the Cloud Source Repositories configuration of the project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sourcerepo.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 sourcerepo = google.sourcerepo('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/cloud-platform'], + * }); + * + * // 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 sourcerepo.projects.getConfig({ + * // The name of the requested project. Values are of the form + * // `projects/`. + * name: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "enablePrivateKeyCheck": false, + * // "name": "my_name", + * // "pubsubConfigs": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sourcerepo.projects.getConfig * @memberOf! () * @@ -498,6 +541,58 @@ export namespace sourcerepo_v1 { /** * sourcerepo.projects.updateConfig * @desc Updates the Cloud Source Repositories configuration of the project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sourcerepo.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 sourcerepo = google.sourcerepo('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/cloud-platform'], + * }); + * + * // 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 sourcerepo.projects.updateConfig({ + * // The name of the requested project. Values are of the form + * // `projects/`. + * name: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "projectConfig": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "enablePrivateKeyCheck": false, + * // "name": "my_name", + * // "pubsubConfigs": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sourcerepo.projects.updateConfig * @memberOf! () * @@ -607,6 +702,66 @@ export namespace sourcerepo_v1 { /** * sourcerepo.projects.repos.create * @desc Creates a repo in the given project with the given name. If the named repository already exists, `CreateRepo` returns `ALREADY_EXISTS`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sourcerepo.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 sourcerepo = google.sourcerepo('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/cloud-platform', + * 'https://www.googleapis.com/auth/source.full_control', + * ], + * }); + * + * // 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 sourcerepo.projects.repos.create({ + * // The project in which to create the repo. Values are of the form + * // `projects/`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "mirrorConfig": {}, + * // "name": "my_name", + * // "pubsubConfigs": {}, + * // "size": "my_size", + * // "url": "my_url" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "mirrorConfig": {}, + * // "name": "my_name", + * // "pubsubConfigs": {}, + * // "size": "my_size", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sourcerepo.projects.repos.create * @memberOf! () * @@ -680,6 +835,48 @@ export namespace sourcerepo_v1 { /** * sourcerepo.projects.repos.delete * @desc Deletes a repo. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sourcerepo.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 sourcerepo = google.sourcerepo('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/cloud-platform', + * 'https://www.googleapis.com/auth/source.full_control', + * ], + * }); + * + * // 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 sourcerepo.projects.repos.delete({ + * // The name of the repo to delete. Values are of the form + * // `projects//repos/`. + * name: 'projects/my-project/repos/.*', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sourcerepo.projects.repos.delete * @memberOf! () * @@ -749,6 +946,56 @@ export namespace sourcerepo_v1 { /** * sourcerepo.projects.repos.get * @desc Returns information about a repo. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sourcerepo.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 sourcerepo = google.sourcerepo('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/cloud-platform', + * 'https://www.googleapis.com/auth/source.full_control', + * 'https://www.googleapis.com/auth/source.read_only', + * 'https://www.googleapis.com/auth/source.read_write', + * ], + * }); + * + * // 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 sourcerepo.projects.repos.get({ + * // The name of the requested repository. Values are of the form + * // `projects//repos/`. + * name: 'projects/my-project/repos/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "mirrorConfig": {}, + * // "name": "my_name", + * // "pubsubConfigs": {}, + * // "size": "my_size", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sourcerepo.projects.repos.get * @memberOf! () * @@ -818,6 +1065,64 @@ export namespace sourcerepo_v1 { /** * sourcerepo.projects.repos.getIamPolicy * @desc Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sourcerepo.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 sourcerepo = google.sourcerepo('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/cloud-platform', + * 'https://www.googleapis.com/auth/source.full_control', + * 'https://www.googleapis.com/auth/source.read_only', + * 'https://www.googleapis.com/auth/source.read_write', + * ], + * }); + * + * // 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 sourcerepo.projects.repos.getIamPolicy({ + * // Optional. The policy format version to be returned. + * // + * // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + * // rejected. + * // + * // Requests for policies with any conditional bindings must specify version 3. + * // Policies without any conditional bindings may specify any valid value or + * // leave the field unset. + * 'options.requestedPolicyVersion': 'placeholder-value', + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/repos/.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sourcerepo.projects.repos.getIamPolicy * @memberOf! () * @@ -891,6 +1196,60 @@ export namespace sourcerepo_v1 { /** * sourcerepo.projects.repos.list * @desc Returns all repos belonging to a project. The sizes of the repos are not set by ListRepos. To get the size of a repo, use GetRepo. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sourcerepo.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 sourcerepo = google.sourcerepo('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/cloud-platform', + * 'https://www.googleapis.com/auth/source.full_control', + * 'https://www.googleapis.com/auth/source.read_only', + * 'https://www.googleapis.com/auth/source.read_write', + * ], + * }); + * + * // 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 sourcerepo.projects.repos.list({ + * // The project ID whose repos should be listed. Values are of the form + * // `projects/`. + * name: 'projects/my-project', + * // Maximum number of repositories to return; between 1 and 500. + * // If not set or zero, defaults to 100 at the server. + * pageSize: 'placeholder-value', + * // Resume listing repositories where a prior ListReposResponse + * // left off. This is an opaque token that must be obtained from + * // a recent, prior ListReposResponse's next_page_token field. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "repos": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sourcerepo.projects.repos.list * @memberOf! () * @@ -964,6 +1323,60 @@ export namespace sourcerepo_v1 { /** * sourcerepo.projects.repos.patch * @desc Updates information about a repo. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sourcerepo.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 sourcerepo = google.sourcerepo('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/cloud-platform'], + * }); + * + * // 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 sourcerepo.projects.repos.patch({ + * // The name of the requested repository. Values are of the form + * // `projects//repos/`. + * name: 'projects/my-project/repos/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "repo": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "mirrorConfig": {}, + * // "name": "my_name", + * // "pubsubConfigs": {}, + * // "size": "my_size", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sourcerepo.projects.repos.patch * @memberOf! () * @@ -1034,6 +1447,62 @@ export namespace sourcerepo_v1 { /** * sourcerepo.projects.repos.setIamPolicy * @desc Sets the access control policy on the specified resource. Replaces any existing policy. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sourcerepo.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 sourcerepo = google.sourcerepo('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/cloud-platform', + * 'https://www.googleapis.com/auth/source.full_control', + * ], + * }); + * + * // 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 sourcerepo.projects.repos.setIamPolicy({ + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/repos/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {}, + * // "updateMask": "my_updateMask" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditConfigs": [], + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sourcerepo.projects.repos.setIamPolicy * @memberOf! () * @@ -1107,6 +1576,57 @@ export namespace sourcerepo_v1 { /** * sourcerepo.projects.repos.sync * @desc Synchronize a connected repo. The response contains SyncRepoMetadata in the metadata field. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sourcerepo.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 sourcerepo = google.sourcerepo('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/cloud-platform'], + * }); + * + * // 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 sourcerepo.projects.repos.sync({ + * // The name of the repo to synchronize. Values are of the form + * // `projects//repos/`. + * name: 'projects/my-project/repos/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sourcerepo.projects.repos.sync * @memberOf! () * @@ -1179,6 +1699,60 @@ export namespace sourcerepo_v1 { /** * sourcerepo.projects.repos.testIamPermissions * @desc Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sourcerepo.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 sourcerepo = google.sourcerepo('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/cloud-platform', + * 'https://www.googleapis.com/auth/source.full_control', + * 'https://www.googleapis.com/auth/source.read_only', + * 'https://www.googleapis.com/auth/source.read_write', + * ], + * }); + * + * // 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 sourcerepo.projects.repos.testIamPermissions({ + * // REQUIRED: The resource for which the policy detail is being requested. + * // See the operation documentation for the appropriate value for this field. + * resource: 'projects/my-project/repos/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sourcerepo.projects.repos.testIamPermissions * @memberOf! () * diff --git a/src/apis/spanner/v1.ts b/src/apis/spanner/v1.ts index 2560bd1a9dc..2a45c50fa44 100644 --- a/src/apis/spanner/v1.ts +++ b/src/apis/spanner/v1.ts @@ -1439,6 +1439,52 @@ export namespace spanner_v1 { /** * spanner.projects.instanceConfigs.get * @desc Gets information about a particular instance configuration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instanceConfigs.get({ + * // Required. The name of the requested instance configuration. Values are of + * // the form `projects//instanceConfigs/`. + * name: 'projects/my-project/instanceConfigs/my-instanceConfig', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "replicas": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instanceConfigs.get * @memberOf! () * @@ -1510,6 +1556,59 @@ export namespace spanner_v1 { /** * spanner.projects.instanceConfigs.list * @desc Lists the supported instance configurations for a given project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instanceConfigs.list({ + * // Number of instance configurations to be returned in the response. If 0 or + * // less, defaults to the server's maximum allowed page size. + * pageSize: 'placeholder-value', + * // If non-empty, `page_token` should contain a + * // next_page_token + * // from a previous ListInstanceConfigsResponse. + * pageToken: 'placeholder-value', + * // Required. The name of the project for which a list of supported instance + * // configurations is requested. Values are of the form + * // `projects/`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "instanceConfigs": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instanceConfigs.list * @memberOf! () * @@ -1649,6 +1748,63 @@ export namespace spanner_v1 { /** * spanner.projects.instances.create * @desc Creates an instance and begins preparing it to begin serving. The returned long-running operation can be used to track the progress of preparing the new instance. The instance name is assigned by the caller. If the named instance already exists, `CreateInstance` returns `ALREADY_EXISTS`. Immediately upon completion of this request: * The instance is readable via the API, with all requested attributes but no allocated resources. Its state is `CREATING`. Until completion of the returned operation: * Cancelling the operation renders the instance immediately unreadable via the API. * The instance can be deleted. * All other attempts to modify the instance are rejected. Upon completion of the returned operation: * Billing for all successfully-allocated resources begins (some types may have lower than the requested levels). * Databases can be created in the instance. * The instance's allocated resource levels are readable via the API. * The instance's state becomes `READY`. The returned long-running operation will have a name of the format `/operations/` and can be used to track creation of the instance. The metadata field type is CreateInstanceMetadata. The response field type is Instance, if successful. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.create({ + * // Required. The name of the project in which to create the instance. Values + * // are of the form `projects/`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "instance": {}, + * // "instanceId": "my_instanceId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.create * @memberOf! () * @@ -1724,6 +1880,48 @@ export namespace spanner_v1 { /** * spanner.projects.instances.delete * @desc Deletes an instance. Immediately upon completion of the request: * Billing ceases for all of the instance's reserved resources. Soon afterward: * The instance and *all of its databases* immediately and irrevocably disappear from the API. All data in the databases is permanently deleted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.delete({ + * // Required. The name of the instance to be deleted. Values are of the form + * // `projects//instances/` + * name: 'projects/my-project/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.delete * @memberOf! () * @@ -1793,6 +1991,60 @@ export namespace spanner_v1 { /** * spanner.projects.instances.get * @desc Gets information about a particular instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.get({ + * // If field_mask is present, specifies the subset of Instance fields that + * // should be returned. + * // If absent, all Instance fields are returned. + * fieldMask: 'placeholder-value', + * // Required. The name of the requested instance. Values are of the form + * // `projects//instances/`. + * name: 'projects/my-project/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "config": "my_config", + * // "displayName": "my_displayName", + * // "endpointUris": [], + * // "labels": {}, + * // "name": "my_name", + * // "nodeCount": 0, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.get * @memberOf! () * @@ -1863,6 +2115,59 @@ export namespace spanner_v1 { /** * spanner.projects.instances.getIamPolicy * @desc Gets the access control policy for an instance resource. Returns an empty policy if an instance exists but does not have a policy set. Authorization requires `spanner.instances.getIamPolicy` on resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.getIamPolicy({ + * // REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + * resource: 'projects/my-project/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.getIamPolicy * @memberOf! () * @@ -1936,6 +2241,78 @@ export namespace spanner_v1 { /** * spanner.projects.instances.list * @desc Lists all instances in the given project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.list({ + * // An expression for filtering the results of the request. Filter rules are + * // case insensitive. The fields eligible for filtering are: + * // + * // * `name` + * // * `display_name` + * // * `labels.key` where key is the name of a label + * // + * // Some examples of using filters are: + * // + * // * `name:*` --> The instance has a name. + * // * `name:Howl` --> The instance's name contains the string "howl". + * // * `name:HOWL` --> Equivalent to above. + * // * `NAME:howl` --> Equivalent to above. + * // * `labels.env:*` --> The instance has the label "env". + * // * `labels.env:dev` --> The instance has the label "env" and the value of + * // the label contains the string "dev". + * // * `name:howl labels.env:dev` --> The instance's name contains "howl" and + * // it has the label "env" with its value + * // containing "dev". + * filter: 'placeholder-value', + * // Number of instances to be returned in the response. If 0 or less, defaults + * // to the server's maximum allowed page size. + * pageSize: 'placeholder-value', + * // If non-empty, `page_token` should contain a + * // next_page_token from a + * // previous ListInstancesResponse. + * pageToken: 'placeholder-value', + * // Required. The name of the project for which a list of instances is + * // requested. Values are of the form `projects/`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "instances": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.list * @memberOf! () * @@ -2015,6 +2392,65 @@ export namespace spanner_v1 { /** * spanner.projects.instances.patch * @desc Updates an instance, and begins allocating or releasing resources as requested. The returned long-running operation can be used to track the progress of updating the instance. If the named instance does not exist, returns `NOT_FOUND`. Immediately upon completion of this request: * For resource types for which a decrease in the instance's allocation has been requested, billing is based on the newly-requested level. Until completion of the returned operation: * Cancelling the operation sets its metadata's cancel_time, and begins restoring resources to their pre-request values. The operation is guaranteed to succeed at undoing all resource changes, after which point it terminates with a `CANCELLED` status. * All other attempts to modify the instance are rejected. * Reading the instance via the API continues to give the pre-request resource levels. Upon completion of the returned operation: * Billing begins for all successfully-allocated resources (some types may have lower than the requested levels). * All newly-reserved resources are available for serving the instance's tables. * The instance's new resource levels are readable via the API. The returned long-running operation will have a name of the format `/operations/` and can be used to track the instance modification. The metadata field type is UpdateInstanceMetadata. The response field type is Instance, if successful. Authorization requires `spanner.instances.update` permission on resource name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.patch({ + * // Required. A unique identifier for the instance, which cannot be changed + * // after the instance is created. Values are of the form + * // `projects//instances/a-z*[a-z0-9]`. The final + * // segment of the name must be between 2 and 64 characters in length. + * name: 'projects/my-project/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "fieldMask": "my_fieldMask", + * // "instance": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.patch * @memberOf! () * @@ -2087,6 +2523,59 @@ export namespace spanner_v1 { /** * spanner.projects.instances.setIamPolicy * @desc Sets the access control policy on an instance resource. Replaces any existing policy. Authorization requires `spanner.instances.setIamPolicy` on resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.setIamPolicy({ + * // REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for databases resources. + * resource: 'projects/my-project/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.setIamPolicy * @memberOf! () * @@ -2160,6 +2649,57 @@ export namespace spanner_v1 { /** * spanner.projects.instances.testIamPermissions * @desc Returns permissions that the caller has on the specified instance resource. Attempting this RPC on a non-existent Cloud Spanner instance resource will result in a NOT_FOUND error if the user has `spanner.instances.list` permission on the containing Google Cloud Project. Otherwise returns an empty set of permissions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.testIamPermissions({ + * // REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + * resource: 'projects/my-project/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.testIamPermissions * @memberOf! () * @@ -2387,6 +2927,98 @@ export namespace spanner_v1 { /** * spanner.projects.instances.backupOperations.list * @desc Lists the backup long-running operations in the given instance. A backup operation has a name of the form `projects//instances//backups//operations/`. The long-running operation metadata field type `metadata.type_url` describes the type of the metadata. Operations returned include those that have completed/failed/canceled within the last 7 days, and pending operations. Operations returned are ordered by `operation.metadata.value.progress.start_time` in descending order starting from the most recently started operation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.backupOperations.list({ + * // An expression that filters the list of returned backup operations. + * // + * // A filter expression consists of a field name, a + * // comparison operator, and a value for filtering. + * // The value must be a string, a number, or a boolean. The comparison operator + * // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + * // Colon `:` is the contains operator. Filter rules are not case sensitive. + * // + * // The following fields in the operation + * // are eligible for filtering: + * // + * // * `name` - The name of the long-running operation + * // * `done` - False if the operation is in progress, else true. + * // * `metadata.@type` - the type of metadata. For example, the type string + * // for CreateBackupMetadata is + * // `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. + * // * `metadata.` - any field in metadata.value. + * // * `error` - Error associated with the long-running operation. + * // * `response.@type` - the type of response. + * // * `response.` - any field in response.value. + * // + * // You can combine multiple expressions by enclosing each expression in + * // parentheses. By default, expressions are combined with AND logic, but + * // you can specify AND, OR, and NOT logic explicitly. + * // + * // Here are a few examples: + * // + * // * `done:true` - The operation is complete. + * // * `metadata.database:prod` - The database the backup was taken from has + * // a name containing the string "prod". + * // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND`
                          + * // `(metadata.name:howl) AND`
                          + * // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND`
                          + * // `(error:*)` - Returns operations where: + * // * The operation's metadata type is CreateBackupMetadata. + * // * The backup name contains the string "howl". + * // * The operation started before 2018-03-28T14:50:00Z. + * // * The operation resulted in an error. + * filter: 'placeholder-value', + * // Number of operations to be returned in the response. If 0 or + * // less, defaults to the server's maximum allowed page size. + * pageSize: 'placeholder-value', + * // If non-empty, `page_token` should contain a + * // next_page_token + * // from a previous ListBackupOperationsResponse to the + * // same `parent` and with the same `filter`. + * pageToken: 'placeholder-value', + * // Required. The instance of the backup operations. Values are of + * // the form `projects//instances/`. + * parent: 'projects/my-project/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.backupOperations.list * @memberOf! () * @@ -2509,6 +3141,76 @@ export namespace spanner_v1 { /** * spanner.projects.instances.backups.create * @desc Starts creating a new Cloud Spanner Backup. The returned backup long-running operation will have a name of the format `projects//instances//backups//operations/` and can be used to track creation of the backup. The metadata field type is CreateBackupMetadata. The response field type is Backup, if successful. Cancelling the returned operation will stop the creation and delete the backup. There can be only one pending backup creation per database. Backup creation of different databases can run concurrently. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.backups.create({ + * // Required. The id of the backup to be created. The `backup_id` appended to + * // `parent` forms the full backup name of the form + * // `projects//instances//backups/`. + * backupId: 'placeholder-value', + * // Required. The name of the instance in which the backup will be + * // created. This must be the same instance that contains the database the + * // backup will be created from. The backup will be stored in the + * // location(s) specified in the instance configuration of this + * // instance. Values are of the form + * // `projects//instances/`. + * parent: 'projects/my-project/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "database": "my_database", + * // "expireTime": "my_expireTime", + * // "name": "my_name", + * // "referencingDatabases": [], + * // "sizeBytes": "my_sizeBytes", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.backups.create * @memberOf! () * @@ -2585,6 +3287,49 @@ export namespace spanner_v1 { /** * spanner.projects.instances.backups.delete * @desc Deletes a pending or completed Backup. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.backups.delete({ + * // Required. Name of the backup to delete. + * // Values are of the form + * // `projects//instances//backups/`. + * name: 'projects/my-project/instances/my-instance/backups/my-backup', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.backups.delete * @memberOf! () * @@ -2654,6 +3399,57 @@ export namespace spanner_v1 { /** * spanner.projects.instances.backups.get * @desc Gets metadata on a pending or completed Backup. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.backups.get({ + * // Required. Name of the backup. + * // Values are of the form + * // `projects//instances//backups/`. + * name: 'projects/my-project/instances/my-instance/backups/my-backup', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "database": "my_database", + * // "expireTime": "my_expireTime", + * // "name": "my_name", + * // "referencingDatabases": [], + * // "sizeBytes": "my_sizeBytes", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.backups.get * @memberOf! () * @@ -2723,6 +3519,59 @@ export namespace spanner_v1 { /** * spanner.projects.instances.backups.getIamPolicy * @desc Gets the access control policy for a database or backup resource. Returns an empty policy if a database or backup exists but does not have a policy set. Authorization requires `spanner.databases.getIamPolicy` permission on resource. For backups, authorization requires `spanner.backups.getIamPolicy` permission on resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.backups.getIamPolicy({ + * // REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + * resource: 'projects/my-project/instances/my-instance/backups/my-backup', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.backups.getIamPolicy * @memberOf! () * @@ -2796,6 +3645,94 @@ export namespace spanner_v1 { /** * spanner.projects.instances.backups.list * @desc Lists completed and pending backups. Backups returned are ordered by `create_time` in descending order, starting from the most recent `create_time`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.backups.list({ + * // An expression that filters the list of returned backups. + * // + * // A filter expression consists of a field name, a comparison operator, and a + * // value for filtering. + * // The value must be a string, a number, or a boolean. The comparison operator + * // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + * // Colon `:` is the contains operator. Filter rules are not case sensitive. + * // + * // The following fields in the Backup are eligible for filtering: + * // + * // * `name` + * // * `database` + * // * `state` + * // * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * // * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + * // * `size_bytes` + * // + * // You can combine multiple expressions by enclosing each expression in + * // parentheses. By default, expressions are combined with AND logic, but + * // you can specify AND, OR, and NOT logic explicitly. + * // + * // Here are a few examples: + * // + * // * `name:Howl` - The backup's name contains the string "howl". + * // * `database:prod` + * // - The database's name contains the string "prod". + * // * `state:CREATING` - The backup is pending creation. + * // * `state:READY` - The backup is fully created and ready for use. + * // * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` + * // - The backup name contains the string "howl" and `create_time` + * // of the backup is before 2018-03-28T14:50:00Z. + * // * `expire_time < \"2018-03-28T14:50:00Z\"` + * // - The backup `expire_time` is before 2018-03-28T14:50:00Z. + * // * `size_bytes > 10000000000` - The backup's size is greater than 10GB + * filter: 'placeholder-value', + * // Number of backups to be returned in the response. If 0 or + * // less, defaults to the server's maximum allowed page size. + * pageSize: 'placeholder-value', + * // If non-empty, `page_token` should contain a + * // next_page_token from a + * // previous ListBackupsResponse to the same `parent` and with the same + * // `filter`. + * pageToken: 'placeholder-value', + * // Required. The instance to list backups from. Values are of the + * // form `projects//instances/`. + * parent: 'projects/my-project/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backups": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.backups.list * @memberOf! () * @@ -2873,6 +3810,87 @@ export namespace spanner_v1 { /** * spanner.projects.instances.backups.patch * @desc Updates a pending or completed Backup. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.backups.patch({ + * // Output only for the CreateBackup operation. + * // Required for the UpdateBackup operation. + * // + * // A globally unique identifier for the backup which cannot be + * // changed. Values are of the form + * // `projects//instances//backups/a-z*[a-z0-9]` + * // The final segment of the name must be between 2 and 60 characters + * // in length. + * // + * // The backup is stored in the location(s) specified in the instance + * // configuration of the instance containing the backup, identified + * // by the prefix of the backup name of the form + * // `projects//instances/`. + * name: 'projects/my-project/instances/my-instance/backups/my-backup', + * // Required. A mask specifying which fields (e.g. `expire_time`) in the + * // Backup resource should be updated. This mask is relative to the Backup + * // resource, not to the request message. The field mask must always be + * // specified; this prevents any future fields from being erased accidentally + * // by clients that do not know about them. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "database": "my_database", + * // "expireTime": "my_expireTime", + * // "name": "my_name", + * // "referencingDatabases": [], + * // "sizeBytes": "my_sizeBytes", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "database": "my_database", + * // "expireTime": "my_expireTime", + * // "name": "my_name", + * // "referencingDatabases": [], + * // "sizeBytes": "my_sizeBytes", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.backups.patch * @memberOf! () * @@ -2944,6 +3962,59 @@ export namespace spanner_v1 { /** * spanner.projects.instances.backups.setIamPolicy * @desc Sets the access control policy on a database or backup resource. Replaces any existing policy. Authorization requires `spanner.databases.setIamPolicy` permission on resource. For backups, authorization requires `spanner.backups.setIamPolicy` permission on resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.backups.setIamPolicy({ + * // REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for databases resources. + * resource: 'projects/my-project/instances/my-instance/backups/my-backup', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.backups.setIamPolicy * @memberOf! () * @@ -3017,6 +4088,57 @@ export namespace spanner_v1 { /** * spanner.projects.instances.backups.testIamPermissions * @desc Returns permissions that the caller has on the specified database or backup resource. Attempting this RPC on a non-existent Cloud Spanner database will result in a NOT_FOUND error if the user has `spanner.databases.list` permission on the containing Cloud Spanner instance. Otherwise returns an empty set of permissions. Calling this method on a backup that does not exist will result in a NOT_FOUND error if the user has `spanner.backups.list` permission on the containing instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.backups.testIamPermissions({ + * // REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + * resource: 'projects/my-project/instances/my-instance/backups/my-backup', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.backups.testIamPermissions * @memberOf! () * @@ -3248,6 +4370,48 @@ export namespace spanner_v1 { /** * spanner.projects.instances.backups.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.backups.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: + * 'projects/my-project/instances/my-instance/backups/my-backup/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.backups.operations.cancel * @memberOf! () * @@ -3317,6 +4481,48 @@ export namespace spanner_v1 { /** * spanner.projects.instances.backups.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.backups.operations.delete({ + * // The name of the operation resource to be deleted. + * name: + * 'projects/my-project/instances/my-instance/backups/my-backup/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.backups.operations.delete * @memberOf! () * @@ -3386,6 +4592,54 @@ export namespace spanner_v1 { /** * spanner.projects.instances.backups.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.backups.operations.get({ + * // The name of the operation resource. + * name: + * 'projects/my-project/instances/my-instance/backups/my-backup/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.backups.operations.get * @memberOf! () * @@ -3457,6 +4711,57 @@ export namespace spanner_v1 { /** * spanner.projects.instances.backups.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.backups.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: + * 'projects/my-project/instances/my-instance/backups/my-backup/operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.backups.operations.list * @memberOf! () * @@ -3601,6 +4906,100 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databaseOperations.list * @desc Lists database longrunning-operations. A database operation has a name of the form `projects//instances//databases//operations/`. The long-running operation metadata field type `metadata.type_url` describes the type of the metadata. Operations returned include those that have completed/failed/canceled within the last 7 days, and pending operations. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.databaseOperations.list({ + * // An expression that filters the list of returned operations. + * // + * // A filter expression consists of a field name, a + * // comparison operator, and a value for filtering. + * // The value must be a string, a number, or a boolean. The comparison operator + * // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + * // Colon `:` is the contains operator. Filter rules are not case sensitive. + * // + * // The following fields in the Operation + * // are eligible for filtering: + * // + * // * `name` - The name of the long-running operation + * // * `done` - False if the operation is in progress, else true. + * // * `metadata.@type` - the type of metadata. For example, the type string + * // for RestoreDatabaseMetadata is + * // `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. + * // * `metadata.` - any field in metadata.value. + * // * `error` - Error associated with the long-running operation. + * // * `response.@type` - the type of response. + * // * `response.` - any field in response.value. + * // + * // You can combine multiple expressions by enclosing each expression in + * // parentheses. By default, expressions are combined with AND logic. However, + * // you can specify AND, OR, and NOT logic explicitly. + * // + * // Here are a few examples: + * // + * // * `done:true` - The operation is complete. + * // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND`
                          + * // `(metadata.source_type:BACKUP) AND`
                          + * // `(metadata.backup_info.backup:backup_howl) AND`
                          + * // `(metadata.name:restored_howl) AND`
                          + * // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND`
                          + * // `(error:*)` - Return operations where: + * // * The operation's metadata type is RestoreDatabaseMetadata. + * // * The database is restored from a backup. + * // * The backup name contains "backup_howl". + * // * The restored database's name contains "restored_howl". + * // * The operation started before 2018-03-28T14:50:00Z. + * // * The operation resulted in an error. + * filter: 'placeholder-value', + * // Number of operations to be returned in the response. If 0 or + * // less, defaults to the server's maximum allowed page size. + * pageSize: 'placeholder-value', + * // If non-empty, `page_token` should contain a + * // next_page_token + * // from a previous ListDatabaseOperationsResponse to the + * // same `parent` and with the same `filter`. + * pageToken: 'placeholder-value', + * // Required. The instance of the database operations. + * // Values are of the form `projects//instances/`. + * parent: 'projects/my-project/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databaseOperations.list * @memberOf! () * @@ -3727,6 +5126,63 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.create * @desc Creates a new Cloud Spanner database and starts to prepare it for serving. The returned long-running operation will have a name of the format `/operations/` and can be used to track preparation of the database. The metadata field type is CreateDatabaseMetadata. The response field type is Database, if successful. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.create({ + * // Required. The name of the instance that will serve the new database. + * // Values are of the form `projects//instances/`. + * parent: 'projects/my-project/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createStatement": "my_createStatement", + * // "extraStatements": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.create * @memberOf! () * @@ -3802,6 +5258,47 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.dropDatabase * @desc Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be retained according to their `expire_time`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.dropDatabase({ + * // Required. The database to be dropped. + * database: 'projects/my-project/instances/my-instance/databases/my-database', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.dropDatabase * @memberOf! () * @@ -3871,6 +5368,53 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.get * @desc Gets the state of a Cloud Spanner database. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.get({ + * // Required. The name of the requested database. Values are of the form + * // `projects//instances//databases/`. + * name: 'projects/my-project/instances/my-instance/databases/my-database', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "name": "my_name", + * // "restoreInfo": {}, + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.get * @memberOf! () * @@ -3940,6 +5484,49 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.getDdl * @desc Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This method does not show pending schema updates, those may be queried using the Operations API. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.getDdl({ + * // Required. The database whose schema we wish to get. + * database: 'projects/my-project/instances/my-instance/databases/my-database', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "statements": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.getDdl * @memberOf! () * @@ -4016,6 +5603,59 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.getIamPolicy * @desc Gets the access control policy for a database or backup resource. Returns an empty policy if a database or backup exists but does not have a policy set. Authorization requires `spanner.databases.getIamPolicy` permission on resource. For backups, authorization requires `spanner.backups.getIamPolicy` permission on resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.getIamPolicy({ + * // REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + * resource: 'projects/my-project/instances/my-instance/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.getIamPolicy * @memberOf! () * @@ -4089,6 +5729,58 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.list * @desc Lists Cloud Spanner databases. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.list({ + * // Number of databases to be returned in the response. If 0 or less, + * // defaults to the server's maximum allowed page size. + * pageSize: 'placeholder-value', + * // If non-empty, `page_token` should contain a + * // next_page_token from a + * // previous ListDatabasesResponse. + * pageToken: 'placeholder-value', + * // Required. The instance whose databases should be listed. + * // Values are of the form `projects//instances/`. + * parent: 'projects/my-project/instances/my-instance', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "databases": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.list * @memberOf! () * @@ -4167,6 +5859,66 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.restore * @desc Create a new database by restoring from a completed backup. The new database must be in the same project and in an instance with the same instance configuration as the instance containing the backup. The returned database long-running operation has a name of the format `projects//instances//databases//operations/`, and can be used to track the progress of the operation, and to cancel it. The metadata field type is RestoreDatabaseMetadata. The response type is Database, if successful. Cancelling the returned operation will stop the restore and delete the database. There can be only one database being restored into an instance at a time. Once the restore operation completes, a new restore operation can be initiated, without waiting for the optimize operation associated with the first restore to complete. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.restore({ + * // Required. The name of the instance in which to create the + * // restored database. This instance must be in the same project and + * // have the same instance configuration as the instance containing + * // the source backup. Values are of the form + * // `projects//instances/`. + * parent: 'projects/my-project/instances/my-instance', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "backup": "my_backup", + * // "databaseId": "my_databaseId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.restore * @memberOf! () * @@ -4242,6 +5994,59 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.setIamPolicy * @desc Sets the access control policy on a database or backup resource. Replaces any existing policy. Authorization requires `spanner.databases.setIamPolicy` permission on resource. For backups, authorization requires `spanner.backups.setIamPolicy` permission on resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.setIamPolicy({ + * // REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for databases resources. + * resource: 'projects/my-project/instances/my-instance/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "policy": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.setIamPolicy * @memberOf! () * @@ -4315,6 +6120,57 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.testIamPermissions * @desc Returns permissions that the caller has on the specified database or backup resource. Attempting this RPC on a non-existent Cloud Spanner database will result in a NOT_FOUND error if the user has `spanner.databases.list` permission on the containing Cloud Spanner instance. Otherwise returns an empty set of permissions. Calling this method on a backup that does not exist will result in a NOT_FOUND error if the user has `spanner.backups.list` permission on the containing instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.testIamPermissions({ + * // REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + * resource: 'projects/my-project/instances/my-instance/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "permissions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.testIamPermissions * @memberOf! () * @@ -4397,6 +6253,62 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.updateDdl * @desc Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. The returned long-running operation will have a name of the format `/operations/` and can be used to track execution of the schema change(s). The metadata field type is UpdateDatabaseDdlMetadata. The operation has no response. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.updateDdl({ + * // Required. The database to update. + * database: 'projects/my-project/instances/my-instance/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "operationId": "my_operationId", + * // "statements": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.updateDdl * @memberOf! () * @@ -4638,6 +6550,48 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: + * 'projects/my-project/instances/my-instance/databases/my-database/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.operations.cancel * @memberOf! () * @@ -4707,6 +6661,48 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.operations.delete({ + * // The name of the operation resource to be deleted. + * name: + * 'projects/my-project/instances/my-instance/databases/my-database/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.operations.delete * @memberOf! () * @@ -4776,6 +6772,54 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.operations.get({ + * // The name of the operation resource. + * name: + * 'projects/my-project/instances/my-instance/databases/my-database/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.operations.get * @memberOf! () * @@ -4847,6 +6891,57 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: + * 'projects/my-project/instances/my-instance/databases/my-database/operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.operations.list * @memberOf! () * @@ -4991,6 +7086,58 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.sessions.batchCreate * @desc Creates multiple new sessions. This API can be used to initialize a session cache on the clients. See https://goo.gl/TgSFN2 for best practices on session cache management. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.data', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.sessions.batchCreate({ + * // Required. The database in which the new sessions are created. + * database: 'projects/my-project/instances/my-instance/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "sessionCount": 0, + * // "sessionTemplate": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "session": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.sessions.batchCreate * @memberOf! () * @@ -5073,6 +7220,61 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.sessions.beginTransaction * @desc Begins a new transaction. This step can often be skipped: Read, ExecuteSql and Commit can begin a new transaction as a side-effect. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.data', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.sessions.beginTransaction( + * { + * // Required. The session in which the transaction runs. + * session: + * 'projects/my-project/instances/my-instance/databases/my-database/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "options": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "id": "my_id", + * // "readTimestamp": "my_readTimestamp" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.sessions.beginTransaction * @memberOf! () * @@ -5148,6 +7350,60 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.sessions.commit * @desc Commits a transaction. The request includes the mutations to be applied to rows in the database. `Commit` might return an `ABORTED` error. This can occur at any time; commonly, the cause is conflicts with concurrent transactions. However, it can also happen for a variety of other reasons. If `Commit` returns `ABORTED`, the caller should re-attempt the transaction from the beginning, re-using the same session. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.data', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.sessions.commit({ + * // Required. The session in which the transaction to be committed is running. + * session: + * 'projects/my-project/instances/my-instance/databases/my-database/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "mutations": [], + * // "singleUseTransaction": {}, + * // "transactionId": "my_transactionId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "commitTimestamp": "my_commitTimestamp" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.sessions.commit * @memberOf! () * @@ -5223,6 +7479,60 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.sessions.create * @desc Creates a new session. A session can be used to perform transactions that read and/or modify data in a Cloud Spanner database. Sessions are meant to be reused for many consecutive transactions. Sessions can only execute one transaction at a time. To execute multiple concurrent read-write/write-only transactions, create multiple sessions. Note that standalone reads and queries use a transaction internally, and count toward the one transaction limit. Active sessions use additional server resources, so it is a good idea to delete idle and unneeded sessions. Aside from explicit deletes, Cloud Spanner may delete sessions for which no operations are sent for more than an hour. If a session is deleted, requests to it return `NOT_FOUND`. Idle sessions can be kept alive by sending a trivial SQL query periodically, e.g., `"SELECT 1"`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.data', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.sessions.create({ + * // Required. The database in which the new session is created. + * database: 'projects/my-project/instances/my-instance/databases/my-database', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "session": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approximateLastUseTime": "my_approximateLastUseTime", + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.sessions.create * @memberOf! () * @@ -5296,6 +7606,48 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.sessions.delete * @desc Ends a session, releasing server resources associated with it. This will asynchronously trigger cancellation of any operations that are running with this session. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.data', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.sessions.delete({ + * // Required. The name of the session to delete. + * name: + * 'projects/my-project/instances/my-instance/databases/my-database/sessions/my-session', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.sessions.delete * @memberOf! () * @@ -5365,6 +7717,63 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.sessions.executeBatchDml * @desc Executes a batch of SQL DML statements. This method allows many statements to be run with lower latency than submitting them sequentially with ExecuteSql. Statements are executed in sequential order. A request can succeed even if a statement fails. The ExecuteBatchDmlResponse.status field in the response provides information about the statement that failed. Clients must inspect this field to determine whether an error occurred. Execution stops after the first failed statement; the remaining statements are not executed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.data', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.sessions.executeBatchDml( + * { + * // Required. The session in which the DML statements should be performed. + * session: + * 'projects/my-project/instances/my-instance/databases/my-database/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "seqno": "my_seqno", + * // "statements": [], + * // "transaction": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "resultSets": [], + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.sessions.executeBatchDml * @memberOf! () * @@ -5444,6 +7853,68 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.sessions.executeSql * @desc Executes an SQL statement, returning all results in a single reply. This method cannot be used to return a result set larger than 10 MiB; if the query yields more data than that, the query fails with a `FAILED_PRECONDITION` error. Operations inside read-write transactions might return `ABORTED`. If this occurs, the application should restart the transaction from the beginning. See Transaction for more details. Larger result sets can be fetched in streaming fashion by calling ExecuteStreamingSql instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.data', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.sessions.executeSql({ + * // Required. The session in which the SQL query should be performed. + * session: + * 'projects/my-project/instances/my-instance/databases/my-database/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "paramTypes": {}, + * // "params": {}, + * // "partitionToken": "my_partitionToken", + * // "queryMode": "my_queryMode", + * // "queryOptions": {}, + * // "resumeToken": "my_resumeToken", + * // "seqno": "my_seqno", + * // "sql": "my_sql", + * // "transaction": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "metadata": {}, + * // "rows": [], + * // "stats": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.sessions.executeSql * @memberOf! () * @@ -5519,6 +7990,72 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.sessions.executeStreamingSql * @desc Like ExecuteSql, except returns the result set as a stream. Unlike ExecuteSql, there is no limit on the size of the returned result set. However, no individual row in the result set can exceed 100 MiB, and no column value can exceed 10 MiB. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.data', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.sessions.executeStreamingSql( + * { + * // Required. The session in which the SQL query should be performed. + * session: + * 'projects/my-project/instances/my-instance/databases/my-database/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "paramTypes": {}, + * // "params": {}, + * // "partitionToken": "my_partitionToken", + * // "queryMode": "my_queryMode", + * // "queryOptions": {}, + * // "resumeToken": "my_resumeToken", + * // "seqno": "my_seqno", + * // "sql": "my_sql", + * // "transaction": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "chunkedValue": false, + * // "metadata": {}, + * // "resumeToken": "my_resumeToken", + * // "stats": {}, + * // "values": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.sessions.executeStreamingSql * @memberOf! () * @@ -5596,6 +8133,53 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.sessions.get * @desc Gets a session. Returns `NOT_FOUND` if the session does not exist. This is mainly useful for determining whether a session is still alive. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.data', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.sessions.get({ + * // Required. The name of the session to retrieve. + * name: + * 'projects/my-project/instances/my-instance/databases/my-database/sessions/my-session', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "approximateLastUseTime": "my_approximateLastUseTime", + * // "createTime": "my_createTime", + * // "labels": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.sessions.get * @memberOf! () * @@ -5665,6 +8249,68 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.sessions.list * @desc Lists all sessions in a given database. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.data', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.sessions.list({ + * // Required. The database in which to list sessions. + * database: 'projects/my-project/instances/my-instance/databases/my-database', + * // An expression for filtering the results of the request. Filter rules are + * // case insensitive. The fields eligible for filtering are: + * // + * // * `labels.key` where key is the name of a label + * // + * // Some examples of using filters are: + * // + * // * `labels.env:*` --> The session has the label "env". + * // * `labels.env:dev` --> The session has the label "env" and the value of + * // the label contains the string "dev". + * filter: 'placeholder-value', + * // Number of sessions to be returned in the response. If 0 or less, defaults + * // to the server's maximum allowed page size. + * pageSize: 'placeholder-value', + * // If non-empty, `page_token` should contain a + * // next_page_token from a previous + * // ListSessionsResponse. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "sessions": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.sessions.list * @memberOf! () * @@ -5744,6 +8390,65 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.sessions.partitionQuery * @desc Creates a set of partition tokens that can be used to execute a query operation in parallel. Each of the returned partition tokens can be used by ExecuteStreamingSql to specify a subset of the query result to read. The same session and read-only transaction must be used by the PartitionQueryRequest used to create the partition tokens and the ExecuteSqlRequests that use the partition tokens. Partition tokens become invalid when the session used to create them is deleted, is idle for too long, begins a new transaction, or becomes too old. When any of these happen, it is not possible to resume the query, and the whole operation must be restarted from the beginning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.data', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.sessions.partitionQuery( + * { + * // Required. The session used to create the partitions. + * session: + * 'projects/my-project/instances/my-instance/databases/my-database/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "paramTypes": {}, + * // "params": {}, + * // "partitionOptions": {}, + * // "sql": "my_sql", + * // "transaction": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "partitions": [], + * // "transaction": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.sessions.partitionQuery * @memberOf! () * @@ -5821,6 +8526,66 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.sessions.partitionRead * @desc Creates a set of partition tokens that can be used to execute a read operation in parallel. Each of the returned partition tokens can be used by StreamingRead to specify a subset of the read result to read. The same session and read-only transaction must be used by the PartitionReadRequest used to create the partition tokens and the ReadRequests that use the partition tokens. There are no ordering guarantees on rows returned among the returned partition tokens, or even within each individual StreamingRead call issued with a partition_token. Partition tokens become invalid when the session used to create them is deleted, is idle for too long, begins a new transaction, or becomes too old. When any of these happen, it is not possible to resume the read, and the whole operation must be restarted from the beginning. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.data', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.sessions.partitionRead( + * { + * // Required. The session used to create the partitions. + * session: + * 'projects/my-project/instances/my-instance/databases/my-database/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "columns": [], + * // "index": "my_index", + * // "keySet": {}, + * // "partitionOptions": {}, + * // "table": "my_table", + * // "transaction": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "partitions": [], + * // "transaction": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.sessions.partitionRead * @memberOf! () * @@ -5898,6 +8663,67 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.sessions.read * @desc Reads rows from the database using key lookups and scans, as a simple key/value style alternative to ExecuteSql. This method cannot be used to return a result set larger than 10 MiB; if the read matches more data than that, the read fails with a `FAILED_PRECONDITION` error. Reads inside read-write transactions might return `ABORTED`. If this occurs, the application should restart the transaction from the beginning. See Transaction for more details. Larger result sets can be yielded in streaming fashion by calling StreamingRead instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.data', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.sessions.read({ + * // Required. The session in which the read should be performed. + * session: + * 'projects/my-project/instances/my-instance/databases/my-database/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "columns": [], + * // "index": "my_index", + * // "keySet": {}, + * // "limit": "my_limit", + * // "partitionToken": "my_partitionToken", + * // "resumeToken": "my_resumeToken", + * // "table": "my_table", + * // "transaction": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "metadata": {}, + * // "rows": [], + * // "stats": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.sessions.read * @memberOf! () * @@ -5973,6 +8799,56 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.sessions.rollback * @desc Rolls back a transaction, releasing any locks it holds. It is a good idea to call this for any transaction that includes one or more Read or ExecuteSql requests and ultimately decides not to commit. `Rollback` returns `OK` if it successfully aborts the transaction, the transaction was already aborted, or the transaction is not found. `Rollback` never returns `ABORTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.data', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.sessions.rollback({ + * // Required. The session in which the transaction to roll back is running. + * session: + * 'projects/my-project/instances/my-instance/databases/my-database/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "transactionId": "my_transactionId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.sessions.rollback * @memberOf! () * @@ -6046,6 +8922,71 @@ export namespace spanner_v1 { /** * spanner.projects.instances.databases.sessions.streamingRead * @desc Like Read, except returns the result set as a stream. Unlike Read, there is no limit on the size of the returned result set. However, no individual row in the result set can exceed 100 MiB, and no column value can exceed 10 MiB. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.data', + * ], + * }); + * + * // 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 spanner.projects.instances.databases.sessions.streamingRead( + * { + * // Required. The session in which the read should be performed. + * session: + * 'projects/my-project/instances/my-instance/databases/my-database/sessions/my-session', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "columns": [], + * // "index": "my_index", + * // "keySet": {}, + * // "limit": "my_limit", + * // "partitionToken": "my_partitionToken", + * // "resumeToken": "my_resumeToken", + * // "table": "my_table", + * // "transaction": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "chunkedValue": false, + * // "metadata": {}, + * // "resumeToken": "my_resumeToken", + * // "stats": {}, + * // "values": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.databases.sessions.streamingRead * @memberOf! () * @@ -6383,6 +9324,47 @@ export namespace spanner_v1 { /** * spanner.projects.instances.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/instances/my-instance/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.operations.cancel * @memberOf! () * @@ -6452,6 +9434,47 @@ export namespace spanner_v1 { /** * spanner.projects.instances.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/instances/my-instance/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.operations.delete * @memberOf! () * @@ -6521,6 +9544,53 @@ export namespace spanner_v1 { /** * spanner.projects.instances.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/instances/my-instance/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.operations.get * @memberOf! () * @@ -6592,6 +9662,56 @@ export namespace spanner_v1 { /** * spanner.projects.instances.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/spanner.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 spanner = google.spanner('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/cloud-platform', + * 'https://www.googleapis.com/auth/spanner.admin', + * ], + * }); + * + * // 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 spanner.projects.instances.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/instances/my-instance/operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias spanner.projects.instances.operations.list * @memberOf! () * diff --git a/src/apis/speech/v1.ts b/src/apis/speech/v1.ts index b88c1ea1476..1c7bb80d82c 100644 --- a/src/apis/speech/v1.ts +++ b/src/apis/speech/v1.ts @@ -439,6 +439,50 @@ export namespace speech_v1 { /** * speech.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/speech.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 speech = google.speech('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/cloud-platform'], + * }); + * + * // 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 speech.operations.get({ + * // The name of the operation resource. + * name: '.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias speech.operations.get * @memberOf! () * @@ -512,6 +556,53 @@ export namespace speech_v1 { /** * speech.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/speech.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 speech = google.speech('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/cloud-platform'], + * }); + * + * // 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 speech.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'placeholder-value', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias speech.operations.list * @memberOf! () * @@ -649,6 +740,50 @@ export namespace speech_v1 { /** * speech.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/speech.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 speech = google.speech('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/cloud-platform'], + * }); + * + * // 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 speech.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias speech.projects.locations.operations.get * @memberOf! () * @@ -720,6 +855,53 @@ export namespace speech_v1 { /** * speech.projects.locations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/speech.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 speech = google.speech('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/cloud-platform'], + * }); + * + * // 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 speech.projects.locations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias speech.projects.locations.operations.list * @memberOf! () * @@ -843,6 +1025,56 @@ export namespace speech_v1 { /** * speech.speech.longrunningrecognize * @desc Performs asynchronous speech recognition: receive results via the google.longrunning.Operations interface. Returns either an `Operation.error` or an `Operation.response` which contains a `LongRunningRecognizeResponse` message. For more information on asynchronous speech recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/speech.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 speech = google.speech('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/cloud-platform'], + * }); + * + * // 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 speech.speech.longrunningrecognize({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "audio": {}, + * // "config": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias speech.speech.longrunningrecognize * @memberOf! () * @@ -919,6 +1151,52 @@ export namespace speech_v1 { /** * speech.speech.recognize * @desc Performs synchronous speech recognition: receive results after all audio has been sent and processed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/speech.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 speech = google.speech('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/cloud-platform'], + * }); + * + * // 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 speech.speech.recognize({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "audio": {}, + * // "config": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "results": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias speech.speech.recognize * @memberOf! () * diff --git a/src/apis/speech/v1p1beta1.ts b/src/apis/speech/v1p1beta1.ts index 25d5d5ad493..b737656b147 100644 --- a/src/apis/speech/v1p1beta1.ts +++ b/src/apis/speech/v1p1beta1.ts @@ -544,6 +544,50 @@ export namespace speech_v1p1beta1 { /** * speech.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/speech.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 speech = google.speech('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 speech.operations.get({ + * // The name of the operation resource. + * name: '.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias speech.operations.get * @memberOf! () * @@ -617,6 +661,53 @@ export namespace speech_v1p1beta1 { /** * speech.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/speech.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 speech = google.speech('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 speech.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'placeholder-value', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias speech.operations.list * @memberOf! () * @@ -757,6 +848,50 @@ export namespace speech_v1p1beta1 { /** * speech.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/speech.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 speech = google.speech('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 speech.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias speech.projects.locations.operations.get * @memberOf! () * @@ -828,6 +963,53 @@ export namespace speech_v1p1beta1 { /** * speech.projects.locations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/speech.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 speech = google.speech('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 speech.projects.locations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias speech.projects.locations.operations.list * @memberOf! () * @@ -951,6 +1133,56 @@ export namespace speech_v1p1beta1 { /** * speech.speech.longrunningrecognize * @desc Performs asynchronous speech recognition: receive results via the google.longrunning.Operations interface. Returns either an `Operation.error` or an `Operation.response` which contains a `LongRunningRecognizeResponse` message. For more information on asynchronous speech recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/speech.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 speech = google.speech('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 speech.speech.longrunningrecognize({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "audio": {}, + * // "config": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias speech.speech.longrunningrecognize * @memberOf! () * @@ -1027,6 +1259,52 @@ export namespace speech_v1p1beta1 { /** * speech.speech.recognize * @desc Performs synchronous speech recognition: receive results after all audio has been sent and processed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/speech.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 speech = google.speech('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 speech.speech.recognize({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "audio": {}, + * // "config": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "results": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias speech.speech.recognize * @memberOf! () * diff --git a/src/apis/speech/v2beta1.ts b/src/apis/speech/v2beta1.ts index 58bf9d54841..e9688684361 100644 --- a/src/apis/speech/v2beta1.ts +++ b/src/apis/speech/v2beta1.ts @@ -287,6 +287,50 @@ export namespace speech_v2beta1 { /** * speech.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/speech.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 speech = google.speech('v2beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 speech.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias speech.projects.locations.operations.get * @memberOf! () * @@ -358,6 +402,53 @@ export namespace speech_v2beta1 { /** * speech.projects.locations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/speech.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 speech = google.speech('v2beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 speech.projects.locations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias speech.projects.locations.operations.list * @memberOf! () * diff --git a/src/apis/sql/v1beta4.ts b/src/apis/sql/v1beta4.ts index e34869a479e..82890b8c5fb 100644 --- a/src/apis/sql/v1beta4.ts +++ b/src/apis/sql/v1beta4.ts @@ -1558,6 +1558,69 @@ export namespace sql_v1beta4 { /** * sql.backupRuns.delete * @desc Deletes the backup taken by a backup run. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.backupRuns.delete({ + * // The ID of the Backup Run to delete. To find a Backup Run ID, use the list + * // method. + * id: 'placeholder-value', + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.backupRuns.delete * @memberOf! () * @@ -1634,6 +1697,67 @@ export namespace sql_v1beta4 { /** * sql.backupRuns.get * @desc Retrieves a resource containing information about a backup run. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.backupRuns.get({ + * // The ID of this Backup Run. + * id: 'placeholder-value', + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "diskEncryptionConfiguration": {}, + * // "diskEncryptionStatus": {}, + * // "endTime": "my_endTime", + * // "enqueuedTime": "my_enqueuedTime", + * // "error": {}, + * // "id": "my_id", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "location": "my_location", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "type": "my_type", + * // "windowStartTime": "my_windowStartTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.backupRuns.get * @memberOf! () * @@ -1709,6 +1833,87 @@ export namespace sql_v1beta4 { /** * sql.backupRuns.insert * @desc Creates a new backup run on demand. This method is applicable only to Second Generation instances. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.backupRuns.insert({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "diskEncryptionConfiguration": {}, + * // "diskEncryptionStatus": {}, + * // "endTime": "my_endTime", + * // "enqueuedTime": "my_enqueuedTime", + * // "error": {}, + * // "id": "my_id", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "location": "my_location", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "type": "my_type", + * // "windowStartTime": "my_windowStartTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.backupRuns.insert * @memberOf! () * @@ -1785,6 +1990,58 @@ export namespace sql_v1beta4 { /** * sql.backupRuns.list * @desc Lists all backup runs associated with a given instance and configuration in the reverse chronological order of the backup initiation time. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.backupRuns.list({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Maximum number of backup runs per response. + * maxResults: 'placeholder-value', + * // A previously-returned page token representing part of the larger set of + * // results to view. + * pageToken: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.backupRuns.list * @memberOf! () * @@ -1954,6 +2211,67 @@ export namespace sql_v1beta4 { /** * sql.databases.delete * @desc Deletes a database from a Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.databases.delete({ + * // Name of the database to be deleted in the instance. + * database: 'placeholder-value', + * // Database instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.databases.delete * @memberOf! () * @@ -2029,6 +2347,61 @@ export namespace sql_v1beta4 { /** * sql.databases.get * @desc Retrieves a resource containing information about a database inside a Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.databases.get({ + * // Name of the database in the instance. + * database: 'placeholder-value', + * // Database instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "charset": "my_charset", + * // "collation": "my_collation", + * // "etag": "my_etag", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "name": "my_name", + * // "project": "my_project", + * // "selfLink": "my_selfLink", + * // "sqlserverDatabaseDetails": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.databases.get * @memberOf! () * @@ -2102,6 +2475,81 @@ export namespace sql_v1beta4 { /** * sql.databases.insert * @desc Inserts a resource containing information about a database inside a Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.databases.insert({ + * // Database instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "charset": "my_charset", + * // "collation": "my_collation", + * // "etag": "my_etag", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "name": "my_name", + * // "project": "my_project", + * // "selfLink": "my_selfLink", + * // "sqlserverDatabaseDetails": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.databases.insert * @memberOf! () * @@ -2177,6 +2625,52 @@ export namespace sql_v1beta4 { /** * sql.databases.list * @desc Lists databases in the specified Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.databases.list({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.databases.list * @memberOf! () * @@ -2253,6 +2747,83 @@ export namespace sql_v1beta4 { /** * sql.databases.patch * @desc Partially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.databases.patch({ + * // Name of the database to be updated in the instance. + * database: 'placeholder-value', + * // Database instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "charset": "my_charset", + * // "collation": "my_collation", + * // "etag": "my_etag", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "name": "my_name", + * // "project": "my_project", + * // "selfLink": "my_selfLink", + * // "sqlserverDatabaseDetails": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.databases.patch * @memberOf! () * @@ -2329,6 +2900,83 @@ export namespace sql_v1beta4 { /** * sql.databases.update * @desc Updates a resource containing information about a database inside a Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.databases.update({ + * // Name of the database to be updated in the instance. + * database: 'placeholder-value', + * // Database instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "charset": "my_charset", + * // "collation": "my_collation", + * // "etag": "my_etag", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "name": "my_name", + * // "project": "my_project", + * // "selfLink": "my_selfLink", + * // "sqlserverDatabaseDetails": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.databases.update * @memberOf! () * @@ -2534,6 +3182,51 @@ export namespace sql_v1beta4 { /** * sql.flags.list * @desc List all available database flags for Cloud SQL instances. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.flags.list({ + * // Database type and version you want to retrieve flags for. By default, this + * // method returns flags for all database types and versions. + * databaseVersion: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.flags.list * @memberOf! () * @@ -2623,6 +3316,65 @@ export namespace sql_v1beta4 { /** * sql.instances.addServerCa * @desc Add a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.instances.addServerCa({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.addServerCa * @memberOf! () * @@ -2698,6 +3450,74 @@ export namespace sql_v1beta4 { /** * sql.instances.clone * @desc Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.instances.clone({ + * // The ID of the Cloud SQL instance to be cloned (source). This does not + * // include the project ID. + * instance: 'placeholder-value', + * // Project ID of the source as well as the clone Cloud SQL instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "cloneContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.clone * @memberOf! () * @@ -2773,6 +3593,65 @@ export namespace sql_v1beta4 { /** * sql.instances.delete * @desc Deletes a Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.instances.delete({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance to be deleted. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.delete * @memberOf! () * @@ -2846,6 +3725,73 @@ export namespace sql_v1beta4 { /** * sql.instances.demoteMaster * @desc Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.instances.demoteMaster({ + * // Cloud SQL instance name. + * instance: 'placeholder-value', + * // ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "demoteMasterContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.demoteMaster * @memberOf! () * @@ -2922,6 +3868,70 @@ export namespace sql_v1beta4 { /** * sql.instances.export * @desc Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform'], + * }); + * + * // 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 sql.instances.export({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance to be exported. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "exportContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.export * @memberOf! () * @@ -2997,6 +4007,73 @@ export namespace sql_v1beta4 { /** * sql.instances.failover * @desc Failover the instance to its failover replica instance. Using this operation might cause your instance to restart. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.instances.failover({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // ID of the project that contains the read replica. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "failoverContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.failover * @memberOf! () * @@ -3073,6 +4150,79 @@ export namespace sql_v1beta4 { /** * sql.instances.get * @desc Retrieves a resource containing information about a Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.instances.get({ + * // Database instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backendType": "my_backendType", + * // "connectionName": "my_connectionName", + * // "currentDiskSize": "my_currentDiskSize", + * // "databaseVersion": "my_databaseVersion", + * // "diskEncryptionConfiguration": {}, + * // "diskEncryptionStatus": {}, + * // "etag": "my_etag", + * // "failoverReplica": {}, + * // "gceZone": "my_gceZone", + * // "instanceType": "my_instanceType", + * // "ipAddresses": [], + * // "ipv6Address": "my_ipv6Address", + * // "kind": "my_kind", + * // "masterInstanceName": "my_masterInstanceName", + * // "maxDiskSize": "my_maxDiskSize", + * // "name": "my_name", + * // "onPremisesConfiguration": {}, + * // "project": "my_project", + * // "region": "my_region", + * // "replicaConfiguration": {}, + * // "replicaNames": [], + * // "rootPassword": "my_rootPassword", + * // "scheduledMaintenance": {}, + * // "selfLink": "my_selfLink", + * // "serverCaCert": {}, + * // "serviceAccountEmailAddress": "my_serviceAccountEmailAddress", + * // "settings": {}, + * // "state": "my_state", + * // "suspensionReason": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.get * @memberOf! () * @@ -3146,6 +4296,70 @@ export namespace sql_v1beta4 { /** * sql.instances.import * @desc Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform'], + * }); + * + * // 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 sql.instances.import({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "importContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.import * @memberOf! () * @@ -3221,6 +4435,100 @@ export namespace sql_v1beta4 { /** * sql.instances.insert * @desc Creates a new Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.instances.insert({ + * // Project ID of the project to which the newly created Cloud SQL instances + * // should belong. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "backendType": "my_backendType", + * // "connectionName": "my_connectionName", + * // "currentDiskSize": "my_currentDiskSize", + * // "databaseVersion": "my_databaseVersion", + * // "diskEncryptionConfiguration": {}, + * // "diskEncryptionStatus": {}, + * // "etag": "my_etag", + * // "failoverReplica": {}, + * // "gceZone": "my_gceZone", + * // "instanceType": "my_instanceType", + * // "ipAddresses": [], + * // "ipv6Address": "my_ipv6Address", + * // "kind": "my_kind", + * // "masterInstanceName": "my_masterInstanceName", + * // "maxDiskSize": "my_maxDiskSize", + * // "name": "my_name", + * // "onPremisesConfiguration": {}, + * // "project": "my_project", + * // "region": "my_region", + * // "replicaConfiguration": {}, + * // "replicaNames": [], + * // "rootPassword": "my_rootPassword", + * // "scheduledMaintenance": {}, + * // "selfLink": "my_selfLink", + * // "serverCaCert": {}, + * // "serviceAccountEmailAddress": "my_serviceAccountEmailAddress", + * // "settings": {}, + * // "state": "my_state", + * // "suspensionReason": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.insert * @memberOf! () * @@ -3294,6 +4602,67 @@ export namespace sql_v1beta4 { /** * sql.instances.list * @desc Lists instances under a given project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.instances.list({ + * // A filter expression that filters resources listed in the response. + * // The expression is in the form of field:value. For example, + * // 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per + * // their JSON representation, such as 'settings.userLabels.auto_start:true'. + * // + * // Multiple filter queries are space-separated. For example. + * // 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each + * // expression is an AND expression. However, you can include AND and OR + * // expressions explicitly. + * filter: 'placeholder-value', + * // The maximum number of results to return per response. + * maxResults: 'placeholder-value', + * // A previously-returned page token representing part of the larger set of + * // results to view. + * pageToken: 'placeholder-value', + * // Project ID of the project for which to list Cloud SQL instances. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.list * @memberOf! () * @@ -3371,6 +4740,53 @@ export namespace sql_v1beta4 { /** * sql.instances.listServerCas * @desc Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certificate that is currently in use, a CA that has been added but not yet used to sign a certificate, and a CA used to sign a certificate that has previously rotated out. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.instances.listServerCas({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeVersion": "my_activeVersion", + * // "certs": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.listServerCas * @memberOf! () * @@ -3455,6 +4871,101 @@ export namespace sql_v1beta4 { /** * sql.instances.patch * @desc Updates settings of a Cloud SQL instance. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.instances.patch({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "backendType": "my_backendType", + * // "connectionName": "my_connectionName", + * // "currentDiskSize": "my_currentDiskSize", + * // "databaseVersion": "my_databaseVersion", + * // "diskEncryptionConfiguration": {}, + * // "diskEncryptionStatus": {}, + * // "etag": "my_etag", + * // "failoverReplica": {}, + * // "gceZone": "my_gceZone", + * // "instanceType": "my_instanceType", + * // "ipAddresses": [], + * // "ipv6Address": "my_ipv6Address", + * // "kind": "my_kind", + * // "masterInstanceName": "my_masterInstanceName", + * // "maxDiskSize": "my_maxDiskSize", + * // "name": "my_name", + * // "onPremisesConfiguration": {}, + * // "project": "my_project", + * // "region": "my_region", + * // "replicaConfiguration": {}, + * // "replicaNames": [], + * // "rootPassword": "my_rootPassword", + * // "scheduledMaintenance": {}, + * // "selfLink": "my_selfLink", + * // "serverCaCert": {}, + * // "serviceAccountEmailAddress": "my_serviceAccountEmailAddress", + * // "settings": {}, + * // "state": "my_state", + * // "suspensionReason": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.patch * @memberOf! () * @@ -3529,6 +5040,65 @@ export namespace sql_v1beta4 { /** * sql.instances.promoteReplica * @desc Promotes the read replica instance to be a stand-alone Cloud SQL instance. Using this operation might cause your instance to restart. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.instances.promoteReplica({ + * // Cloud SQL read replica instance name. + * instance: 'placeholder-value', + * // ID of the project that contains the read replica. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.promoteReplica * @memberOf! () * @@ -3604,6 +5174,65 @@ export namespace sql_v1beta4 { /** * sql.instances.resetSslConfig * @desc Deletes all client certificates and generates a new server SSL certificate for the instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.instances.resetSslConfig({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.resetSslConfig * @memberOf! () * @@ -3679,6 +5308,65 @@ export namespace sql_v1beta4 { /** * sql.instances.restart * @desc Restarts a Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.instances.restart({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance to be restarted. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.restart * @memberOf! () * @@ -3754,6 +5442,73 @@ export namespace sql_v1beta4 { /** * sql.instances.restoreBackup * @desc Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.instances.restoreBackup({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "restoreBackupContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.restoreBackup * @memberOf! () * @@ -3830,6 +5585,73 @@ export namespace sql_v1beta4 { /** * sql.instances.rotateServerCa * @desc Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.instances.rotateServerCa({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "rotateServerCaContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.rotateServerCa * @memberOf! () * @@ -3906,6 +5728,65 @@ export namespace sql_v1beta4 { /** * sql.instances.startReplica * @desc Starts the replication in the read replica instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.instances.startReplica({ + * // Cloud SQL read replica instance name. + * instance: 'placeholder-value', + * // ID of the project that contains the read replica. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.startReplica * @memberOf! () * @@ -3981,6 +5862,65 @@ export namespace sql_v1beta4 { /** * sql.instances.stopReplica * @desc Stops the replication in the read replica instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.instances.stopReplica({ + * // Cloud SQL read replica instance name. + * instance: 'placeholder-value', + * // ID of the project that contains the read replica. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.stopReplica * @memberOf! () * @@ -4056,6 +5996,73 @@ export namespace sql_v1beta4 { /** * sql.instances.truncateLog * @desc Truncate MySQL general and slow query log tables + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.instances.truncateLog({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the Cloud SQL project. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "truncateLogContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.truncateLog * @memberOf! () * @@ -4132,6 +6139,101 @@ export namespace sql_v1beta4 { /** * sql.instances.update * @desc Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.instances.update({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "backendType": "my_backendType", + * // "connectionName": "my_connectionName", + * // "currentDiskSize": "my_currentDiskSize", + * // "databaseVersion": "my_databaseVersion", + * // "diskEncryptionConfiguration": {}, + * // "diskEncryptionStatus": {}, + * // "etag": "my_etag", + * // "failoverReplica": {}, + * // "gceZone": "my_gceZone", + * // "instanceType": "my_instanceType", + * // "ipAddresses": [], + * // "ipv6Address": "my_ipv6Address", + * // "kind": "my_kind", + * // "masterInstanceName": "my_masterInstanceName", + * // "maxDiskSize": "my_maxDiskSize", + * // "name": "my_name", + * // "onPremisesConfiguration": {}, + * // "project": "my_project", + * // "region": "my_region", + * // "replicaConfiguration": {}, + * // "replicaNames": [], + * // "rootPassword": "my_rootPassword", + * // "scheduledMaintenance": {}, + * // "selfLink": "my_selfLink", + * // "serverCaCert": {}, + * // "serviceAccountEmailAddress": "my_serviceAccountEmailAddress", + * // "settings": {}, + * // "state": "my_state", + * // "suspensionReason": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.instances.update * @memberOf! () * @@ -4600,6 +6702,65 @@ export namespace sql_v1beta4 { /** * sql.operations.get * @desc Retrieves an instance operation that has been performed on an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.operations.get({ + * // Instance operation ID. + * operation: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.operations.get * @memberOf! () * @@ -4673,6 +6834,58 @@ export namespace sql_v1beta4 { /** * sql.operations.list * @desc Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.operations.list({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Maximum number of operations per response. + * maxResults: 'placeholder-value', + * // A previously-returned page token representing part of the larger set of + * // results to view. + * pageToken: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.operations.list * @memberOf! () * @@ -4805,6 +7018,73 @@ export namespace sql_v1beta4 { /** * sql.projects.instances.rescheduleMaintenance * @desc Reschedules the maintenance on the given instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.projects.instances.rescheduleMaintenance({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "reschedule": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.projects.instances.rescheduleMaintenance * @memberOf! () * @@ -4883,6 +7163,67 @@ export namespace sql_v1beta4 { /** * sql.projects.instances.startExternalSync * @desc Start External master migration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.projects.instances.startExternalSync({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // ID of the project that contains the first generation instance. + * project: 'placeholder-value', + * // External sync mode + * syncMode: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.projects.instances.startExternalSync * @memberOf! () * @@ -4959,6 +7300,56 @@ export namespace sql_v1beta4 { /** * sql.projects.instances.verifyExternalSyncSettings * @desc Verify External master external sync settings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.projects.instances.verifyExternalSyncSettings({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * // External sync mode + * syncMode: 'placeholder-value', + * // Flag to enable verifying connection only + * verifyConnectionOnly: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "errors": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.projects.instances.verifyExternalSyncSettings * @memberOf! () * @@ -5134,6 +7525,67 @@ export namespace sql_v1beta4 { /** * sql.sslCerts.createEphemeral * @desc Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.sslCerts.createEphemeral({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the Cloud SQL project. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "public_key": "my_public_key" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cert": "my_cert", + * // "certSerialNumber": "my_certSerialNumber", + * // "commonName": "my_commonName", + * // "createTime": "my_createTime", + * // "expirationTime": "my_expirationTime", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "sha1Fingerprint": "my_sha1Fingerprint" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.sslCerts.createEphemeral * @memberOf! () * @@ -5208,6 +7660,67 @@ export namespace sql_v1beta4 { /** * sql.sslCerts.delete * @desc Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.sslCerts.delete({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * // Sha1 FingerPrint. + * sha1Fingerprint: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.sslCerts.delete * @memberOf! () * @@ -5283,6 +7796,61 @@ export namespace sql_v1beta4 { /** * sql.sslCerts.get * @desc Retrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial creation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.sslCerts.get({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * // Sha1 FingerPrint. + * sha1Fingerprint: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cert": "my_cert", + * // "certSerialNumber": "my_certSerialNumber", + * // "commonName": "my_commonName", + * // "createTime": "my_createTime", + * // "expirationTime": "my_expirationTime", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "sha1Fingerprint": "my_sha1Fingerprint" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.sslCerts.get * @memberOf! () * @@ -5356,6 +7924,62 @@ export namespace sql_v1beta4 { /** * sql.sslCerts.insert * @desc Creates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance is restarted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.sslCerts.insert({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "commonName": "my_commonName" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientCert": {}, + * // "kind": "my_kind", + * // "operation": {}, + * // "serverCaCert": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.sslCerts.insert * @memberOf! () * @@ -5433,6 +8057,52 @@ export namespace sql_v1beta4 { /** * sql.sslCerts.list * @desc Lists all of the current SSL certificates for the instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.sslCerts.list({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.sslCerts.list * @memberOf! () * @@ -5611,6 +8281,50 @@ export namespace sql_v1beta4 { /** * sql.tiers.list * @desc Lists all available machine types (tiers) for Cloud SQL, for example, db-n1-standard-1. For related information, see Pricing. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.tiers.list({ + * // Project ID of the project for which to list tiers. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.tiers.list * @memberOf! () * @@ -5703,6 +8417,69 @@ export namespace sql_v1beta4 { /** * sql.users.delete * @desc Deletes a user from a Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.users.delete({ + * // Host of the user in the instance. + * host: 'placeholder-value', + * // Database instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Name of the user in the instance. + * name: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.users.delete * @memberOf! () * @@ -5779,6 +8556,80 @@ export namespace sql_v1beta4 { /** * sql.users.insert * @desc Creates a new user in a Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.users.insert({ + * // Database instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "host": "my_host", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "name": "my_name", + * // "password": "my_password", + * // "project": "my_project", + * // "sqlserverUserDetails": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.users.insert * @memberOf! () * @@ -5854,6 +8705,53 @@ export namespace sql_v1beta4 { /** * sql.users.list * @desc Lists users in the specified Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.users.list({ + * // Database instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.users.list * @memberOf! () * @@ -5928,6 +8826,84 @@ export namespace sql_v1beta4 { /** * sql.users.update * @desc Updates an existing user in a Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sql.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 sql = google.sql('v1beta4'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // 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 sql.users.update({ + * // Optional. Host of the user in the instance. + * host: 'placeholder-value', + * // Database instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Name of the user in the instance. + * name: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "host": "my_host", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "name": "my_name", + * // "password": "my_password", + * // "project": "my_project", + * // "sqlserverUserDetails": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias sql.users.update * @memberOf! () * diff --git a/src/apis/storage/v1.ts b/src/apis/storage/v1.ts index 5ab937d584b..bcdb3953769 100644 --- a/src/apis/storage/v1.ts +++ b/src/apis/storage/v1.ts @@ -881,52 +881,49 @@ export namespace storage_v1 { * storage.bucketAccessControls.delete * @desc Permanently deletes the ACL entry for the specified entity on the specified bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * storage.bucketAccessControls.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await storage.bucketAccessControls.delete({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.bucketAccessControls.delete * @memberOf! () * @@ -1003,55 +1000,64 @@ export namespace storage_v1 { * storage.bucketAccessControls.get * @desc Returns the ACL entry for the specified entity on the specified bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * storage.bucketAccessControls.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await storage.bucketAccessControls.get({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.bucketAccessControls.get * @memberOf! () * @@ -1130,55 +1136,80 @@ export namespace storage_v1 { * storage.bucketAccessControls.insert * @desc Creates a new ACL entry on the specified bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await storage.bucketAccessControls.insert({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * storage.bucketAccessControls.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.bucketAccessControls.insert * @memberOf! () * @@ -1257,51 +1288,53 @@ export namespace storage_v1 { * storage.bucketAccessControls.list * @desc Retrieves ACL entries on the specified bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * auth: authClient, - * }; + * // Do the magic + * const res = await storage.bucketAccessControls.list({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * }); + * console.log(res.data); * - * storage.bucketAccessControls.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.bucketAccessControls.list * @memberOf! () * @@ -1381,60 +1414,82 @@ export namespace storage_v1 { * storage.bucketAccessControls.patch * @desc Patches an ACL entry on the specified bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * // Do the magic + * const res = await storage.bucketAccessControls.patch({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * storage.bucketAccessControls.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.bucketAccessControls.patch * @memberOf! () * @@ -1514,60 +1569,82 @@ export namespace storage_v1 { * storage.bucketAccessControls.update * @desc Updates an ACL entry on the specified bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * // Do the magic + * const res = await storage.bucketAccessControls.update({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * storage.bucketAccessControls.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.bucketAccessControls.update * @memberOf! () * @@ -1806,48 +1883,52 @@ export namespace storage_v1 { * storage.buckets.delete * @desc Permanently deletes an empty bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * storage.buckets.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await storage.buckets.delete({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // If set, only deletes the bucket if its metageneration matches this value. + * ifMetagenerationMatch: 'placeholder-value', + * // If set, only deletes the bucket if its metageneration does not match this value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.buckets.delete * @memberOf! () * @@ -1924,51 +2005,88 @@ export namespace storage_v1 { * storage.buckets.get * @desc Returns metadata for the specified bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * storage.buckets.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await storage.buckets.get({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // Set of properties to return. Defaults to noAcl. + * projection: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "billing": {}, + * // "cors": [], + * // "defaultEventBasedHold": false, + * // "defaultObjectAcl": [], + * // "encryption": {}, + * // "etag": "my_etag", + * // "iamConfiguration": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lifecycle": {}, + * // "location": "my_location", + * // "locationType": "my_locationType", + * // "logging": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "projectNumber": "my_projectNumber", + * // "retentionPolicy": {}, + * // "selfLink": "my_selfLink", + * // "storageClass": "my_storageClass", + * // "timeCreated": "my_timeCreated", + * // "updated": "my_updated", + * // "versioning": {}, + * // "website": {}, + * // "zoneAffinity": [], + * // "zoneSeparation": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.buckets.get * @memberOf! () * @@ -2046,51 +2164,58 @@ export namespace storage_v1 { * storage.buckets.getIamPolicy * @desc Returns an IAM policy for the specified bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * storage.buckets.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await storage.buckets.getIamPolicy({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The IAM policy format version to be returned. If the optionsRequestedPolicyVersion is for an older version that doesn't support part of the requested IAM policy, the request fails. + * optionsRequestedPolicyVersion: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "resourceId": "my_resourceId", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.buckets.getIamPolicy * @memberOf! () * @@ -2167,55 +2292,121 @@ export namespace storage_v1 { * storage.buckets.insert * @desc Creates a new bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // A valid API project identifier. - * project: '', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await storage.buckets.insert({ + * // Apply a predefined set of access controls to this bucket. + * predefinedAcl: 'placeholder-value', + * // Apply a predefined set of default object access controls to this bucket. + * predefinedDefaultObjectAcl: 'placeholder-value', + * // A valid API project identifier. + * project: 'placeholder-value', + * // Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full. + * projection: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "acl": [], + * // "billing": {}, + * // "cors": [], + * // "defaultEventBasedHold": false, + * // "defaultObjectAcl": [], + * // "encryption": {}, + * // "etag": "my_etag", + * // "iamConfiguration": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lifecycle": {}, + * // "location": "my_location", + * // "locationType": "my_locationType", + * // "logging": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "projectNumber": "my_projectNumber", + * // "retentionPolicy": {}, + * // "selfLink": "my_selfLink", + * // "storageClass": "my_storageClass", + * // "timeCreated": "my_timeCreated", + * // "updated": "my_updated", + * // "versioning": {}, + * // "website": {}, + * // "zoneAffinity": [], + * // "zoneSeparation": false + * // } * }, - * - * auth: authClient, - * }; - * - * storage.buckets.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "billing": {}, + * // "cors": [], + * // "defaultEventBasedHold": false, + * // "defaultObjectAcl": [], + * // "encryption": {}, + * // "etag": "my_etag", + * // "iamConfiguration": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lifecycle": {}, + * // "location": "my_location", + * // "locationType": "my_locationType", + * // "logging": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "projectNumber": "my_projectNumber", + * // "retentionPolicy": {}, + * // "selfLink": "my_selfLink", + * // "storageClass": "my_storageClass", + * // "timeCreated": "my_timeCreated", + * // "updated": "my_updated", + * // "versioning": {}, + * // "website": {}, + * // "zoneAffinity": [], + * // "zoneSeparation": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.buckets.insert * @memberOf! () * @@ -2291,64 +2482,65 @@ export namespace storage_v1 { * storage.buckets.list * @desc Retrieves a list of buckets for a given project. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 storage.buckets.list({ + * // Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller. + * maxResults: 'placeholder-value', + * // A previously-returned page token representing part of the larger set of results to view. + * pageToken: 'placeholder-value', + * // Filter results to buckets whose names begin with this prefix. + * prefix: 'placeholder-value', * // A valid API project identifier. - * project: '', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * storage.buckets.list(request, handlePage); - * } - * }; - * - * storage.buckets.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * project: 'placeholder-value', + * // Set of properties to return. Defaults to noAcl. + * projection: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. + * userProject: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.buckets.list * @memberOf! () * @@ -2424,54 +2616,82 @@ export namespace storage_v1 { * storage.buckets.lockRetentionPolicy * @desc Locks retention policy on a bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * // 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 storage.buckets.lockRetentionPolicy({ + * // Name of a bucket. + * bucket: 'placeholder-value', * // Makes the operation conditional on whether bucket's current metageneration matches the given value. - * ifMetagenerationMatch: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.buckets.lockRetentionPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * ifMetagenerationMatch: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "billing": {}, + * // "cors": [], + * // "defaultEventBasedHold": false, + * // "defaultObjectAcl": [], + * // "encryption": {}, + * // "etag": "my_etag", + * // "iamConfiguration": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lifecycle": {}, + * // "location": "my_location", + * // "locationType": "my_locationType", + * // "logging": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "projectNumber": "my_projectNumber", + * // "retentionPolicy": {}, + * // "selfLink": "my_selfLink", + * // "storageClass": "my_storageClass", + * // "timeCreated": "my_timeCreated", + * // "updated": "my_updated", + * // "versioning": {}, + * // "website": {}, + * // "zoneAffinity": [], + * // "zoneSeparation": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.buckets.lockRetentionPolicy * @memberOf! () * @@ -2547,56 +2767,124 @@ export namespace storage_v1 { * storage.buckets.patch * @desc Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * // Do the magic + * const res = await storage.buckets.patch({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // Apply a predefined set of access controls to this bucket. + * predefinedAcl: 'placeholder-value', + * // Apply a predefined set of default object access controls to this bucket. + * predefinedDefaultObjectAcl: 'placeholder-value', + * // Set of properties to return. Defaults to full. + * projection: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "acl": [], + * // "billing": {}, + * // "cors": [], + * // "defaultEventBasedHold": false, + * // "defaultObjectAcl": [], + * // "encryption": {}, + * // "etag": "my_etag", + * // "iamConfiguration": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lifecycle": {}, + * // "location": "my_location", + * // "locationType": "my_locationType", + * // "logging": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "projectNumber": "my_projectNumber", + * // "retentionPolicy": {}, + * // "selfLink": "my_selfLink", + * // "storageClass": "my_storageClass", + * // "timeCreated": "my_timeCreated", + * // "updated": "my_updated", + * // "versioning": {}, + * // "website": {}, + * // "zoneAffinity": [], + * // "zoneSeparation": false + * // } * }, - * - * auth: authClient, - * }; - * - * storage.buckets.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "billing": {}, + * // "cors": [], + * // "defaultEventBasedHold": false, + * // "defaultObjectAcl": [], + * // "encryption": {}, + * // "etag": "my_etag", + * // "iamConfiguration": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lifecycle": {}, + * // "location": "my_location", + * // "locationType": "my_locationType", + * // "logging": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "projectNumber": "my_projectNumber", + * // "retentionPolicy": {}, + * // "selfLink": "my_selfLink", + * // "storageClass": "my_storageClass", + * // "timeCreated": "my_timeCreated", + * // "updated": "my_updated", + * // "versioning": {}, + * // "website": {}, + * // "zoneAffinity": [], + * // "zoneSeparation": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.buckets.patch * @memberOf! () * @@ -2677,56 +2965,68 @@ export namespace storage_v1 { * storage.buckets.setIamPolicy * @desc Updates an IAM policy for the specified bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * // Do the magic + * const res = await storage.buckets.setIamPolicy({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "resourceId": "my_resourceId", + * // "version": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * storage.buckets.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "resourceId": "my_resourceId", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.buckets.setIamPolicy * @memberOf! () * @@ -2803,54 +3103,58 @@ export namespace storage_v1 { * storage.buckets.testIamPermissions * @desc Tests a set of permissions on the given bucket to see which, if any, are held by the caller. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * // 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 storage.buckets.testIamPermissions({ + * // Name of a bucket. + * bucket: 'placeholder-value', * // Permissions to test. - * permissions: [], // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * permissions: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * }); + * console.log(res.data); * - * storage.buckets.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "kind": "my_kind", + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.buckets.testIamPermissions * @memberOf! () * @@ -2935,56 +3239,124 @@ export namespace storage_v1 { * storage.buckets.update * @desc Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * // Do the magic + * const res = await storage.buckets.update({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // Apply a predefined set of access controls to this bucket. + * predefinedAcl: 'placeholder-value', + * // Apply a predefined set of default object access controls to this bucket. + * predefinedDefaultObjectAcl: 'placeholder-value', + * // Set of properties to return. Defaults to full. + * projection: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "acl": [], + * // "billing": {}, + * // "cors": [], + * // "defaultEventBasedHold": false, + * // "defaultObjectAcl": [], + * // "encryption": {}, + * // "etag": "my_etag", + * // "iamConfiguration": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lifecycle": {}, + * // "location": "my_location", + * // "locationType": "my_locationType", + * // "logging": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "projectNumber": "my_projectNumber", + * // "retentionPolicy": {}, + * // "selfLink": "my_selfLink", + * // "storageClass": "my_storageClass", + * // "timeCreated": "my_timeCreated", + * // "updated": "my_updated", + * // "versioning": {}, + * // "website": {}, + * // "zoneAffinity": [], + * // "zoneSeparation": false + * // } * }, - * - * auth: authClient, - * }; - * - * storage.buckets.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "billing": {}, + * // "cors": [], + * // "defaultEventBasedHold": false, + * // "defaultObjectAcl": [], + * // "encryption": {}, + * // "etag": "my_etag", + * // "iamConfiguration": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "labels": {}, + * // "lifecycle": {}, + * // "location": "my_location", + * // "locationType": "my_locationType", + * // "logging": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "projectNumber": "my_projectNumber", + * // "retentionPolicy": {}, + * // "selfLink": "my_selfLink", + * // "storageClass": "my_storageClass", + * // "timeCreated": "my_timeCreated", + * // "updated": "my_updated", + * // "versioning": {}, + * // "website": {}, + * // "zoneAffinity": [], + * // "zoneSeparation": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.buckets.update * @memberOf! () * @@ -3387,49 +3759,60 @@ export namespace storage_v1 { * storage.channels.stop * @desc Stop watching resources through this channel * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 storage.channels.stop({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } * }, - * - * auth: authClient, - * }; - * - * storage.channels.stop(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.channels.stop * @memberOf! () * @@ -3521,52 +3904,49 @@ export namespace storage_v1 { * storage.defaultObjectAccessControls.delete * @desc Permanently deletes the default object ACL entry for the specified entity on the specified bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * storage.defaultObjectAccessControls.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await storage.defaultObjectAccessControls.delete({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.defaultObjectAccessControls.delete * @memberOf! () * @@ -3642,55 +4022,66 @@ export namespace storage_v1 { * storage.defaultObjectAccessControls.get * @desc Returns the default object ACL entry for the specified entity on the specified bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * storage.defaultObjectAccessControls.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await storage.defaultObjectAccessControls.get({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.defaultObjectAccessControls.get * @memberOf! () * @@ -3768,55 +4159,84 @@ export namespace storage_v1 { * storage.defaultObjectAccessControls.insert * @desc Creates a new default object ACL entry on the specified bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await storage.defaultObjectAccessControls.insert({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * storage.defaultObjectAccessControls.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.defaultObjectAccessControls.insert * @memberOf! () * @@ -3895,51 +4315,57 @@ export namespace storage_v1 { * storage.defaultObjectAccessControls.list * @desc Retrieves default object ACL entries on the specified bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * auth: authClient, - * }; + * // Do the magic + * const res = await storage.defaultObjectAccessControls.list({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // If present, only return default ACL listing if the bucket's current metageneration matches this value. + * ifMetagenerationMatch: 'placeholder-value', + * // If present, only return default ACL listing if the bucket's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * }); + * console.log(res.data); * - * storage.defaultObjectAccessControls.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.defaultObjectAccessControls.list * @memberOf! () * @@ -4021,60 +4447,86 @@ export namespace storage_v1 { * storage.defaultObjectAccessControls.patch * @desc Patches a default object ACL entry on the specified bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * // Do the magic + * const res = await storage.defaultObjectAccessControls.patch({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * storage.defaultObjectAccessControls.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.defaultObjectAccessControls.patch * @memberOf! () * @@ -4153,60 +4605,86 @@ export namespace storage_v1 { * storage.defaultObjectAccessControls.update * @desc Updates a default object ACL entry on the specified bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * // Do the magic + * const res = await storage.defaultObjectAccessControls.update({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * storage.defaultObjectAccessControls.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.defaultObjectAccessControls.update * @memberOf! () * @@ -4452,51 +4930,50 @@ export namespace storage_v1 { * storage.notifications.delete * @desc Permanently deletes a notification subscription. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The parent bucket of the notification. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * // 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 storage.notifications.delete({ + * // The parent bucket of the notification. + * bucket: 'placeholder-value', * // ID of the notification to delete. - * notification: 'my-notification', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.notifications.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * notification: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.notifications.delete * @memberOf! () * @@ -4573,54 +5050,65 @@ export namespace storage_v1 { * storage.notifications.get * @desc View a notification configuration. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The parent bucket of the notification. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * // 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 storage.notifications.get({ + * // The parent bucket of the notification. + * bucket: 'placeholder-value', * // Notification ID - * notification: 'my-notification', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.notifications.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * notification: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "custom_attributes": {}, + * // "etag": "my_etag", + * // "event_types": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "object_name_prefix": "my_object_name_prefix", + * // "payload_format": "my_payload_format", + * // "selfLink": "my_selfLink", + * // "topic": "my_topic" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.notifications.get * @memberOf! () * @@ -4699,55 +5187,77 @@ export namespace storage_v1 { * storage.notifications.insert * @desc Creates a notification subscription for a given bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The parent bucket of the notification. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await storage.notifications.insert({ + * // The parent bucket of the notification. + * bucket: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "custom_attributes": {}, + * // "etag": "my_etag", + * // "event_types": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "object_name_prefix": "my_object_name_prefix", + * // "payload_format": "my_payload_format", + * // "selfLink": "my_selfLink", + * // "topic": "my_topic" + * // } * }, - * - * auth: authClient, - * }; - * - * storage.notifications.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "custom_attributes": {}, + * // "etag": "my_etag", + * // "event_types": [], + * // "id": "my_id", + * // "kind": "my_kind", + * // "object_name_prefix": "my_object_name_prefix", + * // "payload_format": "my_payload_format", + * // "selfLink": "my_selfLink", + * // "topic": "my_topic" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.notifications.insert * @memberOf! () * @@ -4825,51 +5335,56 @@ export namespace storage_v1 { * storage.notifications.list * @desc Retrieves a list of notification subscriptions for a given bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Name of a Google Cloud Storage bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * auth: authClient, - * }; + * // Do the magic + * const res = await storage.notifications.list({ + * // Name of a Google Cloud Storage bucket. + * bucket: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * }); + * console.log(res.data); * - * storage.notifications.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.notifications.list * @memberOf! () * @@ -5047,56 +5562,53 @@ export namespace storage_v1 { * storage.objectAccessControls.delete * @desc Permanently deletes the ACL entry for the specified entity on the specified object. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Name of the object. For information about how to URL encode object names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. - * - * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * storage.objectAccessControls.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await storage.objectAccessControls.delete({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * object: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.objectAccessControls.delete * @memberOf! () * @@ -5174,59 +5686,70 @@ export namespace storage_v1 { * storage.objectAccessControls.get * @desc Returns the ACL entry for the specified entity on the specified object. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Name of the object. For information about how to URL encode object names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. - * - * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * storage.objectAccessControls.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await storage.objectAccessControls.get({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * object: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.objectAccessControls.get * @memberOf! () * @@ -5306,59 +5829,88 @@ export namespace storage_v1 { * storage.objectAccessControls.insert * @desc Creates a new ACL entry on the specified object. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * // Name of the object. For information about how to URL encode object names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await storage.objectAccessControls.insert({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * object: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * storage.objectAccessControls.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.objectAccessControls.insert * @memberOf! () * @@ -5439,55 +5991,57 @@ export namespace storage_v1 { * storage.objectAccessControls.list * @desc Retrieves ACL entries on the specified object. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * // Name of the object. For information about how to URL encode object names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * auth: authClient, - * }; + * // Do the magic + * const res = await storage.objectAccessControls.list({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * object: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * }); + * console.log(res.data); * - * storage.objectAccessControls.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.objectAccessControls.list * @memberOf! () * @@ -5569,64 +6123,90 @@ export namespace storage_v1 { * storage.objectAccessControls.patch * @desc Patches an ACL entry on the specified object. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Name of the object. For information about how to URL encode object names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * // Do the magic + * const res = await storage.objectAccessControls.patch({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * object: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * storage.objectAccessControls.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.objectAccessControls.patch * @memberOf! () * @@ -5707,64 +6287,90 @@ export namespace storage_v1 { * storage.objectAccessControls.update * @desc Updates an ACL entry on the specified object. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Name of the object. For information about how to URL encode object names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * // Do the magic + * const res = await storage.objectAccessControls.update({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * object: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } * }, - * - * auth: authClient, - * }; - * - * storage.objectAccessControls.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "projectTeam": {}, + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.objectAccessControls.update * @memberOf! () * @@ -6052,59 +6658,104 @@ export namespace storage_v1 { * storage.objects.compose * @desc Concatenates a list of existing objects into a new object in the same bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket containing the source objects. The destination object is stored in this bucket. - * destinationBucket: 'my-destination-bucket', // TODO: Update placeholder value. + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * // Name of the new object. For information about how to URL encode object names to be path safe, see - * // Encoding URI Path Parts. - * destinationObject: 'my-destination-object', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await storage.objects.compose({ + * // Name of the bucket containing the source objects. The destination object is stored in this bucket. + * destinationBucket: 'placeholder-value', + * // Name of the new object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * destinationObject: 'placeholder-value', + * // Apply a predefined set of access controls to the destination object. + * destinationPredefinedAcl: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. + * ifGenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any. + * kmsKeyName: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destination": {}, + * // "kind": "my_kind", + * // "sourceObjects": [] + * // } * }, - * - * auth: authClient, - * }; - * - * storage.objects.compose(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "customTime": "my_customTime", + * // "customerEncryption": {}, + * // "etag": "my_etag", + * // "eventBasedHold": false, + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "kmsKeyName": "my_kmsKeyName", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "retentionExpirationTime": "my_retentionExpirationTime", + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "temporaryHold": false, + * // "timeCreated": "my_timeCreated", + * // "timeDeleted": "my_timeDeleted", + * // "timeStorageClassUpdated": "my_timeStorageClassUpdated", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.objects.compose * @memberOf! () * @@ -6185,68 +6836,153 @@ export namespace storage_v1 { * storage.objects.copy * @desc Copies a source object to a destination object. Optionally overrides metadata. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 storage.objects.copy({ + * // Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * destinationBucket: 'placeholder-value', + * // Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any. + * destinationKmsKeyName: 'placeholder-value', + * // Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. + * destinationObject: 'placeholder-value', + * // Apply a predefined set of access controls to the destination object. + * destinationPredefinedAcl: 'placeholder-value', + * // Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. + * ifGenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. + * ifGenerationNotMatch: 'placeholder-value', + * // Makes the operation conditional on whether the destination object's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the destination object's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // Makes the operation conditional on whether the source object's current generation matches the given value. + * ifSourceGenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the source object's current generation does not match the given value. + * ifSourceGenerationNotMatch: 'placeholder-value', + * // Makes the operation conditional on whether the source object's current metageneration matches the given value. + * ifSourceMetagenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the source object's current metageneration does not match the given value. + * ifSourceMetagenerationNotMatch: 'placeholder-value', + * // Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. + * projection: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', * // Name of the bucket in which to find the source object. - * sourceBucket: 'my-source-bucket', // TODO: Update placeholder value. - * - * // Name of the source object. For information about how to URL encode object names to be path safe, - * // see Encoding URI Path Parts. - * sourceObject: 'my-source-object', // TODO: Update placeholder value. - * - * // Name of the bucket in which to store the new object. Overrides the provided object metadata's - * // bucket value, if any.For information about how to URL encode object names to be path safe, see - * // Encoding URI Path Parts. - * destinationBucket: 'my-destination-bucket', // TODO: Update placeholder value. - * - * // Name of the new object. Required when the object metadata is not otherwise provided. Overrides the - * // object metadata's name value, if any. - * destinationObject: 'my-destination-object', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * sourceBucket: 'placeholder-value', + * // If present, selects a specific revision of the source object (as opposed to the latest version, the default). + * sourceGeneration: 'placeholder-value', + * // Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * sourceObject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "customTime": "my_customTime", + * // "customerEncryption": {}, + * // "etag": "my_etag", + * // "eventBasedHold": false, + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "kmsKeyName": "my_kmsKeyName", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "retentionExpirationTime": "my_retentionExpirationTime", + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "temporaryHold": false, + * // "timeCreated": "my_timeCreated", + * // "timeDeleted": "my_timeDeleted", + * // "timeStorageClassUpdated": "my_timeStorageClassUpdated", + * // "updated": "my_updated" + * // } * }, - * - * auth: authClient, - * }; - * - * storage.objects.copy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "customTime": "my_customTime", + * // "customerEncryption": {}, + * // "etag": "my_etag", + * // "eventBasedHold": false, + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "kmsKeyName": "my_kmsKeyName", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "retentionExpirationTime": "my_retentionExpirationTime", + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "temporaryHold": false, + * // "timeCreated": "my_timeCreated", + * // "timeDeleted": "my_timeDeleted", + * // "timeStorageClassUpdated": "my_timeStorageClassUpdated", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.objects.copy * @memberOf! () * @@ -6347,52 +7083,60 @@ export namespace storage_v1 { * storage.objects.delete * @desc Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which the object resides. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Name of the object. For information about how to URL encode object names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * storage.objects.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await storage.objects.delete({ + * // Name of the bucket in which the object resides. + * bucket: 'placeholder-value', + * // If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. + * ifGenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. + * ifGenerationNotMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * object: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.objects.delete * @memberOf! () * @@ -6473,59 +7217,100 @@ export namespace storage_v1 { * storage.objects.get * @desc Retrieves an object or its metadata. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which the object resides. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Name of the object. For information about how to URL encode object names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. - * - * // TODO: To download media content, use: - * // - * // alt: 'media', - * - * auth: authClient, - * }; + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * storage.objects.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await storage.objects.get({ + * // Name of the bucket in which the object resides. + * bucket: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. + * ifGenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. + * ifGenerationNotMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * object: 'placeholder-value', + * // Set of properties to return. Defaults to noAcl. + * projection: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "customTime": "my_customTime", + * // "customerEncryption": {}, + * // "etag": "my_etag", + * // "eventBasedHold": false, + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "kmsKeyName": "my_kmsKeyName", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "retentionExpirationTime": "my_retentionExpirationTime", + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "temporaryHold": false, + * // "timeCreated": "my_timeCreated", + * // "timeDeleted": "my_timeDeleted", + * // "timeStorageClassUpdated": "my_timeStorageClassUpdated", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.objects.get * @memberOf! () * @@ -6607,55 +7392,63 @@ export namespace storage_v1 { * storage.objects.getIamPolicy * @desc Returns an IAM policy for the specified object. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which the object resides. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Name of the object. For information about how to URL encode object names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * storage.objects.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await storage.objects.getIamPolicy({ + * // Name of the bucket in which the object resides. + * bucket: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * object: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "resourceId": "my_resourceId", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.objects.getIamPolicy * @memberOf! () * @@ -6733,63 +7526,145 @@ export namespace storage_v1 { * storage.objects.insert * @desc Stores a new object and metadata. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which to store the new object. Overrides the provided object metadata's - * // bucket value, if any. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 storage.objects.insert({ + * // Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. + * bucket: 'placeholder-value', + * // If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded. + * contentEncoding: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. + * ifGenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. + * ifGenerationNotMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any. + * kmsKeyName: 'placeholder-value', + * // Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * name: 'placeholder-value', + * // Apply a predefined set of access controls to this object. + * predefinedAcl: 'placeholder-value', + * // Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. + * projection: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "customTime": "my_customTime", + * // "customerEncryption": {}, + * // "etag": "my_etag", + * // "eventBasedHold": false, + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "kmsKeyName": "my_kmsKeyName", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "retentionExpirationTime": "my_retentionExpirationTime", + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "temporaryHold": false, + * // "timeCreated": "my_timeCreated", + * // "timeDeleted": "my_timeDeleted", + * // "timeStorageClassUpdated": "my_timeStorageClassUpdated", + * // "updated": "my_updated" + * // } * }, - * * media: { - * // TODO: Add desired media content for upload. See - * // https://github.com/google/google-api-nodejs-client#media-uploads - * mimeType: '', // See https://www.w3.org/Protocols/rfc1341/4_Content-Type.html - * body: '', + * mimeType: 'placeholder-value', + * body: 'placeholder-value', * }, - * - * auth: authClient, - * }; - * - * storage.objects.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "customTime": "my_customTime", + * // "customerEncryption": {}, + * // "etag": "my_etag", + * // "eventBasedHold": false, + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "kmsKeyName": "my_kmsKeyName", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "retentionExpirationTime": "my_retentionExpirationTime", + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "temporaryHold": false, + * // "timeCreated": "my_timeCreated", + * // "timeDeleted": "my_timeDeleted", + * // "timeStorageClassUpdated": "my_timeStorageClassUpdated", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.objects.insert * @memberOf! () * @@ -6881,64 +7756,76 @@ export namespace storage_v1 { * storage.objects.list * @desc Retrieves a list of objects matching the criteria. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which to look for objects. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * storage.objects.list(request, handlePage); - * } - * }; - * - * storage.objects.list(request, handlePage); - * }); + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // Do the magic + * const res = await storage.objects.list({ + * // Name of the bucket in which to look for objects. + * bucket: 'placeholder-value', + * // Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. + * delimiter: 'placeholder-value', + * // Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive). + * endOffset: 'placeholder-value', + * // If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes. + * includeTrailingDelimiter: 'placeholder-value', + * // Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller. + * maxResults: 'placeholder-value', + * // A previously-returned page token representing part of the larger set of results to view. + * pageToken: 'placeholder-value', + * // Filter results to objects whose names begin with this prefix. + * prefix: 'placeholder-value', + * // Set of properties to return. Defaults to noAcl. + * projection: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive). + * startOffset: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * // If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning. + * versions: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "prefixes": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.objects.list * @memberOf! () * @@ -7022,60 +7909,138 @@ export namespace storage_v1 { * storage.objects.patch * @desc Patches an object's metadata. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which the object resides. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * // Name of the object. For information about how to URL encode object names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * // Do the magic + * const res = await storage.objects.patch({ + * // Name of the bucket in which the object resides. + * bucket: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. + * ifGenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. + * ifGenerationNotMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * object: 'placeholder-value', + * // Apply a predefined set of access controls to this object. + * predefinedAcl: 'placeholder-value', + * // Set of properties to return. Defaults to full. + * projection: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request, for Requester Pays buckets. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "customTime": "my_customTime", + * // "customerEncryption": {}, + * // "etag": "my_etag", + * // "eventBasedHold": false, + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "kmsKeyName": "my_kmsKeyName", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "retentionExpirationTime": "my_retentionExpirationTime", + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "temporaryHold": false, + * // "timeCreated": "my_timeCreated", + * // "timeDeleted": "my_timeDeleted", + * // "timeStorageClassUpdated": "my_timeStorageClassUpdated", + * // "updated": "my_updated" + * // } * }, - * - * auth: authClient, - * }; - * - * storage.objects.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "customTime": "my_customTime", + * // "customerEncryption": {}, + * // "etag": "my_etag", + * // "eventBasedHold": false, + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "kmsKeyName": "my_kmsKeyName", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "retentionExpirationTime": "my_retentionExpirationTime", + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "temporaryHold": false, + * // "timeCreated": "my_timeCreated", + * // "timeDeleted": "my_timeDeleted", + * // "timeStorageClassUpdated": "my_timeStorageClassUpdated", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.objects.patch * @memberOf! () * @@ -7159,68 +8124,131 @@ export namespace storage_v1 { * storage.objects.rewrite * @desc Rewrites a source object to a destination object. Optionally overrides metadata. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 storage.objects.rewrite({ + * // Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. + * destinationBucket: 'placeholder-value', + * // Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any. + * destinationKmsKeyName: 'placeholder-value', + * // Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * destinationObject: 'placeholder-value', + * // Apply a predefined set of access controls to the destination object. + * destinationPredefinedAcl: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. + * ifGenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. + * ifGenerationNotMatch: 'placeholder-value', + * // Makes the operation conditional on whether the destination object's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the destination object's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // Makes the operation conditional on whether the source object's current generation matches the given value. + * ifSourceGenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the source object's current generation does not match the given value. + * ifSourceGenerationNotMatch: 'placeholder-value', + * // Makes the operation conditional on whether the source object's current metageneration matches the given value. + * ifSourceMetagenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the source object's current metageneration does not match the given value. + * ifSourceMetagenerationNotMatch: 'placeholder-value', + * // The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid. + * maxBytesRewrittenPerCall: 'placeholder-value', + * // Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. + * projection: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request. + * rewriteToken: 'placeholder-value', * // Name of the bucket in which to find the source object. - * sourceBucket: 'my-source-bucket', // TODO: Update placeholder value. - * - * // Name of the source object. For information about how to URL encode object names to be path safe, - * // see Encoding URI Path Parts. - * sourceObject: 'my-source-object', // TODO: Update placeholder value. - * - * // Name of the bucket in which to store the new object. Overrides the provided object metadata's - * // bucket value, if any. - * destinationBucket: 'my-destination-bucket', // TODO: Update placeholder value. - * - * // Name of the new object. Required when the object metadata is not otherwise provided. Overrides the - * // object metadata's name value, if any. For information about how to URL encode object names to be - * // path safe, see Encoding URI Path Parts. - * destinationObject: 'my-destination-object', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * sourceBucket: 'placeholder-value', + * // If present, selects a specific revision of the source object (as opposed to the latest version, the default). + * sourceGeneration: 'placeholder-value', + * // Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * sourceObject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "customTime": "my_customTime", + * // "customerEncryption": {}, + * // "etag": "my_etag", + * // "eventBasedHold": false, + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "kmsKeyName": "my_kmsKeyName", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "retentionExpirationTime": "my_retentionExpirationTime", + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "temporaryHold": false, + * // "timeCreated": "my_timeCreated", + * // "timeDeleted": "my_timeDeleted", + * // "timeStorageClassUpdated": "my_timeStorageClassUpdated", + * // "updated": "my_updated" + * // } * }, - * - * auth: authClient, - * }; - * - * storage.objects.rewrite(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "kind": "my_kind", + * // "objectSize": "my_objectSize", + * // "resource": {}, + * // "rewriteToken": "my_rewriteToken", + * // "totalBytesRewritten": "my_totalBytesRewritten" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.objects.rewrite * @memberOf! () * @@ -7325,60 +8353,73 @@ export namespace storage_v1 { * storage.objects.setIamPolicy * @desc Updates an IAM policy for the specified object. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which the object resides. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * // Name of the object. For information about how to URL encode object names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * // Do the magic + * const res = await storage.objects.setIamPolicy({ + * // Name of the bucket in which the object resides. + * bucket: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * object: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "resourceId": "my_resourceId", + * // "version": 0 + * // } * }, - * - * auth: authClient, - * }; - * - * storage.objects.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bindings": [], + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "resourceId": "my_resourceId", + * // "version": 0 + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.objects.setIamPolicy * @memberOf! () * @@ -7457,58 +8498,62 @@ export namespace storage_v1 { * storage.objects.testIamPermissions * @desc Tests a set of permissions on the given object to see which, if any, are held by the caller. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which the object resides. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * // Name of the object. For information about how to URL encode object names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. + * // 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 storage.objects.testIamPermissions({ + * // Name of the bucket in which the object resides. + * bucket: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * object: 'placeholder-value', * // Permissions to test. - * permissions: [], // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * permissions: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * }); + * console.log(res.data); * - * storage.objects.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "kind": "my_kind", + * // "permissions": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.objects.testIamPermissions * @memberOf! () * @@ -7595,60 +8640,138 @@ export namespace storage_v1 { * storage.objects.update * @desc Updates an object's metadata. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which the object resides. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * // Name of the object. For information about how to URL encode object names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * // Do the magic + * const res = await storage.objects.update({ + * // Name of the bucket in which the object resides. + * bucket: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. + * ifGenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. + * ifGenerationNotMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * object: 'placeholder-value', + * // Apply a predefined set of access controls to this object. + * predefinedAcl: 'placeholder-value', + * // Set of properties to return. Defaults to full. + * projection: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "customTime": "my_customTime", + * // "customerEncryption": {}, + * // "etag": "my_etag", + * // "eventBasedHold": false, + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "kmsKeyName": "my_kmsKeyName", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "retentionExpirationTime": "my_retentionExpirationTime", + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "temporaryHold": false, + * // "timeCreated": "my_timeCreated", + * // "timeDeleted": "my_timeDeleted", + * // "timeStorageClassUpdated": "my_timeStorageClassUpdated", + * // "updated": "my_updated" + * // } * }, - * - * auth: authClient, - * }; - * - * storage.objects.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "customTime": "my_customTime", + * // "customerEncryption": {}, + * // "etag": "my_etag", + * // "eventBasedHold": false, + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "kmsKeyName": "my_kmsKeyName", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "retentionExpirationTime": "my_retentionExpirationTime", + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "temporaryHold": false, + * // "timeCreated": "my_timeCreated", + * // "timeDeleted": "my_timeDeleted", + * // "timeStorageClassUpdated": "my_timeStorageClassUpdated", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.objects.update * @memberOf! () * @@ -7732,55 +8855,99 @@ export namespace storage_v1 { * storage.objects.watchAll * @desc Watch for changes on all objects in a bucket. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which to look for objects. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await storage.objects.watchAll({ + * // Name of the bucket in which to look for objects. + * bucket: 'placeholder-value', + * // Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. + * delimiter: 'placeholder-value', + * // Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive). + * endOffset: 'placeholder-value', + * // If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes. + * includeTrailingDelimiter: 'placeholder-value', + * // Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller. + * maxResults: 'placeholder-value', + * // A previously-returned page token representing part of the larger set of results to view. + * pageToken: 'placeholder-value', + * // Filter results to objects whose names begin with this prefix. + * prefix: 'placeholder-value', + * // Set of properties to return. Defaults to noAcl. + * projection: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive). + * startOffset: 'placeholder-value', + * // The project to be billed for this request. Required for Requester Pays buckets. + * userProject: 'placeholder-value', + * // If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning. + * versions: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } * }, - * - * auth: authClient, - * }; - * - * storage.objects.watchAll(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.objects.watchAll * @memberOf! () * @@ -8589,54 +9756,54 @@ export namespace storage_v1 { * storage.projects.hmacKeys.create * @desc Creates a new HMAC key for the specified service account. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID owning the service account. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // 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 storage.projects.hmacKeys.create({ + * // Project ID owning the service account. + * projectId: 'placeholder-value', * // Email address of the service account. - * serviceAccountEmail: '', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.projects.hmacKeys.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * serviceAccountEmail: 'placeholder-value', + * // The project to be billed for this request. + * userProject: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "kind": "my_kind", + * // "metadata": {}, + * // "secret": "my_secret" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.projects.hmacKeys.create * @memberOf! () * @@ -8711,51 +9878,48 @@ export namespace storage_v1 { * storage.projects.hmacKeys.delete * @desc Deletes an HMAC key. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID owning the requested key - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // 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 storage.projects.hmacKeys.delete({ * // Name of the HMAC key to be deleted. - * accessId: 'my-access-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.projects.hmacKeys.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * accessId: 'placeholder-value', + * // Project ID owning the requested key + * projectId: 'placeholder-value', + * // The project to be billed for this request. + * userProject: 'placeholder-value', * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.projects.hmacKeys.delete * @memberOf! () * @@ -8830,54 +9994,63 @@ export namespace storage_v1 { * storage.projects.hmacKeys.get * @desc Retrieves an HMAC key's metadata * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID owning the service account of the requested key. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // 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 storage.projects.hmacKeys.get({ * // Name of the HMAC key. - * accessId: 'my-access-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.projects.hmacKeys.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * accessId: 'placeholder-value', + * // Project ID owning the service account of the requested key. + * projectId: 'placeholder-value', + * // The project to be billed for this request. + * userProject: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accessId": "my_accessId", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "projectId": "my_projectId", + * // "selfLink": "my_selfLink", + * // "serviceAccountEmail": "my_serviceAccountEmail", + * // "state": "my_state", + * // "timeCreated": "my_timeCreated", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.projects.hmacKeys.get * @memberOf! () * @@ -8954,64 +10127,62 @@ export namespace storage_v1 { * storage.projects.hmacKeys.list * @desc Retrieves a list of HMAC keys matching the criteria. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Name of the project in which to look for HMAC keys. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * storage.projects.hmacKeys.list(request, handlePage); - * } - * }; - * - * storage.projects.hmacKeys.list(request, handlePage); - * }); + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // Do the magic + * const res = await storage.projects.hmacKeys.list({ + * // Maximum number of items to return in a single page of responses. The service uses this parameter or 250 items, whichever is smaller. The max number of items per page will also be limited by the number of distinct service accounts in the response. If the number of service accounts in a single response is too high, the page will truncated and a next page token will be returned. + * maxResults: 'placeholder-value', + * // A previously-returned page token representing part of the larger set of results to view. + * pageToken: 'placeholder-value', + * // Name of the project in which to look for HMAC keys. + * projectId: 'placeholder-value', + * // If present, only keys for the given service account are returned. + * serviceAccountEmail: 'placeholder-value', + * // Whether or not to show keys in the DELETED state. + * showDeletedKeys: 'placeholder-value', + * // The project to be billed for this request. + * userProject: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.projects.hmacKeys.list * @memberOf! () * @@ -9091,59 +10262,78 @@ export namespace storage_v1 { * storage.projects.hmacKeys.update * @desc Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID owning the service account of the updated key. - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // 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 storage.projects.hmacKeys.update({ * // Name of the HMAC key being updated. - * accessId: 'my-access-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing properties - * // will be replaced. + * accessId: 'placeholder-value', + * // Project ID owning the service account of the updated key. + * projectId: 'placeholder-value', + * // The project to be billed for this request. + * userProject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accessId": "my_accessId", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "projectId": "my_projectId", + * // "selfLink": "my_selfLink", + * // "serviceAccountEmail": "my_serviceAccountEmail", + * // "state": "my_state", + * // "timeCreated": "my_timeCreated", + * // "updated": "my_updated" + * // } * }, - * - * auth: authClient, - * }; - * - * storage.projects.hmacKeys.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accessId": "my_accessId", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "projectId": "my_projectId", + * // "selfLink": "my_selfLink", + * // "serviceAccountEmail": "my_serviceAccountEmail", + * // "state": "my_state", + * // "timeCreated": "my_timeCreated", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.projects.hmacKeys.update * @memberOf! () * @@ -9346,51 +10536,56 @@ export namespace storage_v1 { * storage.projects.serviceAccount.get * @desc Get the email address of this project's Google Cloud Storage service account. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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'); - * var storage = google.storage('v1'); + * const storage = google.storage('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * 'https://www.googleapis.com/auth/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Project ID - * projectId: 'my-project-id', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * auth: authClient, - * }; + * // Do the magic + * const res = await storage.projects.serviceAccount.get({ + * // Project ID + * projectId: 'placeholder-value', + * // The project to be billed for this request if the target bucket is requester-pays bucket. + * provisionalUserProject: 'placeholder-value', + * // The project to be billed for this request. + * userProject: 'placeholder-value', + * }); + * console.log(res.data); * - * storage.projects.serviceAccount.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "email_address": "my_email_address", + * // "kind": "my_kind" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storage.projects.serviceAccount.get * @memberOf! () * diff --git a/src/apis/storage/v1beta2.ts b/src/apis/storage/v1beta2.ts index 33f74125a44..38f9f0b747b 100644 --- a/src/apis/storage/v1beta2.ts +++ b/src/apis/storage/v1beta2.ts @@ -540,6 +540,43 @@ export namespace storage_v1beta2 { /** * storage.bucketAccessControls.delete * @desc Permanently deletes the ACL entry for the specified entity on the specified bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control'], + * }); + * + * // 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 storage.bucketAccessControls.delete({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.bucketAccessControls.delete * @memberOf! () * @@ -613,6 +650,57 @@ export namespace storage_v1beta2 { /** * storage.bucketAccessControls.get * @desc Returns the ACL entry for the specified entity on the specified bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control'], + * }); + * + * // 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 storage.bucketAccessControls.get({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.bucketAccessControls.get * @memberOf! () * @@ -688,6 +776,72 @@ export namespace storage_v1beta2 { /** * storage.bucketAccessControls.insert * @desc Creates a new ACL entry on the specified bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control'], + * }); + * + * // 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 storage.bucketAccessControls.insert({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.bucketAccessControls.insert * @memberOf! () * @@ -763,6 +917,47 @@ export namespace storage_v1beta2 { /** * storage.bucketAccessControls.list * @desc Retrieves ACL entries on the specified bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control'], + * }); + * + * // 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 storage.bucketAccessControls.list({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.bucketAccessControls.list * @memberOf! () * @@ -839,6 +1034,74 @@ export namespace storage_v1beta2 { /** * storage.bucketAccessControls.patch * @desc Updates an ACL entry on the specified bucket. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control'], + * }); + * + * // 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 storage.bucketAccessControls.patch({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.bucketAccessControls.patch * @memberOf! () * @@ -915,6 +1178,74 @@ export namespace storage_v1beta2 { /** * storage.bucketAccessControls.update * @desc Updates an ACL entry on the specified bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control'], + * }); + * + * // 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 storage.bucketAccessControls.update({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.bucketAccessControls.update * @memberOf! () * @@ -1102,6 +1433,48 @@ export namespace storage_v1beta2 { /** * storage.buckets.delete * @desc Permanently deletes an empty bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 storage.buckets.delete({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.buckets.delete * @memberOf! () * @@ -1175,6 +1548,72 @@ export namespace storage_v1beta2 { /** * storage.buckets.get * @desc Returns metadata for the specified bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 storage.buckets.get({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // Set of properties to return. Defaults to noAcl. + * projection: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "cors": [], + * // "defaultObjectAcl": [], + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifecycle": {}, + * // "location": "my_location", + * // "logging": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "selfLink": "my_selfLink", + * // "storageClass": "my_storageClass", + * // "timeCreated": "my_timeCreated", + * // "versioning": {}, + * // "website": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.buckets.get * @memberOf! () * @@ -1249,6 +1688,91 @@ export namespace storage_v1beta2 { /** * storage.buckets.insert * @desc Creates a new bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 storage.buckets.insert({ + * // A valid API project identifier. + * project: 'placeholder-value', + * // Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full. + * projection: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "acl": [], + * // "cors": [], + * // "defaultObjectAcl": [], + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifecycle": {}, + * // "location": "my_location", + * // "logging": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "selfLink": "my_selfLink", + * // "storageClass": "my_storageClass", + * // "timeCreated": "my_timeCreated", + * // "versioning": {}, + * // "website": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "cors": [], + * // "defaultObjectAcl": [], + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifecycle": {}, + * // "location": "my_location", + * // "logging": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "selfLink": "my_selfLink", + * // "storageClass": "my_storageClass", + * // "timeCreated": "my_timeCreated", + * // "versioning": {}, + * // "website": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.buckets.insert * @memberOf! () * @@ -1319,6 +1843,58 @@ export namespace storage_v1beta2 { /** * storage.buckets.list * @desc Retrieves a list of buckets for a given project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 storage.buckets.list({ + * // Maximum number of buckets to return. + * maxResults: 'placeholder-value', + * // A previously-returned page token representing part of the larger set of results to view. + * pageToken: 'placeholder-value', + * // A valid API project identifier. + * project: 'placeholder-value', + * // Set of properties to return. Defaults to noAcl. + * projection: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.buckets.list * @memberOf! () * @@ -1390,6 +1966,95 @@ export namespace storage_v1beta2 { /** * storage.buckets.patch * @desc Updates a bucket. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 storage.buckets.patch({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // Set of properties to return. Defaults to full. + * projection: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "acl": [], + * // "cors": [], + * // "defaultObjectAcl": [], + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifecycle": {}, + * // "location": "my_location", + * // "logging": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "selfLink": "my_selfLink", + * // "storageClass": "my_storageClass", + * // "timeCreated": "my_timeCreated", + * // "versioning": {}, + * // "website": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "cors": [], + * // "defaultObjectAcl": [], + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifecycle": {}, + * // "location": "my_location", + * // "logging": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "selfLink": "my_selfLink", + * // "storageClass": "my_storageClass", + * // "timeCreated": "my_timeCreated", + * // "versioning": {}, + * // "website": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.buckets.patch * @memberOf! () * @@ -1465,6 +2130,95 @@ export namespace storage_v1beta2 { /** * storage.buckets.update * @desc Updates a bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 storage.buckets.update({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // Set of properties to return. Defaults to full. + * projection: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "acl": [], + * // "cors": [], + * // "defaultObjectAcl": [], + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifecycle": {}, + * // "location": "my_location", + * // "logging": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "selfLink": "my_selfLink", + * // "storageClass": "my_storageClass", + * // "timeCreated": "my_timeCreated", + * // "versioning": {}, + * // "website": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "cors": [], + * // "defaultObjectAcl": [], + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "lifecycle": {}, + * // "location": "my_location", + * // "logging": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "selfLink": "my_selfLink", + * // "storageClass": "my_storageClass", + * // "timeCreated": "my_timeCreated", + * // "versioning": {}, + * // "website": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.buckets.update * @memberOf! () * @@ -1689,6 +2443,59 @@ export namespace storage_v1beta2 { /** * storage.channels.stop * @desc Stop watching resources through this channel + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 storage.channels.stop({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.channels.stop * @memberOf! () * @@ -1779,6 +2586,43 @@ export namespace storage_v1beta2 { /** * storage.defaultObjectAccessControls.delete * @desc Permanently deletes the default object ACL entry for the specified entity on the specified bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control'], + * }); + * + * // 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 storage.defaultObjectAccessControls.delete({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.defaultObjectAccessControls.delete * @memberOf! () * @@ -1851,6 +2695,59 @@ export namespace storage_v1beta2 { /** * storage.defaultObjectAccessControls.get * @desc Returns the default object ACL entry for the specified entity on the specified bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control'], + * }); + * + * // 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 storage.defaultObjectAccessControls.get({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.defaultObjectAccessControls.get * @memberOf! () * @@ -1925,6 +2822,76 @@ export namespace storage_v1beta2 { /** * storage.defaultObjectAccessControls.insert * @desc Creates a new default object ACL entry on the specified bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control'], + * }); + * + * // 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 storage.defaultObjectAccessControls.insert({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.defaultObjectAccessControls.insert * @memberOf! () * @@ -1999,6 +2966,51 @@ export namespace storage_v1beta2 { /** * storage.defaultObjectAccessControls.list * @desc Retrieves default object ACL entries on the specified bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control'], + * }); + * + * // 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 storage.defaultObjectAccessControls.list({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // If present, only return default ACL listing if the bucket's current metageneration matches this value. + * ifMetagenerationMatch: 'placeholder-value', + * // If present, only return default ACL listing if the bucket's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.defaultObjectAccessControls.list * @memberOf! () * @@ -2076,6 +3088,78 @@ export namespace storage_v1beta2 { /** * storage.defaultObjectAccessControls.patch * @desc Updates a default object ACL entry on the specified bucket. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control'], + * }); + * + * // 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 storage.defaultObjectAccessControls.patch({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.defaultObjectAccessControls.patch * @memberOf! () * @@ -2151,6 +3235,78 @@ export namespace storage_v1beta2 { /** * storage.defaultObjectAccessControls.update * @desc Updates a default object ACL entry on the specified bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control'], + * }); + * + * // 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 storage.defaultObjectAccessControls.update({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.defaultObjectAccessControls.update * @memberOf! () * @@ -2345,6 +3501,47 @@ export namespace storage_v1beta2 { /** * storage.objectAccessControls.delete * @desc Permanently deletes the ACL entry for the specified entity on the specified object. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control'], + * }); + * + * // 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 storage.objectAccessControls.delete({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Name of the object. + * object: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.objectAccessControls.delete * @memberOf! () * @@ -2419,6 +3616,63 @@ export namespace storage_v1beta2 { /** * storage.objectAccessControls.get * @desc Returns the ACL entry for the specified entity on the specified object. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control'], + * }); + * + * // 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 storage.objectAccessControls.get({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Name of the object. + * object: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.objectAccessControls.get * @memberOf! () * @@ -2495,6 +3749,80 @@ export namespace storage_v1beta2 { /** * storage.objectAccessControls.insert * @desc Creates a new ACL entry on the specified object. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control'], + * }); + * + * // 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 storage.objectAccessControls.insert({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Name of the object. + * object: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.objectAccessControls.insert * @memberOf! () * @@ -2571,6 +3899,51 @@ export namespace storage_v1beta2 { /** * storage.objectAccessControls.list * @desc Retrieves ACL entries on the specified object. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control'], + * }); + * + * // 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 storage.objectAccessControls.list({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Name of the object. + * object: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.objectAccessControls.list * @memberOf! () * @@ -2648,6 +4021,82 @@ export namespace storage_v1beta2 { /** * storage.objectAccessControls.patch * @desc Updates an ACL entry on the specified object. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control'], + * }); + * + * // 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 storage.objectAccessControls.patch({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Name of the object. + * object: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.objectAccessControls.patch * @memberOf! () * @@ -2725,6 +4174,82 @@ export namespace storage_v1beta2 { /** * storage.objectAccessControls.update * @desc Updates an ACL entry on the specified object. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control'], + * }); + * + * // 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 storage.objectAccessControls.update({ + * // Name of a bucket. + * bucket: 'placeholder-value', + * // The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Name of the object. + * object: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "bucket": "my_bucket", + * // "domain": "my_domain", + * // "email": "my_email", + * // "entity": "my_entity", + * // "entityId": "my_entityId", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "object": "my_object", + * // "role": "my_role", + * // "selfLink": "my_selfLink" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.objectAccessControls.update * @memberOf! () * @@ -2961,6 +4486,88 @@ export namespace storage_v1beta2 { /** * storage.objects.compose * @desc Concatenates a list of existing objects into a new object in the same bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 storage.objects.compose({ + * // Name of the bucket containing the source objects. The destination object is stored in this bucket. + * destinationBucket: 'placeholder-value', + * // Name of the new object. + * destinationObject: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation matches the given value. + * ifGenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "destination": {}, + * // "kind": "my_kind", + * // "sourceObjects": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "timeDeleted": "my_timeDeleted", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.objects.compose * @memberOf! () * @@ -3036,6 +4643,129 @@ export namespace storage_v1beta2 { /** * storage.objects.copy * @desc Copies an object to a destination in the same location. Optionally overrides metadata. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 storage.objects.copy({ + * // Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. + * destinationBucket: 'placeholder-value', + * // Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. + * destinationObject: 'placeholder-value', + * // Makes the operation conditional on whether the destination object's current generation matches the given value. + * ifGenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the destination object's current generation does not match the given value. + * ifGenerationNotMatch: 'placeholder-value', + * // Makes the operation conditional on whether the destination object's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the destination object's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // Makes the operation conditional on whether the source object's generation matches the given value. + * ifSourceGenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the source object's generation does not match the given value. + * ifSourceGenerationNotMatch: 'placeholder-value', + * // Makes the operation conditional on whether the source object's current metageneration matches the given value. + * ifSourceMetagenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the source object's current metageneration does not match the given value. + * ifSourceMetagenerationNotMatch: 'placeholder-value', + * // Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. + * projection: 'placeholder-value', + * // Name of the bucket in which to find the source object. + * sourceBucket: 'placeholder-value', + * // If present, selects a specific revision of the source object (as opposed to the latest version, the default). + * sourceGeneration: 'placeholder-value', + * // Name of the source object. + * sourceObject: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "timeDeleted": "my_timeDeleted", + * // "updated": "my_updated" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "timeDeleted": "my_timeDeleted", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.objects.copy * @memberOf! () * @@ -3131,6 +4861,56 @@ export namespace storage_v1beta2 { /** * storage.objects.delete * @desc Deletes data blobs and associated metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 storage.objects.delete({ + * // Name of the bucket in which the object resides. + * bucket: 'placeholder-value', + * // If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation matches the given value. + * ifGenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation does not match the given value. + * ifGenerationNotMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // Name of the object. + * object: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.objects.delete * @memberOf! () * @@ -3208,6 +4988,87 @@ export namespace storage_v1beta2 { /** * storage.objects.get * @desc Retrieves objects or their associated metadata. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 storage.objects.get({ + * // Name of the bucket in which the object resides. + * bucket: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Makes the operation conditional on whether the object's generation matches the given value. + * ifGenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's generation does not match the given value. + * ifGenerationNotMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // Name of the object. + * object: 'placeholder-value', + * // Set of properties to return. Defaults to noAcl. + * projection: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "timeDeleted": "my_timeDeleted", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.objects.get * @memberOf! () * @@ -3286,6 +5147,119 @@ export namespace storage_v1beta2 { /** * storage.objects.insert * @desc Stores new data blobs and associated metadata. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 storage.objects.insert({ + * // Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. + * bucket: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation matches the given value. + * ifGenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation does not match the given value. + * ifGenerationNotMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. + * name: 'placeholder-value', + * // Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. + * projection: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "timeDeleted": "my_timeDeleted", + * // "updated": "my_updated" + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "timeDeleted": "my_timeDeleted", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.objects.insert * @memberOf! () * @@ -3371,6 +5345,65 @@ export namespace storage_v1beta2 { /** * storage.objects.list * @desc Retrieves a list of objects matching the criteria. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 storage.objects.list({ + * // Name of the bucket in which to look for objects. + * bucket: 'placeholder-value', + * // Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. + * delimiter: 'placeholder-value', + * // Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested. + * maxResults: 'placeholder-value', + * // A previously-returned page token representing part of the larger set of results to view. + * pageToken: 'placeholder-value', + * // Filter results to objects whose names begin with this prefix. + * prefix: 'placeholder-value', + * // Set of properties to return. Defaults to noAcl. + * projection: 'placeholder-value', + * // If true, lists all versions of a file as distinct results. + * versions: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "prefixes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.objects.list * @memberOf! () * @@ -3448,6 +5481,117 @@ export namespace storage_v1beta2 { /** * storage.objects.patch * @desc Updates a data blob's associated metadata. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 storage.objects.patch({ + * // Name of the bucket in which the object resides. + * bucket: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation matches the given value. + * ifGenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation does not match the given value. + * ifGenerationNotMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // Name of the object. + * object: 'placeholder-value', + * // Set of properties to return. Defaults to full. + * projection: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "timeDeleted": "my_timeDeleted", + * // "updated": "my_updated" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "timeDeleted": "my_timeDeleted", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.objects.patch * @memberOf! () * @@ -3527,6 +5671,117 @@ export namespace storage_v1beta2 { /** * storage.objects.update * @desc Updates a data blob's associated metadata. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 storage.objects.update({ + * // Name of the bucket in which the object resides. + * bucket: 'placeholder-value', + * // If present, selects a specific revision of this object (as opposed to the latest version, the default). + * generation: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation matches the given value. + * ifGenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current generation does not match the given value. + * ifGenerationNotMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration matches the given value. + * ifMetagenerationMatch: 'placeholder-value', + * // Makes the operation conditional on whether the object's current metageneration does not match the given value. + * ifMetagenerationNotMatch: 'placeholder-value', + * // Name of the object. + * object: 'placeholder-value', + * // Set of properties to return. Defaults to full. + * projection: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "timeDeleted": "my_timeDeleted", + * // "updated": "my_updated" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acl": [], + * // "bucket": "my_bucket", + * // "cacheControl": "my_cacheControl", + * // "componentCount": 0, + * // "contentDisposition": "my_contentDisposition", + * // "contentEncoding": "my_contentEncoding", + * // "contentLanguage": "my_contentLanguage", + * // "contentType": "my_contentType", + * // "crc32c": "my_crc32c", + * // "etag": "my_etag", + * // "generation": "my_generation", + * // "id": "my_id", + * // "kind": "my_kind", + * // "md5Hash": "my_md5Hash", + * // "mediaLink": "my_mediaLink", + * // "metadata": {}, + * // "metageneration": "my_metageneration", + * // "name": "my_name", + * // "owner": {}, + * // "selfLink": "my_selfLink", + * // "size": "my_size", + * // "storageClass": "my_storageClass", + * // "timeDeleted": "my_timeDeleted", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.objects.update * @memberOf! () * @@ -3606,6 +5861,88 @@ export namespace storage_v1beta2 { /** * storage.objects.watchAll * @desc Watch for changes on all objects in a bucket. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storage.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 storage = google.storage('v1beta2'); + * + * 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/devstorage.full_control', + * 'https://www.googleapis.com/auth/devstorage.read_only', + * 'https://www.googleapis.com/auth/devstorage.read_write', + * ], + * }); + * + * // 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 storage.objects.watchAll({ + * // Name of the bucket in which to look for objects. + * bucket: 'placeholder-value', + * // Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. + * delimiter: 'placeholder-value', + * // Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested. + * maxResults: 'placeholder-value', + * // A previously-returned page token representing part of the larger set of results to view. + * pageToken: 'placeholder-value', + * // Filter results to objects whose names begin with this prefix. + * prefix: 'placeholder-value', + * // Set of properties to return. Defaults to noAcl. + * projection: 'placeholder-value', + * // If true, lists all versions of a file as distinct results. + * versions: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "address": "my_address", + * // "expiration": "my_expiration", + * // "id": "my_id", + * // "kind": "my_kind", + * // "params": {}, + * // "payload": false, + * // "resourceId": "my_resourceId", + * // "resourceUri": "my_resourceUri", + * // "token": "my_token", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storage.objects.watchAll * @memberOf! () * diff --git a/src/apis/storagetransfer/v1.ts b/src/apis/storagetransfer/v1.ts index 20a7c5c957b..f11efbc8238 100644 --- a/src/apis/storagetransfer/v1.ts +++ b/src/apis/storagetransfer/v1.ts @@ -646,52 +646,46 @@ export namespace storagetransfer_v1 { * storagetransfer.googleServiceAccounts.get * @desc Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Cloud Platform Console project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storagetransfer.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'); - * var storagetransfer = google.storagetransfer('v1'); + * const storagetransfer = google.storagetransfer('v1'); * - * authorize(function(authClient) { - * var request = { + * 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/cloud-platform'], + * }); + * + * // 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 storagetransfer.googleServiceAccounts.get({ * // Required. The ID of the Google Cloud Platform Console project that the * // Google service account is associated with. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * projectId: 'placeholder-value', + * }); + * console.log(res.data); * - * storagetransfer.googleServiceAccounts.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "accountEmail": "my_accountEmail" + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storagetransfer.googleServiceAccounts.get * @memberOf! () * @@ -790,52 +784,68 @@ export namespace storagetransfer_v1 { * storagetransfer.transferJobs.create * @desc Creates a transfer job that runs periodically. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storagetransfer.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'); - * var storagetransfer = google.storagetransfer('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, + * const storagetransfer = google.storagetransfer('v1'); * - * auth: authClient, - * }; - * - * storagetransfer.transferJobs.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * 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/cloud-platform'], * }); - * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 storagetransfer.transferJobs.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "creationTime": "my_creationTime", + * // "deletionTime": "my_deletionTime", + * // "description": "my_description", + * // "lastModificationTime": "my_lastModificationTime", + * // "name": "my_name", + * // "notificationConfig": {}, + * // "projectId": "my_projectId", + * // "schedule": {}, + * // "status": "my_status", + * // "transferSpec": {} + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "deletionTime": "my_deletionTime", + * // "description": "my_description", + * // "lastModificationTime": "my_lastModificationTime", + * // "name": "my_name", + * // "notificationConfig": {}, + * // "projectId": "my_projectId", + * // "schedule": {}, + * // "status": "my_status", + * // "transferSpec": {} + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storagetransfer.transferJobs.create * @memberOf! () * @@ -909,51 +919,57 @@ export namespace storagetransfer_v1 { * storagetransfer.transferJobs.get * @desc Gets a transfer job. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storagetransfer.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'); - * var storagetransfer = google.storagetransfer('v1'); + * const storagetransfer = google.storagetransfer('v1'); * - * authorize(function(authClient) { - * var request = { - * // Required. The job to get. - * jobName: 'transferJobs/my-transfer-job', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * storagetransfer.transferJobs.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await storagetransfer.transferJobs.get({ + * // Required. The job to get. + * jobName: 'transferJobs/.*', + * // Required. The ID of the Google Cloud Platform Console project that owns the + * // job. + * projectId: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "deletionTime": "my_deletionTime", + * // "description": "my_description", + * // "lastModificationTime": "my_lastModificationTime", + * // "name": "my_name", + * // "notificationConfig": {}, + * // "projectId": "my_projectId", + * // "schedule": {}, + * // "status": "my_status", + * // "transferSpec": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storagetransfer.transferJobs.get * @memberOf! () * @@ -1027,61 +1043,60 @@ export namespace storagetransfer_v1 { * storagetransfer.transferJobs.list * @desc Lists transfer jobs. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storagetransfer.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'); - * var storagetransfer = google.storagetransfer('v1'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var transferJobsPage = response['transferJobs']; - * if (!transferJobsPage) { - * return; - * } - * for (var i = 0; i < transferJobsPage.length; i++) { - * // TODO: Change code below to process each resource in `transferJobsPage`: - * console.log(JSON.stringify(transferJobsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * storagetransfer.transferJobs.list(request, handlePage); - * } - * }; - * - * storagetransfer.transferJobs.list(request, handlePage); - * }); + * const storagetransfer = google.storagetransfer('v1'); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * 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/cloud-platform'], * }); + * + * // 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 storagetransfer.transferJobs.list({ + * // Required. A list of query parameters specified as JSON text in the form of: + * // {"project_id":"my_project_id", + * // "job_names":["jobid1","jobid2",...], + * // "job_statuses":["status1","status2",...]}. + * // Since `job_names` and `job_statuses` support multiple values, their values + * // must be specified with array notation. `project``_``id` is + * // required. `job_names` and `job_statuses` are optional. The valid values + * // for `job_statuses` are case-insensitive: + * // ENABLED, + * // DISABLED, and + * // DELETED. + * filter: 'placeholder-value', + * // The list page size. The max allowed value is 256. + * pageSize: 'placeholder-value', + * // The list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "transferJobs": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storagetransfer.transferJobs.list * @memberOf! () * @@ -1159,56 +1174,64 @@ export namespace storagetransfer_v1 { * storagetransfer.transferJobs.patch * @desc Updates a transfer job. Updating a job's transfer spec does not affect transfer operations that are running already. Updating a job's schedule is not allowed. **Note:** The job's status field can be modified using this RPC (for example, to set a job's status to DELETED, DISABLED, or ENABLED). * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storagetransfer.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'); - * var storagetransfer = google.storagetransfer('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The name of job to update. - * jobName: 'transferJobs/my-transfer-job', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. - * }, + * const storagetransfer = google.storagetransfer('v1'); * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * storagetransfer.transferJobs.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await storagetransfer.transferJobs.patch({ + * // Required. The name of job to update. + * jobName: 'transferJobs/.*', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "projectId": "my_projectId", + * // "transferJob": {}, + * // "updateTransferJobFieldMask": "my_updateTransferJobFieldMask" + * // } + * }, * }); + * console.log(res.data); + * + * // Example response + * // { + * // "creationTime": "my_creationTime", + * // "deletionTime": "my_deletionTime", + * // "description": "my_description", + * // "lastModificationTime": "my_lastModificationTime", + * // "name": "my_name", + * // "notificationConfig": {}, + * // "projectId": "my_projectId", + * // "schedule": {}, + * // "status": "my_status", + * // "transferSpec": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storagetransfer.transferJobs.patch * @memberOf! () * @@ -1355,48 +1378,43 @@ export namespace storagetransfer_v1 { * storagetransfer.transferOperations.cancel * @desc Cancels a transfer. Use the get method to check whether the cancellation succeeded or whether the operation completed despite cancellation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storagetransfer.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'); - * var storagetransfer = google.storagetransfer('v1'); + * const storagetransfer = google.storagetransfer('v1'); * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource to be cancelled. - * name: 'transferOperations/my-transfer-operation', // TODO: Update placeholder value. + * 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/cloud-platform'], + * }); * - * auth: authClient, - * }; + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * storagetransfer.transferOperations.cancel(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } + * // Do the magic + * const res = await storagetransfer.transferOperations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'transferOperations/.*', * }); - * }); + * console.log(res.data); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); + * // Example response + * // {} * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storagetransfer.transferOperations.cancel * @memberOf! () * @@ -1468,51 +1486,49 @@ export namespace storagetransfer_v1 { * storagetransfer.transferOperations.get * @desc 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. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storagetransfer.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'); - * var storagetransfer = google.storagetransfer('v1'); + * const storagetransfer = google.storagetransfer('v1'); * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource. - * name: 'transferOperations/my-transfer-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * 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/cloud-platform'], + * }); * - * storagetransfer.transferOperations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await storagetransfer.transferOperations.get({ + * // The name of the operation resource. + * name: 'transferOperations/.*', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storagetransfer.transferOperations.get * @memberOf! () * @@ -1586,64 +1602,56 @@ export namespace storagetransfer_v1 { * storagetransfer.transferOperations.list * @desc Lists transfer operations. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storagetransfer.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'); - * var storagetransfer = google.storagetransfer('v1'); + * const storagetransfer = google.storagetransfer('v1'); * - * authorize(function(authClient) { - * var request = { - * // Required. The value `transferOperations`. - * name: 'transferOperations', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var operationsPage = response['operations']; - * if (!operationsPage) { - * return; - * } - * for (var i = 0; i < operationsPage.length; i++) { - * // TODO: Change code below to process each resource in `operationsPage`: - * console.log(JSON.stringify(operationsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * storagetransfer.transferOperations.list(request, handlePage); - * } - * }; - * - * storagetransfer.transferOperations.list(request, handlePage); - * }); + * 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/cloud-platform'], + * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // 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 storagetransfer.transferOperations.list({ + * // Required. A list of query parameters specified as JSON text in the form of: {"project_id":"my_project_id", + * // "job_names":["jobid1","jobid2",...], + * // "operation_names":["opid1","opid2",...], + * // "transfer_statuses":["status1","status2",...]}. + * // Since `job_names`, `operation_names`, and `transfer_statuses` support multiple values, they must be specified with array notation. `project``_``id` is required. `job_names`, `operation_names`, and `transfer_statuses` are optional. The valid values for `transfer_statuses` are case-insensitive: IN_PROGRESS, PAUSED, SUCCESS, FAILED, and ABORTED. + * filter: 'placeholder-value', + * // Required. The value `transferOperations`. + * name: 'transferOperations', + * // The list page size. The max allowed value is 256. + * pageSize: 'placeholder-value', + * // The list page token. + * pageToken: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias storagetransfer.transferOperations.list * @memberOf! () * @@ -1722,52 +1730,49 @@ export namespace storagetransfer_v1 { * storagetransfer.transferOperations.pause * @desc Pauses a transfer operation. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storagetransfer.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'); - * var storagetransfer = google.storagetransfer('v1'); + * const storagetransfer = google.storagetransfer('v1'); * - * authorize(function(authClient) { - * var request = { + * 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/cloud-platform'], + * }); + * + * // 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 storagetransfer.transferOperations.pause({ * // Required. The name of the transfer operation. - * name: 'transferOperations/my-transfer-operation', // TODO: Update placeholder value. + * name: 'transferOperations/.*', * - * resource: { - * // TODO: Add desired properties to the request body. + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * storagetransfer.transferOperations.pause(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storagetransfer.transferOperations.pause * @memberOf! () * @@ -1840,52 +1845,49 @@ export namespace storagetransfer_v1 { * storagetransfer.transferOperations.resume * @desc Resumes a transfer operation that is paused. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/storagetransfer.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'); - * var storagetransfer = google.storagetransfer('v1'); + * const storagetransfer = google.storagetransfer('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/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await storagetransfer.transferOperations.resume({ * // Required. The name of the transfer operation. - * name: 'transferOperations/my-transfer-operation', // TODO: Update placeholder value. + * name: 'transferOperations/.*', * - * resource: { - * // TODO: Add desired properties to the request body. + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * storagetransfer.transferOperations.resume(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias storagetransfer.transferOperations.resume * @memberOf! () * diff --git a/src/apis/streetviewpublish/v1.ts b/src/apis/streetviewpublish/v1.ts index 6b602688c77..e144ac3569e 100644 --- a/src/apis/streetviewpublish/v1.ts +++ b/src/apis/streetviewpublish/v1.ts @@ -411,6 +411,73 @@ export namespace streetviewpublish_v1 { /** * streetviewpublish.photo.create * @desc After the client finishes uploading the photo with the returned UploadRef, CreatePhoto publishes the uploaded Photo to Street View on Google Maps. Currently, the only way to set heading, pitch, and roll in CreatePhoto is through the [Photo Sphere XMP metadata](https://developers.google.com/streetview/spherical-metadata) in the photo bytes. CreatePhoto ignores the `pose.heading`, `pose.pitch`, `pose.roll`, `pose.altitude`, and `pose.level` fields in Pose. This method returns the following error codes: * google.rpc.Code.INVALID_ARGUMENT if the request is malformed or if the uploaded photo is not a 360 photo. * google.rpc.Code.NOT_FOUND if the upload reference does not exist. * google.rpc.Code.RESOURCE_EXHAUSTED if the account has reached the storage limit. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/streetviewpublish.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 streetviewpublish = google.streetviewpublish('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/streetviewpublish'], + * }); + * + * // 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 streetviewpublish.photo.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "captureTime": "my_captureTime", + * // "connections": [], + * // "downloadUrl": "my_downloadUrl", + * // "mapsPublishStatus": "my_mapsPublishStatus", + * // "photoId": {}, + * // "places": [], + * // "pose": {}, + * // "shareLink": "my_shareLink", + * // "thumbnailUrl": "my_thumbnailUrl", + * // "transferStatus": "my_transferStatus", + * // "uploadReference": {}, + * // "viewCount": "my_viewCount" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "captureTime": "my_captureTime", + * // "connections": [], + * // "downloadUrl": "my_downloadUrl", + * // "mapsPublishStatus": "my_mapsPublishStatus", + * // "photoId": {}, + * // "places": [], + * // "pose": {}, + * // "shareLink": "my_shareLink", + * // "thumbnailUrl": "my_thumbnailUrl", + * // "transferStatus": "my_transferStatus", + * // "uploadReference": {}, + * // "viewCount": "my_viewCount" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias streetviewpublish.photo.create * @memberOf! () * @@ -480,6 +547,44 @@ export namespace streetviewpublish_v1 { /** * streetviewpublish.photo.delete * @desc Deletes a Photo and its metadata. This method returns the following error codes: * google.rpc.Code.PERMISSION_DENIED if the requesting user did not create the requested photo. * google.rpc.Code.NOT_FOUND if the photo ID does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/streetviewpublish.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 streetviewpublish = google.streetviewpublish('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/streetviewpublish'], + * }); + * + * // 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 streetviewpublish.photo.delete({ + * // Required. ID of the Photo. + * photoId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias streetviewpublish.photo.delete * @memberOf! () * @@ -552,6 +657,66 @@ export namespace streetviewpublish_v1 { /** * streetviewpublish.photo.get * @desc Gets the metadata of the specified Photo. This method returns the following error codes: * google.rpc.Code.PERMISSION_DENIED if the requesting user did not create the requested Photo. * google.rpc.Code.NOT_FOUND if the requested Photo does not exist. * google.rpc.Code.UNAVAILABLE if the requested Photo is still being indexed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/streetviewpublish.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 streetviewpublish = google.streetviewpublish('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/streetviewpublish'], + * }); + * + * // 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 streetviewpublish.photo.get({ + * // The BCP-47 language code, such as "en-US" or "sr-Latn". For more + * // information, see + * // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * // If language_code is unspecified, the user's language preference for Google + * // services is used. + * languageCode: 'placeholder-value', + * // Required. ID of the Photo. + * photoId: 'placeholder-value', + * // Required. Specifies if a download URL for the photo bytes should be returned in the + * // Photo response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "captureTime": "my_captureTime", + * // "connections": [], + * // "downloadUrl": "my_downloadUrl", + * // "mapsPublishStatus": "my_mapsPublishStatus", + * // "photoId": {}, + * // "places": [], + * // "pose": {}, + * // "shareLink": "my_shareLink", + * // "thumbnailUrl": "my_thumbnailUrl", + * // "transferStatus": "my_transferStatus", + * // "uploadReference": {}, + * // "viewCount": "my_viewCount" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias streetviewpublish.photo.get * @memberOf! () * @@ -626,6 +791,49 @@ export namespace streetviewpublish_v1 { /** * streetviewpublish.photo.startUpload * @desc Creates an upload session to start uploading photo bytes. The method uses the upload URL of the returned UploadRef to upload the bytes for the Photo. In addition to the photo requirements shown in https://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604, the photo must meet the following requirements: * Photo Sphere XMP metadata must be included in the photo metadata. See https://developers.google.com/streetview/spherical-metadata for the required fields. * The pixel size of the photo must meet the size requirements listed in https://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604, and the photo must be a full 360 horizontally. After the upload completes, the method uses UploadRef with CreatePhoto to create the Photo object entry. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/streetviewpublish.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 streetviewpublish = google.streetviewpublish('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/streetviewpublish'], + * }); + * + * // 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 streetviewpublish.photo.startUpload({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "uploadUrl": "my_uploadUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias streetviewpublish.photo.startUpload * @memberOf! () * @@ -701,6 +909,103 @@ export namespace streetviewpublish_v1 { /** * streetviewpublish.photo.update * @desc Updates the metadata of a Photo, such as pose, place association, connections, etc. Changing the pixels of a photo is not supported. Only the fields specified in the updateMask field are used. If `updateMask` is not present, the update applies to all fields. This method returns the following error codes: * google.rpc.Code.PERMISSION_DENIED if the requesting user did not create the requested photo. * google.rpc.Code.INVALID_ARGUMENT if the request is malformed. * google.rpc.Code.NOT_FOUND if the requested photo does not exist. * google.rpc.Code.UNAVAILABLE if the requested Photo is still being indexed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/streetviewpublish.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 streetviewpublish = google.streetviewpublish('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/streetviewpublish'], + * }); + * + * // 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 streetviewpublish.photo.update({ + * // Required. A unique identifier for a photo. + * id: 'placeholder-value', + * // Required. Mask that identifies fields on the photo metadata to update. + * // If not present, the old Photo + * // metadata is entirely replaced with the + * // new Photo metadata in this request. + * // The update fails if invalid fields are specified. Multiple fields can be + * // specified in a comma-delimited list. + * // + * // The following fields are valid: + * // + * // * `pose.heading` + * // * `pose.latLngPair` + * // * `pose.pitch` + * // * `pose.roll` + * // * `pose.level` + * // * `pose.altitude` + * // * `connections` + * // * `places` + * // + * // + * // + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "captureTime": "my_captureTime", + * // "connections": [], + * // "downloadUrl": "my_downloadUrl", + * // "mapsPublishStatus": "my_mapsPublishStatus", + * // "photoId": {}, + * // "places": [], + * // "pose": {}, + * // "shareLink": "my_shareLink", + * // "thumbnailUrl": "my_thumbnailUrl", + * // "transferStatus": "my_transferStatus", + * // "uploadReference": {}, + * // "viewCount": "my_viewCount" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "captureTime": "my_captureTime", + * // "connections": [], + * // "downloadUrl": "my_downloadUrl", + * // "mapsPublishStatus": "my_mapsPublishStatus", + * // "photoId": {}, + * // "places": [], + * // "pose": {}, + * // "shareLink": "my_shareLink", + * // "thumbnailUrl": "my_thumbnailUrl", + * // "transferStatus": "my_transferStatus", + * // "uploadReference": {}, + * // "viewCount": "my_viewCount" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias streetviewpublish.photo.update * @memberOf! () * @@ -853,6 +1158,51 @@ export namespace streetviewpublish_v1 { /** * streetviewpublish.photos.batchDelete * @desc Deletes a list of Photos and their metadata. Note that if BatchDeletePhotos fails, either critical fields are missing or there is an authentication error. Even if BatchDeletePhotos succeeds, individual photos in the batch may have failures. These failures are specified in each PhotoResponse.status in BatchDeletePhotosResponse.results. See DeletePhoto for specific failures that can occur per photo. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/streetviewpublish.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 streetviewpublish = google.streetviewpublish('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/streetviewpublish'], + * }); + * + * // 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 streetviewpublish.photos.batchDelete({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "photoIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "status": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias streetviewpublish.photos.batchDelete * @memberOf! () * @@ -935,6 +1285,57 @@ export namespace streetviewpublish_v1 { /** * streetviewpublish.photos.batchGet * @desc Gets the metadata of the specified Photo batch. Note that if BatchGetPhotos fails, either critical fields are missing or there is an authentication error. Even if BatchGetPhotos succeeds, individual photos in the batch may have failures. These failures are specified in each PhotoResponse.status in BatchGetPhotosResponse.results. See GetPhoto for specific failures that can occur per photo. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/streetviewpublish.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 streetviewpublish = google.streetviewpublish('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/streetviewpublish'], + * }); + * + * // 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 streetviewpublish.photos.batchGet({ + * // The BCP-47 language code, such as "en-US" or "sr-Latn". For more + * // information, see + * // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * // If language_code is unspecified, the user's language preference for Google + * // services is used. + * languageCode: 'placeholder-value', + * // Required. IDs of the Photos. For HTTP + * // GET requests, the URL query parameter should be + * // `photoIds=&photoIds=&...`. + * photoIds: 'placeholder-value', + * // Required. Specifies if a download URL for the photo bytes should be returned in the + * // Photo response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "results": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias streetviewpublish.photos.batchGet * @memberOf! () * @@ -1015,6 +1416,51 @@ export namespace streetviewpublish_v1 { /** * streetviewpublish.photos.batchUpdate * @desc Updates the metadata of Photos, such as pose, place association, connections, etc. Changing the pixels of photos is not supported. Note that if BatchUpdatePhotos fails, either critical fields are missing or there is an authentication error. Even if BatchUpdatePhotos succeeds, individual photos in the batch may have failures. These failures are specified in each PhotoResponse.status in BatchUpdatePhotosResponse.results. See UpdatePhoto for specific failures that can occur per photo. Only the fields specified in updateMask field are used. If `updateMask` is not present, the update applies to all fields. The number of UpdatePhotoRequest messages in a BatchUpdatePhotosRequest must not exceed 20. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/streetviewpublish.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 streetviewpublish = google.streetviewpublish('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/streetviewpublish'], + * }); + * + * // 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 streetviewpublish.photos.batchUpdate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "updatePhotoRequests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "results": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias streetviewpublish.photos.batchUpdate * @memberOf! () * @@ -1097,6 +1543,70 @@ export namespace streetviewpublish_v1 { /** * streetviewpublish.photos.list * @desc Lists all the Photos that belong to the user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/streetviewpublish.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 streetviewpublish = google.streetviewpublish('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/streetviewpublish'], + * }); + * + * // 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 streetviewpublish.photos.list({ + * // Required. The filter expression. For example: `placeId=ChIJj61dQgK6j4AR4GeTYWZsKWw`. + * // + * // The only filter supported at the moment is `placeId`. + * filter: 'placeholder-value', + * // The BCP-47 language code, such as "en-US" or "sr-Latn". For more + * // information, see + * // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * // If language_code is unspecified, the user's language preference for Google + * // services is used. + * languageCode: 'placeholder-value', + * // The maximum number of photos to return. + * // `pageSize` must be non-negative. If `pageSize` is zero or is not provided, + * // the default page size of 100 is used. + * // The number of photos returned in the response may be less than `pageSize` + * // if the number of photos that belong to the user is less than `pageSize`. + * pageSize: 'placeholder-value', + * // The + * // nextPageToken + * // value returned from a previous + * // ListPhotos + * // request, if any. + * pageToken: 'placeholder-value', + * // Required. Specifies if a download URL for the photos bytes should be returned in the + * // Photos response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "photos": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias streetviewpublish.photos.list * @memberOf! () * diff --git a/src/apis/tagmanager/v1.ts b/src/apis/tagmanager/v1.ts index 8d84a05ded6..26de2cdc437 100644 --- a/src/apis/tagmanager/v1.ts +++ b/src/apis/tagmanager/v1.ts @@ -981,6 +981,53 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.get * @desc Gets a GTM Account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.manage.accounts', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.get({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "shareData": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.get * @memberOf! () * @@ -1052,6 +1099,47 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.list * @desc Lists all GTM Accounts that a user has access to. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.manage.accounts', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.list({}); + * console.log(res.data); + * + * // Example response + * // { + * // "accounts": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.list * @memberOf! () * @@ -1126,6 +1214,63 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.update * @desc Updates a GTM Account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.manage.accounts'], + * }); + * + * // 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 tagmanager.accounts.update({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // When provided, this fingerprint must match the fingerprint of the account + * // in storage. + * fingerprint: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "shareData": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "shareData": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.update * @memberOf! () * @@ -1266,6 +1411,74 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.create * @desc Creates a Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.create({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "domainName": [], + * // "enabledBuiltInVariable": [], + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "notes": "my_notes", + * // "publicId": "my_publicId", + * // "timeZoneCountryId": "my_timeZoneCountryId", + * // "timeZoneId": "my_timeZoneId", + * // "usageContext": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "domainName": [], + * // "enabledBuiltInVariable": [], + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "notes": "my_notes", + * // "publicId": "my_publicId", + * // "timeZoneCountryId": "my_timeZoneCountryId", + * // "timeZoneId": "my_timeZoneId", + * // "usageContext": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.create * @memberOf! () * @@ -1340,6 +1553,43 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.delete * @desc Deletes a Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.delete.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.delete({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.delete * @memberOf! () * @@ -1413,6 +1663,61 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.get * @desc Gets a Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.get({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "domainName": [], + * // "enabledBuiltInVariable": [], + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "notes": "my_notes", + * // "publicId": "my_publicId", + * // "timeZoneCountryId": "my_timeZoneCountryId", + * // "timeZoneId": "my_timeZoneId", + * // "usageContext": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.get * @memberOf! () * @@ -1488,6 +1793,49 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.list * @desc Lists all Containers that belongs to a GTM Account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.list({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "containers": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.list * @memberOf! () * @@ -1563,6 +1911,79 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.update * @desc Updates a Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.update({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // When provided, this fingerprint must match the fingerprint of the + * // container in storage. + * fingerprint: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "domainName": [], + * // "enabledBuiltInVariable": [], + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "notes": "my_notes", + * // "publicId": "my_publicId", + * // "timeZoneCountryId": "my_timeZoneCountryId", + * // "timeZoneId": "my_timeZoneId", + * // "usageContext": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "domainName": [], + * // "enabledBuiltInVariable": [], + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "notes": "my_notes", + * // "publicId": "my_publicId", + * // "timeZoneCountryId": "my_timeZoneCountryId", + * // "timeZoneId": "my_timeZoneId", + * // "usageContext": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.update * @memberOf! () * @@ -1734,6 +2155,78 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.environments.create * @desc Creates a GTM Environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.environments.create({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "authorizationCode": "my_authorizationCode", + * // "authorizationTimestampMs": "my_authorizationTimestampMs", + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "description": "my_description", + * // "enableDebug": false, + * // "environmentId": "my_environmentId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "type": "my_type", + * // "url": "my_url" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "authorizationCode": "my_authorizationCode", + * // "authorizationTimestampMs": "my_authorizationTimestampMs", + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "description": "my_description", + * // "enableDebug": false, + * // "environmentId": "my_environmentId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "type": "my_type", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.environments.create * @memberOf! () * @@ -1810,6 +2303,45 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.environments.delete * @desc Deletes a GTM Environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.environments.delete({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // The GTM Environment ID. + * environmentId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.environments.delete * @memberOf! () * @@ -1884,6 +2416,64 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.environments.get * @desc Gets a GTM Environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.environments.get({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // The GTM Environment ID. + * environmentId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "authorizationCode": "my_authorizationCode", + * // "authorizationTimestampMs": "my_authorizationTimestampMs", + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "description": "my_description", + * // "enableDebug": false, + * // "environmentId": "my_environmentId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "type": "my_type", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.environments.get * @memberOf! () * @@ -1960,6 +2550,51 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.environments.list * @desc Lists all GTM Environments of a GTM Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.environments.list({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "environments": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.environments.list * @memberOf! () * @@ -2037,6 +2672,83 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.environments.update * @desc Updates a GTM Environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.environments.update({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // The GTM Environment ID. + * environmentId: 'placeholder-value', + * // When provided, this fingerprint must match the fingerprint of the + * // environment in storage. + * fingerprint: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "authorizationCode": "my_authorizationCode", + * // "authorizationTimestampMs": "my_authorizationTimestampMs", + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "description": "my_description", + * // "enableDebug": false, + * // "environmentId": "my_environmentId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "type": "my_type", + * // "url": "my_url" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "authorizationCode": "my_authorizationCode", + * // "authorizationTimestampMs": "my_authorizationTimestampMs", + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "description": "my_description", + * // "enableDebug": false, + * // "environmentId": "my_environmentId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "type": "my_type", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.environments.update * @memberOf! () * @@ -2233,6 +2945,64 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.folders.create * @desc Creates a GTM Folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.folders.create({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "folderId": "my_folderId", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "folderId": "my_folderId", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.folders.create * @memberOf! () * @@ -2307,6 +3077,45 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.folders.delete * @desc Deletes a GTM Folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.folders.delete({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // The GTM Folder ID. + * folderId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.folders.delete * @memberOf! () * @@ -2381,6 +3190,57 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.folders.get * @desc Gets a GTM Folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.folders.get({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // The GTM Folder ID. + * folderId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "folderId": "my_folderId", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.folders.get * @memberOf! () * @@ -2455,6 +3315,51 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.folders.list * @desc Lists all GTM Folders of a Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.folders.list({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "folders": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.folders.list * @memberOf! () * @@ -2530,6 +3435,69 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.folders.update * @desc Updates a GTM Folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.folders.update({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // When provided, this fingerprint must match the fingerprint of the folder in + * // storage. + * fingerprint: 'placeholder-value', + * // The GTM Folder ID. + * folderId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "folderId": "my_folderId", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "folderId": "my_folderId", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.folders.update * @memberOf! () * @@ -2720,6 +3688,55 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.folders.entities.list * @desc List all entities in a GTM Folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.folders.entities.list({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // The GTM Folder ID. + * folderId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "tag": [], + * // "trigger": [], + * // "variable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.folders.entities.list * @memberOf! () * @@ -2824,6 +3841,63 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.move_folders.update * @desc Moves entities to a GTM Folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.move_folders.update({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // The GTM Folder ID. + * folderId: 'placeholder-value', + * // The tags to be moved to the folder. + * tagId: 'placeholder-value', + * // The triggers to be moved to the folder. + * triggerId: 'placeholder-value', + * // The variables to be moved to the folder. + * variableId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "folderId": "my_folderId", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.move_folders.update * @memberOf! () * @@ -2947,6 +4021,82 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.reauthorize_environments.update * @desc Re-generates the authorization code for a GTM Environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.publish'], + * }); + * + * // 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 tagmanager.accounts.containers.reauthorize_environments.update( + * { + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // The GTM Environment ID. + * environmentId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "authorizationCode": "my_authorizationCode", + * // "authorizationTimestampMs": "my_authorizationTimestampMs", + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "description": "my_description", + * // "enableDebug": false, + * // "environmentId": "my_environmentId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "type": "my_type", + * // "url": "my_url" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "authorizationCode": "my_authorizationCode", + * // "authorizationTimestampMs": "my_authorizationTimestampMs", + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "description": "my_description", + * // "enableDebug": false, + * // "environmentId": "my_environmentId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "type": "my_type", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.reauthorize_environments.update * @memberOf! () * @@ -3057,6 +4207,96 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.tags.create * @desc Creates a GTM Tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.tags.create({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "blockingRuleId": [], + * // "blockingTriggerId": [], + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "firingRuleId": [], + * // "firingTriggerId": [], + * // "liveOnly": false, + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "paused": false, + * // "priority": {}, + * // "scheduleEndMs": "my_scheduleEndMs", + * // "scheduleStartMs": "my_scheduleStartMs", + * // "setupTag": [], + * // "tagFiringOption": "my_tagFiringOption", + * // "tagId": "my_tagId", + * // "teardownTag": [], + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "blockingRuleId": [], + * // "blockingTriggerId": [], + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "firingRuleId": [], + * // "firingTriggerId": [], + * // "liveOnly": false, + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "paused": false, + * // "priority": {}, + * // "scheduleEndMs": "my_scheduleEndMs", + * // "scheduleStartMs": "my_scheduleStartMs", + * // "setupTag": [], + * // "tagFiringOption": "my_tagFiringOption", + * // "tagId": "my_tagId", + * // "teardownTag": [], + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.tags.create * @memberOf! () * @@ -3131,6 +4371,45 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.tags.delete * @desc Deletes a GTM Tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.tags.delete({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // The GTM Tag ID. + * tagId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.tags.delete * @memberOf! () * @@ -3205,6 +4484,73 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.tags.get * @desc Gets a GTM Tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.tags.get({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // The GTM Tag ID. + * tagId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "blockingRuleId": [], + * // "blockingTriggerId": [], + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "firingRuleId": [], + * // "firingTriggerId": [], + * // "liveOnly": false, + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "paused": false, + * // "priority": {}, + * // "scheduleEndMs": "my_scheduleEndMs", + * // "scheduleStartMs": "my_scheduleStartMs", + * // "setupTag": [], + * // "tagFiringOption": "my_tagFiringOption", + * // "tagId": "my_tagId", + * // "teardownTag": [], + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.tags.get * @memberOf! () * @@ -3279,6 +4625,51 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.tags.list * @desc Lists all GTM Tags of a Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.tags.list({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "tags": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.tags.list * @memberOf! () * @@ -3354,6 +4745,101 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.tags.update * @desc Updates a GTM Tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.tags.update({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // When provided, this fingerprint must match the fingerprint of the tag in + * // storage. + * fingerprint: 'placeholder-value', + * // The GTM Tag ID. + * tagId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "blockingRuleId": [], + * // "blockingTriggerId": [], + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "firingRuleId": [], + * // "firingTriggerId": [], + * // "liveOnly": false, + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "paused": false, + * // "priority": {}, + * // "scheduleEndMs": "my_scheduleEndMs", + * // "scheduleStartMs": "my_scheduleStartMs", + * // "setupTag": [], + * // "tagFiringOption": "my_tagFiringOption", + * // "tagId": "my_tagId", + * // "teardownTag": [], + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "blockingRuleId": [], + * // "blockingTriggerId": [], + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "firingRuleId": [], + * // "firingTriggerId": [], + * // "liveOnly": false, + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "paused": false, + * // "priority": {}, + * // "scheduleEndMs": "my_scheduleEndMs", + * // "scheduleStartMs": "my_scheduleStartMs", + * // "setupTag": [], + * // "tagFiringOption": "my_tagFiringOption", + * // "tagId": "my_tagId", + * // "teardownTag": [], + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.tags.update * @memberOf! () * @@ -3544,6 +5030,110 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.triggers.create * @desc Creates a GTM Trigger. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.triggers.create({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "autoEventFilter": [], + * // "checkValidation": {}, + * // "containerId": "my_containerId", + * // "continuousTimeMinMilliseconds": {}, + * // "customEventFilter": [], + * // "eventName": {}, + * // "filter": [], + * // "fingerprint": "my_fingerprint", + * // "horizontalScrollPercentageList": {}, + * // "interval": {}, + * // "intervalSeconds": {}, + * // "limit": {}, + * // "maxTimerLengthSeconds": {}, + * // "name": "my_name", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "selector": {}, + * // "totalTimeMinMilliseconds": {}, + * // "triggerId": "my_triggerId", + * // "type": "my_type", + * // "uniqueTriggerId": {}, + * // "verticalScrollPercentageList": {}, + * // "visibilitySelector": {}, + * // "visiblePercentageMax": {}, + * // "visiblePercentageMin": {}, + * // "waitForTags": {}, + * // "waitForTagsTimeout": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "autoEventFilter": [], + * // "checkValidation": {}, + * // "containerId": "my_containerId", + * // "continuousTimeMinMilliseconds": {}, + * // "customEventFilter": [], + * // "eventName": {}, + * // "filter": [], + * // "fingerprint": "my_fingerprint", + * // "horizontalScrollPercentageList": {}, + * // "interval": {}, + * // "intervalSeconds": {}, + * // "limit": {}, + * // "maxTimerLengthSeconds": {}, + * // "name": "my_name", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "selector": {}, + * // "totalTimeMinMilliseconds": {}, + * // "triggerId": "my_triggerId", + * // "type": "my_type", + * // "uniqueTriggerId": {}, + * // "verticalScrollPercentageList": {}, + * // "visibilitySelector": {}, + * // "visiblePercentageMax": {}, + * // "visiblePercentageMin": {}, + * // "waitForTags": {}, + * // "waitForTagsTimeout": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.triggers.create * @memberOf! () * @@ -3618,6 +5208,45 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.triggers.delete * @desc Deletes a GTM Trigger. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.triggers.delete({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // The GTM Trigger ID. + * triggerId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.triggers.delete * @memberOf! () * @@ -3692,6 +5321,80 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.triggers.get * @desc Gets a GTM Trigger. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.triggers.get({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // The GTM Trigger ID. + * triggerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "autoEventFilter": [], + * // "checkValidation": {}, + * // "containerId": "my_containerId", + * // "continuousTimeMinMilliseconds": {}, + * // "customEventFilter": [], + * // "eventName": {}, + * // "filter": [], + * // "fingerprint": "my_fingerprint", + * // "horizontalScrollPercentageList": {}, + * // "interval": {}, + * // "intervalSeconds": {}, + * // "limit": {}, + * // "maxTimerLengthSeconds": {}, + * // "name": "my_name", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "selector": {}, + * // "totalTimeMinMilliseconds": {}, + * // "triggerId": "my_triggerId", + * // "type": "my_type", + * // "uniqueTriggerId": {}, + * // "verticalScrollPercentageList": {}, + * // "visibilitySelector": {}, + * // "visiblePercentageMax": {}, + * // "visiblePercentageMin": {}, + * // "waitForTags": {}, + * // "waitForTagsTimeout": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.triggers.get * @memberOf! () * @@ -3766,6 +5469,51 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.triggers.list * @desc Lists all GTM Triggers of a Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.triggers.list({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "triggers": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.triggers.list * @memberOf! () * @@ -3843,6 +5591,115 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.triggers.update * @desc Updates a GTM Trigger. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.triggers.update({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // When provided, this fingerprint must match the fingerprint of the trigger + * // in storage. + * fingerprint: 'placeholder-value', + * // The GTM Trigger ID. + * triggerId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "autoEventFilter": [], + * // "checkValidation": {}, + * // "containerId": "my_containerId", + * // "continuousTimeMinMilliseconds": {}, + * // "customEventFilter": [], + * // "eventName": {}, + * // "filter": [], + * // "fingerprint": "my_fingerprint", + * // "horizontalScrollPercentageList": {}, + * // "interval": {}, + * // "intervalSeconds": {}, + * // "limit": {}, + * // "maxTimerLengthSeconds": {}, + * // "name": "my_name", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "selector": {}, + * // "totalTimeMinMilliseconds": {}, + * // "triggerId": "my_triggerId", + * // "type": "my_type", + * // "uniqueTriggerId": {}, + * // "verticalScrollPercentageList": {}, + * // "visibilitySelector": {}, + * // "visiblePercentageMax": {}, + * // "visiblePercentageMin": {}, + * // "waitForTags": {}, + * // "waitForTagsTimeout": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "autoEventFilter": [], + * // "checkValidation": {}, + * // "containerId": "my_containerId", + * // "continuousTimeMinMilliseconds": {}, + * // "customEventFilter": [], + * // "eventName": {}, + * // "filter": [], + * // "fingerprint": "my_fingerprint", + * // "horizontalScrollPercentageList": {}, + * // "interval": {}, + * // "intervalSeconds": {}, + * // "limit": {}, + * // "maxTimerLengthSeconds": {}, + * // "name": "my_name", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "selector": {}, + * // "totalTimeMinMilliseconds": {}, + * // "triggerId": "my_triggerId", + * // "type": "my_type", + * // "uniqueTriggerId": {}, + * // "verticalScrollPercentageList": {}, + * // "visibilitySelector": {}, + * // "visiblePercentageMax": {}, + * // "visiblePercentageMin": {}, + * // "waitForTags": {}, + * // "waitForTagsTimeout": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.triggers.update * @memberOf! () * @@ -4033,6 +5890,80 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.variables.create * @desc Creates a GTM Variable. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.variables.create({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "disablingTriggerId": [], + * // "enablingTriggerId": [], + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "scheduleEndMs": "my_scheduleEndMs", + * // "scheduleStartMs": "my_scheduleStartMs", + * // "type": "my_type", + * // "variableId": "my_variableId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "disablingTriggerId": [], + * // "enablingTriggerId": [], + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "scheduleEndMs": "my_scheduleEndMs", + * // "scheduleStartMs": "my_scheduleStartMs", + * // "type": "my_type", + * // "variableId": "my_variableId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.variables.create * @memberOf! () * @@ -4107,6 +6038,45 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.variables.delete * @desc Deletes a GTM Variable. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.variables.delete({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // The GTM Variable ID. + * variableId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.variables.delete * @memberOf! () * @@ -4181,6 +6151,65 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.variables.get * @desc Gets a GTM Variable. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.variables.get({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // The GTM Variable ID. + * variableId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "disablingTriggerId": [], + * // "enablingTriggerId": [], + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "scheduleEndMs": "my_scheduleEndMs", + * // "scheduleStartMs": "my_scheduleStartMs", + * // "type": "my_type", + * // "variableId": "my_variableId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.variables.get * @memberOf! () * @@ -4255,6 +6284,51 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.variables.list * @desc Lists all GTM Variables of a Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.variables.list({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "variables": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.variables.list * @memberOf! () * @@ -4332,6 +6406,85 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.variables.update * @desc Updates a GTM Variable. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.variables.update({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // When provided, this fingerprint must match the fingerprint of the variable + * // in storage. + * fingerprint: 'placeholder-value', + * // The GTM Variable ID. + * variableId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "disablingTriggerId": [], + * // "enablingTriggerId": [], + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "scheduleEndMs": "my_scheduleEndMs", + * // "scheduleStartMs": "my_scheduleStartMs", + * // "type": "my_type", + * // "variableId": "my_variableId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "disablingTriggerId": [], + * // "enablingTriggerId": [], + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "scheduleEndMs": "my_scheduleEndMs", + * // "scheduleStartMs": "my_scheduleStartMs", + * // "type": "my_type", + * // "variableId": "my_variableId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.variables.update * @memberOf! () * @@ -4522,6 +6675,61 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.versions.create * @desc Creates a Container Version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containerversions', + * ], + * }); + * + * // 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 tagmanager.accounts.containers.versions.create({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name", + * // "notes": "my_notes", + * // "quickPreview": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "compilerError": false, + * // "containerVersion": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.versions.create * @memberOf! () * @@ -4607,6 +6815,47 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.versions.delete * @desc Deletes a Container Version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containerversions', + * ], + * }); + * + * // 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 tagmanager.accounts.containers.versions.delete({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // The GTM Container Version ID. + * containerVersionId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.versions.delete * @memberOf! () * @@ -4681,6 +6930,68 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.versions.get * @desc Gets a Container Version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.edit.containerversions', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.versions.get({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // The GTM Container Version ID. Specify published to retrieve + * // the currently published version. + * containerVersionId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "container": {}, + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "deleted": false, + * // "fingerprint": "my_fingerprint", + * // "folder": [], + * // "macro": [], + * // "name": "my_name", + * // "notes": "my_notes", + * // "rule": [], + * // "tag": [], + * // "trigger": [], + * // "variable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.versions.get * @memberOf! () * @@ -4757,6 +7068,57 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.versions.list * @desc Lists all Container Versions of a GTM Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.edit.containerversions', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.versions.list({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // Retrieve headers only when true. + * headers: 'placeholder-value', + * // Also retrieve deleted (archived) versions when true. + * includeDeleted: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "containerVersion": [], + * // "containerVersionHeader": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.versions.list * @memberOf! () * @@ -4843,6 +7205,54 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.versions.publish * @desc Publishes a Container Version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.publish'], + * }); + * + * // 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 tagmanager.accounts.containers.versions.publish({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // The GTM Container Version ID. + * containerVersionId: 'placeholder-value', + * // When provided, this fingerprint must match the fingerprint of the + * // container version in storage. + * fingerprint: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "compilerError": false, + * // "containerVersion": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.versions.publish * @memberOf! () * @@ -4929,6 +7339,63 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.versions.restore * @desc Restores a Container Version. This will overwrite the container's current configuration (including its variables, triggers and tags). The operation will not have any effect on the version that is being served (i.e. the published version). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.versions.restore({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // The GTM Container Version ID. + * containerVersionId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "container": {}, + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "deleted": false, + * // "fingerprint": "my_fingerprint", + * // "folder": [], + * // "macro": [], + * // "name": "my_name", + * // "notes": "my_notes", + * // "rule": [], + * // "tag": [], + * // "trigger": [], + * // "variable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.versions.restore * @memberOf! () * @@ -5005,6 +7472,65 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.versions.undelete * @desc Undeletes a Container Version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containerversions', + * ], + * }); + * + * // 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 tagmanager.accounts.containers.versions.undelete({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // The GTM Container Version ID. + * containerVersionId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "container": {}, + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "deleted": false, + * // "fingerprint": "my_fingerprint", + * // "folder": [], + * // "macro": [], + * // "name": "my_name", + * // "notes": "my_notes", + * // "rule": [], + * // "tag": [], + * // "trigger": [], + * // "variable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.versions.undelete * @memberOf! () * @@ -5081,6 +7607,89 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.containers.versions.update * @desc Updates a Container Version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.edit.containerversions', + * ], + * }); + * + * // 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 tagmanager.accounts.containers.versions.update({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM Container ID. + * containerId: 'placeholder-value', + * // The GTM Container Version ID. + * containerVersionId: 'placeholder-value', + * // When provided, this fingerprint must match the fingerprint of the + * // container version in storage. + * fingerprint: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "container": {}, + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "deleted": false, + * // "fingerprint": "my_fingerprint", + * // "folder": [], + * // "macro": [], + * // "name": "my_name", + * // "notes": "my_notes", + * // "rule": [], + * // "tag": [], + * // "trigger": [], + * // "variable": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "container": {}, + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "deleted": false, + * // "fingerprint": "my_fingerprint", + * // "folder": [], + * // "macro": [], + * // "name": "my_name", + * // "notes": "my_notes", + * // "rule": [], + * // "tag": [], + * // "trigger": [], + * // "variable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.versions.update * @memberOf! () * @@ -5345,6 +7954,62 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.permissions.create * @desc Creates a user's Account & Container Permissions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.manage.users'], + * }); + * + * // 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 tagmanager.accounts.permissions.create({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountAccess": {}, + * // "accountId": "my_accountId", + * // "containerAccess": [], + * // "emailAddress": "my_emailAddress", + * // "permissionId": "my_permissionId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountAccess": {}, + * // "accountId": "my_accountId", + * // "containerAccess": [], + * // "emailAddress": "my_emailAddress", + * // "permissionId": "my_permissionId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.permissions.create * @memberOf! () * @@ -5419,6 +8084,43 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.permissions.delete * @desc Removes a user from the account, revoking access to it and all of its containers. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.manage.users'], + * }); + * + * // 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 tagmanager.accounts.permissions.delete({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM User ID. + * permissionId: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.permissions.delete * @memberOf! () * @@ -5492,6 +8194,52 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.permissions.get * @desc Gets a user's Account & Container Permissions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.manage.users'], + * }); + * + * // 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 tagmanager.accounts.permissions.get({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM User ID. + * permissionId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountAccess": {}, + * // "accountId": "my_accountId", + * // "containerAccess": [], + * // "emailAddress": "my_emailAddress", + * // "permissionId": "my_permissionId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.permissions.get * @memberOf! () * @@ -5567,6 +8315,46 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.permissions.list * @desc List all users that have access to the account along with Account and Container Permissions granted to each of them. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.manage.users'], + * }); + * + * // 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 tagmanager.accounts.permissions.list({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "userAccess": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.permissions.list * @memberOf! () * @@ -5642,6 +8430,64 @@ export namespace tagmanager_v1 { /** * tagmanager.accounts.permissions.update * @desc Updates a user's Account & Container Permissions. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('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/tagmanager.manage.users'], + * }); + * + * // 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 tagmanager.accounts.permissions.update({ + * // The GTM Account ID. + * accountId: 'placeholder-value', + * // The GTM User ID. + * permissionId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountAccess": {}, + * // "accountId": "my_accountId", + * // "containerAccess": [], + * // "emailAddress": "my_emailAddress", + * // "permissionId": "my_permissionId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountAccess": {}, + * // "accountId": "my_accountId", + * // "containerAccess": [], + * // "emailAddress": "my_emailAddress", + * // "permissionId": "my_permissionId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.permissions.update * @memberOf! () * diff --git a/src/apis/tagmanager/v2.ts b/src/apis/tagmanager/v2.ts index ccc69948f08..7afa669a6c3 100644 --- a/src/apis/tagmanager/v2.ts +++ b/src/apis/tagmanager/v2.ts @@ -1563,6 +1563,56 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.get * @desc Gets a GTM Account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.manage.accounts', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.get({ + * // GTM Accounts's API relative path. + * // Example: accounts/{account_id} + * path: 'accounts/my-account', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "path": "my_path", + * // "shareData": false, + * // "tagManagerUrl": "my_tagManagerUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.get * @memberOf! () * @@ -1634,6 +1684,51 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.list * @desc Lists all GTM Accounts that a user has access to. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.manage.accounts', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.list({ + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "account": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.list * @memberOf! () * @@ -1709,6 +1804,68 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.update * @desc Updates a GTM Account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.manage.accounts'], + * }); + * + * // 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 tagmanager.accounts.update({ + * // When provided, this fingerprint must match the fingerprint of the account + * // in storage. + * fingerprint: 'placeholder-value', + * // GTM Accounts's API relative path. + * // Example: accounts/{account_id} + * path: 'accounts/my-account', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "path": "my_path", + * // "shareData": false, + * // "tagManagerUrl": "my_tagManagerUrl" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "path": "my_path", + * // "shareData": false, + * // "tagManagerUrl": "my_tagManagerUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.update * @memberOf! () * @@ -1846,6 +2003,73 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.create * @desc Creates a Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.create({ + * // GTM Account's API relative path. + * // Example: accounts/{account_id}. + * parent: 'accounts/my-account', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "domainName": [], + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "notes": "my_notes", + * // "path": "my_path", + * // "publicId": "my_publicId", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "usageContext": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "domainName": [], + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "notes": "my_notes", + * // "path": "my_path", + * // "publicId": "my_publicId", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "usageContext": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.create * @memberOf! () * @@ -1921,6 +2145,42 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.delete * @desc Deletes a Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.delete.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.delete({ + * // GTM Container's API relative path. + * // Example: accounts/{account_id}/containers/{container_id} + * path: 'accounts/my-account/containers/my-container', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.delete * @memberOf! () * @@ -1993,6 +2253,59 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.get * @desc Gets a Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.get({ + * // GTM Container's API relative path. + * // Example: accounts/{account_id}/containers/{container_id} + * path: 'accounts/my-account/containers/my-container', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "domainName": [], + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "notes": "my_notes", + * // "path": "my_path", + * // "publicId": "my_publicId", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "usageContext": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.get * @memberOf! () * @@ -2067,6 +2380,53 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.list * @desc Lists all Containers that belongs to a GTM Account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.list({ + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // GTM Accounts's API relative path. + * // Example: accounts/{account_id}. + * parent: 'accounts/my-account', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "container": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.list * @memberOf! () * @@ -2144,6 +2504,76 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.update * @desc Updates a Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.update({ + * // When provided, this fingerprint must match the fingerprint of the + * // container in storage. + * fingerprint: 'placeholder-value', + * // GTM Container's API relative path. + * // Example: accounts/{account_id}/containers/{container_id} + * path: 'accounts/my-account/containers/my-container', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "domainName": [], + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "notes": "my_notes", + * // "path": "my_path", + * // "publicId": "my_publicId", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "usageContext": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "domainName": [], + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "notes": "my_notes", + * // "path": "my_path", + * // "publicId": "my_publicId", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "usageContext": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.update * @memberOf! () * @@ -2306,6 +2736,83 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.environments.create * @desc Creates a GTM Environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.environments.create({ + * // GTM Container's API relative path. + * // Example: accounts/{account_id}/containers/{container_id} + * parent: 'accounts/my-account/containers/my-container', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "authorizationCode": "my_authorizationCode", + * // "authorizationTimestamp": "my_authorizationTimestamp", + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "description": "my_description", + * // "enableDebug": false, + * // "environmentId": "my_environmentId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "type": "my_type", + * // "url": "my_url", + * // "workspaceId": "my_workspaceId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "authorizationCode": "my_authorizationCode", + * // "authorizationTimestamp": "my_authorizationTimestamp", + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "description": "my_description", + * // "enableDebug": false, + * // "environmentId": "my_environmentId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "type": "my_type", + * // "url": "my_url", + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.environments.create * @memberOf! () * @@ -2381,6 +2888,44 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.environments.delete * @desc Deletes a GTM Environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.environments.delete({ + * // GTM Environment's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/environments/{environment_id} + * path: + * 'accounts/my-account/containers/my-container/environments/my-environment', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.environments.delete * @memberOf! () * @@ -2453,6 +2998,66 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.environments.get * @desc Gets a GTM Environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.environments.get({ + * // GTM Environment's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/environments/{environment_id} + * path: + * 'accounts/my-account/containers/my-container/environments/my-environment', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "authorizationCode": "my_authorizationCode", + * // "authorizationTimestamp": "my_authorizationTimestamp", + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "description": "my_description", + * // "enableDebug": false, + * // "environmentId": "my_environmentId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "type": "my_type", + * // "url": "my_url", + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.environments.get * @memberOf! () * @@ -2527,6 +3132,53 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.environments.list * @desc Lists all GTM Environments of a GTM Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.environments.list({ + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // GTM Container's API relative path. + * // Example: accounts/{account_id}/containers/{container_id} + * parent: 'accounts/my-account/containers/my-container', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "environment": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.environments.list * @memberOf! () * @@ -2604,6 +3256,85 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.environments.reauthorize * @desc Re-generates the authorization code for a GTM Environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.publish'], + * }); + * + * // 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 tagmanager.accounts.containers.environments.reauthorize({ + * // GTM Environment's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/environments/{environment_id} + * path: + * 'accounts/my-account/containers/my-container/environments/my-environment', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "authorizationCode": "my_authorizationCode", + * // "authorizationTimestamp": "my_authorizationTimestamp", + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "description": "my_description", + * // "enableDebug": false, + * // "environmentId": "my_environmentId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "type": "my_type", + * // "url": "my_url", + * // "workspaceId": "my_workspaceId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "authorizationCode": "my_authorizationCode", + * // "authorizationTimestamp": "my_authorizationTimestamp", + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "description": "my_description", + * // "enableDebug": false, + * // "environmentId": "my_environmentId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "type": "my_type", + * // "url": "my_url", + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.environments.reauthorize * @memberOf! () * @@ -2679,6 +3410,88 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.environments.update * @desc Updates a GTM Environment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.environments.update({ + * // When provided, this fingerprint must match the fingerprint of the + * // environment in storage. + * fingerprint: 'placeholder-value', + * // GTM Environment's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/environments/{environment_id} + * path: + * 'accounts/my-account/containers/my-container/environments/my-environment', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "authorizationCode": "my_authorizationCode", + * // "authorizationTimestamp": "my_authorizationTimestamp", + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "description": "my_description", + * // "enableDebug": false, + * // "environmentId": "my_environmentId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "type": "my_type", + * // "url": "my_url", + * // "workspaceId": "my_workspaceId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "authorizationCode": "my_authorizationCode", + * // "authorizationTimestamp": "my_authorizationTimestamp", + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "description": "my_description", + * // "enableDebug": false, + * // "environmentId": "my_environmentId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "type": "my_type", + * // "url": "my_url", + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.environments.update * @memberOf! () * @@ -2858,6 +3671,45 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.versions.delete * @desc Deletes a Container Version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containerversions', + * ], + * }); + * + * // 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 tagmanager.accounts.containers.versions.delete({ + * // GTM ContainerVersion's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/versions/{version_id} + * path: 'accounts/my-account/containers/my-container/versions/my-version', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.versions.delete * @memberOf! () * @@ -2930,6 +3782,72 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.versions.get * @desc Gets a Container Version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.edit.containerversions', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.versions.get({ + * // The GTM ContainerVersion ID. Specify published to retrieve + * // the currently published version. + * containerVersionId: 'placeholder-value', + * // GTM ContainerVersion's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/versions/{version_id} + * path: 'accounts/my-account/containers/my-container/versions/my-version', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "builtInVariable": [], + * // "client": [], + * // "container": {}, + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "customTemplate": [], + * // "deleted": false, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "folder": [], + * // "name": "my_name", + * // "path": "my_path", + * // "tag": [], + * // "tagManagerUrl": "my_tagManagerUrl", + * // "trigger": [], + * // "variable": [], + * // "zone": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.versions.get * @memberOf! () * @@ -3005,6 +3923,67 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.versions.live * @desc Gets the live (i.e. published) container version + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.versions.live({ + * // GTM Container's API relative path. + * // Example: accounts/{account_id}/containers/{container_id} + * parent: 'accounts/my-account/containers/my-container', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "builtInVariable": [], + * // "client": [], + * // "container": {}, + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "customTemplate": [], + * // "deleted": false, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "folder": [], + * // "name": "my_name", + * // "path": "my_path", + * // "tag": [], + * // "tagManagerUrl": "my_tagManagerUrl", + * // "trigger": [], + * // "variable": [], + * // "zone": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.versions.live * @memberOf! () * @@ -3079,6 +4058,52 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.versions.publish * @desc Publishes a Container Version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.publish'], + * }); + * + * // 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 tagmanager.accounts.containers.versions.publish({ + * // When provided, this fingerprint must match the fingerprint of the + * // container version in storage. + * fingerprint: 'placeholder-value', + * // GTM ContainerVersion's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/versions/{version_id} + * path: 'accounts/my-account/containers/my-container/versions/my-version', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "compilerError": false, + * // "containerVersion": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.versions.publish * @memberOf! () * @@ -3163,6 +4188,65 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.versions.set_latest * @desc Sets the latest version used for synchronization of workspaces when detecting conflicts and errors. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.versions.set_latest({ + * // GTM ContainerVersion's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/versions/{version_id} + * path: 'accounts/my-account/containers/my-container/versions/my-version', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "builtInVariable": [], + * // "client": [], + * // "container": {}, + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "customTemplate": [], + * // "deleted": false, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "folder": [], + * // "name": "my_name", + * // "path": "my_path", + * // "tag": [], + * // "tagManagerUrl": "my_tagManagerUrl", + * // "trigger": [], + * // "variable": [], + * // "zone": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.versions.set_latest * @memberOf! () * @@ -3237,6 +4321,67 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.versions.undelete * @desc Undeletes a Container Version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containerversions', + * ], + * }); + * + * // 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 tagmanager.accounts.containers.versions.undelete({ + * // GTM ContainerVersion's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/versions/{version_id} + * path: 'accounts/my-account/containers/my-container/versions/my-version', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "builtInVariable": [], + * // "client": [], + * // "container": {}, + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "customTemplate": [], + * // "deleted": false, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "folder": [], + * // "name": "my_name", + * // "path": "my_path", + * // "tag": [], + * // "tagManagerUrl": "my_tagManagerUrl", + * // "trigger": [], + * // "variable": [], + * // "zone": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.versions.undelete * @memberOf! () * @@ -3311,6 +4456,95 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.versions.update * @desc Updates a Container Version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containerversions', + * ], + * }); + * + * // 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 tagmanager.accounts.containers.versions.update({ + * // When provided, this fingerprint must match the fingerprint of the + * // container version in storage. + * fingerprint: 'placeholder-value', + * // GTM ContainerVersion's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/versions/{version_id} + * path: 'accounts/my-account/containers/my-container/versions/my-version', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "builtInVariable": [], + * // "client": [], + * // "container": {}, + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "customTemplate": [], + * // "deleted": false, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "folder": [], + * // "name": "my_name", + * // "path": "my_path", + * // "tag": [], + * // "tagManagerUrl": "my_tagManagerUrl", + * // "trigger": [], + * // "variable": [], + * // "zone": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "builtInVariable": [], + * // "client": [], + * // "container": {}, + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "customTemplate": [], + * // "deleted": false, + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "folder": [], + * // "name": "my_name", + * // "path": "my_path", + * // "tag": [], + * // "tagManagerUrl": "my_tagManagerUrl", + * // "trigger": [], + * // "variable": [], + * // "zone": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.versions.update * @memberOf! () * @@ -3496,6 +4730,62 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.version_headers.latest * @desc Gets the latest container version header + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.version_headers.latest({ + * // GTM Container's API relative path. + * // Example: accounts/{account_id}/containers/{container_id} + * parent: 'accounts/my-account/containers/my-container', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "containerVersionId": "my_containerVersionId", + * // "deleted": false, + * // "name": "my_name", + * // "numCustomTemplates": "my_numCustomTemplates", + * // "numMacros": "my_numMacros", + * // "numRules": "my_numRules", + * // "numTags": "my_numTags", + * // "numTriggers": "my_numTriggers", + * // "numVariables": "my_numVariables", + * // "numZones": "my_numZones", + * // "path": "my_path" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.version_headers.latest * @memberOf! () * @@ -3571,6 +4861,56 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.version_headers.list * @desc Lists all Container Versions of a GTM Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.edit.containerversions', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.version_headers.list({ + * // Also retrieve deleted (archived) versions when true. + * includeDeleted: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // GTM Container's API relative path. + * // Example: accounts/{account_id}/containers/{container_id} + * parent: 'accounts/my-account/containers/my-container', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "containerVersionHeader": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.version_headers.list * @memberOf! () * @@ -3724,6 +5064,69 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.create * @desc Creates a Workspace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.create({ + * // GTM parent Container's API relative path. + * // Example: accounts/{account_id}/containers/{container_id} + * parent: 'accounts/my-account/containers/my-container', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "workspaceId": "my_workspaceId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.create * @memberOf! () * @@ -3799,6 +5202,62 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.create_version * @desc Creates a Container Version from the entities present in the workspace, deletes the workspace, and sets the base container version to the newly created version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containerversions', + * ], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.create_version({ + * // GTM Workspace's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * path: 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "name": "my_name", + * // "notes": "my_notes" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "compilerError": false, + * // "containerVersion": {}, + * // "newWorkspacePath": "my_newWorkspacePath", + * // "syncStatus": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.create_version * @memberOf! () * @@ -3883,6 +5342,43 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.delete * @desc Deletes a Workspace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.delete.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.delete({ + * // GTM Workspace's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * path: 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.delete * @memberOf! () * @@ -3955,6 +5451,58 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.get * @desc Gets a Workspace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.workspaces.get({ + * // GTM Workspace's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * path: 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.get * @memberOf! () * @@ -4029,6 +5577,52 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.getStatus * @desc Finds conflicting and modified entities in the workspace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.workspaces.getStatus({ + * // GTM Workspace's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * path: 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "mergeConflict": [], + * // "workspaceChange": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.getStatus * @memberOf! () * @@ -4110,6 +5704,53 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.list * @desc Lists all Workspaces that belong to a GTM Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.workspaces.list({ + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // GTM parent Container's API relative path. + * // Example: accounts/{account_id}/containers/{container_id} + * parent: 'accounts/my-account/containers/my-container', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "workspace": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.list * @memberOf! () * @@ -4187,6 +5828,52 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.quick_preview * @desc Quick previews a workspace by creating a fake container version from all entities in the provided workspace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containerversions', + * ], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.quick_preview({ + * // GTM Workspace's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * path: 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "compilerError": false, + * // "containerVersion": {}, + * // "syncStatus": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.quick_preview * @memberOf! () * @@ -4265,6 +5952,58 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.resolve_conflict * @desc Resolves a merge conflict for a workspace entity by updating it to the resolved entity passed in the request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.resolve_conflict({ + * // When provided, this fingerprint must match the fingerprint of the + * // entity_in_workspace in the merge conflict. + * fingerprint: 'placeholder-value', + * // GTM Workspace's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * path: 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "changeStatus": "my_changeStatus", + * // "folder": {}, + * // "tag": {}, + * // "trigger": {}, + * // "variable": {} + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.resolve_conflict * @memberOf! () * @@ -4339,6 +6078,49 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.sync * @desc Syncs a workspace to the latest container version by updating all unmodified workspace entities and displaying conflicts for modified entities. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.sync({ + * // GTM Workspace's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * path: 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "mergeConflict": [], + * // "syncStatus": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.sync * @memberOf! () * @@ -4415,6 +6197,73 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.update * @desc Updates a Workspace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.update({ + * // When provided, this fingerprint must match the fingerprint of the + * // workspace in storage. + * fingerprint: 'placeholder-value', + * // GTM Workspace's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * path: 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "workspaceId": "my_workspaceId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "description": "my_description", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.update * @memberOf! () * @@ -4651,6 +6500,53 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.built_in_variables.create * @desc Creates one or more GTM Built-In Variables. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.built_in_variables.create( + * { + * // GTM Workspace's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * parent: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * // The types of built-in variables to enable. + * type: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "builtInVariable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.built_in_variables.create * @memberOf! () * @@ -4734,6 +6630,48 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.built_in_variables.delete * @desc Deletes one or more GTM Built-In Variables. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.built_in_variables.delete( + * { + * // GTM BuiltInVariable's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/built_in_variables', + * // The types of built-in variables to delete. + * type: 'placeholder-value', + * } + * ); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.built_in_variables.delete * @memberOf! () * @@ -4807,6 +6745,57 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.built_in_variables.list * @desc Lists all the enabled Built-In Variables of a GTM Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.workspaces.built_in_variables.list( + * { + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // GTM Workspace's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * parent: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "builtInVariable": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.built_in_variables.list * @memberOf! () * @@ -4892,6 +6881,53 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.built_in_variables.revert * @desc Reverts changes to a GTM Built-In Variables in a GTM Workspace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.built_in_variables.revert( + * { + * // GTM BuiltInVariable's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * // The type of built-in variable to revert. + * type: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "enabled": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.built_in_variables.revert * @memberOf! () * @@ -5047,6 +7083,73 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.folders.create * @desc Creates a GTM Folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.folders.create({ + * // GTM Workspace's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * parent: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "folderId": "my_folderId", + * // "name": "my_name", + * // "notes": "my_notes", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "workspaceId": "my_workspaceId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "folderId": "my_folderId", + * // "name": "my_name", + * // "notes": "my_notes", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.folders.create * @memberOf! () * @@ -5120,6 +7223,44 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.folders.delete * @desc Deletes a GTM Folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.folders.delete({ + * // GTM Folder's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/folders/my-folder', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.folders.delete * @memberOf! () * @@ -5192,6 +7333,57 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.folders.entities * @desc List all entities in a GTM Folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.workspaces.folders.entities({ + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // GTM Folder's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/folders/my-folder', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "tag": [], + * // "trigger": [], + * // "variable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.folders.entities * @memberOf! () * @@ -5267,6 +7459,60 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.folders.get * @desc Gets a GTM Folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.workspaces.folders.get({ + * // GTM Folder's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/folders/my-folder', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "folderId": "my_folderId", + * // "name": "my_name", + * // "notes": "my_notes", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.folders.get * @memberOf! () * @@ -5339,6 +7585,55 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.folders.list * @desc Lists all GTM Folders of a Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.workspaces.folders.list({ + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // GTM Workspace's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * parent: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "folder": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.folders.list * @memberOf! () * @@ -5414,6 +7709,68 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.folders.move_entities_to_folder * @desc Moves entities to a GTM Folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.folders.move_entities_to_folder( + * { + * // GTM Folder's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/folders/my-folder', + * // The tags to be moved to the folder. + * tagId: 'placeholder-value', + * // The triggers to be moved to the folder. + * triggerId: 'placeholder-value', + * // The variables to be moved to the folder. + * variableId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "folderId": "my_folderId", + * // "name": "my_name", + * // "notes": "my_notes", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "workspaceId": "my_workspaceId" + * // } + * }, + * } + * ); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.folders.move_entities_to_folder * @memberOf! () * @@ -5489,6 +7846,52 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.folders.revert * @desc Reverts changes to a GTM Folder in a GTM Workspace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.folders.revert({ + * // When provided, this fingerprint must match the fingerprint of the tag + * // in storage. + * fingerprint: 'placeholder-value', + * // GTM Folder's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/folders/my-folder', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "folder": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.folders.revert * @memberOf! () * @@ -5566,6 +7969,76 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.folders.update * @desc Updates a GTM Folder. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.folders.update({ + * // When provided, this fingerprint must match the fingerprint of the folder in + * // storage. + * fingerprint: 'placeholder-value', + * // GTM Folder's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/folders/my-folder', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "folderId": "my_folderId", + * // "name": "my_name", + * // "notes": "my_notes", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "workspaceId": "my_workspaceId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "folderId": "my_folderId", + * // "name": "my_name", + * // "notes": "my_notes", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.folders.update * @memberOf! () * @@ -5787,6 +8260,107 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.tags.create * @desc Creates a GTM Tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.tags.create({ + * // GTM Workspace's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * parent: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "blockingRuleId": [], + * // "blockingTriggerId": [], + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "firingRuleId": [], + * // "firingTriggerId": [], + * // "liveOnly": false, + * // "monitoringMetadata": {}, + * // "monitoringMetadataTagNameKey": "my_monitoringMetadataTagNameKey", + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "path": "my_path", + * // "paused": false, + * // "priority": {}, + * // "scheduleEndMs": "my_scheduleEndMs", + * // "scheduleStartMs": "my_scheduleStartMs", + * // "setupTag": [], + * // "tagFiringOption": "my_tagFiringOption", + * // "tagId": "my_tagId", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "teardownTag": [], + * // "type": "my_type", + * // "workspaceId": "my_workspaceId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "blockingRuleId": [], + * // "blockingTriggerId": [], + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "firingRuleId": [], + * // "firingTriggerId": [], + * // "liveOnly": false, + * // "monitoringMetadata": {}, + * // "monitoringMetadataTagNameKey": "my_monitoringMetadataTagNameKey", + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "path": "my_path", + * // "paused": false, + * // "priority": {}, + * // "scheduleEndMs": "my_scheduleEndMs", + * // "scheduleStartMs": "my_scheduleStartMs", + * // "setupTag": [], + * // "tagFiringOption": "my_tagFiringOption", + * // "tagId": "my_tagId", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "teardownTag": [], + * // "type": "my_type", + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.tags.create * @memberOf! () * @@ -5860,6 +8434,44 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.tags.delete * @desc Deletes a GTM Tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.tags.delete({ + * // GTM Tag's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/tags/my-tag', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.tags.delete * @memberOf! () * @@ -5932,6 +8544,77 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.tags.get * @desc Gets a GTM Tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.workspaces.tags.get({ + * // GTM Tag's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/tags/my-tag', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "blockingRuleId": [], + * // "blockingTriggerId": [], + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "firingRuleId": [], + * // "firingTriggerId": [], + * // "liveOnly": false, + * // "monitoringMetadata": {}, + * // "monitoringMetadataTagNameKey": "my_monitoringMetadataTagNameKey", + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "path": "my_path", + * // "paused": false, + * // "priority": {}, + * // "scheduleEndMs": "my_scheduleEndMs", + * // "scheduleStartMs": "my_scheduleStartMs", + * // "setupTag": [], + * // "tagFiringOption": "my_tagFiringOption", + * // "tagId": "my_tagId", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "teardownTag": [], + * // "type": "my_type", + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.tags.get * @memberOf! () * @@ -6004,6 +8687,55 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.tags.list * @desc Lists all GTM Tags of a Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.workspaces.tags.list({ + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // GTM Workspace's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * parent: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "tag": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.tags.list * @memberOf! () * @@ -6079,6 +8811,52 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.tags.revert * @desc Reverts changes to a GTM Tag in a GTM Workspace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.tags.revert({ + * // When provided, this fingerprint must match the fingerprint of thetag + * // in storage. + * fingerprint: 'placeholder-value', + * // GTM Tag's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/tags/my-tag', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "tag": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.tags.revert * @memberOf! () * @@ -6154,6 +8932,110 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.tags.update * @desc Updates a GTM Tag. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.tags.update({ + * // When provided, this fingerprint must match the fingerprint of the tag in + * // storage. + * fingerprint: 'placeholder-value', + * // GTM Tag's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/tags/my-tag', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "blockingRuleId": [], + * // "blockingTriggerId": [], + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "firingRuleId": [], + * // "firingTriggerId": [], + * // "liveOnly": false, + * // "monitoringMetadata": {}, + * // "monitoringMetadataTagNameKey": "my_monitoringMetadataTagNameKey", + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "path": "my_path", + * // "paused": false, + * // "priority": {}, + * // "scheduleEndMs": "my_scheduleEndMs", + * // "scheduleStartMs": "my_scheduleStartMs", + * // "setupTag": [], + * // "tagFiringOption": "my_tagFiringOption", + * // "tagId": "my_tagId", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "teardownTag": [], + * // "type": "my_type", + * // "workspaceId": "my_workspaceId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "blockingRuleId": [], + * // "blockingTriggerId": [], + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "firingRuleId": [], + * // "firingTriggerId": [], + * // "liveOnly": false, + * // "monitoringMetadata": {}, + * // "monitoringMetadataTagNameKey": "my_monitoringMetadataTagNameKey", + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "path": "my_path", + * // "paused": false, + * // "priority": {}, + * // "scheduleEndMs": "my_scheduleEndMs", + * // "scheduleStartMs": "my_scheduleStartMs", + * // "setupTag": [], + * // "tagFiringOption": "my_tagFiringOption", + * // "tagId": "my_tagId", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "teardownTag": [], + * // "type": "my_type", + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.tags.update * @memberOf! () * @@ -6330,6 +9212,75 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.templates.create * @desc Creates a GTM Custom Template. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.templates.create({ + * // GTM Workspace's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * parent: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "galleryReference": {}, + * // "name": "my_name", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "templateData": "my_templateData", + * // "templateId": "my_templateId", + * // "workspaceId": "my_workspaceId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "galleryReference": {}, + * // "name": "my_name", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "templateData": "my_templateData", + * // "templateId": "my_templateId", + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.templates.create * @memberOf! () * @@ -6405,6 +9356,44 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.templates.delete * @desc Deletes a GTM Template. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.templates.delete({ + * // GTM Custom Template's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/templates/my-template', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.templates.delete * @memberOf! () * @@ -6477,6 +9466,61 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.templates.get * @desc Gets a GTM Template. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.workspaces.templates.get({ + * // GTM Custom Template's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/templates/my-template', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "galleryReference": {}, + * // "name": "my_name", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "templateData": "my_templateData", + * // "templateId": "my_templateId", + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.templates.get * @memberOf! () * @@ -6551,6 +9595,55 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.templates.list * @desc Lists all GTM Templates of a GTM container workspace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.workspaces.templates.list({ + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // GTM Workspace's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * parent: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "template": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.templates.list * @memberOf! () * @@ -6628,6 +9721,52 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.templates.revert * @desc Reverts changes to a GTM Template in a GTM Workspace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.templates.revert({ + * // When provided, this fingerprint must match the fingerprint of the template + * // in storage. + * fingerprint: 'placeholder-value', + * // GTM Custom Template's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/templates/my-template', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "template": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.templates.revert * @memberOf! () * @@ -6705,6 +9844,78 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.templates.update * @desc Updates a GTM Template. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.templates.update({ + * // When provided, this fingerprint must match the fingerprint of the templates + * // in storage. + * fingerprint: 'placeholder-value', + * // GTM Custom Template's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/templates/my-template', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "galleryReference": {}, + * // "name": "my_name", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "templateData": "my_templateData", + * // "templateId": "my_templateId", + * // "workspaceId": "my_workspaceId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "galleryReference": {}, + * // "name": "my_name", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "templateData": "my_templateData", + * // "templateId": "my_templateId", + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.templates.update * @memberOf! () * @@ -6883,6 +10094,119 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.triggers.create * @desc Creates a GTM Trigger. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.triggers.create({ + * // GTM Workspaces's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * parent: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "autoEventFilter": [], + * // "checkValidation": {}, + * // "containerId": "my_containerId", + * // "continuousTimeMinMilliseconds": {}, + * // "customEventFilter": [], + * // "eventName": {}, + * // "filter": [], + * // "fingerprint": "my_fingerprint", + * // "horizontalScrollPercentageList": {}, + * // "interval": {}, + * // "intervalSeconds": {}, + * // "limit": {}, + * // "maxTimerLengthSeconds": {}, + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "path": "my_path", + * // "selector": {}, + * // "tagManagerUrl": "my_tagManagerUrl", + * // "totalTimeMinMilliseconds": {}, + * // "triggerId": "my_triggerId", + * // "type": "my_type", + * // "uniqueTriggerId": {}, + * // "verticalScrollPercentageList": {}, + * // "visibilitySelector": {}, + * // "visiblePercentageMax": {}, + * // "visiblePercentageMin": {}, + * // "waitForTags": {}, + * // "waitForTagsTimeout": {}, + * // "workspaceId": "my_workspaceId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "autoEventFilter": [], + * // "checkValidation": {}, + * // "containerId": "my_containerId", + * // "continuousTimeMinMilliseconds": {}, + * // "customEventFilter": [], + * // "eventName": {}, + * // "filter": [], + * // "fingerprint": "my_fingerprint", + * // "horizontalScrollPercentageList": {}, + * // "interval": {}, + * // "intervalSeconds": {}, + * // "limit": {}, + * // "maxTimerLengthSeconds": {}, + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "path": "my_path", + * // "selector": {}, + * // "tagManagerUrl": "my_tagManagerUrl", + * // "totalTimeMinMilliseconds": {}, + * // "triggerId": "my_triggerId", + * // "type": "my_type", + * // "uniqueTriggerId": {}, + * // "verticalScrollPercentageList": {}, + * // "visibilitySelector": {}, + * // "visiblePercentageMax": {}, + * // "visiblePercentageMin": {}, + * // "waitForTags": {}, + * // "waitForTagsTimeout": {}, + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.triggers.create * @memberOf! () * @@ -6956,6 +10280,44 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.triggers.delete * @desc Deletes a GTM Trigger. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.triggers.delete({ + * // GTM Trigger's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/triggers/my-trigger', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.triggers.delete * @memberOf! () * @@ -7028,6 +10390,83 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.triggers.get * @desc Gets a GTM Trigger. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.workspaces.triggers.get({ + * // GTM Trigger's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/triggers/my-trigger', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "autoEventFilter": [], + * // "checkValidation": {}, + * // "containerId": "my_containerId", + * // "continuousTimeMinMilliseconds": {}, + * // "customEventFilter": [], + * // "eventName": {}, + * // "filter": [], + * // "fingerprint": "my_fingerprint", + * // "horizontalScrollPercentageList": {}, + * // "interval": {}, + * // "intervalSeconds": {}, + * // "limit": {}, + * // "maxTimerLengthSeconds": {}, + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "path": "my_path", + * // "selector": {}, + * // "tagManagerUrl": "my_tagManagerUrl", + * // "totalTimeMinMilliseconds": {}, + * // "triggerId": "my_triggerId", + * // "type": "my_type", + * // "uniqueTriggerId": {}, + * // "verticalScrollPercentageList": {}, + * // "visibilitySelector": {}, + * // "visiblePercentageMax": {}, + * // "visiblePercentageMin": {}, + * // "waitForTags": {}, + * // "waitForTagsTimeout": {}, + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.triggers.get * @memberOf! () * @@ -7100,6 +10539,55 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.triggers.list * @desc Lists all GTM Triggers of a Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.workspaces.triggers.list({ + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // GTM Workspaces's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * parent: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "trigger": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.triggers.list * @memberOf! () * @@ -7177,6 +10665,52 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.triggers.revert * @desc Reverts changes to a GTM Trigger in a GTM Workspace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.triggers.revert({ + * // When provided, this fingerprint must match the fingerprint of the trigger + * // in storage. + * fingerprint: 'placeholder-value', + * // GTM Trigger's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/triggers/my-trigger', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "trigger": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.triggers.revert * @memberOf! () * @@ -7254,6 +10788,122 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.triggers.update * @desc Updates a GTM Trigger. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.triggers.update({ + * // When provided, this fingerprint must match the fingerprint of the trigger + * // in storage. + * fingerprint: 'placeholder-value', + * // GTM Trigger's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/triggers/my-trigger', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "autoEventFilter": [], + * // "checkValidation": {}, + * // "containerId": "my_containerId", + * // "continuousTimeMinMilliseconds": {}, + * // "customEventFilter": [], + * // "eventName": {}, + * // "filter": [], + * // "fingerprint": "my_fingerprint", + * // "horizontalScrollPercentageList": {}, + * // "interval": {}, + * // "intervalSeconds": {}, + * // "limit": {}, + * // "maxTimerLengthSeconds": {}, + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "path": "my_path", + * // "selector": {}, + * // "tagManagerUrl": "my_tagManagerUrl", + * // "totalTimeMinMilliseconds": {}, + * // "triggerId": "my_triggerId", + * // "type": "my_type", + * // "uniqueTriggerId": {}, + * // "verticalScrollPercentageList": {}, + * // "visibilitySelector": {}, + * // "visiblePercentageMax": {}, + * // "visiblePercentageMin": {}, + * // "waitForTags": {}, + * // "waitForTagsTimeout": {}, + * // "workspaceId": "my_workspaceId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "autoEventFilter": [], + * // "checkValidation": {}, + * // "containerId": "my_containerId", + * // "continuousTimeMinMilliseconds": {}, + * // "customEventFilter": [], + * // "eventName": {}, + * // "filter": [], + * // "fingerprint": "my_fingerprint", + * // "horizontalScrollPercentageList": {}, + * // "interval": {}, + * // "intervalSeconds": {}, + * // "limit": {}, + * // "maxTimerLengthSeconds": {}, + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "path": "my_path", + * // "selector": {}, + * // "tagManagerUrl": "my_tagManagerUrl", + * // "totalTimeMinMilliseconds": {}, + * // "triggerId": "my_triggerId", + * // "type": "my_type", + * // "uniqueTriggerId": {}, + * // "verticalScrollPercentageList": {}, + * // "visibilitySelector": {}, + * // "visiblePercentageMax": {}, + * // "visiblePercentageMin": {}, + * // "waitForTags": {}, + * // "waitForTagsTimeout": {}, + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.triggers.update * @memberOf! () * @@ -7430,6 +11080,89 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.variables.create * @desc Creates a GTM Variable. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.variables.create({ + * // GTM Workspace's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * parent: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "disablingTriggerId": [], + * // "enablingTriggerId": [], + * // "fingerprint": "my_fingerprint", + * // "formatValue": {}, + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "path": "my_path", + * // "scheduleEndMs": "my_scheduleEndMs", + * // "scheduleStartMs": "my_scheduleStartMs", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "type": "my_type", + * // "variableId": "my_variableId", + * // "workspaceId": "my_workspaceId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "disablingTriggerId": [], + * // "enablingTriggerId": [], + * // "fingerprint": "my_fingerprint", + * // "formatValue": {}, + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "path": "my_path", + * // "scheduleEndMs": "my_scheduleEndMs", + * // "scheduleStartMs": "my_scheduleStartMs", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "type": "my_type", + * // "variableId": "my_variableId", + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.variables.create * @memberOf! () * @@ -7503,6 +11236,44 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.variables.delete * @desc Deletes a GTM Variable. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.variables.delete({ + * // GTM Variable's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/variables/my-variable', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.variables.delete * @memberOf! () * @@ -7575,6 +11346,68 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.variables.get * @desc Gets a GTM Variable. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.workspaces.variables.get({ + * // GTM Variable's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/variables/my-variable', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "disablingTriggerId": [], + * // "enablingTriggerId": [], + * // "fingerprint": "my_fingerprint", + * // "formatValue": {}, + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "path": "my_path", + * // "scheduleEndMs": "my_scheduleEndMs", + * // "scheduleStartMs": "my_scheduleStartMs", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "type": "my_type", + * // "variableId": "my_variableId", + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.variables.get * @memberOf! () * @@ -7647,6 +11480,55 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.variables.list * @desc Lists all GTM Variables of a Container. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.workspaces.variables.list({ + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // GTM Workspace's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * parent: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "variable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.variables.list * @memberOf! () * @@ -7724,6 +11606,52 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.variables.revert * @desc Reverts changes to a GTM Variable in a GTM Workspace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.variables.revert({ + * // When provided, this fingerprint must match the fingerprint of the variable + * // in storage. + * fingerprint: 'placeholder-value', + * // GTM Variable's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/variables/my-variable', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "variable": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.variables.revert * @memberOf! () * @@ -7801,6 +11729,92 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.variables.update * @desc Updates a GTM Variable. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.variables.update({ + * // When provided, this fingerprint must match the fingerprint of the variable + * // in storage. + * fingerprint: 'placeholder-value', + * // GTM Variable's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/variables/my-variable', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "disablingTriggerId": [], + * // "enablingTriggerId": [], + * // "fingerprint": "my_fingerprint", + * // "formatValue": {}, + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "path": "my_path", + * // "scheduleEndMs": "my_scheduleEndMs", + * // "scheduleStartMs": "my_scheduleStartMs", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "type": "my_type", + * // "variableId": "my_variableId", + * // "workspaceId": "my_workspaceId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "containerId": "my_containerId", + * // "disablingTriggerId": [], + * // "enablingTriggerId": [], + * // "fingerprint": "my_fingerprint", + * // "formatValue": {}, + * // "name": "my_name", + * // "notes": "my_notes", + * // "parameter": [], + * // "parentFolderId": "my_parentFolderId", + * // "path": "my_path", + * // "scheduleEndMs": "my_scheduleEndMs", + * // "scheduleStartMs": "my_scheduleStartMs", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "type": "my_type", + * // "variableId": "my_variableId", + * // "workspaceId": "my_workspaceId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.variables.update * @memberOf! () * @@ -7977,6 +11991,79 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.zones.create * @desc Creates a GTM Zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.zones.create({ + * // GTM Workspace's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * parent: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "boundary": {}, + * // "childContainer": [], + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "notes": "my_notes", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "typeRestriction": {}, + * // "workspaceId": "my_workspaceId", + * // "zoneId": "my_zoneId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "boundary": {}, + * // "childContainer": [], + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "notes": "my_notes", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "typeRestriction": {}, + * // "workspaceId": "my_workspaceId", + * // "zoneId": "my_zoneId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.zones.create * @memberOf! () * @@ -8050,6 +12137,44 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.zones.delete * @desc Deletes a GTM Zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.zones.delete({ + * // GTM Zone's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/zones/my-zone', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.zones.delete * @memberOf! () * @@ -8122,6 +12247,63 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.zones.get * @desc Gets a GTM Zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.workspaces.zones.get({ + * // GTM Zone's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/zones/my-zone', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "boundary": {}, + * // "childContainer": [], + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "notes": "my_notes", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "typeRestriction": {}, + * // "workspaceId": "my_workspaceId", + * // "zoneId": "my_zoneId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.zones.get * @memberOf! () * @@ -8194,6 +12376,55 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.zones.list * @desc Lists all GTM Zones of a GTM container workspace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers', + * 'https://www.googleapis.com/auth/tagmanager.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 tagmanager.accounts.containers.workspaces.zones.list({ + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // GTM Workspace's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * parent: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "zone": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.zones.list * @memberOf! () * @@ -8269,6 +12500,52 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.zones.revert * @desc Reverts changes to a GTM Zone in a GTM Workspace. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.zones.revert({ + * // When provided, this fingerprint must match the fingerprint of the zone in + * // storage. + * fingerprint: 'placeholder-value', + * // GTM Zone's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/zones/my-zone', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "zone": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.zones.revert * @memberOf! () * @@ -8344,6 +12621,82 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.containers.workspaces.zones.update * @desc Updates a GTM Zone. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.edit.containers'], + * }); + * + * // 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 tagmanager.accounts.containers.workspaces.zones.update({ + * // When provided, this fingerprint must match the fingerprint of the zone in + * // storage. + * fingerprint: 'placeholder-value', + * // GTM Zone's API relative path. + * // Example: + * // accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id} + * path: + * 'accounts/my-account/containers/my-container/workspaces/my-workspace/zones/my-zone', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "boundary": {}, + * // "childContainer": [], + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "notes": "my_notes", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "typeRestriction": {}, + * // "workspaceId": "my_workspaceId", + * // "zoneId": "my_zoneId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "boundary": {}, + * // "childContainer": [], + * // "containerId": "my_containerId", + * // "fingerprint": "my_fingerprint", + * // "name": "my_name", + * // "notes": "my_notes", + * // "path": "my_path", + * // "tagManagerUrl": "my_tagManagerUrl", + * // "typeRestriction": {}, + * // "workspaceId": "my_workspaceId", + * // "zoneId": "my_zoneId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.containers.workspaces.zones.update * @memberOf! () * @@ -8520,6 +12873,63 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.user_permissions.create * @desc Creates a user's Account & Container access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.manage.users'], + * }); + * + * // 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 tagmanager.accounts.user_permissions.create({ + * // GTM Account's API relative path. + * // Example: accounts/{account_id} + * parent: 'accounts/my-account', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountAccess": {}, + * // "accountId": "my_accountId", + * // "containerAccess": [], + * // "emailAddress": "my_emailAddress", + * // "path": "my_path" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountAccess": {}, + * // "accountId": "my_accountId", + * // "containerAccess": [], + * // "emailAddress": "my_emailAddress", + * // "path": "my_path" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.user_permissions.create * @memberOf! () * @@ -8594,6 +13004,42 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.user_permissions.delete * @desc Removes a user from the account, revoking access to it and all of its containers. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.manage.users'], + * }); + * + * // 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 tagmanager.accounts.user_permissions.delete({ + * // GTM UserPermission's API relative path. + * // Example: accounts/{account_id}/user_permissions/{user_permission_id} + * path: 'accounts/my-account/user_permissions/my-user_permission', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.user_permissions.delete * @memberOf! () * @@ -8666,6 +13112,51 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.user_permissions.get * @desc Gets a user's Account & Container access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.manage.users'], + * }); + * + * // 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 tagmanager.accounts.user_permissions.get({ + * // GTM UserPermission's API relative path. + * // Example: accounts/{account_id}/user_permissions/{user_permission_id} + * path: 'accounts/my-account/user_permissions/my-user_permission', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountAccess": {}, + * // "accountId": "my_accountId", + * // "containerAccess": [], + * // "emailAddress": "my_emailAddress", + * // "path": "my_path" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.user_permissions.get * @memberOf! () * @@ -8740,6 +13231,50 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.user_permissions.list * @desc List all users that have access to the account along with Account and Container user access granted to each of them. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.manage.users'], + * }); + * + * // 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 tagmanager.accounts.user_permissions.list({ + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // GTM Accounts's API relative path. + * // Example: accounts/{account_id} + * parent: 'accounts/my-account', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "userPermission": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.user_permissions.list * @memberOf! () * @@ -8821,6 +13356,63 @@ export namespace tagmanager_v2 { /** * tagmanager.accounts.user_permissions.update * @desc Updates a user's Account & Container access. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tagmanager.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 tagmanager = google.tagmanager('v2'); + * + * 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/tagmanager.manage.users'], + * }); + * + * // 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 tagmanager.accounts.user_permissions.update({ + * // GTM UserPermission's API relative path. + * // Example: accounts/{account_id}/user_permissions/{user_permission_id} + * path: 'accounts/my-account/user_permissions/my-user_permission', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountAccess": {}, + * // "accountId": "my_accountId", + * // "containerAccess": [], + * // "emailAddress": "my_emailAddress", + * // "path": "my_path" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountAccess": {}, + * // "accountId": "my_accountId", + * // "containerAccess": [], + * // "emailAddress": "my_emailAddress", + * // "path": "my_path" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tagmanager.accounts.user_permissions.update * @memberOf! () * diff --git a/src/apis/tasks/v1.ts b/src/apis/tasks/v1.ts index e73f32c4af3..542f80ec24d 100644 --- a/src/apis/tasks/v1.ts +++ b/src/apis/tasks/v1.ts @@ -233,6 +233,41 @@ export namespace tasks_v1 { /** * tasks.tasklists.delete * @desc Deletes the authenticated user's specified task list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tasks.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 tasks = google.tasks('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/tasks'], + * }); + * + * // 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 tasks.tasklists.delete({ + * // Task list identifier. + * tasklist: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tasks.tasklists.delete * @memberOf! () * @@ -304,6 +339,54 @@ export namespace tasks_v1 { /** * tasks.tasklists.get * @desc Returns the authenticated user's specified task list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tasks.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 tasks = google.tasks('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/tasks', + * 'https://www.googleapis.com/auth/tasks.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 tasks.tasklists.get({ + * // Task list identifier. + * tasklist: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "title": "my_title", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tasks.tasklists.get * @memberOf! () * @@ -375,6 +458,61 @@ export namespace tasks_v1 { /** * tasks.tasklists.insert * @desc Creates a new task list and adds it to the authenticated user's task lists. Fails with HTTP code 403 or 429 after reaching the storage limit of 2,000 lists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tasks.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 tasks = google.tasks('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/tasks'], + * }); + * + * // 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 tasks.tasklists.insert({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "title": "my_title", + * // "updated": "my_updated" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "title": "my_title", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tasks.tasklists.insert * @memberOf! () * @@ -446,6 +584,54 @@ export namespace tasks_v1 { /** * tasks.tasklists.list * @desc Returns all the authenticated user's task lists. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tasks.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 tasks = google.tasks('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/tasks', + * 'https://www.googleapis.com/auth/tasks.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 tasks.tasklists.list({ + * // Maximum number of task lists returned on one page. Optional. The default is 20 (max allowed: 100). + * maxResults: 'placeholder-value', + * // Token specifying the result page to return. Optional. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tasks.tasklists.list * @memberOf! () * @@ -520,6 +706,64 @@ export namespace tasks_v1 { /** * tasks.tasklists.patch * @desc Updates the authenticated user's specified task list. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tasks.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 tasks = google.tasks('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/tasks'], + * }); + * + * // 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 tasks.tasklists.patch({ + * // Task list identifier. + * tasklist: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "title": "my_title", + * // "updated": "my_updated" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "title": "my_title", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tasks.tasklists.patch * @memberOf! () * @@ -592,6 +836,64 @@ export namespace tasks_v1 { /** * tasks.tasklists.update * @desc Updates the authenticated user's specified task list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tasks.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 tasks = google.tasks('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/tasks'], + * }); + * + * // 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 tasks.tasklists.update({ + * // Task list identifier. + * tasklist: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "title": "my_title", + * // "updated": "my_updated" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "title": "my_title", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tasks.tasklists.update * @memberOf! () * @@ -752,6 +1054,41 @@ export namespace tasks_v1 { /** * tasks.tasks.clear * @desc Clears all completed tasks from the specified task list. The affected tasks will be marked as 'hidden' and no longer be returned by default when retrieving all tasks for a task list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tasks.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 tasks = google.tasks('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/tasks'], + * }); + * + * // 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 tasks.tasks.clear({ + * // Task list identifier. + * tasklist: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tasks.tasks.clear * @memberOf! () * @@ -823,6 +1160,43 @@ export namespace tasks_v1 { /** * tasks.tasks.delete * @desc Deletes the specified task from the task list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tasks.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 tasks = google.tasks('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/tasks'], + * }); + * + * // 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 tasks.tasks.delete({ + * // Task identifier. + * task: 'placeholder-value', + * // Task list identifier. + * tasklist: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tasks.tasks.delete * @memberOf! () * @@ -895,6 +1269,65 @@ export namespace tasks_v1 { /** * tasks.tasks.get * @desc Returns the specified task. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tasks.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 tasks = google.tasks('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/tasks', + * 'https://www.googleapis.com/auth/tasks.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 tasks.tasks.get({ + * // Task identifier. + * task: 'placeholder-value', + * // Task list identifier. + * tasklist: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "completed": "my_completed", + * // "deleted": false, + * // "due": "my_due", + * // "etag": "my_etag", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "links": [], + * // "notes": "my_notes", + * // "parent": "my_parent", + * // "position": "my_position", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tasks.tasks.get * @memberOf! () * @@ -967,6 +1400,86 @@ export namespace tasks_v1 { /** * tasks.tasks.insert * @desc Creates a new task on the specified task list. Fails with HTTP code 403 or 429 after reaching the storage limit of 100,000 tasks per account. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tasks.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 tasks = google.tasks('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/tasks'], + * }); + * + * // 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 tasks.tasks.insert({ + * // Parent task identifier. If the task is created at the top level, this parameter is omitted. Optional. + * parent: 'placeholder-value', + * // Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted. Optional. + * previous: 'placeholder-value', + * // Task list identifier. + * tasklist: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "completed": "my_completed", + * // "deleted": false, + * // "due": "my_due", + * // "etag": "my_etag", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "links": [], + * // "notes": "my_notes", + * // "parent": "my_parent", + * // "position": "my_position", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "completed": "my_completed", + * // "deleted": false, + * // "due": "my_due", + * // "etag": "my_etag", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "links": [], + * // "notes": "my_notes", + * // "parent": "my_parent", + * // "position": "my_position", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tasks.tasks.insert * @memberOf! () * @@ -1041,6 +1554,72 @@ export namespace tasks_v1 { /** * tasks.tasks.list * @desc Returns all tasks in the specified task list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tasks.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 tasks = google.tasks('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/tasks', + * 'https://www.googleapis.com/auth/tasks.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 tasks.tasks.list({ + * // Upper bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date. + * completedMax: 'placeholder-value', + * // Lower bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date. + * completedMin: 'placeholder-value', + * // Upper bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date. + * dueMax: 'placeholder-value', + * // Lower bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date. + * dueMin: 'placeholder-value', + * // Maximum number of task lists returned on one page. Optional. The default is 20 (max allowed: 100). + * maxResults: 'placeholder-value', + * // Token specifying the result page to return. Optional. + * pageToken: 'placeholder-value', + * // Flag indicating whether completed tasks are returned in the result. Optional. The default is True. + * showCompleted: 'placeholder-value', + * // Flag indicating whether deleted tasks are returned in the result. Optional. The default is False. + * showDeleted: 'placeholder-value', + * // Flag indicating whether hidden tasks are returned in the result. Optional. The default is False. + * showHidden: 'placeholder-value', + * // Task list identifier. + * tasklist: 'placeholder-value', + * // Lower bound for a task's last modification time (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by last modification time. + * updatedMin: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tasks.tasks.list * @memberOf! () * @@ -1122,6 +1701,66 @@ export namespace tasks_v1 { /** * tasks.tasks.move * @desc Moves the specified task to another position in the task list. This can include putting it as a child task under a new parent and/or move it to a different position among its sibling tasks. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tasks.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 tasks = google.tasks('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/tasks'], + * }); + * + * // 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 tasks.tasks.move({ + * // New parent task identifier. If the task is moved to the top level, this parameter is omitted. Optional. + * parent: 'placeholder-value', + * // New previous sibling task identifier. If the task is moved to the first position among its siblings, this parameter is omitted. Optional. + * previous: 'placeholder-value', + * // Task identifier. + * task: 'placeholder-value', + * // Task list identifier. + * tasklist: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "completed": "my_completed", + * // "deleted": false, + * // "due": "my_due", + * // "etag": "my_etag", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "links": [], + * // "notes": "my_notes", + * // "parent": "my_parent", + * // "position": "my_position", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tasks.tasks.move * @memberOf! () * @@ -1195,6 +1834,84 @@ export namespace tasks_v1 { /** * tasks.tasks.patch * @desc Updates the specified task. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tasks.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 tasks = google.tasks('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/tasks'], + * }); + * + * // 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 tasks.tasks.patch({ + * // Task identifier. + * task: 'placeholder-value', + * // Task list identifier. + * tasklist: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "completed": "my_completed", + * // "deleted": false, + * // "due": "my_due", + * // "etag": "my_etag", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "links": [], + * // "notes": "my_notes", + * // "parent": "my_parent", + * // "position": "my_position", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "completed": "my_completed", + * // "deleted": false, + * // "due": "my_due", + * // "etag": "my_etag", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "links": [], + * // "notes": "my_notes", + * // "parent": "my_parent", + * // "position": "my_position", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tasks.tasks.patch * @memberOf! () * @@ -1268,6 +1985,84 @@ export namespace tasks_v1 { /** * tasks.tasks.update * @desc Updates the specified task. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tasks.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 tasks = google.tasks('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/tasks'], + * }); + * + * // 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 tasks.tasks.update({ + * // Task identifier. + * task: 'placeholder-value', + * // Task list identifier. + * tasklist: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "completed": "my_completed", + * // "deleted": false, + * // "due": "my_due", + * // "etag": "my_etag", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "links": [], + * // "notes": "my_notes", + * // "parent": "my_parent", + * // "position": "my_position", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "completed": "my_completed", + * // "deleted": false, + * // "due": "my_due", + * // "etag": "my_etag", + * // "hidden": false, + * // "id": "my_id", + * // "kind": "my_kind", + * // "links": [], + * // "notes": "my_notes", + * // "parent": "my_parent", + * // "position": "my_position", + * // "selfLink": "my_selfLink", + * // "status": "my_status", + * // "title": "my_title", + * // "updated": "my_updated" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tasks.tasks.update * @memberOf! () * diff --git a/src/apis/testing/v1.ts b/src/apis/testing/v1.ts index 8374b476274..5abb7558072 100644 --- a/src/apis/testing/v1.ts +++ b/src/apis/testing/v1.ts @@ -1358,6 +1358,51 @@ export namespace testing_v1 { /** * testing.applicationDetailService.getApkDetails * @desc Gets the details of an Android application APK. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/testing.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 testing = google.testing('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/cloud-platform'], + * }); + * + * // 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 testing.applicationDetailService.getApkDetails({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "gcsPath": "my_gcsPath" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "apkDetail": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias testing.applicationDetailService.getApkDetails * @memberOf! () * @@ -1464,6 +1509,48 @@ export namespace testing_v1 { /** * testing.projects.testMatrices.cancel * @desc Cancels unfinished test executions in a test matrix. This call returns immediately and cancellation proceeds asychronously. If the matrix is already final, this operation will have no effect. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to read project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the Test Matrix does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/testing.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 testing = google.testing('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/cloud-platform'], + * }); + * + * // 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 testing.projects.testMatrices.cancel({ + * // Cloud project that owns the test. + * projectId: 'placeholder-value', + * // Test matrix that will be canceled. + * testMatrixId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "testState": "my_testState" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias testing.projects.testMatrices.cancel * @memberOf! () * @@ -1543,6 +1630,83 @@ export namespace testing_v1 { /** * testing.projects.testMatrices.create * @desc Creates and runs a matrix of tests according to the given specifications. Unsupported environments will be returned in the state UNSUPPORTED. Matrices are limited to at most 200 supported executions. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to write to project - INVALID_ARGUMENT - if the request is malformed or if the matrix expands to more than 200 supported executions + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/testing.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 testing = google.testing('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/cloud-platform'], + * }); + * + * // 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 testing.projects.testMatrices.create({ + * // The GCE project under which this job will run. + * projectId: 'placeholder-value', + * // A string id used to detect duplicated requests. + * // Ids are automatically scoped to a project, so + * // users should ensure the ID is unique per-project. + * // A UUID is recommended. + * // + * // Optional, but strongly recommended. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "clientInfo": {}, + * // "environmentMatrix": {}, + * // "flakyTestAttempts": 0, + * // "invalidMatrixDetails": "my_invalidMatrixDetails", + * // "outcomeSummary": "my_outcomeSummary", + * // "projectId": "my_projectId", + * // "resultStorage": {}, + * // "state": "my_state", + * // "testExecutions": [], + * // "testMatrixId": "my_testMatrixId", + * // "testSpecification": {}, + * // "timestamp": "my_timestamp" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientInfo": {}, + * // "environmentMatrix": {}, + * // "flakyTestAttempts": 0, + * // "invalidMatrixDetails": "my_invalidMatrixDetails", + * // "outcomeSummary": "my_outcomeSummary", + * // "projectId": "my_projectId", + * // "resultStorage": {}, + * // "state": "my_state", + * // "testExecutions": [], + * // "testMatrixId": "my_testMatrixId", + * // "testSpecification": {}, + * // "timestamp": "my_timestamp" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias testing.projects.testMatrices.create * @memberOf! () * @@ -1619,6 +1783,62 @@ export namespace testing_v1 { /** * testing.projects.testMatrices.get * @desc Checks the status of a test matrix. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to read project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the Test Matrix does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/testing.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 testing = google.testing('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 testing.projects.testMatrices.get({ + * // Cloud project that owns the test matrix. + * projectId: 'placeholder-value', + * // Unique test matrix id which was assigned by the service. + * testMatrixId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientInfo": {}, + * // "environmentMatrix": {}, + * // "flakyTestAttempts": 0, + * // "invalidMatrixDetails": "my_invalidMatrixDetails", + * // "outcomeSummary": "my_outcomeSummary", + * // "projectId": "my_projectId", + * // "resultStorage": {}, + * // "state": "my_state", + * // "testExecutions": [], + * // "testMatrixId": "my_testMatrixId", + * // "testSpecification": {}, + * // "timestamp": "my_timestamp" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias testing.projects.testMatrices.get * @memberOf! () * @@ -1754,6 +1974,54 @@ export namespace testing_v1 { /** * testing.testEnvironmentCatalog.get * @desc Gets the catalog of supported test environments. May return any of the following canonical error codes: - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the environment type does not exist - INTERNAL - if an internal error occurred + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/testing.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 testing = google.testing('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-platform.read-only', + * ], + * }); + * + * // 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 testing.testEnvironmentCatalog.get({ + * // Required. The type of environment that should be listed. + * environmentType: 'placeholder-value', + * // For authorization, the cloud project requesting the TestEnvironmentCatalog. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "androidDeviceCatalog": {}, + * // "iosDeviceCatalog": {}, + * // "networkConfigurationCatalog": {}, + * // "softwareCatalog": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias testing.testEnvironmentCatalog.get * @memberOf! () * diff --git a/src/apis/texttospeech/v1.ts b/src/apis/texttospeech/v1.ts index 1d8ca38178f..4cdf7617b8a 100644 --- a/src/apis/texttospeech/v1.ts +++ b/src/apis/texttospeech/v1.ts @@ -240,6 +240,53 @@ export namespace texttospeech_v1 { /** * texttospeech.text.synthesize * @desc Synthesizes speech synchronously: receive results after all text input has been processed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/texttospeech.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 texttospeech = google.texttospeech('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/cloud-platform'], + * }); + * + * // 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 texttospeech.text.synthesize({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "audioConfig": {}, + * // "input": {}, + * // "voice": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "audioContent": "my_audioContent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias texttospeech.text.synthesize * @memberOf! () * @@ -336,6 +383,53 @@ export namespace texttospeech_v1 { /** * texttospeech.voices.list * @desc Returns a list of Voice supported for synthesis. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/texttospeech.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 texttospeech = google.texttospeech('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/cloud-platform'], + * }); + * + * // 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 texttospeech.voices.list({ + * // Optional. Recommended. + * // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If + * // specified, the ListVoices call will only return voices that can be used to + * // synthesize this language_code. E.g. when specifying "en-NZ", you will get + * // supported "en-*" voices; when specifying "no", you will get supported + * // "no-*" (Norwegian) and "nb-*" (Norwegian Bokmal) voices; specifying "zh" + * // will also get supported "cmn-*" voices; specifying "zh-hk" will also get + * // supported "yue-*" voices. + * languageCode: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "voices": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias texttospeech.voices.list * @memberOf! () * diff --git a/src/apis/texttospeech/v1beta1.ts b/src/apis/texttospeech/v1beta1.ts index 8c70aa44366..c3b99a4123f 100644 --- a/src/apis/texttospeech/v1beta1.ts +++ b/src/apis/texttospeech/v1beta1.ts @@ -240,6 +240,53 @@ export namespace texttospeech_v1beta1 { /** * texttospeech.text.synthesize * @desc Synthesizes speech synchronously: receive results after all text input has been processed. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/texttospeech.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 texttospeech = google.texttospeech('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 texttospeech.text.synthesize({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "audioConfig": {}, + * // "input": {}, + * // "voice": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "audioContent": "my_audioContent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias texttospeech.text.synthesize * @memberOf! () * @@ -336,6 +383,53 @@ export namespace texttospeech_v1beta1 { /** * texttospeech.voices.list * @desc Returns a list of Voice supported for synthesis. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/texttospeech.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 texttospeech = google.texttospeech('v1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 texttospeech.voices.list({ + * // Optional. Recommended. + * // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If + * // specified, the ListVoices call will only return voices that can be used to + * // synthesize this language_code. E.g. when specifying "en-NZ", you will get + * // supported "en-*" voices; when specifying "no", you will get supported + * // "no-*" (Norwegian) and "nb-*" (Norwegian Bokmal) voices; specifying "zh" + * // will also get supported "cmn-*" voices; specifying "zh-hk" will also get + * // supported "yue-*" voices. + * languageCode: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "voices": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias texttospeech.voices.list * @memberOf! () * diff --git a/src/apis/toolresults/v1beta3.ts b/src/apis/toolresults/v1beta3.ts index c6f68dcbe53..7c0b2aee63e 100644 --- a/src/apis/toolresults/v1beta3.ts +++ b/src/apis/toolresults/v1beta3.ts @@ -1710,6 +1710,63 @@ export namespace toolresults_v1beta3 { /** * toolresults.clusters.get * @desc Retrieves a single screenshot cluster by its ID + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.clusters.get({ + * // A Cluster id + * // + * // Required. + * clusterId: 'placeholder-value', + * // An Execution id. + * // + * // Required. + * executionId: 'placeholder-value', + * // A History id. + * // + * // Required. + * historyId: 'placeholder-value', + * // A Project id. + * // + * // Required. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activity": "my_activity", + * // "clusterId": "my_clusterId", + * // "keyScreen": {}, + * // "screens": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.clusters.get * @memberOf! () * @@ -1786,6 +1843,56 @@ export namespace toolresults_v1beta3 { /** * toolresults.clusters.list * @desc Lists Screenshot Clusters Returns the list of screenshot clusters corresponding to an execution. Screenshot clusters are created after the execution is finished. Clusters are created from a set of screenshots. Between any two screenshots, a matching score is calculated based off their metadata that determines how similar they are. Screenshots are placed in the cluster that has screens which have the highest matching scores. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.clusters.list({ + * // An Execution id. + * // + * // Required. + * executionId: 'placeholder-value', + * // A History id. + * // + * // Required. + * historyId: 'placeholder-value', + * // A Project id. + * // + * // Required. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusters": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.clusters.list * @memberOf! () * @@ -1920,6 +2027,62 @@ export namespace toolresults_v1beta3 { /** * toolresults.environments.get * @desc Gets an Environment. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to read project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the Environment does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.environments.get({ + * // Required. An Environment id. + * environmentId: 'placeholder-value', + * // Required. An Execution id. + * executionId: 'placeholder-value', + * // Required. A History id. + * historyId: 'placeholder-value', + * // Required. A Project id. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "completionTime": {}, + * // "creationTime": {}, + * // "dimensionValue": [], + * // "displayName": "my_displayName", + * // "environmentId": "my_environmentId", + * // "environmentResult": {}, + * // "executionId": "my_executionId", + * // "historyId": "my_historyId", + * // "projectId": "my_projectId", + * // "resultsStorage": {}, + * // "shardSummaries": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.environments.get * @memberOf! () * @@ -2001,6 +2164,61 @@ export namespace toolresults_v1beta3 { /** * toolresults.environments.list * @desc Lists Environments for a given Execution. The Environments are sorted by display name. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to read project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the containing Execution does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.environments.list({ + * // Required. An Execution id. + * executionId: 'placeholder-value', + * // Required. A History id. + * historyId: 'placeholder-value', + * // The maximum number of Environments to fetch. + * // + * // Default value: 25. The server will use this default if the field is not set + * // or has a value of 0. + * pageSize: 'placeholder-value', + * // A continuation token to resume the query at the next item. + * pageToken: 'placeholder-value', + * // Required. A Project id. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "environments": [], + * // "executionId": "my_executionId", + * // "historyId": "my_historyId", + * // "nextPageToken": "my_nextPageToken", + * // "projectId": "my_projectId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.environments.list * @memberOf! () * @@ -2140,6 +2358,79 @@ export namespace toolresults_v1beta3 { /** * toolresults.executions.create * @desc Creates an Execution. The returned Execution will have the id set. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to write to project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the containing History does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.executions.create({ + * // A History id. + * // + * // Required. + * historyId: 'placeholder-value', + * // A Project id. + * // + * // Required. + * projectId: 'placeholder-value', + * // A unique request ID for server to detect duplicated requests. + * // For example, a UUID. + * // + * // Optional, but strongly recommended. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "completionTime": {}, + * // "creationTime": {}, + * // "dimensionDefinitions": [], + * // "executionId": "my_executionId", + * // "outcome": {}, + * // "specification": {}, + * // "state": "my_state", + * // "testExecutionMatrixId": "my_testExecutionMatrixId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "completionTime": {}, + * // "creationTime": {}, + * // "dimensionDefinitions": [], + * // "executionId": "my_executionId", + * // "outcome": {}, + * // "specification": {}, + * // "state": "my_state", + * // "testExecutionMatrixId": "my_testExecutionMatrixId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.executions.create * @memberOf! () * @@ -2217,6 +2508,63 @@ export namespace toolresults_v1beta3 { /** * toolresults.executions.get * @desc Gets an Execution. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to write to project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the Execution does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.executions.get({ + * // An Execution id. + * // + * // Required. + * executionId: 'placeholder-value', + * // A History id. + * // + * // Required. + * historyId: 'placeholder-value', + * // A Project id. + * // + * // Required. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "completionTime": {}, + * // "creationTime": {}, + * // "dimensionDefinitions": [], + * // "executionId": "my_executionId", + * // "outcome": {}, + * // "specification": {}, + * // "state": "my_state", + * // "testExecutionMatrixId": "my_testExecutionMatrixId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.executions.get * @memberOf! () * @@ -2292,6 +2640,64 @@ export namespace toolresults_v1beta3 { /** * toolresults.executions.list * @desc Lists Executions for a given History. The executions are sorted by creation_time in descending order. The execution_id key will be used to order the executions with the same creation_time. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to read project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the containing History does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.executions.list({ + * // A History id. + * // + * // Required. + * historyId: 'placeholder-value', + * // The maximum number of Executions to fetch. + * // + * // Default value: 25. The server will use this default if the field is not set + * // or has a value of 0. + * // + * // Optional. + * pageSize: 'placeholder-value', + * // A continuation token to resume the query at the next item. + * // + * // Optional. + * pageToken: 'placeholder-value', + * // A Project id. + * // + * // Required. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "executions": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.executions.list * @memberOf! () * @@ -2370,6 +2776,78 @@ export namespace toolresults_v1beta3 { /** * toolresults.executions.patch * @desc Updates an existing Execution with the supplied partial entity. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to write to project - INVALID_ARGUMENT - if the request is malformed - FAILED_PRECONDITION - if the requested state transition is illegal - NOT_FOUND - if the containing History does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.executions.patch({ + * // Required. + * executionId: 'placeholder-value', + * // Required. + * historyId: 'placeholder-value', + * // A Project id. + * // Required. + * projectId: 'placeholder-value', + * // A unique request ID for server to detect duplicated requests. + * // For example, a UUID. + * // + * // Optional, but strongly recommended. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "completionTime": {}, + * // "creationTime": {}, + * // "dimensionDefinitions": [], + * // "executionId": "my_executionId", + * // "outcome": {}, + * // "specification": {}, + * // "state": "my_state", + * // "testExecutionMatrixId": "my_testExecutionMatrixId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "completionTime": {}, + * // "creationTime": {}, + * // "dimensionDefinitions": [], + * // "executionId": "my_executionId", + * // "outcome": {}, + * // "specification": {}, + * // "state": "my_state", + * // "testExecutionMatrixId": "my_testExecutionMatrixId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.executions.patch * @memberOf! () * @@ -2550,6 +3028,65 @@ export namespace toolresults_v1beta3 { /** * toolresults.histories.create * @desc Creates a History. The returned History will have the id set. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to write to project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the containing project does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.histories.create({ + * // A Project id. + * // + * // Required. + * projectId: 'placeholder-value', + * // A unique request ID for server to detect duplicated requests. + * // For example, a UUID. + * // + * // Optional, but strongly recommended. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "historyId": "my_historyId", + * // "name": "my_name" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "historyId": "my_historyId", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.histories.create * @memberOf! () * @@ -2622,6 +3159,54 @@ export namespace toolresults_v1beta3 { /** * toolresults.histories.get * @desc Gets a History. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to read project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the History does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.histories.get({ + * // A History id. + * // + * // Required. + * historyId: 'placeholder-value', + * // A Project id. + * // + * // Required. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "historyId": "my_historyId", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.histories.get * @memberOf! () * @@ -2694,6 +3279,64 @@ export namespace toolresults_v1beta3 { /** * toolresults.histories.list * @desc Lists Histories for a given Project. The histories are sorted by modification time in descending order. The history_id key will be used to order the history with the same modification time. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to read project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the History does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.histories.list({ + * // If set, only return histories with the given name. + * // + * // Optional. + * filterByName: 'placeholder-value', + * // The maximum number of Histories to fetch. + * // + * // Default value: 20. The server will use this default if the field is not set + * // or has a value of 0. Any value greater than 100 will be treated as 100. + * // + * // Optional. + * pageSize: 'placeholder-value', + * // A continuation token to resume the query at the next item. + * // + * // Optional. + * pageToken: 'placeholder-value', + * // A Project id. + * // + * // Required. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "histories": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.histories.list * @memberOf! () * @@ -2837,6 +3480,74 @@ export namespace toolresults_v1beta3 { /** * toolresults.perfMetricsSummary.create * @desc Creates a PerfMetricsSummary resource. Returns the existing one if it has already been created. May return any of the following error code(s): - NOT_FOUND - The containing Step does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.perfMetricsSummary.create({ + * // A tool results execution ID. + * executionId: 'placeholder-value', + * // A tool results history ID. + * historyId: 'placeholder-value', + * // The cloud project + * projectId: 'placeholder-value', + * // A tool results step ID. + * stepId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "appStartTime": {}, + * // "executionId": "my_executionId", + * // "graphicsStats": {}, + * // "historyId": "my_historyId", + * // "perfEnvironment": {}, + * // "perfMetrics": [], + * // "projectId": "my_projectId", + * // "stepId": "my_stepId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appStartTime": {}, + * // "executionId": "my_executionId", + * // "graphicsStats": {}, + * // "historyId": "my_historyId", + * // "perfEnvironment": {}, + * // "perfMetrics": [], + * // "projectId": "my_projectId", + * // "stepId": "my_stepId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.perfMetricsSummary.create * @memberOf! () * @@ -2952,6 +3663,70 @@ export namespace toolresults_v1beta3 { /** * toolresults.perfSampleSeries.create * @desc Creates a PerfSampleSeries. May return any of the following error code(s): - ALREADY_EXISTS - PerfMetricSummary already exists for the given Step - NOT_FOUND - The containing Step does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.perfSampleSeries.create({ + * // A tool results execution ID. + * executionId: 'placeholder-value', + * // A tool results history ID. + * historyId: 'placeholder-value', + * // The cloud project + * projectId: 'placeholder-value', + * // A tool results step ID. + * stepId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "basicPerfSampleSeries": {}, + * // "executionId": "my_executionId", + * // "historyId": "my_historyId", + * // "projectId": "my_projectId", + * // "sampleSeriesId": "my_sampleSeriesId", + * // "stepId": "my_stepId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "basicPerfSampleSeries": {}, + * // "executionId": "my_executionId", + * // "historyId": "my_historyId", + * // "projectId": "my_projectId", + * // "sampleSeriesId": "my_sampleSeriesId", + * // "stepId": "my_stepId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.perfSampleSeries.create * @memberOf! () * @@ -3030,6 +3805,59 @@ export namespace toolresults_v1beta3 { /** * toolresults.perfSampleSeries.get * @desc Gets a PerfSampleSeries. May return any of the following error code(s): - NOT_FOUND - The specified PerfSampleSeries does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.perfSampleSeries.get({ + * // A tool results execution ID. + * executionId: 'placeholder-value', + * // A tool results history ID. + * historyId: 'placeholder-value', + * // The cloud project + * projectId: 'placeholder-value', + * // A sample series id + * sampleSeriesId: 'placeholder-value', + * // A tool results step ID. + * stepId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "basicPerfSampleSeries": {}, + * // "executionId": "my_executionId", + * // "historyId": "my_historyId", + * // "projectId": "my_projectId", + * // "sampleSeriesId": "my_sampleSeriesId", + * // "stepId": "my_stepId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.perfSampleSeries.get * @memberOf! () * @@ -3120,6 +3948,54 @@ export namespace toolresults_v1beta3 { /** * toolresults.perfSampleSeries.list * @desc Lists PerfSampleSeries for a given Step. The request provides an optional filter which specifies one or more PerfMetricsType to include in the result; if none returns all. The resulting PerfSampleSeries are sorted by ids. May return any of the following canonical error codes: - NOT_FOUND - The containing Step does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.perfSampleSeries.list({ + * // A tool results execution ID. + * executionId: 'placeholder-value', + * // Specify one or more PerfMetricType values such as CPU to filter the result + * filter: 'placeholder-value', + * // A tool results history ID. + * historyId: 'placeholder-value', + * // The cloud project + * projectId: 'placeholder-value', + * // A tool results step ID. + * stepId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "perfSampleSeries": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.perfSampleSeries.list * @memberOf! () * @@ -3300,6 +4176,49 @@ export namespace toolresults_v1beta3 { /** * toolresults.projects.getSettings * @desc Gets the Tool Results settings for a project. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to read from project + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.projects.getSettings({ + * // A Project id. + * // + * // Required. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "defaultBucket": "my_defaultBucket", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.projects.getSettings * @memberOf! () * @@ -3373,6 +4292,49 @@ export namespace toolresults_v1beta3 { /** * toolresults.projects.initializeSettings * @desc Creates resources for settings which have not yet been set. Currently, this creates a single resource: a Google Cloud Storage bucket, to be used as the default bucket for this project. The bucket is created in an FTL-own storage project. Except for in rare cases, calling this method in parallel from multiple clients will only create a single bucket. In order to avoid unnecessary storage charges, the bucket is configured to automatically delete objects older than 90 days. The bucket is created with the following permissions: - Owner access for owners of central storage project (FTL-owned) - Writer access for owners/editors of customer project - Reader access for viewers of customer project The default ACL on objects created in the bucket is: - Owner access for owners of central storage project - Reader access for owners/editors/viewers of customer project See Google Cloud Storage documentation for more details. If there is already a default bucket set and the project can access the bucket, this call does nothing. However, if the project doesn't have the permission to access the bucket or the bucket is deleted, a new bucket will be created. May return any canonical error codes, including the following: - PERMISSION_DENIED - if the user is not authorized to write to project - Any error code raised by Google Cloud Storage + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.projects.initializeSettings({ + * // A Project id. + * // + * // Required. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "defaultBucket": "my_defaultBucket", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.projects.initializeSettings * @memberOf! () * @@ -3481,6 +4443,62 @@ export namespace toolresults_v1beta3 { /** * toolresults.samples.batchCreate * @desc Creates a batch of PerfSamples - a client can submit multiple batches of Perf Samples through repeated calls to this method in order to split up a large request payload - duplicates and existing timestamp entries will be ignored. - the batch operation may partially succeed - the set of elements successfully inserted is returned in the response (omits items which already existed in the database). May return any of the following canonical error codes: - NOT_FOUND - The containing PerfSampleSeries does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.samples.batchCreate({ + * // A tool results execution ID. + * executionId: 'placeholder-value', + * // A tool results history ID. + * historyId: 'placeholder-value', + * // The cloud project + * projectId: 'placeholder-value', + * // A sample series id + * sampleSeriesId: 'placeholder-value', + * // A tool results step ID. + * stepId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "perfSamples": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "perfSamples": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.samples.batchCreate * @memberOf! () * @@ -3581,6 +4599,60 @@ export namespace toolresults_v1beta3 { /** * toolresults.samples.list * @desc Lists the Performance Samples of a given Sample Series - The list results are sorted by timestamps ascending - The default page size is 500 samples; and maximum size allowed 5000 - The response token indicates the last returned PerfSample timestamp - When the results size exceeds the page size, submit a subsequent request including the page token to return the rest of the samples up to the page limit May return any of the following canonical error codes: - OUT_OF_RANGE - The specified request page_token is out of valid range - NOT_FOUND - The containing PerfSampleSeries does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.samples.list({ + * // A tool results execution ID. + * executionId: 'placeholder-value', + * // A tool results history ID. + * historyId: 'placeholder-value', + * // The default page size is 500 samples, and the maximum size is 5000. If + * // the page_size is greater than 5000, the effective page size will be 5000 + * pageSize: 'placeholder-value', + * // Optional, the next_page_token returned in the previous response + * pageToken: 'placeholder-value', + * // The cloud project + * projectId: 'placeholder-value', + * // A sample series id + * sampleSeriesId: 'placeholder-value', + * // A tool results step ID. + * stepId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "perfSamples": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.samples.list * @memberOf! () * @@ -3750,6 +4822,60 @@ export namespace toolresults_v1beta3 { /** * toolresults.steps.accessibilityClusters * @desc Lists accessibility clusters for a given Step May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to read project - INVALID_ARGUMENT - if the request is malformed - FAILED_PRECONDITION - if an argument in the request happens to be invalid; e.g. if the locale format is incorrect - NOT_FOUND - if the containing Step does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.steps.accessibilityClusters({ + * // The accepted format is the canonical Unicode format with hyphen as a + * // delimiter. Language must be lowercase, Language Script - Capitalized, + * // Region - UPPERCASE. + * // See http://www.unicode.org/reports/tr35/#Unicode_locale_identifier for + * // details. + * // + * // Required. + * locale: 'placeholder-value', + * // A full resource name of the step. + * // For example, projects/my-project/histories/bh.1234567890abcdef/executions/ + * // 1234567890123456789/steps/bs.1234567890abcdef + * // + * // Required. + * name: + * 'projects/my-project/histories/my-historie/executions/my-execution/steps/my-step', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clusters": [], + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.steps.accessibilityClusters * @memberOf! () * @@ -3841,6 +4967,91 @@ export namespace toolresults_v1beta3 { /** * toolresults.steps.create * @desc Creates a Step. The returned Step will have the id set. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to write to project - INVALID_ARGUMENT - if the request is malformed - FAILED_PRECONDITION - if the step is too large (more than 10Mib) - NOT_FOUND - if the containing Execution does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.steps.create({ + * // Required. An Execution id. + * executionId: 'placeholder-value', + * // Required. A History id. + * historyId: 'placeholder-value', + * // Required. A Project id. + * projectId: 'placeholder-value', + * // A unique request ID for server to detect duplicated requests. + * // For example, a UUID. + * // + * // Optional, but strongly recommended. + * requestId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "completionTime": {}, + * // "creationTime": {}, + * // "description": "my_description", + * // "deviceUsageDuration": {}, + * // "dimensionValue": [], + * // "hasImages": false, + * // "labels": [], + * // "multiStep": {}, + * // "name": "my_name", + * // "outcome": {}, + * // "runDuration": {}, + * // "state": "my_state", + * // "stepId": "my_stepId", + * // "testExecutionStep": {}, + * // "toolExecutionStep": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "completionTime": {}, + * // "creationTime": {}, + * // "description": "my_description", + * // "deviceUsageDuration": {}, + * // "dimensionValue": [], + * // "hasImages": false, + * // "labels": [], + * // "multiStep": {}, + * // "name": "my_name", + * // "outcome": {}, + * // "runDuration": {}, + * // "state": "my_state", + * // "stepId": "my_stepId", + * // "testExecutionStep": {}, + * // "toolExecutionStep": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.steps.create * @memberOf! () * @@ -3916,6 +5127,74 @@ export namespace toolresults_v1beta3 { /** * toolresults.steps.get * @desc Gets a Step. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to read project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the Step does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.steps.get({ + * // A Execution id. + * // + * // Required. + * executionId: 'placeholder-value', + * // A History id. + * // + * // Required. + * historyId: 'placeholder-value', + * // A Project id. + * // + * // Required. + * projectId: 'placeholder-value', + * // A Step id. + * // + * // Required. + * stepId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "completionTime": {}, + * // "creationTime": {}, + * // "description": "my_description", + * // "deviceUsageDuration": {}, + * // "dimensionValue": [], + * // "hasImages": false, + * // "labels": [], + * // "multiStep": {}, + * // "name": "my_name", + * // "outcome": {}, + * // "runDuration": {}, + * // "state": "my_state", + * // "stepId": "my_stepId", + * // "testExecutionStep": {}, + * // "toolExecutionStep": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.steps.get * @memberOf! () * @@ -3990,6 +5269,59 @@ export namespace toolresults_v1beta3 { /** * toolresults.steps.getPerfMetricsSummary * @desc Retrieves a PerfMetricsSummary. May return any of the following error code(s): - NOT_FOUND - The specified PerfMetricsSummary does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.steps.getPerfMetricsSummary({ + * // A tool results execution ID. + * executionId: 'placeholder-value', + * // A tool results history ID. + * historyId: 'placeholder-value', + * // The cloud project + * projectId: 'placeholder-value', + * // A tool results step ID. + * stepId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "appStartTime": {}, + * // "executionId": "my_executionId", + * // "graphicsStats": {}, + * // "historyId": "my_historyId", + * // "perfEnvironment": {}, + * // "perfMetrics": [], + * // "projectId": "my_projectId", + * // "stepId": "my_stepId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.steps.getPerfMetricsSummary * @memberOf! () * @@ -4069,6 +5401,68 @@ export namespace toolresults_v1beta3 { /** * toolresults.steps.list * @desc Lists Steps for a given Execution. The steps are sorted by creation_time in descending order. The step_id key will be used to order the steps with the same creation_time. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to read project - INVALID_ARGUMENT - if the request is malformed - FAILED_PRECONDITION - if an argument in the request happens to be invalid; e.g. if an attempt is made to list the children of a nonexistent Step - NOT_FOUND - if the containing Execution does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.steps.list({ + * // A Execution id. + * // + * // Required. + * executionId: 'placeholder-value', + * // A History id. + * // + * // Required. + * historyId: 'placeholder-value', + * // The maximum number of Steps to fetch. + * // + * // Default value: 25. The server will use this default if the field is not set + * // or has a value of 0. + * // + * // Optional. + * pageSize: 'placeholder-value', + * // A continuation token to resume the query at the next item. + * // + * // Optional. + * pageToken: 'placeholder-value', + * // A Project id. + * // + * // Required. + * projectId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "steps": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.steps.list * @memberOf! () * @@ -4146,6 +5540,101 @@ export namespace toolresults_v1beta3 { /** * toolresults.steps.patch * @desc Updates an existing Step with the supplied partial entity. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to write project - INVALID_ARGUMENT - if the request is malformed - FAILED_PRECONDITION - if the requested state transition is illegal (e.g try to upload a duplicate xml file), if the updated step is too large (more than 10Mib) - NOT_FOUND - if the containing Execution does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.steps.patch({ + * // A Execution id. + * // + * // Required. + * executionId: 'placeholder-value', + * // A History id. + * // + * // Required. + * historyId: 'placeholder-value', + * // A Project id. + * // + * // Required. + * projectId: 'placeholder-value', + * // A unique request ID for server to detect duplicated requests. + * // For example, a UUID. + * // + * // Optional, but strongly recommended. + * requestId: 'placeholder-value', + * // A Step id. + * // + * // Required. + * stepId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "completionTime": {}, + * // "creationTime": {}, + * // "description": "my_description", + * // "deviceUsageDuration": {}, + * // "dimensionValue": [], + * // "hasImages": false, + * // "labels": [], + * // "multiStep": {}, + * // "name": "my_name", + * // "outcome": {}, + * // "runDuration": {}, + * // "state": "my_state", + * // "stepId": "my_stepId", + * // "testExecutionStep": {}, + * // "toolExecutionStep": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "completionTime": {}, + * // "creationTime": {}, + * // "description": "my_description", + * // "deviceUsageDuration": {}, + * // "dimensionValue": [], + * // "hasImages": false, + * // "labels": [], + * // "multiStep": {}, + * // "name": "my_name", + * // "outcome": {}, + * // "runDuration": {}, + * // "state": "my_state", + * // "stepId": "my_stepId", + * // "testExecutionStep": {}, + * // "toolExecutionStep": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.steps.patch * @memberOf! () * @@ -4222,6 +5711,83 @@ export namespace toolresults_v1beta3 { /** * toolresults.steps.publishXunitXmlFiles * @desc Publish xml files to an existing Step. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to write project - INVALID_ARGUMENT - if the request is malformed - FAILED_PRECONDITION - if the requested state transition is illegal, e.g try to upload a duplicate xml file or a file too large. - NOT_FOUND - if the containing Execution does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.steps.publishXunitXmlFiles({ + * // A Execution id. + * // + * // Required. + * executionId: 'placeholder-value', + * // A History id. + * // + * // Required. + * historyId: 'placeholder-value', + * // A Project id. + * // + * // Required. + * projectId: 'placeholder-value', + * // A Step id. + * // Note: This step must include a TestExecutionStep. + * // + * // Required. + * stepId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "xunitXmlFiles": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "completionTime": {}, + * // "creationTime": {}, + * // "description": "my_description", + * // "deviceUsageDuration": {}, + * // "dimensionValue": [], + * // "hasImages": false, + * // "labels": [], + * // "multiStep": {}, + * // "name": "my_name", + * // "outcome": {}, + * // "runDuration": {}, + * // "state": "my_state", + * // "stepId": "my_stepId", + * // "testExecutionStep": {}, + * // "toolExecutionStep": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.steps.publishXunitXmlFiles * @memberOf! () * @@ -4485,6 +6051,73 @@ export namespace toolresults_v1beta3 { /** * toolresults.testCases.get * @desc Gets details of a Test Case for a Step. Experimental test cases API. Still in active development. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to write to project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the containing Test Case does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.testCases.get({ + * // A Execution id + * // + * // Required. + * executionId: 'placeholder-value', + * // A History id. + * // + * // Required. + * historyId: 'placeholder-value', + * // A Project id. + * // + * // Required. + * projectId: 'placeholder-value', + * // A Step id. + * // Note: This step must include a TestExecutionStep. + * // + * // Required. + * stepId: 'placeholder-value', + * // A Test Case id. + * // + * // Required. + * testCaseId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "elapsedTime": {}, + * // "endTime": {}, + * // "skippedMessage": "my_skippedMessage", + * // "stackTraces": [], + * // "startTime": {}, + * // "status": "my_status", + * // "testCaseId": "my_testCaseId", + * // "testCaseReference": {}, + * // "toolOutputs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.testCases.get * @memberOf! () * @@ -4572,6 +6205,73 @@ export namespace toolresults_v1beta3 { /** * toolresults.testCases.list * @desc Lists Test Cases attached to a Step. Experimental test cases API. Still in active development. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to write to project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the containing Step does not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.testCases.list({ + * // A Execution id + * // + * // Required. + * executionId: 'placeholder-value', + * // A History id. + * // + * // Required. + * historyId: 'placeholder-value', + * // The maximum number of TestCases to fetch. + * // + * // Default value: 100. The server will use this default if the field is not + * // set or has a value of 0. + * // + * // Optional. + * pageSize: 'placeholder-value', + * // A continuation token to resume the query at the next item. + * // + * // Optional. + * pageToken: 'placeholder-value', + * // A Project id. + * // + * // Required. + * projectId: 'placeholder-value', + * // A Step id. + * // Note: This step must include a TestExecutionStep. + * // + * // Required. + * stepId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "testCases": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.testCases.list * @memberOf! () * @@ -4718,6 +6418,72 @@ export namespace toolresults_v1beta3 { /** * toolresults.thumbnails.list * @desc Lists thumbnails of images attached to a step. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to read from the project, or from any of the images - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the step does not exist, or if any of the images do not exist + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/toolresults.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 toolresults = google.toolresults('v1beta3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 toolresults.thumbnails.list({ + * // An Execution id. + * // + * // Required. + * executionId: 'placeholder-value', + * // A History id. + * // + * // Required. + * historyId: 'placeholder-value', + * // The maximum number of thumbnails to fetch. + * // + * // Default value: 50. The server will use this default if the field is not set + * // or has a value of 0. + * // + * // Optional. + * pageSize: 'placeholder-value', + * // A continuation token to resume the query at the next item. + * // + * // Optional. + * pageToken: 'placeholder-value', + * // A Project id. + * // + * // Required. + * projectId: 'placeholder-value', + * // A Step id. + * // + * // Required. + * stepId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "thumbnails": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias toolresults.thumbnails.list * @memberOf! () * diff --git a/src/apis/tpu/v1.ts b/src/apis/tpu/v1.ts index dfd55641028..d9fba4226fd 100644 --- a/src/apis/tpu/v1.ts +++ b/src/apis/tpu/v1.ts @@ -456,6 +456,50 @@ export namespace tpu_v1 { /** * tpu.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.get * @memberOf! () * @@ -525,6 +569,53 @@ export namespace tpu_v1 { /** * tpu.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.list * @memberOf! () * @@ -648,6 +739,48 @@ export namespace tpu_v1 { /** * tpu.projects.locations.acceleratorTypes.get * @desc Gets AcceleratorType. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.acceleratorTypes.get({ + * // The resource name. + * name: + * 'projects/my-project/locations/my-location/acceleratorTypes/my-acceleratorType', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.acceleratorTypes.get * @memberOf! () * @@ -719,6 +852,56 @@ export namespace tpu_v1 { /** * tpu.projects.locations.acceleratorTypes.list * @desc Lists accelerator types supported by this API. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.acceleratorTypes.list({ + * // List filter. + * filter: 'placeholder-value', + * // Sort results. + * orderBy: 'placeholder-value', + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // The parent resource name. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acceleratorTypes": [], + * // "nextPageToken": "my_nextPageToken", + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.acceleratorTypes.list * @memberOf! () * @@ -854,6 +1037,75 @@ export namespace tpu_v1 { /** * tpu.projects.locations.nodes.create * @desc Creates a node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.nodes.create({ + * // The unqualified resource name. + * nodeId: 'placeholder-value', + * // The parent resource name. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "acceleratorType": "my_acceleratorType", + * // "cidrBlock": "my_cidrBlock", + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "health": "my_health", + * // "healthDescription": "my_healthDescription", + * // "ipAddress": "my_ipAddress", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkEndpoints": [], + * // "port": "my_port", + * // "schedulingConfig": {}, + * // "serviceAccount": "my_serviceAccount", + * // "state": "my_state", + * // "tensorflowVersion": "my_tensorflowVersion" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.nodes.create * @memberOf! () * @@ -930,6 +1182,50 @@ export namespace tpu_v1 { /** * tpu.projects.locations.nodes.delete * @desc Deletes a node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.nodes.delete({ + * // The resource name. + * name: 'projects/my-project/locations/my-location/nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.nodes.delete * @memberOf! () * @@ -1001,6 +1297,61 @@ export namespace tpu_v1 { /** * tpu.projects.locations.nodes.get * @desc Gets the details of a node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.nodes.get({ + * // The resource name. + * name: 'projects/my-project/locations/my-location/nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acceleratorType": "my_acceleratorType", + * // "cidrBlock": "my_cidrBlock", + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "health": "my_health", + * // "healthDescription": "my_healthDescription", + * // "ipAddress": "my_ipAddress", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkEndpoints": [], + * // "port": "my_port", + * // "schedulingConfig": {}, + * // "serviceAccount": "my_serviceAccount", + * // "state": "my_state", + * // "tensorflowVersion": "my_tensorflowVersion" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.nodes.get * @memberOf! () * @@ -1070,6 +1421,52 @@ export namespace tpu_v1 { /** * tpu.projects.locations.nodes.list * @desc Lists nodes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.nodes.list({ + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // The parent resource name. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "nodes": [], + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.nodes.list * @memberOf! () * @@ -1146,6 +1543,58 @@ export namespace tpu_v1 { /** * tpu.projects.locations.nodes.reimage * @desc Reimages a node's OS. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.nodes.reimage({ + * // The resource name. + * name: 'projects/my-project/locations/my-location/nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "tensorflowVersion": "my_tensorflowVersion" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.nodes.reimage * @memberOf! () * @@ -1221,6 +1670,56 @@ export namespace tpu_v1 { /** * tpu.projects.locations.nodes.start * @desc Starts a node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.nodes.start({ + * // The resource name. + * name: 'projects/my-project/locations/my-location/nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.nodes.start * @memberOf! () * @@ -1293,6 +1792,56 @@ export namespace tpu_v1 { /** * tpu.projects.locations.nodes.stop * @desc Stops a node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.nodes.stop({ + * // The resource name. + * name: 'projects/my-project/locations/my-location/nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.nodes.stop * @memberOf! () * @@ -1489,6 +2038,44 @@ export namespace tpu_v1 { /** * tpu.projects.locations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.operations.cancel * @memberOf! () * @@ -1558,6 +2145,44 @@ export namespace tpu_v1 { /** * tpu.projects.locations.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.operations.delete * @memberOf! () * @@ -1627,6 +2252,50 @@ export namespace tpu_v1 { /** * tpu.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.operations.get * @memberOf! () * @@ -1698,6 +2367,53 @@ export namespace tpu_v1 { /** * tpu.projects.locations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.operations.list * @memberOf! () * @@ -1845,6 +2561,48 @@ export namespace tpu_v1 { /** * tpu.projects.locations.tensorflowVersions.get * @desc Gets TensorFlow Version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.tensorflowVersions.get({ + * // The resource name. + * name: + * 'projects/my-project/locations/my-location/tensorflowVersions/my-tensorflowVersion', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "version": "my_version" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.tensorflowVersions.get * @memberOf! () * @@ -1916,6 +2674,56 @@ export namespace tpu_v1 { /** * tpu.projects.locations.tensorflowVersions.list * @desc List TensorFlow versions supported by this API. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.tensorflowVersions.list({ + * // List filter. + * filter: 'placeholder-value', + * // Sort results. + * orderBy: 'placeholder-value', + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // The parent resource name. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "tensorflowVersions": [], + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.tensorflowVersions.list * @memberOf! () * diff --git a/src/apis/tpu/v1alpha1.ts b/src/apis/tpu/v1alpha1.ts index 4062e80a1ff..bdbbefefda4 100644 --- a/src/apis/tpu/v1alpha1.ts +++ b/src/apis/tpu/v1alpha1.ts @@ -456,6 +456,50 @@ export namespace tpu_v1alpha1 { /** * tpu.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.get * @memberOf! () * @@ -525,6 +569,53 @@ export namespace tpu_v1alpha1 { /** * tpu.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.list * @memberOf! () * @@ -648,6 +739,48 @@ export namespace tpu_v1alpha1 { /** * tpu.projects.locations.acceleratorTypes.get * @desc Gets AcceleratorType. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.acceleratorTypes.get({ + * // The resource name. + * name: + * 'projects/my-project/locations/my-location/acceleratorTypes/my-acceleratorType', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "type": "my_type" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.acceleratorTypes.get * @memberOf! () * @@ -719,6 +852,56 @@ export namespace tpu_v1alpha1 { /** * tpu.projects.locations.acceleratorTypes.list * @desc Lists accelerator types supported by this API. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.acceleratorTypes.list({ + * // List filter. + * filter: 'placeholder-value', + * // Sort results. + * orderBy: 'placeholder-value', + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // The parent resource name. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acceleratorTypes": [], + * // "nextPageToken": "my_nextPageToken", + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.acceleratorTypes.list * @memberOf! () * @@ -854,6 +1037,75 @@ export namespace tpu_v1alpha1 { /** * tpu.projects.locations.nodes.create * @desc Creates a node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.nodes.create({ + * // The unqualified resource name. + * nodeId: 'placeholder-value', + * // The parent resource name. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "acceleratorType": "my_acceleratorType", + * // "cidrBlock": "my_cidrBlock", + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "health": "my_health", + * // "healthDescription": "my_healthDescription", + * // "ipAddress": "my_ipAddress", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkEndpoints": [], + * // "port": "my_port", + * // "schedulingConfig": {}, + * // "serviceAccount": "my_serviceAccount", + * // "state": "my_state", + * // "tensorflowVersion": "my_tensorflowVersion" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.nodes.create * @memberOf! () * @@ -930,6 +1182,50 @@ export namespace tpu_v1alpha1 { /** * tpu.projects.locations.nodes.delete * @desc Deletes a node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.nodes.delete({ + * // The resource name. + * name: 'projects/my-project/locations/my-location/nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.nodes.delete * @memberOf! () * @@ -1001,6 +1297,61 @@ export namespace tpu_v1alpha1 { /** * tpu.projects.locations.nodes.get * @desc Gets the details of a node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.nodes.get({ + * // The resource name. + * name: 'projects/my-project/locations/my-location/nodes/my-node', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "acceleratorType": "my_acceleratorType", + * // "cidrBlock": "my_cidrBlock", + * // "createTime": "my_createTime", + * // "description": "my_description", + * // "health": "my_health", + * // "healthDescription": "my_healthDescription", + * // "ipAddress": "my_ipAddress", + * // "labels": {}, + * // "name": "my_name", + * // "network": "my_network", + * // "networkEndpoints": [], + * // "port": "my_port", + * // "schedulingConfig": {}, + * // "serviceAccount": "my_serviceAccount", + * // "state": "my_state", + * // "tensorflowVersion": "my_tensorflowVersion" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.nodes.get * @memberOf! () * @@ -1070,6 +1421,52 @@ export namespace tpu_v1alpha1 { /** * tpu.projects.locations.nodes.list * @desc Lists nodes. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.nodes.list({ + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // The parent resource name. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "nodes": [], + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.nodes.list * @memberOf! () * @@ -1146,6 +1543,58 @@ export namespace tpu_v1alpha1 { /** * tpu.projects.locations.nodes.reimage * @desc Reimages a node's OS. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.nodes.reimage({ + * // The resource name. + * name: 'projects/my-project/locations/my-location/nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "tensorflowVersion": "my_tensorflowVersion" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.nodes.reimage * @memberOf! () * @@ -1221,6 +1670,56 @@ export namespace tpu_v1alpha1 { /** * tpu.projects.locations.nodes.start * @desc Starts a node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.nodes.start({ + * // The resource name. + * name: 'projects/my-project/locations/my-location/nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.nodes.start * @memberOf! () * @@ -1296,6 +1795,56 @@ export namespace tpu_v1alpha1 { /** * tpu.projects.locations.nodes.stop * @desc Stops a node. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.nodes.stop({ + * // The resource name. + * name: 'projects/my-project/locations/my-location/nodes/my-node', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.nodes.stop * @memberOf! () * @@ -1495,6 +2044,44 @@ export namespace tpu_v1alpha1 { /** * tpu.projects.locations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.operations.cancel * @memberOf! () * @@ -1567,6 +2154,44 @@ export namespace tpu_v1alpha1 { /** * tpu.projects.locations.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.operations.delete * @memberOf! () * @@ -1636,6 +2261,50 @@ export namespace tpu_v1alpha1 { /** * tpu.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.operations.get * @memberOf! () * @@ -1707,6 +2376,53 @@ export namespace tpu_v1alpha1 { /** * tpu.projects.locations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.operations.list * @memberOf! () * @@ -1854,6 +2570,48 @@ export namespace tpu_v1alpha1 { /** * tpu.projects.locations.tensorflowVersions.get * @desc Gets TensorFlow Version. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.tensorflowVersions.get({ + * // The resource name. + * name: + * 'projects/my-project/locations/my-location/tensorflowVersions/my-tensorflowVersion', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "name": "my_name", + * // "version": "my_version" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.tensorflowVersions.get * @memberOf! () * @@ -1925,6 +2683,56 @@ export namespace tpu_v1alpha1 { /** * tpu.projects.locations.tensorflowVersions.list * @desc Lists TensorFlow versions supported by this API. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/tpu.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 tpu = google.tpu('v1alpha1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 tpu.projects.locations.tensorflowVersions.list({ + * // List filter. + * filter: 'placeholder-value', + * // Sort results. + * orderBy: 'placeholder-value', + * // The maximum number of items to return. + * pageSize: 'placeholder-value', + * // The next_page_token value returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // The parent resource name. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "tensorflowVersions": [], + * // "unreachable": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias tpu.projects.locations.tensorflowVersions.list * @memberOf! () * diff --git a/src/apis/translate/v2.ts b/src/apis/translate/v2.ts index 745000473d1..0e8b3a39603 100644 --- a/src/apis/translate/v2.ts +++ b/src/apis/translate/v2.ts @@ -227,6 +227,54 @@ export namespace translate_v2 { /** * language.detections.detect * @desc Detects the language of text within a request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v2'); + * + * 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/cloud-translation', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.detections.detect({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "q": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "detections": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.detections.detect * @memberOf! () * @@ -303,6 +351,50 @@ export namespace translate_v2 { /** * language.detections.list * @desc Detects the language of text within a request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v2'); + * + * 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/cloud-translation', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.detections.list({ + * // The input text upon which to perform language detection. Repeat this + * // parameter to perform language detection on multiple text inputs. + * q: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "detections": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.detections.list * @memberOf! () * @@ -409,6 +501,52 @@ export namespace translate_v2 { /** * language.languages.list * @desc Returns a list of supported languages for translation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v2'); + * + * 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/cloud-translation', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.languages.list({ + * // The model type for which supported languages should be returned. + * model: 'placeholder-value', + * // The language to use to return localized, human readable names of supported + * // languages. + * target: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "languages": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.languages.list * @memberOf! () * @@ -508,6 +646,66 @@ export namespace translate_v2 { /** * language.translations.list * @desc Translates input text, returning translated text. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v2'); + * + * 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/cloud-translation', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.translations.list({ + * // The customization id for translate + * cid: 'placeholder-value', + * // The format of the source text, in either HTML (default) or plain-text. A + * // value of "html" indicates HTML and a value of "text" indicates plain-text. + * format: 'placeholder-value', + * // The `model` type requested for this translation. Valid values are + * // listed in public documentation. + * model: 'placeholder-value', + * // The input text to translate. Repeat this parameter to perform translation + * // operations on multiple text inputs. + * q: 'placeholder-value', + * // The language of the source text, set to one of the language codes listed in + * // Language Support. If the source language is not specified, the API will + * // attempt to identify the source language automatically and return it within + * // the response. + * source: 'placeholder-value', + * // The language to use for translation of the input text, set to one of the + * // language codes listed in Language Support. + * target: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "translations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.translations.list * @memberOf! () * @@ -589,6 +787,58 @@ export namespace translate_v2 { /** * language.translations.translate * @desc Translates input text, returning translated text. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v2'); + * + * 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/cloud-translation', + * 'https://www.googleapis.com/auth/cloud-platform', + * ], + * }); + * + * // 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 language.translations.translate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "format": "my_format", + * // "model": "my_model", + * // "q": [], + * // "source": "my_source", + * // "target": "my_target" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "translations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias language.translations.translate * @memberOf! () * diff --git a/src/apis/translate/v3.ts b/src/apis/translate/v3.ts index 437bfa3d9b6..a273fcd75ae 100644 --- a/src/apis/translate/v3.ts +++ b/src/apis/translate/v3.ts @@ -535,6 +535,70 @@ export namespace translate_v3 { /** * translate.projects.detectLanguage * @desc Detects the language of text within a request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.detectLanguage({ + * // Required. Project or location to make a call. Must refer to a caller's + * // project. + * // + * // Format: `projects/{project-number-or-id}/locations/{location-id}` or + * // `projects/{project-number-or-id}`. + * // + * // For global calls, use `projects/{project-number-or-id}/locations/global` or + * // `projects/{project-number-or-id}`. + * // + * // Only models within the same region (has same location-id) can be used. + * // Otherwise an INVALID_ARGUMENT (400) error is returned. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "content": "my_content", + * // "labels": {}, + * // "mimeType": "my_mimeType", + * // "model": "my_model" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "languages": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.detectLanguage * @memberOf! () * @@ -614,6 +678,80 @@ export namespace translate_v3 { /** * translate.projects.getSupportedLanguages * @desc Returns a list of supported languages for translation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.getSupportedLanguages({ + * // Optional. The language to use to return localized, human readable names + * // of supported languages. If missing, then display names are not returned + * // in a response. + * displayLanguageCode: 'placeholder-value', + * // Optional. Get supported languages of this model. + * // + * // The format depends on model type: + * // + * // - AutoML Translation models: + * // `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * // + * // - General (built-in) models: + * // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + * // + * // + * // Returns languages supported by the specified model. + * // If missing, we get supported languages of Google general base (PBMT) model. + * model: 'placeholder-value', + * // Required. Project or location to make a call. Must refer to a caller's + * // project. + * // + * // Format: `projects/{project-number-or-id}` or + * // `projects/{project-number-or-id}/locations/{location-id}`. + * // + * // For global calls, use `projects/{project-number-or-id}/locations/global` or + * // `projects/{project-number-or-id}`. + * // + * // Non-global location is required for AutoML models. + * // + * // Only models within the same region (have same location-id) can be used, + * // otherwise an INVALID_ARGUMENT (400) error is returned. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "languages": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.getSupportedLanguages * @memberOf! () * @@ -692,6 +830,77 @@ export namespace translate_v3 { /** * translate.projects.translateText * @desc Translates input text and returns translated text. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.translateText({ + * // Required. Project or location to make a call. Must refer to a caller's + * // project. + * // + * // Format: `projects/{project-number-or-id}` or + * // `projects/{project-number-or-id}/locations/{location-id}`. + * // + * // For global calls, use `projects/{project-number-or-id}/locations/global` or + * // `projects/{project-number-or-id}`. + * // + * // Non-global location is required for requests using AutoML models or + * // custom glossaries. + * // + * // Models and glossaries must be within the same region (have same + * // location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contents": [], + * // "glossaryConfig": {}, + * // "labels": {}, + * // "mimeType": "my_mimeType", + * // "model": "my_model", + * // "sourceLanguageCode": "my_sourceLanguageCode", + * // "targetLanguageCode": "my_targetLanguageCode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "glossaryTranslations": [], + * // "translations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.translateText * @memberOf! () * @@ -841,6 +1050,72 @@ export namespace translate_v3 { /** * translate.projects.locations.batchTranslateText * @desc Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 translate.projects.locations.batchTranslateText({ + * // Required. Location to make a call. Must refer to a caller's project. + * // + * // Format: `projects/{project-number-or-id}/locations/{location-id}`. + * // + * // The `global` location is not supported for batch translation. + * // + * // Only AutoML Translation models or glossaries within the same region (have + * // the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + * // error is returned. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "glossaries": {}, + * // "inputConfigs": [], + * // "labels": {}, + * // "models": {}, + * // "outputConfig": {}, + * // "sourceLanguageCode": "my_sourceLanguageCode", + * // "targetLanguageCodes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.batchTranslateText * @memberOf! () * @@ -916,6 +1191,70 @@ export namespace translate_v3 { /** * translate.projects.locations.detectLanguage * @desc Detects the language of text within a request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.detectLanguage({ + * // Required. Project or location to make a call. Must refer to a caller's + * // project. + * // + * // Format: `projects/{project-number-or-id}/locations/{location-id}` or + * // `projects/{project-number-or-id}`. + * // + * // For global calls, use `projects/{project-number-or-id}/locations/global` or + * // `projects/{project-number-or-id}`. + * // + * // Only models within the same region (has same location-id) can be used. + * // Otherwise an INVALID_ARGUMENT (400) error is returned. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "content": "my_content", + * // "labels": {}, + * // "mimeType": "my_mimeType", + * // "model": "my_model" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "languages": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.detectLanguage * @memberOf! () * @@ -995,6 +1334,53 @@ export namespace translate_v3 { /** * translate.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.get * @memberOf! () * @@ -1064,6 +1450,80 @@ export namespace translate_v3 { /** * translate.projects.locations.getSupportedLanguages * @desc Returns a list of supported languages for translation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.getSupportedLanguages({ + * // Optional. The language to use to return localized, human readable names + * // of supported languages. If missing, then display names are not returned + * // in a response. + * displayLanguageCode: 'placeholder-value', + * // Optional. Get supported languages of this model. + * // + * // The format depends on model type: + * // + * // - AutoML Translation models: + * // `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * // + * // - General (built-in) models: + * // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + * // + * // + * // Returns languages supported by the specified model. + * // If missing, we get supported languages of Google general base (PBMT) model. + * model: 'placeholder-value', + * // Required. Project or location to make a call. Must refer to a caller's + * // project. + * // + * // Format: `projects/{project-number-or-id}` or + * // `projects/{project-number-or-id}/locations/{location-id}`. + * // + * // For global calls, use `projects/{project-number-or-id}/locations/global` or + * // `projects/{project-number-or-id}`. + * // + * // Non-global location is required for AutoML models. + * // + * // Only models within the same region (have same location-id) can be used, + * // otherwise an INVALID_ARGUMENT (400) error is returned. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "languages": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.getSupportedLanguages * @memberOf! () * @@ -1142,6 +1602,56 @@ export namespace translate_v3 { /** * translate.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.list * @memberOf! () * @@ -1221,6 +1731,77 @@ export namespace translate_v3 { /** * translate.projects.locations.translateText * @desc Translates input text and returns translated text. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.translateText({ + * // Required. Project or location to make a call. Must refer to a caller's + * // project. + * // + * // Format: `projects/{project-number-or-id}` or + * // `projects/{project-number-or-id}/locations/{location-id}`. + * // + * // For global calls, use `projects/{project-number-or-id}/locations/global` or + * // `projects/{project-number-or-id}`. + * // + * // Non-global location is required for requests using AutoML models or + * // custom glossaries. + * // + * // Models and glossaries must be within the same region (have same + * // location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contents": [], + * // "glossaryConfig": {}, + * // "labels": {}, + * // "mimeType": "my_mimeType", + * // "model": "my_model", + * // "sourceLanguageCode": "my_sourceLanguageCode", + * // "targetLanguageCode": "my_targetLanguageCode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "glossaryTranslations": [], + * // "translations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.translateText * @memberOf! () * @@ -1415,6 +1996,64 @@ export namespace translate_v3 { /** * translate.projects.locations.glossaries.create * @desc Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3'); + * + * 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/cloud-platform'], + * }); + * + * // 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 translate.projects.locations.glossaries.create({ + * // Required. The project name. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "endTime": "my_endTime", + * // "entryCount": 0, + * // "inputConfig": {}, + * // "languageCodesSet": {}, + * // "languagePair": {}, + * // "name": "my_name", + * // "submitTime": "my_submitTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.glossaries.create * @memberOf! () * @@ -1490,6 +2129,53 @@ export namespace translate_v3 { /** * translate.projects.locations.glossaries.delete * @desc Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.glossaries.delete({ + * // Required. The name of the glossary to delete. + * name: 'projects/my-project/locations/my-location/glossaries/my-glossarie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.glossaries.delete * @memberOf! () * @@ -1561,6 +2247,55 @@ export namespace translate_v3 { /** * translate.projects.locations.glossaries.get * @desc Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.glossaries.get({ + * // Required. The name of the glossary to retrieve. + * name: 'projects/my-project/locations/my-location/glossaries/my-glossarie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "entryCount": 0, + * // "inputConfig": {}, + * // "languageCodesSet": {}, + * // "languagePair": {}, + * // "name": "my_name", + * // "submitTime": "my_submitTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.glossaries.get * @memberOf! () * @@ -1630,6 +2365,62 @@ export namespace translate_v3 { /** * translate.projects.locations.glossaries.list * @desc Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.glossaries.list({ + * // Optional. Filter specifying constraints of a list operation. + * // Filtering is not supported yet, and the parameter currently has no effect. + * // If missing, no filtering is performed. + * filter: 'placeholder-value', + * // Optional. Requested page size. The server may return fewer glossaries than + * // requested. If unspecified, the server picks an appropriate default. + * pageSize: 'placeholder-value', + * // Optional. A token identifying a page of results the server should return. + * // Typically, this is the value of [ListGlossariesResponse.next_page_token] + * // returned from the previous call to `ListGlossaries` method. + * // The first page is returned if `page_token`is empty or missing. + * pageToken: 'placeholder-value', + * // Required. The name of the project from which to list all of the glossaries. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "glossaries": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.glossaries.list * @memberOf! () * @@ -1782,6 +2573,53 @@ export namespace translate_v3 { /** * translate.projects.locations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.operations.cancel * @memberOf! () * @@ -1852,6 +2690,47 @@ export namespace translate_v3 { /** * translate.projects.locations.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.operations.delete * @memberOf! () * @@ -1921,6 +2800,53 @@ export namespace translate_v3 { /** * translate.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.operations.get * @memberOf! () * @@ -1992,6 +2918,56 @@ export namespace translate_v3 { /** * translate.projects.locations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.operations.list * @memberOf! () * @@ -2071,6 +3047,61 @@ export namespace translate_v3 { /** * translate.projects.locations.operations.wait * @desc Waits for the specified long-running operation until it is done or reaches at most a specified timeout, returning the latest state. If the operation is already done, the latest state is immediately returned. If the timeout specified is greater than the default HTTP/RPC timeout, the HTTP/RPC timeout is used. If the server does not support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort basis. It may return the latest state before the specified timeout (including immediately), meaning even an immediate response is no guarantee that the operation is done. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.operations.wait({ + * // The name of the operation resource to wait on. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "timeout": "my_timeout" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.operations.wait * @memberOf! () * diff --git a/src/apis/translate/v3beta1.ts b/src/apis/translate/v3beta1.ts index c7778d01fcc..312bacac3b8 100644 --- a/src/apis/translate/v3beta1.ts +++ b/src/apis/translate/v3beta1.ts @@ -535,6 +535,70 @@ export namespace translate_v3beta1 { /** * translate.projects.detectLanguage * @desc Detects the language of text within a request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.detectLanguage({ + * // Required. Project or location to make a call. Must refer to a caller's + * // project. + * // + * // Format: `projects/{project-number-or-id}/locations/{location-id}` or + * // `projects/{project-number-or-id}`. + * // + * // For global calls, use `projects/{project-number-or-id}/locations/global` or + * // `projects/{project-number-or-id}`. + * // + * // Only models within the same region (has same location-id) can be used. + * // Otherwise an INVALID_ARGUMENT (400) error is returned. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "content": "my_content", + * // "labels": {}, + * // "mimeType": "my_mimeType", + * // "model": "my_model" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "languages": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.detectLanguage * @memberOf! () * @@ -614,6 +678,80 @@ export namespace translate_v3beta1 { /** * translate.projects.getSupportedLanguages * @desc Returns a list of supported languages for translation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.getSupportedLanguages({ + * // Optional. The language to use to return localized, human readable names + * // of supported languages. If missing, then display names are not returned + * // in a response. + * displayLanguageCode: 'placeholder-value', + * // Optional. Get supported languages of this model. + * // + * // The format depends on model type: + * // + * // - AutoML Translation models: + * // `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * // + * // - General (built-in) models: + * // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + * // + * // + * // Returns languages supported by the specified model. + * // If missing, we get supported languages of Google general base (PBMT) model. + * model: 'placeholder-value', + * // Required. Project or location to make a call. Must refer to a caller's + * // project. + * // + * // Format: `projects/{project-number-or-id}` or + * // `projects/{project-number-or-id}/locations/{location-id}`. + * // + * // For global calls, use `projects/{project-number-or-id}/locations/global` or + * // `projects/{project-number-or-id}`. + * // + * // Non-global location is required for AutoML models. + * // + * // Only models within the same region (have same location-id) can be used, + * // otherwise an INVALID_ARGUMENT (400) error is returned. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "languages": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.getSupportedLanguages * @memberOf! () * @@ -692,6 +830,77 @@ export namespace translate_v3beta1 { /** * translate.projects.translateText * @desc Translates input text and returns translated text. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.translateText({ + * // Required. Project or location to make a call. Must refer to a caller's + * // project. + * // + * // Format: `projects/{project-number-or-id}` or + * // `projects/{project-number-or-id}/locations/{location-id}`. + * // + * // For global calls, use `projects/{project-number-or-id}/locations/global` or + * // `projects/{project-number-or-id}`. + * // + * // Non-global location is required for requests using AutoML models or + * // custom glossaries. + * // + * // Models and glossaries must be within the same region (have same + * // location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contents": [], + * // "glossaryConfig": {}, + * // "labels": {}, + * // "mimeType": "my_mimeType", + * // "model": "my_model", + * // "sourceLanguageCode": "my_sourceLanguageCode", + * // "targetLanguageCode": "my_targetLanguageCode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "glossaryTranslations": [], + * // "translations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.translateText * @memberOf! () * @@ -841,6 +1050,72 @@ export namespace translate_v3beta1 { /** * translate.projects.locations.batchTranslateText * @desc Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 translate.projects.locations.batchTranslateText({ + * // Required. Location to make a call. Must refer to a caller's project. + * // + * // Format: `projects/{project-number-or-id}/locations/{location-id}`. + * // + * // The `global` location is not supported for batch translation. + * // + * // Only AutoML Translation models or glossaries within the same region (have + * // the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + * // error is returned. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "glossaries": {}, + * // "inputConfigs": [], + * // "labels": {}, + * // "models": {}, + * // "outputConfig": {}, + * // "sourceLanguageCode": "my_sourceLanguageCode", + * // "targetLanguageCodes": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.batchTranslateText * @memberOf! () * @@ -916,6 +1191,70 @@ export namespace translate_v3beta1 { /** * translate.projects.locations.detectLanguage * @desc Detects the language of text within a request. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.detectLanguage({ + * // Required. Project or location to make a call. Must refer to a caller's + * // project. + * // + * // Format: `projects/{project-number-or-id}/locations/{location-id}` or + * // `projects/{project-number-or-id}`. + * // + * // For global calls, use `projects/{project-number-or-id}/locations/global` or + * // `projects/{project-number-or-id}`. + * // + * // Only models within the same region (has same location-id) can be used. + * // Otherwise an INVALID_ARGUMENT (400) error is returned. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "content": "my_content", + * // "labels": {}, + * // "mimeType": "my_mimeType", + * // "model": "my_model" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "languages": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.detectLanguage * @memberOf! () * @@ -995,6 +1334,53 @@ export namespace translate_v3beta1 { /** * translate.projects.locations.get * @desc Gets information about a location. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.get({ + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "labels": {}, + * // "locationId": "my_locationId", + * // "metadata": {}, + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.get * @memberOf! () * @@ -1064,6 +1450,80 @@ export namespace translate_v3beta1 { /** * translate.projects.locations.getSupportedLanguages * @desc Returns a list of supported languages for translation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.getSupportedLanguages({ + * // Optional. The language to use to return localized, human readable names + * // of supported languages. If missing, then display names are not returned + * // in a response. + * displayLanguageCode: 'placeholder-value', + * // Optional. Get supported languages of this model. + * // + * // The format depends on model type: + * // + * // - AutoML Translation models: + * // `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + * // + * // - General (built-in) models: + * // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + * // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` + * // + * // + * // Returns languages supported by the specified model. + * // If missing, we get supported languages of Google general base (PBMT) model. + * model: 'placeholder-value', + * // Required. Project or location to make a call. Must refer to a caller's + * // project. + * // + * // Format: `projects/{project-number-or-id}` or + * // `projects/{project-number-or-id}/locations/{location-id}`. + * // + * // For global calls, use `projects/{project-number-or-id}/locations/global` or + * // `projects/{project-number-or-id}`. + * // + * // Non-global location is required for AutoML models. + * // + * // Only models within the same region (have same location-id) can be used, + * // otherwise an INVALID_ARGUMENT (400) error is returned. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "languages": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.getSupportedLanguages * @memberOf! () * @@ -1142,6 +1602,56 @@ export namespace translate_v3beta1 { /** * translate.projects.locations.list * @desc Lists information about the supported locations for this service. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "locations": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.list * @memberOf! () * @@ -1221,6 +1731,77 @@ export namespace translate_v3beta1 { /** * translate.projects.locations.translateText * @desc Translates input text and returns translated text. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.translateText({ + * // Required. Project or location to make a call. Must refer to a caller's + * // project. + * // + * // Format: `projects/{project-number-or-id}` or + * // `projects/{project-number-or-id}/locations/{location-id}`. + * // + * // For global calls, use `projects/{project-number-or-id}/locations/global` or + * // `projects/{project-number-or-id}`. + * // + * // Non-global location is required for requests using AutoML models or + * // custom glossaries. + * // + * // Models and glossaries must be within the same region (have same + * // location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contents": [], + * // "glossaryConfig": {}, + * // "labels": {}, + * // "mimeType": "my_mimeType", + * // "model": "my_model", + * // "sourceLanguageCode": "my_sourceLanguageCode", + * // "targetLanguageCode": "my_targetLanguageCode" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "glossaryTranslations": [], + * // "translations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.translateText * @memberOf! () * @@ -1415,6 +1996,64 @@ export namespace translate_v3beta1 { /** * translate.projects.locations.glossaries.create * @desc Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 translate.projects.locations.glossaries.create({ + * // Required. The project name. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "endTime": "my_endTime", + * // "entryCount": 0, + * // "inputConfig": {}, + * // "languageCodesSet": {}, + * // "languagePair": {}, + * // "name": "my_name", + * // "submitTime": "my_submitTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.glossaries.create * @memberOf! () * @@ -1490,6 +2129,53 @@ export namespace translate_v3beta1 { /** * translate.projects.locations.glossaries.delete * @desc Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.glossaries.delete({ + * // Required. The name of the glossary to delete. + * name: 'projects/my-project/locations/my-location/glossaries/my-glossarie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.glossaries.delete * @memberOf! () * @@ -1561,6 +2247,55 @@ export namespace translate_v3beta1 { /** * translate.projects.locations.glossaries.get * @desc Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.glossaries.get({ + * // Required. The name of the glossary to retrieve. + * name: 'projects/my-project/locations/my-location/glossaries/my-glossarie', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "entryCount": 0, + * // "inputConfig": {}, + * // "languageCodesSet": {}, + * // "languagePair": {}, + * // "name": "my_name", + * // "submitTime": "my_submitTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.glossaries.get * @memberOf! () * @@ -1630,6 +2365,62 @@ export namespace translate_v3beta1 { /** * translate.projects.locations.glossaries.list * @desc Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.glossaries.list({ + * // Optional. Filter specifying constraints of a list operation. + * // Filtering is not supported yet, and the parameter currently has no effect. + * // If missing, no filtering is performed. + * filter: 'placeholder-value', + * // Optional. Requested page size. The server may return fewer glossaries than + * // requested. If unspecified, the server picks an appropriate default. + * pageSize: 'placeholder-value', + * // Optional. A token identifying a page of results the server should return. + * // Typically, this is the value of [ListGlossariesResponse.next_page_token] + * // returned from the previous call to `ListGlossaries` method. + * // The first page is returned if `page_token`is empty or missing. + * pageToken: 'placeholder-value', + * // Required. The name of the project from which to list all of the glossaries. + * parent: 'projects/my-project/locations/my-location', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "glossaries": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.glossaries.list * @memberOf! () * @@ -1782,6 +2573,53 @@ export namespace translate_v3beta1 { /** * translate.projects.locations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.operations.cancel * @memberOf! () * @@ -1855,6 +2693,47 @@ export namespace translate_v3beta1 { /** * translate.projects.locations.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.operations.delete * @memberOf! () * @@ -1924,6 +2803,53 @@ export namespace translate_v3beta1 { /** * translate.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.operations.get * @memberOf! () * @@ -1995,6 +2921,56 @@ export namespace translate_v3beta1 { /** * translate.projects.locations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.operations.list * @memberOf! () * @@ -2074,6 +3050,61 @@ export namespace translate_v3beta1 { /** * translate.projects.locations.operations.wait * @desc Waits for the specified long-running operation until it is done or reaches at most a specified timeout, returning the latest state. If the operation is already done, the latest state is immediately returned. If the timeout specified is greater than the default HTTP/RPC timeout, the HTTP/RPC timeout is used. If the server does not support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort basis. It may return the latest state before the specified timeout (including immediately), meaning even an immediate response is no guarantee that the operation is done. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/translate.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 translate = google.translate('v3beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-translation', + * ], + * }); + * + * // 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 translate.projects.locations.operations.wait({ + * // The name of the operation resource to wait on. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "timeout": "my_timeout" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias translate.projects.locations.operations.wait * @memberOf! () * diff --git a/src/apis/vault/v1.ts b/src/apis/vault/v1.ts index b8f7de745d1..ddcaad3945b 100644 --- a/src/apis/vault/v1.ts +++ b/src/apis/vault/v1.ts @@ -852,6 +852,57 @@ export namespace vault_v1 { /** * vault.matters.addPermissions * @desc Adds an account as a matter collaborator. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery'], + * }); + * + * // 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 vault.matters.addPermissions({ + * // The matter ID. + * matterId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ccMe": false, + * // "matterPermission": {}, + * // "sendEmails": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "role": "my_role" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.addPermissions * @memberOf! () * @@ -929,6 +980,52 @@ export namespace vault_v1 { /** * vault.matters.close * @desc Closes the specified matter. Returns matter with updated state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery'], + * }); + * + * // 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 vault.matters.close({ + * // The matter ID. + * matterId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "matter": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.close * @memberOf! () * @@ -1003,6 +1100,59 @@ export namespace vault_v1 { /** * vault.matters.create * @desc Creates a new matter with the given name and description. The initial state is open, and the owner is the method caller. Returns the created matter with default view. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery'], + * }); + * + * // 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 vault.matters.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "matterId": "my_matterId", + * // "matterPermissions": [], + * // "name": "my_name", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "matterId": "my_matterId", + * // "matterPermissions": [], + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.create * @memberOf! () * @@ -1071,6 +1221,50 @@ export namespace vault_v1 { /** * vault.matters.delete * @desc Deletes the specified matter. Returns matter with updated state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery'], + * }); + * + * // 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 vault.matters.delete({ + * // The matter ID + * matterId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "matterId": "my_matterId", + * // "matterPermissions": [], + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.delete * @memberOf! () * @@ -1142,6 +1336,55 @@ export namespace vault_v1 { /** * vault.matters.get * @desc Gets the specified matter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery', + * 'https://www.googleapis.com/auth/ediscovery.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 vault.matters.get({ + * // The matter ID. + * matterId: 'placeholder-value', + * // Specifies which parts of the Matter to return in the response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "matterId": "my_matterId", + * // "matterPermissions": [], + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.get * @memberOf! () * @@ -1214,6 +1457,58 @@ export namespace vault_v1 { /** * vault.matters.list * @desc Lists matters the user has access to. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery', + * 'https://www.googleapis.com/auth/ediscovery.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 vault.matters.list({ + * // The number of matters to return in the response. + * // Default and maximum are 100. + * pageSize: 'placeholder-value', + * // The pagination token as returned in the response. + * pageToken: 'placeholder-value', + * // If set, list only matters with that specific state. The default is listing + * // matters of all states. + * state: 'placeholder-value', + * // Specifies which parts of the matter to return in response. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "matters": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.list * @memberOf! () * @@ -1287,6 +1582,52 @@ export namespace vault_v1 { /** * vault.matters.removePermissions * @desc Removes an account as a matter collaborator. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery'], + * }); + * + * // 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 vault.matters.removePermissions({ + * // The matter ID. + * matterId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.removePermissions * @memberOf! () * @@ -1360,6 +1701,52 @@ export namespace vault_v1 { /** * vault.matters.reopen * @desc Reopens the specified matter. Returns matter with updated state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery'], + * }); + * + * // 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 vault.matters.reopen({ + * // The matter ID. + * matterId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "matter": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.reopen * @memberOf! () * @@ -1436,6 +1823,56 @@ export namespace vault_v1 { /** * vault.matters.undelete * @desc Undeletes the specified matter. Returns matter with updated state. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery'], + * }); + * + * // 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 vault.matters.undelete({ + * // The matter ID. + * matterId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "matterId": "my_matterId", + * // "matterPermissions": [], + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.undelete * @memberOf! () * @@ -1508,6 +1945,62 @@ export namespace vault_v1 { /** * vault.matters.update * @desc Updates the specified matter. This updates only the name and description of the matter, identified by matter ID. Changes to any other fields are ignored. Returns the default view of the matter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery'], + * }); + * + * // 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 vault.matters.update({ + * // The matter ID. + * matterId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "matterId": "my_matterId", + * // "matterPermissions": [], + * // "name": "my_name", + * // "state": "my_state" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "matterId": "my_matterId", + * // "matterPermissions": [], + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.update * @memberOf! () * @@ -1746,6 +2239,72 @@ export namespace vault_v1 { /** * vault.matters.exports.create * @desc Creates an Export. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery'], + * }); + * + * // 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 vault.matters.exports.create({ + * // The matter ID. + * matterId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "cloudStorageSink": {}, + * // "createTime": "my_createTime", + * // "exportOptions": {}, + * // "id": "my_id", + * // "matterId": "my_matterId", + * // "name": "my_name", + * // "query": {}, + * // "requester": {}, + * // "stats": {}, + * // "status": "my_status" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cloudStorageSink": {}, + * // "createTime": "my_createTime", + * // "exportOptions": {}, + * // "id": "my_id", + * // "matterId": "my_matterId", + * // "name": "my_name", + * // "query": {}, + * // "requester": {}, + * // "stats": {}, + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.exports.create * @memberOf! () * @@ -1819,6 +2378,46 @@ export namespace vault_v1 { /** * vault.matters.exports.delete * @desc Deletes an Export. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery'], + * }); + * + * // 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 vault.matters.exports.delete({ + * // The export ID. + * exportId: 'placeholder-value', + * // The matter ID. + * matterId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.exports.delete * @memberOf! () * @@ -1891,6 +2490,60 @@ export namespace vault_v1 { /** * vault.matters.exports.get * @desc Gets an Export. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery', + * 'https://www.googleapis.com/auth/ediscovery.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 vault.matters.exports.get({ + * // The export ID. + * exportId: 'placeholder-value', + * // The matter ID. + * matterId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cloudStorageSink": {}, + * // "createTime": "my_createTime", + * // "exportOptions": {}, + * // "id": "my_id", + * // "matterId": "my_matterId", + * // "name": "my_name", + * // "query": {}, + * // "requester": {}, + * // "stats": {}, + * // "status": "my_status" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.exports.get * @memberOf! () * @@ -1963,6 +2616,54 @@ export namespace vault_v1 { /** * vault.matters.exports.list * @desc Lists Exports. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery', + * 'https://www.googleapis.com/auth/ediscovery.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 vault.matters.exports.list({ + * // The matter ID. + * matterId: 'placeholder-value', + * // The number of exports to return in the response. + * pageSize: 'placeholder-value', + * // The pagination token as returned in the response. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "exports": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.exports.list * @memberOf! () * @@ -2118,6 +2819,57 @@ export namespace vault_v1 { /** * vault.matters.holds.addHeldAccounts * @desc Adds HeldAccounts to a hold. Returns a list of accounts that have been successfully added. Accounts can only be added to an existing account-based hold. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery'], + * }); + * + * // 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 vault.matters.holds.addHeldAccounts({ + * // The hold ID. + * holdId: 'placeholder-value', + * // The matter ID. + * matterId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountIds": [], + * // "emails": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.holds.addHeldAccounts * @memberOf! () * @@ -2197,6 +2949,66 @@ export namespace vault_v1 { /** * vault.matters.holds.create * @desc Creates a hold in the given matter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery'], + * }); + * + * // 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 vault.matters.holds.create({ + * // The matter ID. + * matterId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accounts": [], + * // "corpus": "my_corpus", + * // "holdId": "my_holdId", + * // "name": "my_name", + * // "orgUnit": {}, + * // "query": {}, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accounts": [], + * // "corpus": "my_corpus", + * // "holdId": "my_holdId", + * // "name": "my_name", + * // "orgUnit": {}, + * // "query": {}, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.holds.create * @memberOf! () * @@ -2270,6 +3082,46 @@ export namespace vault_v1 { /** * vault.matters.holds.delete * @desc Removes a hold by ID. This will release any HeldAccounts on this Hold. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery'], + * }); + * + * // 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 vault.matters.holds.delete({ + * // The hold ID. + * holdId: 'placeholder-value', + * // The matter ID. + * matterId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.holds.delete * @memberOf! () * @@ -2343,6 +3195,59 @@ export namespace vault_v1 { /** * vault.matters.holds.get * @desc Gets a hold by ID. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery', + * 'https://www.googleapis.com/auth/ediscovery.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 vault.matters.holds.get({ + * // The hold ID. + * holdId: 'placeholder-value', + * // The matter ID. + * matterId: 'placeholder-value', + * // Specifies which parts of the Hold to return. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accounts": [], + * // "corpus": "my_corpus", + * // "holdId": "my_holdId", + * // "name": "my_name", + * // "orgUnit": {}, + * // "query": {}, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.holds.get * @memberOf! () * @@ -2417,6 +3322,58 @@ export namespace vault_v1 { /** * vault.matters.holds.list * @desc Lists holds within a matter. An empty page token in ListHoldsResponse denotes no more holds to list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery', + * 'https://www.googleapis.com/auth/ediscovery.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 vault.matters.holds.list({ + * // The matter ID. + * matterId: 'placeholder-value', + * // The number of holds to return in the response, between 0 and 100 inclusive. + * // Leaving this empty, or as 0, is the same as page_size = 100. + * pageSize: 'placeholder-value', + * // The pagination token as returned in the response. + * // An empty token means start from the beginning. + * pageToken: 'placeholder-value', + * // Specifies which parts of the Hold to return. + * view: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "holds": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.holds.list * @memberOf! () * @@ -2494,6 +3451,56 @@ export namespace vault_v1 { /** * vault.matters.holds.removeHeldAccounts * @desc Removes HeldAccounts from a hold. Returns a list of statuses in the same order as the request. If this request leaves the hold with no held accounts, the hold will not apply to any accounts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery'], + * }); + * + * // 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 vault.matters.holds.removeHeldAccounts({ + * // The hold ID. + * holdId: 'placeholder-value', + * // The matter ID. + * matterId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountIds": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "statuses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.holds.removeHeldAccounts * @memberOf! () * @@ -2577,6 +3584,68 @@ export namespace vault_v1 { /** * vault.matters.holds.update * @desc Updates the OU and/or query parameters of a hold. You cannot add accounts to a hold that covers an OU, nor can you add OUs to a hold that covers individual accounts. Accounts listed in the hold will be ignored. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery'], + * }); + * + * // 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 vault.matters.holds.update({ + * // The ID of the hold. + * holdId: 'placeholder-value', + * // The matter ID. + * matterId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accounts": [], + * // "corpus": "my_corpus", + * // "holdId": "my_holdId", + * // "name": "my_name", + * // "orgUnit": {}, + * // "query": {}, + * // "updateTime": "my_updateTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accounts": [], + * // "corpus": "my_corpus", + * // "holdId": "my_holdId", + * // "name": "my_name", + * // "orgUnit": {}, + * // "query": {}, + * // "updateTime": "my_updateTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.holds.update * @memberOf! () * @@ -2799,6 +3868,64 @@ export namespace vault_v1 { /** * vault.matters.holds.accounts.create * @desc Adds a HeldAccount to a hold. Accounts can only be added to a hold that has no held_org_unit set. Attempting to add an account to an OU-based hold will result in an error. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery'], + * }); + * + * // 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 vault.matters.holds.accounts.create({ + * // The hold ID. + * holdId: 'placeholder-value', + * // The matter ID. + * matterId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "accountId": "my_accountId", + * // "email": "my_email", + * // "firstName": "my_firstName", + * // "holdTime": "my_holdTime", + * // "lastName": "my_lastName" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accountId": "my_accountId", + * // "email": "my_email", + * // "firstName": "my_firstName", + * // "holdTime": "my_holdTime", + * // "lastName": "my_lastName" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.holds.accounts.create * @memberOf! () * @@ -2874,6 +4001,48 @@ export namespace vault_v1 { /** * vault.matters.holds.accounts.delete * @desc Removes a HeldAccount from a hold. If this request leaves the hold with no held accounts, the hold will not apply to any accounts. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery'], + * }); + * + * // 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 vault.matters.holds.accounts.delete({ + * // The ID of the account to remove from the hold. + * accountId: 'placeholder-value', + * // The hold ID. + * holdId: 'placeholder-value', + * // The matter ID. + * matterId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.holds.accounts.delete * @memberOf! () * @@ -2948,6 +4117,51 @@ export namespace vault_v1 { /** * vault.matters.holds.accounts.list * @desc Lists HeldAccounts for a hold. This will only list individually specified held accounts. If the hold is on an OU, then use Admin SDK to enumerate its members. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery', + * 'https://www.googleapis.com/auth/ediscovery.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 vault.matters.holds.accounts.list({ + * // The hold ID. + * holdId: 'placeholder-value', + * // The matter ID. + * matterId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "accounts": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.holds.accounts.list * @memberOf! () * @@ -3089,6 +4303,63 @@ export namespace vault_v1 { /** * vault.matters.savedQueries.create * @desc Creates a saved query. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery'], + * }); + * + * // 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 vault.matters.savedQueries.create({ + * // The matter ID of the parent matter for which the saved query is to be + * // created. + * matterId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "displayName": "my_displayName", + * // "matterId": "my_matterId", + * // "query": {}, + * // "savedQueryId": "my_savedQueryId" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "displayName": "my_displayName", + * // "matterId": "my_matterId", + * // "query": {}, + * // "savedQueryId": "my_savedQueryId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.savedQueries.create * @memberOf! () * @@ -3164,6 +4435,47 @@ export namespace vault_v1 { /** * vault.matters.savedQueries.delete * @desc Deletes a saved query by Id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery'], + * }); + * + * // 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 vault.matters.savedQueries.delete({ + * // The matter ID of the parent matter for which the saved query is to be + * // deleted. + * matterId: 'placeholder-value', + * // ID of the saved query to be deleted. + * savedQueryId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.savedQueries.delete * @memberOf! () * @@ -3236,6 +4548,56 @@ export namespace vault_v1 { /** * vault.matters.savedQueries.get * @desc Retrieves a saved query by Id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery', + * 'https://www.googleapis.com/auth/ediscovery.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 vault.matters.savedQueries.get({ + * // The matter ID of the parent matter for which the saved query is to be + * // retrieved. + * matterId: 'placeholder-value', + * // ID of the saved query to be retrieved. + * savedQueryId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "displayName": "my_displayName", + * // "matterId": "my_matterId", + * // "query": {}, + * // "savedQueryId": "my_savedQueryId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.savedQueries.get * @memberOf! () * @@ -3310,6 +4672,56 @@ export namespace vault_v1 { /** * vault.matters.savedQueries.list * @desc Lists saved queries within a matter. An empty page token in ListSavedQueriesResponse denotes no more saved queries to list. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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/ediscovery', + * 'https://www.googleapis.com/auth/ediscovery.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 vault.matters.savedQueries.list({ + * // The matter ID of the parent matter for which the saved queries are to be + * // retrieved. + * matterId: 'placeholder-value', + * // The maximum number of saved queries to return. + * pageSize: 'placeholder-value', + * // The pagination token as returned in the previous response. + * // An empty token means start from the beginning. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "savedQueries": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.matters.savedQueries.list * @memberOf! () * @@ -3465,6 +4877,44 @@ export namespace vault_v1 { /** * vault.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vault.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 vault = google.vault('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: [], + * }); + * + * // 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 vault.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'operations/.*', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vault.operations.delete * @memberOf! () * diff --git a/src/apis/verifiedaccess/v1.ts b/src/apis/verifiedaccess/v1.ts index c0f830a4f4c..284a2f8a636 100644 --- a/src/apis/verifiedaccess/v1.ts +++ b/src/apis/verifiedaccess/v1.ts @@ -187,6 +187,50 @@ export namespace verifiedaccess_v1 { /** * verifiedaccess.challenge.create * @desc CreateChallenge API + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/verifiedaccess.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 verifiedaccess = google.verifiedaccess('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/verifiedaccess'], + * }); + * + * // 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 verifiedaccess.challenge.create({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "alternativeChallenge": {}, + * // "challenge": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias verifiedaccess.challenge.create * @memberOf! () * @@ -258,6 +302,55 @@ export namespace verifiedaccess_v1 { /** * verifiedaccess.challenge.verify * @desc VerifyChallengeResponse API + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/verifiedaccess.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 verifiedaccess = google.verifiedaccess('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/verifiedaccess'], + * }); + * + * // 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 verifiedaccess.challenge.verify({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "challengeResponse": {}, + * // "expectedIdentity": "my_expectedIdentity" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "deviceEnrollmentId": "my_deviceEnrollmentId", + * // "devicePermanentId": "my_devicePermanentId", + * // "signedPublicKeyAndChallenge": "my_signedPublicKeyAndChallenge", + * // "verificationOutput": "my_verificationOutput" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias verifiedaccess.challenge.verify * @memberOf! () * diff --git a/src/apis/videointelligence/v1.ts b/src/apis/videointelligence/v1.ts index a1a36d872cc..96b30266ae2 100644 --- a/src/apis/videointelligence/v1.ts +++ b/src/apis/videointelligence/v1.ts @@ -3007,6 +3007,46 @@ export namespace videointelligence_v1 { /** * videointelligence.operations.projects.locations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/videointelligence.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 videointelligence = google.videointelligence('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/cloud-platform'], + * }); + * + * // 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 videointelligence.operations.projects.locations.operations.cancel( + * { + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias videointelligence.operations.projects.locations.operations.cancel * @memberOf! () * @@ -3084,6 +3124,46 @@ export namespace videointelligence_v1 { /** * videointelligence.operations.projects.locations.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/videointelligence.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 videointelligence = google.videointelligence('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/cloud-platform'], + * }); + * + * // 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 videointelligence.operations.projects.locations.operations.delete( + * { + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * } + * ); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias videointelligence.operations.projects.locations.operations.delete * @memberOf! () * @@ -3161,6 +3241,52 @@ export namespace videointelligence_v1 { /** * videointelligence.operations.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/videointelligence.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 videointelligence = google.videointelligence('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/cloud-platform'], + * }); + * + * // 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 videointelligence.operations.projects.locations.operations.get( + * { + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias videointelligence.operations.projects.locations.operations.get * @memberOf! () * @@ -3307,6 +3433,50 @@ export namespace videointelligence_v1 { /** * videointelligence.projects.locations.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/videointelligence.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 videointelligence = google.videointelligence('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/cloud-platform'], + * }); + * + * // 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 videointelligence.projects.locations.operations.cancel({ + * // The name of the operation resource to be cancelled. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias videointelligence.projects.locations.operations.cancel * @memberOf! () * @@ -3382,6 +3552,44 @@ export namespace videointelligence_v1 { /** * videointelligence.projects.locations.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/videointelligence.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 videointelligence = google.videointelligence('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/cloud-platform'], + * }); + * + * // 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 videointelligence.projects.locations.operations.delete({ + * // The name of the operation resource to be deleted. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias videointelligence.projects.locations.operations.delete * @memberOf! () * @@ -3456,6 +3664,50 @@ export namespace videointelligence_v1 { /** * videointelligence.projects.locations.operations.get * @desc 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. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/videointelligence.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 videointelligence = google.videointelligence('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/cloud-platform'], + * }); + * + * // 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 videointelligence.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias videointelligence.projects.locations.operations.get * @memberOf! () * @@ -3535,6 +3787,53 @@ export namespace videointelligence_v1 { /** * videointelligence.projects.locations.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/videointelligence.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 videointelligence = google.videointelligence('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/cloud-platform'], + * }); + * + * // 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 videointelligence.projects.locations.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'projects/my-project/locations/my-location', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias videointelligence.projects.locations.operations.list * @memberOf! () * @@ -3703,6 +4002,60 @@ export namespace videointelligence_v1 { /** * videointelligence.videos.annotate * @desc Performs asynchronous video annotation. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` (results). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/videointelligence.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 videointelligence = google.videointelligence('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/cloud-platform'], + * }); + * + * // 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 videointelligence.videos.annotate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "features": [], + * // "inputContent": "my_inputContent", + * // "inputUri": "my_inputUri", + * // "locationId": "my_locationId", + * // "outputUri": "my_outputUri", + * // "videoContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias videointelligence.videos.annotate * @memberOf! () * diff --git a/src/apis/videointelligence/v1beta2.ts b/src/apis/videointelligence/v1beta2.ts index 4c7886dc216..526550aca08 100644 --- a/src/apis/videointelligence/v1beta2.ts +++ b/src/apis/videointelligence/v1beta2.ts @@ -2953,6 +2953,60 @@ export namespace videointelligence_v1beta2 { /** * videointelligence.videos.annotate * @desc Performs asynchronous video annotation. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` (results). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/videointelligence.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 videointelligence = google.videointelligence('v1beta2'); + * + * 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/cloud-platform'], + * }); + * + * // 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 videointelligence.videos.annotate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "features": [], + * // "inputContent": "my_inputContent", + * // "inputUri": "my_inputUri", + * // "locationId": "my_locationId", + * // "outputUri": "my_outputUri", + * // "videoContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias videointelligence.videos.annotate * @memberOf! () * diff --git a/src/apis/videointelligence/v1p1beta1.ts b/src/apis/videointelligence/v1p1beta1.ts index 8a3efc677ce..512e8e94d7d 100644 --- a/src/apis/videointelligence/v1p1beta1.ts +++ b/src/apis/videointelligence/v1p1beta1.ts @@ -2953,6 +2953,60 @@ export namespace videointelligence_v1p1beta1 { /** * videointelligence.videos.annotate * @desc Performs asynchronous video annotation. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` (results). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/videointelligence.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 videointelligence = google.videointelligence('v1p1beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 videointelligence.videos.annotate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "features": [], + * // "inputContent": "my_inputContent", + * // "inputUri": "my_inputUri", + * // "locationId": "my_locationId", + * // "outputUri": "my_outputUri", + * // "videoContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias videointelligence.videos.annotate * @memberOf! () * diff --git a/src/apis/videointelligence/v1p2beta1.ts b/src/apis/videointelligence/v1p2beta1.ts index 62164367f70..a76e1670cc9 100644 --- a/src/apis/videointelligence/v1p2beta1.ts +++ b/src/apis/videointelligence/v1p2beta1.ts @@ -2953,6 +2953,60 @@ export namespace videointelligence_v1p2beta1 { /** * videointelligence.videos.annotate * @desc Performs asynchronous video annotation. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` (results). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/videointelligence.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 videointelligence = google.videointelligence('v1p2beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 videointelligence.videos.annotate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "features": [], + * // "inputContent": "my_inputContent", + * // "inputUri": "my_inputUri", + * // "locationId": "my_locationId", + * // "outputUri": "my_outputUri", + * // "videoContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias videointelligence.videos.annotate * @memberOf! () * diff --git a/src/apis/videointelligence/v1p3beta1.ts b/src/apis/videointelligence/v1p3beta1.ts index 42855a4adb7..072b7884ca7 100644 --- a/src/apis/videointelligence/v1p3beta1.ts +++ b/src/apis/videointelligence/v1p3beta1.ts @@ -2995,6 +2995,60 @@ export namespace videointelligence_v1p3beta1 { /** * videointelligence.videos.annotate * @desc Performs asynchronous video annotation. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` (results). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/videointelligence.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 videointelligence = google.videointelligence('v1p3beta1'); + * + * 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/cloud-platform'], + * }); + * + * // 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 videointelligence.videos.annotate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "features": [], + * // "inputContent": "my_inputContent", + * // "inputUri": "my_inputUri", + * // "locationId": "my_locationId", + * // "outputUri": "my_outputUri", + * // "videoContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias videointelligence.videos.annotate * @memberOf! () * diff --git a/src/apis/vision/v1.ts b/src/apis/vision/v1.ts index 0fe7a8f3884..3161f16acf2 100644 --- a/src/apis/vision/v1.ts +++ b/src/apis/vision/v1.ts @@ -5142,52 +5142,54 @@ export namespace vision_v1 { * vision.files.annotate * @desc Service that performs image detection and annotation for a batch of files. Now only "application/pdf", "image/tiff" and "image/gif" are supported. This service will extract at most 5 (customers can specify which 5 in AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and perform detection and annotation for each image extracted. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 vision.files.annotate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * vision.files.annotate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "responses": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.files.annotate * @memberOf! () * @@ -5266,52 +5268,58 @@ export namespace vision_v1 { * vision.files.asyncBatchAnnotate * @desc Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 vision.files.asyncBatchAnnotate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } * }, - * - * auth: authClient, - * }; - * - * vision.files.asyncBatchAnnotate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.files.asyncBatchAnnotate * @memberOf! () * @@ -5418,52 +5426,54 @@ export namespace vision_v1 { * vision.images.annotate * @desc Run image detection and annotation for a batch of images. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 vision.images.annotate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; - * - * vision.images.annotate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Example response + * // { + * // "responses": [] + * // } + * } * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.images.annotate * @memberOf! () * @@ -5545,52 +5555,59 @@ export namespace vision_v1 { * vision.images.asyncBatchAnnotate * @desc Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. + * // 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 vision.images.asyncBatchAnnotate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "outputConfig": {}, + * // "parent": "my_parent", + * // "requests": [] + * // } * }, - * - * auth: authClient, - * }; - * - * vision.images.asyncBatchAnnotate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.images.asyncBatchAnnotate * @memberOf! () * @@ -5706,51 +5723,52 @@ export namespace vision_v1 { * vision.locations.operations.get * @desc 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. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource. - * name: 'locations/my-location/operations/my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * vision.locations.operations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await vision.locations.operations.get({ + * // The name of the operation resource. + * name: 'locations/my-location/operations/my-operation', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.locations.operations.get * @memberOf! () * @@ -5843,52 +5861,52 @@ export namespace vision_v1 { * vision.operations.cancel * @desc Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await vision.operations.cancel({ * // The name of the operation resource to be cancelled. - * name: 'operations/my-operation', // TODO: Update placeholder value. + * name: 'operations/.*', * - * resource: { - * // TODO: Add desired properties to the request body. + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * vision.operations.cancel(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.operations.cancel * @memberOf! () * @@ -5960,48 +5978,46 @@ export namespace vision_v1 { * vision.operations.delete * @desc Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 vision.operations.delete({ * // The name of the operation resource to be deleted. - * name: 'operations/my-operation', // TODO: Update placeholder value. + * name: 'operations/.*', + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * vision.operations.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.operations.delete * @memberOf! () * @@ -6072,51 +6088,52 @@ export namespace vision_v1 { * vision.operations.get * @desc 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. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource. - * name: 'operations/my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * vision.operations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await vision.operations.get({ + * // The name of the operation resource. + * name: 'operations/my-operation', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.operations.get * @memberOf! () * @@ -6188,64 +6205,55 @@ export namespace vision_v1 { * vision.operations.list * @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The name of the operation's parent resource. - * name: 'operations', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var operationsPage = response['operations']; - * if (!operationsPage) { - * return; - * } - * for (var i = 0; i < operationsPage.length; i++) { - * // TODO: Change code below to process each resource in `operationsPage`: - * console.log(JSON.stringify(operationsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * vision.operations.list(request, handlePage); - * } - * }; - * - * vision.operations.list(request, handlePage); - * }); + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * // Do the magic + * const res = await vision.operations.list({ + * // The standard list filter. + * filter: 'placeholder-value', + * // The name of the operation's parent resource. + * name: 'operations', + * // The standard list page size. + * pageSize: 'placeholder-value', + * // The standard list page token. + * pageToken: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "operations": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.operations.list * @memberOf! () * @@ -6407,6 +6415,69 @@ export namespace vision_v1 { /** * vision.projects.files.annotate * @desc Service that performs image detection and annotation for a batch of files. Now only "application/pdf", "image/tiff" and "image/gif" are supported. This service will extract at most 5 (customers can specify which 5 in AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and perform detection and annotation for each image extracted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.files.annotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.files.annotate * @memberOf! () * @@ -6489,6 +6560,73 @@ export namespace vision_v1 { /** * vision.projects.files.asyncBatchAnnotate * @desc Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.files.asyncBatchAnnotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.files.asyncBatchAnnotate * @memberOf! () * @@ -6606,6 +6744,69 @@ export namespace vision_v1 { /** * vision.projects.images.annotate * @desc Run image detection and annotation for a batch of images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.images.annotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.images.annotate * @memberOf! () * @@ -6688,6 +6889,74 @@ export namespace vision_v1 { /** * vision.projects.images.asyncBatchAnnotate * @desc Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.images.asyncBatchAnnotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "outputConfig": {}, + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.images.asyncBatchAnnotate * @memberOf! () * @@ -6826,6 +7095,69 @@ export namespace vision_v1 { /** * vision.projects.locations.files.annotate * @desc Service that performs image detection and annotation for a batch of files. Now only "application/pdf", "image/tiff" and "image/gif" are supported. This service will extract at most 5 (customers can specify which 5 in AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and perform detection and annotation for each image extracted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.locations.files.annotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.locations.files.annotate * @memberOf! () * @@ -6908,6 +7240,73 @@ export namespace vision_v1 { /** * vision.projects.locations.files.asyncBatchAnnotate * @desc Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.locations.files.asyncBatchAnnotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.locations.files.asyncBatchAnnotate * @memberOf! () * @@ -7025,6 +7424,69 @@ export namespace vision_v1 { /** * vision.projects.locations.images.annotate * @desc Run image detection and annotation for a batch of images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.locations.images.annotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.locations.images.annotate * @memberOf! () * @@ -7107,6 +7569,74 @@ export namespace vision_v1 { /** * vision.projects.locations.images.asyncBatchAnnotate * @desc Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.locations.images.asyncBatchAnnotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "outputConfig": {}, + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.locations.images.asyncBatchAnnotate * @memberOf! () * @@ -7225,51 +7755,52 @@ export namespace vision_v1 { * vision.projects.locations.operations.get * @desc 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. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource. - * name: 'projects/my-project/locations/my-location/operations/my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * vision.projects.locations.operations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await vision.projects.locations.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/locations/my-location/operations/my-operation', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.projects.locations.operations.get * @memberOf! () * @@ -7366,57 +7897,72 @@ export namespace vision_v1 { * vision.projects.locations.products.create * @desc Creates and returns a new product resource. Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is missing or invalid. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { - * // The project in which the Product should be created. + * // Do the magic + * const res = await vision.projects.locations.products.create({ + * // Required. The project in which the Product should be created. + * // * // Format is * // `projects/PROJECT_ID/locations/LOC_ID`. - * parent: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * parent: 'projects/my-project/locations/my-location', + * // A user-supplied resource id for this Product. If set, the server will + * // attempt to use this value as the resource id. If it is already in use, an + * // error is returned with code ALREADY_EXISTS. Must be at most 128 characters + * // long. It cannot contain the character `/`. + * productId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "productCategory": "my_productCategory", + * // "productLabels": [] + * // } * }, - * - * auth: authClient, - * }; - * - * vision.projects.locations.products.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "productCategory": "my_productCategory", + * // "productLabels": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.projects.locations.products.create * @memberOf! () * @@ -7492,50 +8038,49 @@ export namespace vision_v1 { * vision.projects.locations.products.delete * @desc Permanently deletes a product and its reference images. Metadata of the product and all its images will be deleted right away, but search queries against ProductSets containing the product may still work until all related caches are refreshed. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Resource name of product to delete. + * // 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 vision.projects.locations.products.delete({ + * // Required. Resource name of product to delete. + * // * // Format is: * // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - * name: 'projects/my-project/locations/my-location/products/my-product', // TODO: Update placeholder value. + * name: 'projects/my-project/locations/my-location/products/my-product', + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * vision.projects.locations.products.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.projects.locations.products.delete * @memberOf! () * @@ -7606,53 +8151,55 @@ export namespace vision_v1 { * vision.projects.locations.products.get * @desc Gets information associated with a Product. Possible errors: * Returns NOT_FOUND if the Product does not exist. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { - * // Resource name of the Product to get. + * // Do the magic + * const res = await vision.projects.locations.products.get({ + * // Required. Resource name of the Product to get. + * // * // Format is: * // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - * name: 'projects/my-project/locations/my-location/products/my-product', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * vision.projects.locations.products.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * name: 'projects/my-project/locations/my-location/products/my-product', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "productCategory": "my_productCategory", + * // "productLabels": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.projects.locations.products.get * @memberOf! () * @@ -7723,66 +8270,56 @@ export namespace vision_v1 { * vision.projects.locations.products.list * @desc Lists products in an unspecified order. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The project OR ProductSet from which Products should be listed. + * // 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 vision.projects.locations.products.list({ + * // The maximum number of items to return. Default 10, maximum 100. + * pageSize: 'placeholder-value', + * // The next_page_token returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // Required. The project OR ProductSet from which Products should be listed. + * // * // Format: * // `projects/PROJECT_ID/locations/LOC_ID` - * parent: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var productsPage = response['products']; - * if (!productsPage) { - * return; - * } - * for (var i = 0; i < productsPage.length; i++) { - * // TODO: Change code below to process each resource in `productsPage`: - * console.log(JSON.stringify(productsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * vision.projects.locations.products.list(request, handlePage); - * } - * }; - * - * vision.projects.locations.products.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * parent: 'projects/my-project/locations/my-location', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "products": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.locations.products.list * @memberOf! () * @@ -7862,59 +8399,75 @@ export namespace vision_v1 { * vision.projects.locations.products.patch * @desc Makes changes to a Product resource. Only the `display_name`, `description`, and `labels` fields can be updated right now. If labels are updated, the change will not be reflected in queries until the next index time. Possible errors: * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but is missing from the request or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is present in update_mask. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { + * // Do the magic + * const res = await vision.projects.locations.products.patch({ * // The resource name of the product. + * // * // Format is: * // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + * // * // This field is ignored when creating a product. - * name: 'projects/my-project/locations/my-location/products/my-product', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * name: 'projects/my-project/locations/my-location/products/my-product', + * // The FieldMask that specifies which fields + * // to update. + * // If update_mask isn't specified, all mutable fields are to be updated. + * // Valid mask paths include `product_labels`, `display_name`, and + * // `description`. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "productCategory": "my_productCategory", + * // "productLabels": [] + * // } * }, - * - * auth: authClient, - * }; - * - * vision.projects.locations.products.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "description": "my_description", + * // "displayName": "my_displayName", + * // "name": "my_name", + * // "productCategory": "my_productCategory", + * // "productLabels": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.projects.locations.products.patch * @memberOf! () * @@ -7986,6 +8539,65 @@ export namespace vision_v1 { /** * vision.projects.locations.products.purge * @desc Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted. It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep the csv files used in ImportProductSets (if that was how you originally built the Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. The google.longrunning.Operation API can be used to keep track of the progress and results of the request. `Operation.metadata` contains `BatchOperationMetadata`. (progress) + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.locations.products.purge({ + * // Required. The project and location in which the Products should be deleted. + * // + * // Format is `projects/PROJECT_ID/locations/LOC_ID`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "deleteOrphanProducts": false, + * // "force": false, + * // "productSetPurgeConfig": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.locations.products.purge * @memberOf! () * @@ -8173,57 +8785,68 @@ export namespace vision_v1 { * vision.projects.locations.products.referenceImages.create * @desc Creates and returns a new ReferenceImage resource. The `bounding_poly` field is optional. If `bounding_poly` is not specified, the system will try to detect regions of interest in the image that are compatible with the product_category on the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category is detected. * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Resource name of the product in which to create the reference image. + * // 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 vision.projects.locations.products.referenceImages.create({ + * // Required. Resource name of the product in which to create the reference image. + * // * // Format is * // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - * parent: 'projects/my-project/locations/my-location/products/my-product', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * parent: 'projects/my-project/locations/my-location/products/my-product', + * // A user-supplied resource id for the ReferenceImage to be added. If set, + * // the server will attempt to use this value as the resource id. If it is + * // already in use, an error is returned with code ALREADY_EXISTS. Must be at + * // most 128 characters long. It cannot contain the character `/`. + * referenceImageId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "boundingPolys": [], + * // "name": "my_name", + * // "uri": "my_uri" + * // } * }, - * - * auth: authClient, - * }; - * - * vision.projects.locations.products.referenceImages.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "boundingPolys": [], + * // "name": "my_name", + * // "uri": "my_uri" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.projects.locations.products.referenceImages.create * @memberOf! () * @@ -8301,50 +8924,51 @@ export namespace vision_v1 { * vision.projects.locations.products.referenceImages.delete * @desc Permanently deletes a reference image. The image metadata will be deleted right away, but search queries against ProductSets containing the image may still work until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the reference image to delete. + * // Do the magic + * const res = await vision.projects.locations.products.referenceImages.delete({ + * // Required. The resource name of the reference image to delete. + * // * // Format is: + * // * // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` - * name: 'projects/my-project/locations/my-location/products/my-product/referenceImages/my-reference-image', // TODO: Update placeholder value. + * name: + * 'projects/my-project/locations/my-location/products/my-product/referenceImages/my-referenceImage', + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * vision.projects.locations.products.referenceImages.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.projects.locations.products.referenceImages.delete * @memberOf! () * @@ -8415,53 +9039,55 @@ export namespace vision_v1 { * vision.projects.locations.products.referenceImages.get * @desc Gets information associated with a ReferenceImage. Possible errors: * Returns NOT_FOUND if the specified image does not exist. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The resource name of the ReferenceImage to get. + * // 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 vision.projects.locations.products.referenceImages.get({ + * // Required. The resource name of the ReferenceImage to get. + * // * // Format is: + * // * // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. - * name: 'projects/my-project/locations/my-location/products/my-product/referenceImages/my-reference-image', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * vision.projects.locations.products.referenceImages.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * name: + * 'projects/my-project/locations/my-location/products/my-product/referenceImages/my-referenceImage', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "boundingPolys": [], + * // "name": "my_name", + * // "uri": "my_uri" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.projects.locations.products.referenceImages.get * @memberOf! () * @@ -8534,66 +9160,60 @@ export namespace vision_v1 { * vision.projects.locations.products.referenceImages.list * @desc Lists reference images. Possible errors: * Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // Resource name of the product containing the reference images. + * // 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 vision.projects.locations.products.referenceImages.list({ + * // The maximum number of items to return. Default 10, maximum 100. + * pageSize: 'placeholder-value', + * // A token identifying a page of results to be returned. This is the value + * // of `nextPageToken` returned in a previous reference image list request. + * // + * // Defaults to the first page if not specified. + * pageToken: 'placeholder-value', + * // Required. Resource name of the product containing the reference images. + * // * // Format is * // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - * parent: 'projects/my-project/locations/my-location/products/my-product', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var referenceImagesPage = response['referenceImages']; - * if (!referenceImagesPage) { - * return; - * } - * for (var i = 0; i < referenceImagesPage.length; i++) { - * // TODO: Change code below to process each resource in `referenceImagesPage`: - * console.log(JSON.stringify(referenceImagesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * vision.projects.locations.products.referenceImages.list(request, handlePage); - * } - * }; - * - * vision.projects.locations.products.referenceImages.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * parent: 'projects/my-project/locations/my-location/products/my-product', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "pageSize": 0, + * // "referenceImages": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.locations.products.referenceImages.list * @memberOf! () * @@ -8755,54 +9375,57 @@ export namespace vision_v1 { * vision.projects.locations.productSets.addProduct * @desc Adds a Product to the specified ProductSet. If the Product is already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: * Returns NOT_FOUND if the Product or the ProductSet doesn't exist. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The resource name for the ProductSet to modify. + * // 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 vision.projects.locations.productSets.addProduct({ + * // Required. The resource name for the ProductSet to modify. + * // * // Format is: * // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - * name: 'projects/my-project/locations/my-location/productSets/my-product-set', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * name: 'projects/my-project/locations/my-location/productSets/my-productSet', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "product": "my_product" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * vision.projects.locations.productSets.addProduct(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.projects.locations.productSets.addProduct * @memberOf! () * @@ -8877,56 +9500,69 @@ export namespace vision_v1 { * vision.projects.locations.productSets.create * @desc Creates and returns a new ProductSet resource. Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The project in which the ProductSet should be created. - * // Format is `projects/PROJECT_ID/locations/LOC_ID`. - * parent: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await vision.projects.locations.productSets.create({ + * // Required. The project in which the ProductSet should be created. + * // + * // Format is `projects/PROJECT_ID/locations/LOC_ID`. + * parent: 'projects/my-project/locations/my-location', + * // A user-supplied resource id for this ProductSet. If set, the server will + * // attempt to use this value as the resource id. If it is already in use, an + * // error is returned with code ALREADY_EXISTS. Must be at most 128 characters + * // long. It cannot contain the character `/`. + * productSetId: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "indexError": {}, + * // "indexTime": "my_indexTime", + * // "name": "my_name" + * // } * }, - * - * auth: authClient, - * }; - * - * vision.projects.locations.productSets.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "indexError": {}, + * // "indexTime": "my_indexTime", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.projects.locations.productSets.create * @memberOf! () * @@ -9004,50 +9640,49 @@ export namespace vision_v1 { * vision.projects.locations.productSets.delete * @desc Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not deleted. The actual image files are not deleted from Google Cloud Storage. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { - * // Resource name of the ProductSet to delete. + * // Do the magic + * const res = await vision.projects.locations.productSets.delete({ + * // Required. Resource name of the ProductSet to delete. + * // * // Format is: * // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - * name: 'projects/my-project/locations/my-location/productSets/my-product-set', // TODO: Update placeholder value. + * name: 'projects/my-project/locations/my-location/productSets/my-productSet', + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * vision.projects.locations.productSets.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.projects.locations.productSets.delete * @memberOf! () * @@ -9118,53 +9753,54 @@ export namespace vision_v1 { * vision.projects.locations.productSets.get * @desc Gets information associated with a ProductSet. Possible errors: * Returns NOT_FOUND if the ProductSet does not exist. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Resource name of the ProductSet to get. - * // Format is: - * // `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID` - * name: 'projects/my-project/locations/my-location/productSets/my-product-set', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * vision.projects.locations.productSets.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await vision.projects.locations.productSets.get({ + * // Required. Resource name of the ProductSet to get. + * // + * // Format is: + * // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + * name: 'projects/my-project/locations/my-location/productSets/my-productSet', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "indexError": {}, + * // "indexTime": "my_indexTime", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.projects.locations.productSets.get * @memberOf! () * @@ -9237,56 +9873,62 @@ export namespace vision_v1 { * vision.projects.locations.productSets.import * @desc Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. The google.longrunning.Operation API can be used to keep track of the progress and results of the request. `Operation.metadata` contains `BatchOperationMetadata`. (progress) `Operation.response` contains `ImportProductSetsResponse`. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see ImportProductSetsGcsSource.csv_file_uri. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The project in which the ProductSets should be imported. - * // Format is `projects/PROJECT_ID/locations/LOC_ID`. - * parent: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * resource: { - * // TODO: Add desired properties to the request body. + * // Do the magic + * const res = await vision.projects.locations.productSets.import({ + * // Required. The project in which the ProductSets should be imported. + * // + * // Format is `projects/PROJECT_ID/locations/LOC_ID`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "inputConfig": {} + * // } * }, - * - * auth: authClient, - * }; - * - * vision.projects.locations.productSets.import(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.projects.locations.productSets.import * @memberOf! () * @@ -9363,65 +10005,55 @@ export namespace vision_v1 { * vision.projects.locations.productSets.list * @desc Lists ProductSets in an unspecified order. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * authorize(function(authClient) { - * var request = { - * // The project from which ProductSets should be listed. + * // 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 vision.projects.locations.productSets.list({ + * // The maximum number of items to return. Default 10, maximum 100. + * pageSize: 'placeholder-value', + * // The next_page_token returned from a previous List request, if any. + * pageToken: 'placeholder-value', + * // Required. The project from which ProductSets should be listed. + * // * // Format is `projects/PROJECT_ID/locations/LOC_ID`. - * parent: 'projects/my-project/locations/my-location', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var productSetsPage = response['productSets']; - * if (!productSetsPage) { - * return; - * } - * for (var i = 0; i < productSetsPage.length; i++) { - * // TODO: Change code below to process each resource in `productSetsPage`: - * console.log(JSON.stringify(productSetsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * vision.projects.locations.productSets.list(request, handlePage); - * } - * }; - * - * vision.projects.locations.productSets.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * parent: 'projects/my-project/locations/my-location', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "productSets": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.locations.productSets.list * @memberOf! () * @@ -9501,59 +10133,72 @@ export namespace vision_v1 { * vision.projects.locations.productSets.patch * @desc Makes changes to a ProductSet resource. Only display_name can be updated currently. Possible errors: * Returns NOT_FOUND if the ProductSet does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but missing from the request or longer than 4096 characters. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * authorize(function(authClient) { - * var request = { + * // 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 vision.projects.locations.productSets.patch({ * // The resource name of the ProductSet. + * // * // Format is: * // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. + * // * // This field is ignored when creating a ProductSet. - * name: 'projects/my-project/locations/my-location/productSets/my-product-set', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these properties - * // will be changed. + * name: 'projects/my-project/locations/my-location/productSets/my-productSet', + * // The FieldMask that specifies which fields to + * // update. + * // If update_mask isn't specified, all mutable fields are to be updated. + * // Valid mask path is `display_name`. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "displayName": "my_displayName", + * // "indexError": {}, + * // "indexTime": "my_indexTime", + * // "name": "my_name" + * // } * }, - * - * auth: authClient, - * }; - * - * vision.projects.locations.productSets.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); * }); + * console.log(res.data); + * + * // Example response + * // { + * // "displayName": "my_displayName", + * // "indexError": {}, + * // "indexTime": "my_indexTime", + * // "name": "my_name" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.projects.locations.productSets.patch * @memberOf! () * @@ -9628,54 +10273,57 @@ export namespace vision_v1 { * vision.projects.locations.productSets.removeProduct * @desc Removes a Product from the specified ProductSet. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { - * // The resource name for the ProductSet to modify. + * // Do the magic + * const res = await vision.projects.locations.productSets.removeProduct({ + * // Required. The resource name for the ProductSet to modify. + * // * // Format is: * // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - * name: 'projects/my-project/locations/my-location/productSets/my-product-set', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. + * name: 'projects/my-project/locations/my-location/productSets/my-productSet', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "product": "my_product" + * // } * }, + * }); + * console.log(res.data); * - * auth: authClient, - * }; + * // Example response + * // {} + * } * - * vision.projects.locations.productSets.removeProduct(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.projects.locations.productSets.removeProduct * @memberOf! () * @@ -9895,66 +10543,56 @@ export namespace vision_v1 { * vision.projects.locations.productSets.products.list * @desc Lists the Products in a ProductSet, in an unspecified order. If the ProductSet does not exist, the products field of the response will be empty. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * authorize(function(authClient) { - * var request = { - * // The ProductSet resource for which to retrieve Products. + * // Do the magic + * const res = await vision.projects.locations.productSets.products.list({ + * // Required. The ProductSet resource for which to retrieve Products. + * // * // Format is: * // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - * name: 'projects/my-project/locations/my-location/productSets/my-product-set', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var productsPage = response['products']; - * if (!productsPage) { - * return; - * } - * for (var i = 0; i < productsPage.length; i++) { - * // TODO: Change code below to process each resource in `productsPage`: - * console.log(JSON.stringify(productsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * vision.projects.locations.productSets.products.list(request, handlePage); - * } - * }; - * - * vision.projects.locations.productSets.products.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); + * name: 'projects/my-project/locations/my-location/productSets/my-productSet', + * // The maximum number of items to return. Default 10, maximum 100. + * pageSize: 'placeholder-value', + * // The next_page_token returned from a previous List request, if any. + * pageToken: 'placeholder-value', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "products": [] + * // } * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.locations.productSets.products.list * @memberOf! () * @@ -10069,51 +10707,52 @@ export namespace vision_v1 { * vision.projects.operations.get * @desc 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. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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'); - * var vision = google.vision('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource. - * name: 'projects/my-project/operations/my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * const vision = google.vision('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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); * - * vision.projects.operations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options('auth', authClient); * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); + * // Do the magic + * const res = await vision.projects.operations.get({ + * // The name of the operation resource. + * name: 'projects/my-project/operations/my-operation', * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; * }); * - * function authorize(callback) { - * google.auth.getClient({ - * scopes: ['https://www.googleapis.com/auth/cloud-platform'] - * }).then(client => { - * callback(client); - * }).catch(err => { - * console.error('authentication failed: ', err); - * }); - * } * @alias vision.projects.operations.get * @memberOf! () * diff --git a/src/apis/vision/v1p1beta1.ts b/src/apis/vision/v1p1beta1.ts index 8a3ce9ecfd0..1867056c629 100644 --- a/src/apis/vision/v1p1beta1.ts +++ b/src/apis/vision/v1p1beta1.ts @@ -4977,6 +4977,55 @@ export namespace vision_v1p1beta1 { /** * vision.files.annotate * @desc Service that performs image detection and annotation for a batch of files. Now only "application/pdf", "image/tiff" and "image/gif" are supported. This service will extract at most 5 (customers can specify which 5 in AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and perform detection and annotation for each image extracted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.files.annotate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.files.annotate * @memberOf! () * @@ -5076,6 +5125,59 @@ export namespace vision_v1p1beta1 { /** * vision.files.asyncBatchAnnotate * @desc Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.files.asyncBatchAnnotate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.files.asyncBatchAnnotate * @memberOf! () * @@ -5181,6 +5283,55 @@ export namespace vision_v1p1beta1 { /** * vision.images.annotate * @desc Run image detection and annotation for a batch of images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.images.annotate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.images.annotate * @memberOf! () * @@ -5280,6 +5431,60 @@ export namespace vision_v1p1beta1 { /** * vision.images.asyncBatchAnnotate * @desc Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.images.asyncBatchAnnotate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "outputConfig": {}, + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.images.asyncBatchAnnotate * @memberOf! () * @@ -5398,6 +5603,69 @@ export namespace vision_v1p1beta1 { /** * vision.projects.files.annotate * @desc Service that performs image detection and annotation for a batch of files. Now only "application/pdf", "image/tiff" and "image/gif" are supported. This service will extract at most 5 (customers can specify which 5 in AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and perform detection and annotation for each image extracted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.files.annotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.files.annotate * @memberOf! () * @@ -5499,6 +5767,73 @@ export namespace vision_v1p1beta1 { /** * vision.projects.files.asyncBatchAnnotate * @desc Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.files.asyncBatchAnnotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.files.asyncBatchAnnotate * @memberOf! () * @@ -5615,6 +5950,69 @@ export namespace vision_v1p1beta1 { /** * vision.projects.images.annotate * @desc Run image detection and annotation for a batch of images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.images.annotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.images.annotate * @memberOf! () * @@ -5716,6 +6114,74 @@ export namespace vision_v1p1beta1 { /** * vision.projects.images.asyncBatchAnnotate * @desc Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.images.asyncBatchAnnotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "outputConfig": {}, + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.images.asyncBatchAnnotate * @memberOf! () * @@ -5843,6 +6309,69 @@ export namespace vision_v1p1beta1 { /** * vision.projects.locations.files.annotate * @desc Service that performs image detection and annotation for a batch of files. Now only "application/pdf", "image/tiff" and "image/gif" are supported. This service will extract at most 5 (customers can specify which 5 in AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and perform detection and annotation for each image extracted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.locations.files.annotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.locations.files.annotate * @memberOf! () * @@ -5944,6 +6473,73 @@ export namespace vision_v1p1beta1 { /** * vision.projects.locations.files.asyncBatchAnnotate * @desc Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.locations.files.asyncBatchAnnotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.locations.files.asyncBatchAnnotate * @memberOf! () * @@ -6060,6 +6656,69 @@ export namespace vision_v1p1beta1 { /** * vision.projects.locations.images.annotate * @desc Run image detection and annotation for a batch of images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.locations.images.annotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.locations.images.annotate * @memberOf! () * @@ -6161,6 +6820,74 @@ export namespace vision_v1p1beta1 { /** * vision.projects.locations.images.asyncBatchAnnotate * @desc Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p1beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.locations.images.asyncBatchAnnotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "outputConfig": {}, + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.locations.images.asyncBatchAnnotate * @memberOf! () * diff --git a/src/apis/vision/v1p2beta1.ts b/src/apis/vision/v1p2beta1.ts index 01f47ce2702..0edc234c8f1 100644 --- a/src/apis/vision/v1p2beta1.ts +++ b/src/apis/vision/v1p2beta1.ts @@ -4977,6 +4977,55 @@ export namespace vision_v1p2beta1 { /** * vision.files.annotate * @desc Service that performs image detection and annotation for a batch of files. Now only "application/pdf", "image/tiff" and "image/gif" are supported. This service will extract at most 5 (customers can specify which 5 in AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and perform detection and annotation for each image extracted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.files.annotate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.files.annotate * @memberOf! () * @@ -5076,6 +5125,59 @@ export namespace vision_v1p2beta1 { /** * vision.files.asyncBatchAnnotate * @desc Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.files.asyncBatchAnnotate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.files.asyncBatchAnnotate * @memberOf! () * @@ -5181,6 +5283,55 @@ export namespace vision_v1p2beta1 { /** * vision.images.annotate * @desc Run image detection and annotation for a batch of images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.images.annotate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.images.annotate * @memberOf! () * @@ -5280,6 +5431,60 @@ export namespace vision_v1p2beta1 { /** * vision.images.asyncBatchAnnotate * @desc Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.images.asyncBatchAnnotate({ + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "outputConfig": {}, + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.images.asyncBatchAnnotate * @memberOf! () * @@ -5398,6 +5603,69 @@ export namespace vision_v1p2beta1 { /** * vision.projects.files.annotate * @desc Service that performs image detection and annotation for a batch of files. Now only "application/pdf", "image/tiff" and "image/gif" are supported. This service will extract at most 5 (customers can specify which 5 in AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and perform detection and annotation for each image extracted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.files.annotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.files.annotate * @memberOf! () * @@ -5499,6 +5767,73 @@ export namespace vision_v1p2beta1 { /** * vision.projects.files.asyncBatchAnnotate * @desc Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.files.asyncBatchAnnotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.files.asyncBatchAnnotate * @memberOf! () * @@ -5615,6 +5950,69 @@ export namespace vision_v1p2beta1 { /** * vision.projects.images.annotate * @desc Run image detection and annotation for a batch of images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.images.annotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.images.annotate * @memberOf! () * @@ -5716,6 +6114,74 @@ export namespace vision_v1p2beta1 { /** * vision.projects.images.asyncBatchAnnotate * @desc Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.images.asyncBatchAnnotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "outputConfig": {}, + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.images.asyncBatchAnnotate * @memberOf! () * @@ -5843,6 +6309,69 @@ export namespace vision_v1p2beta1 { /** * vision.projects.locations.files.annotate * @desc Service that performs image detection and annotation for a batch of files. Now only "application/pdf", "image/tiff" and "image/gif" are supported. This service will extract at most 5 (customers can specify which 5 in AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and perform detection and annotation for each image extracted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.locations.files.annotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.locations.files.annotate * @memberOf! () * @@ -5944,6 +6473,73 @@ export namespace vision_v1p2beta1 { /** * vision.projects.locations.files.asyncBatchAnnotate * @desc Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.locations.files.asyncBatchAnnotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.locations.files.asyncBatchAnnotate * @memberOf! () * @@ -6060,6 +6656,69 @@ export namespace vision_v1p2beta1 { /** * vision.projects.locations.images.annotate * @desc Run image detection and annotation for a batch of images. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.locations.images.annotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responses": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.locations.images.annotate * @memberOf! () * @@ -6161,6 +6820,74 @@ export namespace vision_v1p2beta1 { /** * vision.projects.locations.images.asyncBatchAnnotate * @desc Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/vision.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 vision = google.vision('v1p2beta1'); + * + * 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/cloud-platform', + * 'https://www.googleapis.com/auth/cloud-vision', + * ], + * }); + * + * // 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 vision.projects.locations.images.asyncBatchAnnotate({ + * // Optional. Target project and location to make a call. + * // + * // Format: `projects/{project-id}/locations/{location-id}`. + * // + * // If no parent is specified, a region will be chosen automatically. + * // + * // Supported location-ids: + * // `us`: USA country only, + * // `asia`: East asia areas, like Japan, Taiwan, + * // `eu`: The European Union. + * // + * // Example: `projects/project-A/locations/eu`. + * parent: 'projects/my-project/locations/my-location', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "outputConfig": {}, + * // "parent": "my_parent", + * // "requests": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias vision.projects.locations.images.asyncBatchAnnotate * @memberOf! () * diff --git a/src/apis/webfonts/v1.ts b/src/apis/webfonts/v1.ts index 689e69039c4..623fba550af 100644 --- a/src/apis/webfonts/v1.ts +++ b/src/apis/webfonts/v1.ts @@ -151,6 +151,47 @@ export namespace webfonts_v1 { /** * webfonts.webfonts.list * @desc Retrieves the list of fonts currently served by the Google Fonts Developer API + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/webfonts.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 webfonts = google.webfonts('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: [], + * }); + * + * // 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 webfonts.webfonts.list({ + * // Enables sorting of the list + * sort: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias webfonts.webfonts.list * @memberOf! () * diff --git a/src/apis/webmasters/v3.ts b/src/apis/webmasters/v3.ts index a8b4f9446fe..bb8035b3fc9 100644 --- a/src/apis/webmasters/v3.ts +++ b/src/apis/webmasters/v3.ts @@ -263,6 +263,65 @@ export namespace webmasters_v3 { /** * webmasters.searchanalytics.query * @desc Query your data with filters and parameters that you define. Returns zero or more rows grouped by the row keys that you define. You must define a date range of one or more days. When date is one of the group by values, any days without data are omitted from the result list. If you need to know which days have data, issue a broad date range query grouped by date for any metric, and see which day rows are returned. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/webmasters.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 webmasters = google.webmasters('v3'); + * + * 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/webmasters', + * 'https://www.googleapis.com/auth/webmasters.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 webmasters.searchanalytics.query({ + * // The site's URL, including protocol. For example: http://www.example.com/ + * siteUrl: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "aggregationType": "my_aggregationType", + * // "dimensionFilterGroups": [], + * // "dimensions": [], + * // "endDate": "my_endDate", + * // "rowLimit": 0, + * // "searchType": "my_searchType", + * // "startDate": "my_startDate", + * // "startRow": 0 + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "responseAggregationType": "my_responseAggregationType", + * // "rows": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias webmasters.searchanalytics.query * @memberOf! () * @@ -371,6 +430,43 @@ export namespace webmasters_v3 { /** * webmasters.sitemaps.delete * @desc Deletes a sitemap from this site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/webmasters.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 webmasters = google.webmasters('v3'); + * + * 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/webmasters'], + * }); + * + * // 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 webmasters.sitemaps.delete({ + * // The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml + * feedpath: 'placeholder-value', + * // The site's URL, including protocol. For example: http://www.example.com/ + * siteUrl: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias webmasters.sitemaps.delete * @memberOf! () * @@ -442,6 +538,59 @@ export namespace webmasters_v3 { /** * webmasters.sitemaps.get * @desc Retrieves information about a specific sitemap. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/webmasters.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 webmasters = google.webmasters('v3'); + * + * 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/webmasters', + * 'https://www.googleapis.com/auth/webmasters.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 webmasters.sitemaps.get({ + * // The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml + * feedpath: 'placeholder-value', + * // The site's URL, including protocol. For example: http://www.example.com/ + * siteUrl: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contents": [], + * // "errors": "my_errors", + * // "isPending": false, + * // "isSitemapsIndex": false, + * // "lastDownloaded": "my_lastDownloaded", + * // "lastSubmitted": "my_lastSubmitted", + * // "path": "my_path", + * // "type": "my_type", + * // "warnings": "my_warnings" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias webmasters.sitemaps.get * @memberOf! () * @@ -515,6 +664,51 @@ export namespace webmasters_v3 { /** * webmasters.sitemaps.list * @desc Lists the sitemaps-entries submitted for this site, or included in the sitemap index file (if sitemapIndex is specified in the request). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/webmasters.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 webmasters = google.webmasters('v3'); + * + * 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/webmasters', + * 'https://www.googleapis.com/auth/webmasters.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 webmasters.sitemaps.list({ + * // A URL of a site's sitemap index. For example: http://www.example.com/sitemapindex.xml + * sitemapIndex: 'placeholder-value', + * // The site's URL, including protocol. For example: http://www.example.com/ + * siteUrl: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "sitemap": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias webmasters.sitemaps.list * @memberOf! () * @@ -591,6 +785,43 @@ export namespace webmasters_v3 { /** * webmasters.sitemaps.submit * @desc Submits a sitemap for a site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/webmasters.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 webmasters = google.webmasters('v3'); + * + * 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/webmasters'], + * }); + * + * // 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 webmasters.sitemaps.submit({ + * // The URL of the sitemap to add. For example: http://www.example.com/sitemap.xml + * feedpath: 'placeholder-value', + * // The site's URL, including protocol. For example: http://www.example.com/ + * siteUrl: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias webmasters.sitemaps.submit * @memberOf! () * @@ -730,6 +961,41 @@ export namespace webmasters_v3 { /** * webmasters.sites.add * @desc Adds a site to the set of the user's sites in Search Console. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/webmasters.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 webmasters = google.webmasters('v3'); + * + * 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/webmasters'], + * }); + * + * // 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 webmasters.sites.add({ + * // The URL of the site to add. + * siteUrl: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias webmasters.sites.add * @memberOf! () * @@ -799,6 +1065,41 @@ export namespace webmasters_v3 { /** * webmasters.sites.delete * @desc Removes a site from the set of the user's Search Console sites. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/webmasters.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 webmasters = google.webmasters('v3'); + * + * 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/webmasters'], + * }); + * + * // 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 webmasters.sites.delete({ + * // The URI of the property as defined in Search Console. Examples: http://www.example.com/ or android-app://com.example/ Note: for property-sets, use the URI that starts with sc-set: which is used in Search Console URLs. + * siteUrl: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias webmasters.sites.delete * @memberOf! () * @@ -870,6 +1171,50 @@ export namespace webmasters_v3 { /** * webmasters.sites.get * @desc Retrieves information about specific site. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/webmasters.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 webmasters = google.webmasters('v3'); + * + * 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/webmasters', + * 'https://www.googleapis.com/auth/webmasters.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 webmasters.sites.get({ + * // The URI of the property as defined in Search Console. Examples: http://www.example.com/ or android-app://com.example/ Note: for property-sets, use the URI that starts with sc-set: which is used in Search Console URLs. + * siteUrl: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "permissionLevel": "my_permissionLevel", + * // "siteUrl": "my_siteUrl" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias webmasters.sites.get * @memberOf! () * @@ -941,6 +1286,46 @@ export namespace webmasters_v3 { /** * webmasters.sites.list * @desc Lists the user's Search Console sites. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/webmasters.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 webmasters = google.webmasters('v3'); + * + * 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/webmasters', + * 'https://www.googleapis.com/auth/webmasters.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 webmasters.sites.list({}); + * console.log(res.data); + * + * // Example response + * // { + * // "siteEntry": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias webmasters.sites.list * @memberOf! () * diff --git a/src/apis/websecurityscanner/v1.ts b/src/apis/websecurityscanner/v1.ts index bb579915749..bf9c60f4e3e 100644 --- a/src/apis/websecurityscanner/v1.ts +++ b/src/apis/websecurityscanner/v1.ts @@ -628,6 +628,77 @@ export namespace websecurityscanner_v1 { /** * websecurityscanner.projects.scanConfigs.create * @desc Creates a new ScanConfig. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.create({ + * // Required. The parent resource name where the scan is created, which should be a + * // project resource name in the format 'projects/{projectId}'. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "authentication": {}, + * // "blacklistPatterns": [], + * // "displayName": "my_displayName", + * // "exportToSecurityCommandCenter": "my_exportToSecurityCommandCenter", + * // "managedScan": false, + * // "maxQps": 0, + * // "name": "my_name", + * // "riskLevel": "my_riskLevel", + * // "schedule": {}, + * // "startingUrls": [], + * // "staticIpScan": false, + * // "userAgent": "my_userAgent" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authentication": {}, + * // "blacklistPatterns": [], + * // "displayName": "my_displayName", + * // "exportToSecurityCommandCenter": "my_exportToSecurityCommandCenter", + * // "managedScan": false, + * // "maxQps": 0, + * // "name": "my_name", + * // "riskLevel": "my_riskLevel", + * // "schedule": {}, + * // "startingUrls": [], + * // "staticIpScan": false, + * // "userAgent": "my_userAgent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.create * @memberOf! () * @@ -704,6 +775,45 @@ export namespace websecurityscanner_v1 { /** * websecurityscanner.projects.scanConfigs.delete * @desc Deletes an existing ScanConfig and its child resources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.delete({ + * // Required. The resource name of the ScanConfig to be deleted. The name follows the + * // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * name: 'projects/my-project/scanConfigs/my-scanConfig', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.delete * @memberOf! () * @@ -774,6 +884,58 @@ export namespace websecurityscanner_v1 { /** * websecurityscanner.projects.scanConfigs.get * @desc Gets a ScanConfig. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.get({ + * // Required. The resource name of the ScanConfig to be returned. The name follows the + * // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * name: 'projects/my-project/scanConfigs/my-scanConfig', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authentication": {}, + * // "blacklistPatterns": [], + * // "displayName": "my_displayName", + * // "exportToSecurityCommandCenter": "my_exportToSecurityCommandCenter", + * // "managedScan": false, + * // "maxQps": 0, + * // "name": "my_name", + * // "riskLevel": "my_riskLevel", + * // "schedule": {}, + * // "startingUrls": [], + * // "staticIpScan": false, + * // "userAgent": "my_userAgent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.get * @memberOf! () * @@ -846,6 +1008,56 @@ export namespace websecurityscanner_v1 { /** * websecurityscanner.projects.scanConfigs.list * @desc Lists ScanConfigs under a given project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.list({ + * // The maximum number of ScanConfigs to return, can be limited by server. + * // If not specified or not positive, the implementation will select a + * // reasonable value. + * pageSize: 'placeholder-value', + * // A token identifying a page of results to be returned. This should be a + * // `next_page_token` value returned from a previous List request. + * // If unspecified, the first page of results is returned. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, which should be a project resource name in the + * // format 'projects/{projectId}'. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "scanConfigs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.list * @memberOf! () * @@ -925,6 +1137,82 @@ export namespace websecurityscanner_v1 { /** * websecurityscanner.projects.scanConfigs.patch * @desc Updates a ScanConfig. This method support partial update of a ScanConfig. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.patch({ + * // The resource name of the ScanConfig. The name follows the format of + * // 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are + * // generated by the system. + * name: 'projects/my-project/scanConfigs/my-scanConfig', + * // Required. The update mask applies to the resource. For the `FieldMask` definition, + * // see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "authentication": {}, + * // "blacklistPatterns": [], + * // "displayName": "my_displayName", + * // "exportToSecurityCommandCenter": "my_exportToSecurityCommandCenter", + * // "managedScan": false, + * // "maxQps": 0, + * // "name": "my_name", + * // "riskLevel": "my_riskLevel", + * // "schedule": {}, + * // "startingUrls": [], + * // "staticIpScan": false, + * // "userAgent": "my_userAgent" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authentication": {}, + * // "blacklistPatterns": [], + * // "displayName": "my_displayName", + * // "exportToSecurityCommandCenter": "my_exportToSecurityCommandCenter", + * // "managedScan": false, + * // "maxQps": 0, + * // "name": "my_name", + * // "riskLevel": "my_riskLevel", + * // "schedule": {}, + * // "startingUrls": [], + * // "staticIpScan": false, + * // "userAgent": "my_userAgent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.patch * @memberOf! () * @@ -999,6 +1287,63 @@ export namespace websecurityscanner_v1 { /** * websecurityscanner.projects.scanConfigs.start * @desc Start a ScanRun according to the given ScanConfig. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.start({ + * // Required. The resource name of the ScanConfig to be used. The name follows the + * // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * name: 'projects/my-project/scanConfigs/my-scanConfig', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "errorTrace": {}, + * // "executionState": "my_executionState", + * // "hasVulnerabilities": false, + * // "name": "my_name", + * // "progressPercent": 0, + * // "resultState": "my_resultState", + * // "startTime": "my_startTime", + * // "urlsCrawledCount": "my_urlsCrawledCount", + * // "urlsTestedCount": "my_urlsTestedCount", + * // "warningTraces": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.start * @memberOf! () * @@ -1189,6 +1534,58 @@ export namespace websecurityscanner_v1 { /** * websecurityscanner.projects.scanConfigs.scanRuns.get * @desc Gets a ScanRun. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.get({ + * // Required. The resource name of the ScanRun to be returned. The name follows the + * // format of + * // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * name: 'projects/my-project/scanConfigs/my-scanConfig/scanRuns/my-scanRun', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "errorTrace": {}, + * // "executionState": "my_executionState", + * // "hasVulnerabilities": false, + * // "name": "my_name", + * // "progressPercent": 0, + * // "resultState": "my_resultState", + * // "startTime": "my_startTime", + * // "urlsCrawledCount": "my_urlsCrawledCount", + * // "urlsTestedCount": "my_urlsTestedCount", + * // "warningTraces": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.get * @memberOf! () * @@ -1259,6 +1656,56 @@ export namespace websecurityscanner_v1 { /** * websecurityscanner.projects.scanConfigs.scanRuns.list * @desc Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.list({ + * // The maximum number of ScanRuns to return, can be limited by server. + * // If not specified or not positive, the implementation will select a + * // reasonable value. + * pageSize: 'placeholder-value', + * // A token identifying a page of results to be returned. This should be a + * // `next_page_token` value returned from a previous List request. + * // If unspecified, the first page of results is returned. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, which should be a scan resource name in the + * // format 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * parent: 'projects/my-project/scanConfigs/my-scanConfig', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "scanRuns": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.list * @memberOf! () * @@ -1338,6 +1785,64 @@ export namespace websecurityscanner_v1 { /** * websecurityscanner.projects.scanConfigs.scanRuns.stop * @desc Stops a ScanRun. The stopped ScanRun is returned. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.stop({ + * // Required. The resource name of the ScanRun to be stopped. The name follows the + * // format of + * // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * name: 'projects/my-project/scanConfigs/my-scanConfig/scanRuns/my-scanRun', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "errorTrace": {}, + * // "executionState": "my_executionState", + * // "hasVulnerabilities": false, + * // "name": "my_name", + * // "progressPercent": 0, + * // "resultState": "my_resultState", + * // "startTime": "my_startTime", + * // "urlsCrawledCount": "my_urlsCrawledCount", + * // "urlsTestedCount": "my_urlsTestedCount", + * // "warningTraces": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.stop * @memberOf! () * @@ -1466,6 +1971,60 @@ export namespace websecurityscanner_v1 { /** * websecurityscanner.projects.scanConfigs.scanRuns.crawledUrls.list * @desc List CrawledUrls under a given ScanRun. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.crawledUrls.list( + * { + * // The maximum number of CrawledUrls to return, can be limited by server. + * // If not specified or not positive, the implementation will select a + * // reasonable value. + * pageSize: 'placeholder-value', + * // A token identifying a page of results to be returned. This should be a + * // `next_page_token` value returned from a previous List request. + * // If unspecified, the first page of results is returned. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, which should be a scan run resource name in the + * // format + * // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * parent: + * 'projects/my-project/scanConfigs/my-scanConfig/scanRuns/my-scanRun', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "crawledUrls": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.crawledUrls.list * @memberOf! () * @@ -1573,6 +2132,67 @@ export namespace websecurityscanner_v1 { /** * websecurityscanner.projects.scanConfigs.scanRuns.findings.get * @desc Gets a Finding. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.findings.get( + * { + * // Required. The resource name of the Finding to be returned. The name follows the + * // format of + * // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. + * name: + * 'projects/my-project/scanConfigs/my-scanConfig/scanRuns/my-scanRun/findings/my-finding', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "body": "my_body", + * // "description": "my_description", + * // "finalUrl": "my_finalUrl", + * // "findingType": "my_findingType", + * // "form": {}, + * // "frameUrl": "my_frameUrl", + * // "fuzzedUrl": "my_fuzzedUrl", + * // "httpMethod": "my_httpMethod", + * // "name": "my_name", + * // "outdatedLibrary": {}, + * // "reproductionUrl": "my_reproductionUrl", + * // "severity": "my_severity", + * // "trackingId": "my_trackingId", + * // "violatingResource": {}, + * // "vulnerableHeaders": {}, + * // "vulnerableParameters": {}, + * // "xss": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.findings.get * @memberOf! () * @@ -1643,6 +2263,65 @@ export namespace websecurityscanner_v1 { /** * websecurityscanner.projects.scanConfigs.scanRuns.findings.list * @desc List Findings under a given ScanRun. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.findings.list( + * { + * // The filter expression. The expression must be in the format: + * // . + * // Supported field: 'finding_type'. + * // Supported operator: '='. + * filter: 'placeholder-value', + * // The maximum number of Findings to return, can be limited by server. + * // If not specified or not positive, the implementation will select a + * // reasonable value. + * pageSize: 'placeholder-value', + * // A token identifying a page of results to be returned. This should be a + * // `next_page_token` value returned from a previous List request. + * // If unspecified, the first page of results is returned. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, which should be a scan run resource name in the + * // format + * // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * parent: + * 'projects/my-project/scanConfigs/my-scanConfig/scanRuns/my-scanRun', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "findings": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.findings.list * @memberOf! () * @@ -1767,6 +2446,51 @@ export namespace websecurityscanner_v1 { /** * websecurityscanner.projects.scanConfigs.scanRuns.findingTypeStats.list * @desc List all FindingTypeStats under a given ScanRun. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.findingTypeStats.list( + * { + * // Required. The parent resource name, which should be a scan run resource name in the + * // format + * // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * parent: + * 'projects/my-project/scanConfigs/my-scanConfig/scanRuns/my-scanRun', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "findingTypeStats": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.findingTypeStats.list * @memberOf! () * diff --git a/src/apis/websecurityscanner/v1alpha.ts b/src/apis/websecurityscanner/v1alpha.ts index 1e154490709..e25c6a56206 100644 --- a/src/apis/websecurityscanner/v1alpha.ts +++ b/src/apis/websecurityscanner/v1alpha.ts @@ -522,6 +522,73 @@ export namespace websecurityscanner_v1alpha { /** * websecurityscanner.projects.scanConfigs.create * @desc Creates a new ScanConfig. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.create({ + * // Required. The parent resource name where the scan is created, which should be a + * // project resource name in the format 'projects/{projectId}'. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "authentication": {}, + * // "blacklistPatterns": [], + * // "displayName": "my_displayName", + * // "latestRun": {}, + * // "maxQps": 0, + * // "name": "my_name", + * // "schedule": {}, + * // "startingUrls": [], + * // "targetPlatforms": [], + * // "userAgent": "my_userAgent" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authentication": {}, + * // "blacklistPatterns": [], + * // "displayName": "my_displayName", + * // "latestRun": {}, + * // "maxQps": 0, + * // "name": "my_name", + * // "schedule": {}, + * // "startingUrls": [], + * // "targetPlatforms": [], + * // "userAgent": "my_userAgent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.create * @memberOf! () * @@ -598,6 +665,45 @@ export namespace websecurityscanner_v1alpha { /** * websecurityscanner.projects.scanConfigs.delete * @desc Deletes an existing ScanConfig and its child resources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.delete({ + * // Required. The resource name of the ScanConfig to be deleted. The name follows the + * // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * name: 'projects/my-project/scanConfigs/my-scanConfig', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.delete * @memberOf! () * @@ -668,6 +774,56 @@ export namespace websecurityscanner_v1alpha { /** * websecurityscanner.projects.scanConfigs.get * @desc Gets a ScanConfig. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.get({ + * // Required. The resource name of the ScanConfig to be returned. The name follows the + * // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * name: 'projects/my-project/scanConfigs/my-scanConfig', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authentication": {}, + * // "blacklistPatterns": [], + * // "displayName": "my_displayName", + * // "latestRun": {}, + * // "maxQps": 0, + * // "name": "my_name", + * // "schedule": {}, + * // "startingUrls": [], + * // "targetPlatforms": [], + * // "userAgent": "my_userAgent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.get * @memberOf! () * @@ -740,6 +896,56 @@ export namespace websecurityscanner_v1alpha { /** * websecurityscanner.projects.scanConfigs.list * @desc Lists ScanConfigs under a given project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.list({ + * // The maximum number of ScanConfigs to return, can be limited by server. + * // If not specified or not positive, the implementation will select a + * // reasonable value. + * pageSize: 'placeholder-value', + * // A token identifying a page of results to be returned. This should be a + * // `next_page_token` value returned from a previous List request. + * // If unspecified, the first page of results is returned. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, which should be a project resource name in the + * // format 'projects/{projectId}'. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "scanConfigs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.list * @memberOf! () * @@ -819,6 +1025,78 @@ export namespace websecurityscanner_v1alpha { /** * websecurityscanner.projects.scanConfigs.patch * @desc Updates a ScanConfig. This method support partial update of a ScanConfig. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.patch({ + * // The resource name of the ScanConfig. The name follows the format of + * // 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are + * // generated by the system. + * name: 'projects/my-project/scanConfigs/my-scanConfig', + * // Required. The update mask applies to the resource. For the `FieldMask` definition, + * // see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "authentication": {}, + * // "blacklistPatterns": [], + * // "displayName": "my_displayName", + * // "latestRun": {}, + * // "maxQps": 0, + * // "name": "my_name", + * // "schedule": {}, + * // "startingUrls": [], + * // "targetPlatforms": [], + * // "userAgent": "my_userAgent" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authentication": {}, + * // "blacklistPatterns": [], + * // "displayName": "my_displayName", + * // "latestRun": {}, + * // "maxQps": 0, + * // "name": "my_name", + * // "schedule": {}, + * // "startingUrls": [], + * // "targetPlatforms": [], + * // "userAgent": "my_userAgent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.patch * @memberOf! () * @@ -893,6 +1171,61 @@ export namespace websecurityscanner_v1alpha { /** * websecurityscanner.projects.scanConfigs.start * @desc Start a ScanRun according to the given ScanConfig. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.start({ + * // Required. The resource name of the ScanConfig to be used. The name follows the + * // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * name: 'projects/my-project/scanConfigs/my-scanConfig', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "executionState": "my_executionState", + * // "hasVulnerabilities": false, + * // "name": "my_name", + * // "progressPercent": 0, + * // "resultState": "my_resultState", + * // "startTime": "my_startTime", + * // "urlsCrawledCount": "my_urlsCrawledCount", + * // "urlsTestedCount": "my_urlsTestedCount" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.start * @memberOf! () * @@ -1086,6 +1419,56 @@ export namespace websecurityscanner_v1alpha { /** * websecurityscanner.projects.scanConfigs.scanRuns.get * @desc Gets a ScanRun. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.get({ + * // Required. The resource name of the ScanRun to be returned. The name follows the + * // format of + * // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * name: 'projects/my-project/scanConfigs/my-scanConfig/scanRuns/my-scanRun', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "executionState": "my_executionState", + * // "hasVulnerabilities": false, + * // "name": "my_name", + * // "progressPercent": 0, + * // "resultState": "my_resultState", + * // "startTime": "my_startTime", + * // "urlsCrawledCount": "my_urlsCrawledCount", + * // "urlsTestedCount": "my_urlsTestedCount" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.get * @memberOf! () * @@ -1156,6 +1539,56 @@ export namespace websecurityscanner_v1alpha { /** * websecurityscanner.projects.scanConfigs.scanRuns.list * @desc Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.list({ + * // The maximum number of ScanRuns to return, can be limited by server. + * // If not specified or not positive, the implementation will select a + * // reasonable value. + * pageSize: 'placeholder-value', + * // A token identifying a page of results to be returned. This should be a + * // `next_page_token` value returned from a previous List request. + * // If unspecified, the first page of results is returned. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, which should be a scan resource name in the + * // format 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * parent: 'projects/my-project/scanConfigs/my-scanConfig', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "scanRuns": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.list * @memberOf! () * @@ -1235,6 +1668,62 @@ export namespace websecurityscanner_v1alpha { /** * websecurityscanner.projects.scanConfigs.scanRuns.stop * @desc Stops a ScanRun. The stopped ScanRun is returned. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.stop({ + * // Required. The resource name of the ScanRun to be stopped. The name follows the + * // format of + * // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * name: 'projects/my-project/scanConfigs/my-scanConfig/scanRuns/my-scanRun', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "executionState": "my_executionState", + * // "hasVulnerabilities": false, + * // "name": "my_name", + * // "progressPercent": 0, + * // "resultState": "my_resultState", + * // "startTime": "my_startTime", + * // "urlsCrawledCount": "my_urlsCrawledCount", + * // "urlsTestedCount": "my_urlsTestedCount" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.stop * @memberOf! () * @@ -1366,6 +1855,60 @@ export namespace websecurityscanner_v1alpha { /** * websecurityscanner.projects.scanConfigs.scanRuns.crawledUrls.list * @desc List CrawledUrls under a given ScanRun. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.crawledUrls.list( + * { + * // The maximum number of CrawledUrls to return, can be limited by server. + * // If not specified or not positive, the implementation will select a + * // reasonable value. + * pageSize: 'placeholder-value', + * // A token identifying a page of results to be returned. This should be a + * // `next_page_token` value returned from a previous List request. + * // If unspecified, the first page of results is returned. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, which should be a scan run resource name in the + * // format + * // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * parent: + * 'projects/my-project/scanConfigs/my-scanConfig/scanRuns/my-scanRun', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "crawledUrls": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.crawledUrls.list * @memberOf! () * @@ -1473,6 +2016,65 @@ export namespace websecurityscanner_v1alpha { /** * websecurityscanner.projects.scanConfigs.scanRuns.findings.get * @desc Gets a Finding. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.findings.get( + * { + * // Required. The resource name of the Finding to be returned. The name follows the + * // format of + * // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. + * name: + * 'projects/my-project/scanConfigs/my-scanConfig/scanRuns/my-scanRun/findings/my-finding', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "body": "my_body", + * // "description": "my_description", + * // "finalUrl": "my_finalUrl", + * // "findingType": "my_findingType", + * // "frameUrl": "my_frameUrl", + * // "fuzzedUrl": "my_fuzzedUrl", + * // "httpMethod": "my_httpMethod", + * // "name": "my_name", + * // "outdatedLibrary": {}, + * // "reproductionUrl": "my_reproductionUrl", + * // "trackingId": "my_trackingId", + * // "violatingResource": {}, + * // "vulnerableHeaders": {}, + * // "vulnerableParameters": {}, + * // "xss": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.findings.get * @memberOf! () * @@ -1543,6 +2145,65 @@ export namespace websecurityscanner_v1alpha { /** * websecurityscanner.projects.scanConfigs.scanRuns.findings.list * @desc List Findings under a given ScanRun. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.findings.list( + * { + * // Required. The filter expression. The expression must be in the format: + * // . + * // Supported field: 'finding_type'. + * // Supported operator: '='. + * filter: 'placeholder-value', + * // The maximum number of Findings to return, can be limited by server. + * // If not specified or not positive, the implementation will select a + * // reasonable value. + * pageSize: 'placeholder-value', + * // A token identifying a page of results to be returned. This should be a + * // `next_page_token` value returned from a previous List request. + * // If unspecified, the first page of results is returned. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, which should be a scan run resource name in the + * // format + * // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * parent: + * 'projects/my-project/scanConfigs/my-scanConfig/scanRuns/my-scanRun', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "findings": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.findings.list * @memberOf! () * @@ -1667,6 +2328,51 @@ export namespace websecurityscanner_v1alpha { /** * websecurityscanner.projects.scanConfigs.scanRuns.findingTypeStats.list * @desc List all FindingTypeStats under a given ScanRun. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1alpha'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.findingTypeStats.list( + * { + * // Required. The parent resource name, which should be a scan run resource name in the + * // format + * // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * parent: + * 'projects/my-project/scanConfigs/my-scanConfig/scanRuns/my-scanRun', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "findingTypeStats": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.findingTypeStats.list * @memberOf! () * diff --git a/src/apis/websecurityscanner/v1beta.ts b/src/apis/websecurityscanner/v1beta.ts index 2f22ee6c01f..f9026d766fe 100644 --- a/src/apis/websecurityscanner/v1beta.ts +++ b/src/apis/websecurityscanner/v1beta.ts @@ -628,6 +628,81 @@ export namespace websecurityscanner_v1beta { /** * websecurityscanner.projects.scanConfigs.create * @desc Creates a new ScanConfig. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.create({ + * // Required. The parent resource name where the scan is created, which should be a + * // project resource name in the format 'projects/{projectId}'. + * parent: 'projects/my-project', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "authentication": {}, + * // "blacklistPatterns": [], + * // "displayName": "my_displayName", + * // "exportToSecurityCommandCenter": "my_exportToSecurityCommandCenter", + * // "latestRun": {}, + * // "managedScan": false, + * // "maxQps": 0, + * // "name": "my_name", + * // "riskLevel": "my_riskLevel", + * // "schedule": {}, + * // "startingUrls": [], + * // "staticIpScan": false, + * // "targetPlatforms": [], + * // "userAgent": "my_userAgent" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authentication": {}, + * // "blacklistPatterns": [], + * // "displayName": "my_displayName", + * // "exportToSecurityCommandCenter": "my_exportToSecurityCommandCenter", + * // "latestRun": {}, + * // "managedScan": false, + * // "maxQps": 0, + * // "name": "my_name", + * // "riskLevel": "my_riskLevel", + * // "schedule": {}, + * // "startingUrls": [], + * // "staticIpScan": false, + * // "targetPlatforms": [], + * // "userAgent": "my_userAgent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.create * @memberOf! () * @@ -704,6 +779,45 @@ export namespace websecurityscanner_v1beta { /** * websecurityscanner.projects.scanConfigs.delete * @desc Deletes an existing ScanConfig and its child resources. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.delete({ + * // Required. The resource name of the ScanConfig to be deleted. The name follows the + * // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * name: 'projects/my-project/scanConfigs/my-scanConfig', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.delete * @memberOf! () * @@ -774,6 +888,60 @@ export namespace websecurityscanner_v1beta { /** * websecurityscanner.projects.scanConfigs.get * @desc Gets a ScanConfig. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.get({ + * // Required. The resource name of the ScanConfig to be returned. The name follows the + * // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * name: 'projects/my-project/scanConfigs/my-scanConfig', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authentication": {}, + * // "blacklistPatterns": [], + * // "displayName": "my_displayName", + * // "exportToSecurityCommandCenter": "my_exportToSecurityCommandCenter", + * // "latestRun": {}, + * // "managedScan": false, + * // "maxQps": 0, + * // "name": "my_name", + * // "riskLevel": "my_riskLevel", + * // "schedule": {}, + * // "startingUrls": [], + * // "staticIpScan": false, + * // "targetPlatforms": [], + * // "userAgent": "my_userAgent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.get * @memberOf! () * @@ -846,6 +1014,56 @@ export namespace websecurityscanner_v1beta { /** * websecurityscanner.projects.scanConfigs.list * @desc Lists ScanConfigs under a given project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.list({ + * // The maximum number of ScanConfigs to return, can be limited by server. + * // If not specified or not positive, the implementation will select a + * // reasonable value. + * pageSize: 'placeholder-value', + * // A token identifying a page of results to be returned. This should be a + * // `next_page_token` value returned from a previous List request. + * // If unspecified, the first page of results is returned. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, which should be a project resource name in the + * // format 'projects/{projectId}'. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "scanConfigs": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.list * @memberOf! () * @@ -925,6 +1143,86 @@ export namespace websecurityscanner_v1beta { /** * websecurityscanner.projects.scanConfigs.patch * @desc Updates a ScanConfig. This method support partial update of a ScanConfig. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.patch({ + * // The resource name of the ScanConfig. The name follows the format of + * // 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are + * // generated by the system. + * name: 'projects/my-project/scanConfigs/my-scanConfig', + * // Required. The update mask applies to the resource. For the `FieldMask` definition, + * // see + * // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "authentication": {}, + * // "blacklistPatterns": [], + * // "displayName": "my_displayName", + * // "exportToSecurityCommandCenter": "my_exportToSecurityCommandCenter", + * // "latestRun": {}, + * // "managedScan": false, + * // "maxQps": 0, + * // "name": "my_name", + * // "riskLevel": "my_riskLevel", + * // "schedule": {}, + * // "startingUrls": [], + * // "staticIpScan": false, + * // "targetPlatforms": [], + * // "userAgent": "my_userAgent" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authentication": {}, + * // "blacklistPatterns": [], + * // "displayName": "my_displayName", + * // "exportToSecurityCommandCenter": "my_exportToSecurityCommandCenter", + * // "latestRun": {}, + * // "managedScan": false, + * // "maxQps": 0, + * // "name": "my_name", + * // "riskLevel": "my_riskLevel", + * // "schedule": {}, + * // "startingUrls": [], + * // "staticIpScan": false, + * // "targetPlatforms": [], + * // "userAgent": "my_userAgent" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.patch * @memberOf! () * @@ -999,6 +1297,63 @@ export namespace websecurityscanner_v1beta { /** * websecurityscanner.projects.scanConfigs.start * @desc Start a ScanRun according to the given ScanConfig. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.start({ + * // Required. The resource name of the ScanConfig to be used. The name follows the + * // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * name: 'projects/my-project/scanConfigs/my-scanConfig', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "errorTrace": {}, + * // "executionState": "my_executionState", + * // "hasVulnerabilities": false, + * // "name": "my_name", + * // "progressPercent": 0, + * // "resultState": "my_resultState", + * // "startTime": "my_startTime", + * // "urlsCrawledCount": "my_urlsCrawledCount", + * // "urlsTestedCount": "my_urlsTestedCount", + * // "warningTraces": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.start * @memberOf! () * @@ -1192,6 +1547,58 @@ export namespace websecurityscanner_v1beta { /** * websecurityscanner.projects.scanConfigs.scanRuns.get * @desc Gets a ScanRun. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.get({ + * // Required. The resource name of the ScanRun to be returned. The name follows the + * // format of + * // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * name: 'projects/my-project/scanConfigs/my-scanConfig/scanRuns/my-scanRun', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "errorTrace": {}, + * // "executionState": "my_executionState", + * // "hasVulnerabilities": false, + * // "name": "my_name", + * // "progressPercent": 0, + * // "resultState": "my_resultState", + * // "startTime": "my_startTime", + * // "urlsCrawledCount": "my_urlsCrawledCount", + * // "urlsTestedCount": "my_urlsTestedCount", + * // "warningTraces": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.get * @memberOf! () * @@ -1262,6 +1669,56 @@ export namespace websecurityscanner_v1beta { /** * websecurityscanner.projects.scanConfigs.scanRuns.list * @desc Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.list({ + * // The maximum number of ScanRuns to return, can be limited by server. + * // If not specified or not positive, the implementation will select a + * // reasonable value. + * pageSize: 'placeholder-value', + * // A token identifying a page of results to be returned. This should be a + * // `next_page_token` value returned from a previous List request. + * // If unspecified, the first page of results is returned. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, which should be a scan resource name in the + * // format 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * parent: 'projects/my-project/scanConfigs/my-scanConfig', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "scanRuns": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.list * @memberOf! () * @@ -1341,6 +1798,64 @@ export namespace websecurityscanner_v1beta { /** * websecurityscanner.projects.scanConfigs.scanRuns.stop * @desc Stops a ScanRun. The stopped ScanRun is returned. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.stop({ + * // Required. The resource name of the ScanRun to be stopped. The name follows the + * // format of + * // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * name: 'projects/my-project/scanConfigs/my-scanConfig/scanRuns/my-scanRun', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "errorTrace": {}, + * // "executionState": "my_executionState", + * // "hasVulnerabilities": false, + * // "name": "my_name", + * // "progressPercent": 0, + * // "resultState": "my_resultState", + * // "startTime": "my_startTime", + * // "urlsCrawledCount": "my_urlsCrawledCount", + * // "urlsTestedCount": "my_urlsTestedCount", + * // "warningTraces": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.stop * @memberOf! () * @@ -1472,6 +1987,60 @@ export namespace websecurityscanner_v1beta { /** * websecurityscanner.projects.scanConfigs.scanRuns.crawledUrls.list * @desc List CrawledUrls under a given ScanRun. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.crawledUrls.list( + * { + * // The maximum number of CrawledUrls to return, can be limited by server. + * // If not specified or not positive, the implementation will select a + * // reasonable value. + * pageSize: 'placeholder-value', + * // A token identifying a page of results to be returned. This should be a + * // `next_page_token` value returned from a previous List request. + * // If unspecified, the first page of results is returned. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, which should be a scan run resource name in the + * // format + * // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * parent: + * 'projects/my-project/scanConfigs/my-scanConfig/scanRuns/my-scanRun', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "crawledUrls": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.crawledUrls.list * @memberOf! () * @@ -1579,6 +2148,67 @@ export namespace websecurityscanner_v1beta { /** * websecurityscanner.projects.scanConfigs.scanRuns.findings.get * @desc Gets a Finding. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.findings.get( + * { + * // Required. The resource name of the Finding to be returned. The name follows the + * // format of + * // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. + * name: + * 'projects/my-project/scanConfigs/my-scanConfig/scanRuns/my-scanRun/findings/my-finding', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "body": "my_body", + * // "description": "my_description", + * // "finalUrl": "my_finalUrl", + * // "findingType": "my_findingType", + * // "form": {}, + * // "frameUrl": "my_frameUrl", + * // "fuzzedUrl": "my_fuzzedUrl", + * // "httpMethod": "my_httpMethod", + * // "name": "my_name", + * // "outdatedLibrary": {}, + * // "reproductionUrl": "my_reproductionUrl", + * // "severity": "my_severity", + * // "trackingId": "my_trackingId", + * // "violatingResource": {}, + * // "vulnerableHeaders": {}, + * // "vulnerableParameters": {}, + * // "xss": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.findings.get * @memberOf! () * @@ -1649,6 +2279,65 @@ export namespace websecurityscanner_v1beta { /** * websecurityscanner.projects.scanConfigs.scanRuns.findings.list * @desc List Findings under a given ScanRun. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.findings.list( + * { + * // Required. The filter expression. The expression must be in the format: + * // . + * // Supported field: 'finding_type'. + * // Supported operator: '='. + * filter: 'placeholder-value', + * // The maximum number of Findings to return, can be limited by server. + * // If not specified or not positive, the implementation will select a + * // reasonable value. + * pageSize: 'placeholder-value', + * // A token identifying a page of results to be returned. This should be a + * // `next_page_token` value returned from a previous List request. + * // If unspecified, the first page of results is returned. + * pageToken: 'placeholder-value', + * // Required. The parent resource name, which should be a scan run resource name in the + * // format + * // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * parent: + * 'projects/my-project/scanConfigs/my-scanConfig/scanRuns/my-scanRun', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "findings": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.findings.list * @memberOf! () * @@ -1773,6 +2462,51 @@ export namespace websecurityscanner_v1beta { /** * websecurityscanner.projects.scanConfigs.scanRuns.findingTypeStats.list * @desc List all FindingTypeStats under a given ScanRun. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/websecurityscanner.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 websecurityscanner = google.websecurityscanner('v1beta'); + * + * 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/cloud-platform'], + * }); + * + * // 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 websecurityscanner.projects.scanConfigs.scanRuns.findingTypeStats.list( + * { + * // Required. The parent resource name, which should be a scan run resource name in the + * // format + * // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * parent: + * 'projects/my-project/scanConfigs/my-scanConfig/scanRuns/my-scanRun', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "findingTypeStats": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias websecurityscanner.projects.scanConfigs.scanRuns.findingTypeStats.list * @memberOf! () * diff --git a/src/apis/youtube/v3.ts b/src/apis/youtube/v3.ts index 4fbdf55c604..26f25eb3ec2 100644 --- a/src/apis/youtube/v3.ts +++ b/src/apis/youtube/v3.ts @@ -4497,6 +4497,65 @@ export namespace youtube_v3 { /** * youtube.activities.insert * @desc Posts a bulletin for a specific channel. (The user submitting the request must be authorized to act on the channel's behalf.) Note: Even though an activity resource can contain information about actions like a user rating a video or marking a video as a favorite, you need to use other API methods to generate those activity resources. For example, you would use the API's videos.rate() method to rate a video and the playlistItems.insert() method to mark a video as a favorite. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * ], + * }); + * + * // 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 youtube.activities.insert({ + * // The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.activities.insert * @memberOf! () * @@ -4570,6 +4629,76 @@ export namespace youtube_v3 { /** * youtube.activities.list * @desc Returns a list of channel activity events that match the request criteria. For example, you can retrieve events associated with a particular channel, events associated with the user's subscriptions and Google+ friends, or the YouTube home page feed, which is customized for each user. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.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 youtube.activities.list({ + * // The channelId parameter specifies a unique YouTube channel ID. The API will then return a list of that channel's activities. + * channelId: 'placeholder-value', + * // Set this parameter's value to true to retrieve the activity feed that displays on the YouTube home page for the currently authenticated user. + * home: 'placeholder-value', + * // The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * maxResults: 'placeholder-value', + * // Set this parameter's value to true to retrieve a feed of the authenticated user's activities. + * mine: 'placeholder-value', + * // The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * pageToken: 'placeholder-value', + * // The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include. + * // + * // If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in an activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties. + * part: 'placeholder-value', + * // The publishedAfter parameter specifies the earliest date and time that an activity could have occurred for that activity to be included in the API response. If the parameter value specifies a day, but not a time, then any activities that occurred that day will be included in the result set. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + * publishedAfter: 'placeholder-value', + * // The publishedBefore parameter specifies the date and time before which an activity must have occurred for that activity to be included in the API response. If the parameter value specifies a day, but not a time, then any activities that occurred that day will be excluded from the result set. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + * publishedBefore: 'placeholder-value', + * // The regionCode parameter instructs the API to return results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code. YouTube uses this value when the authorized user's previous activity on YouTube does not provide enough information to generate the activity feed. + * regionCode: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "pageInfo": {}, + * // "prevPageToken": "my_prevPageToken", + * // "tokenPagination": {}, + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.activities.list * @memberOf! () * @@ -4721,6 +4850,50 @@ export namespace youtube_v3 { /** * youtube.captions.delete * @desc Deletes a specified caption track. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.captions.delete({ + * // The id parameter identifies the caption track that is being deleted. The value is a caption track ID as identified by the id property in a caption resource. + * id: 'placeholder-value', + * // ID of the Google+ Page for the channel that the request is be on behalf of + * onBehalfOf: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.captions.delete * @memberOf! () * @@ -4794,6 +4967,54 @@ export namespace youtube_v3 { /** * youtube.captions.download * @desc Downloads a caption track. The caption track is returned in its original format unless the request specifies a value for the tfmt parameter and in its original language unless the request specifies a value for the tlang parameter. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.captions.download({ + * // The id parameter identifies the caption track that is being retrieved. The value is a caption track ID as identified by the id property in a caption resource. + * id: 'placeholder-value', + * // ID of the Google+ Page for the channel that the request is be on behalf of + * onBehalfOf: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // The tfmt parameter specifies that the caption track should be returned in a specific format. If the parameter is not included in the request, the track is returned in its original format. + * tfmt: 'placeholder-value', + * // The tlang parameter specifies that the API response should return a translation of the specified caption track. The parameter value is an ISO 639-1 two-letter language code that identifies the desired caption language. The translation is generated by using machine translation, such as Google Translate. + * tlang: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.captions.download * @memberOf! () * @@ -4870,6 +5091,77 @@ export namespace youtube_v3 { /** * youtube.captions.insert * @desc Uploads a caption track. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.captions.insert({ + * // ID of the Google+ Page for the channel that the request is be on behalf of + * onBehalfOf: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // The part parameter specifies the caption resource parts that the API response will include. Set the parameter value to snippet. + * part: 'placeholder-value', + * // The sync parameter indicates whether YouTube should automatically synchronize the caption file with the audio track of the video. If you set the value to true, YouTube will disregard any time codes that are in the uploaded caption file and generate new time codes for the captions. + * // + * // You should set the sync parameter to true if you are uploading a transcript, which has no time codes, or if you suspect the time codes in your file are incorrect and want YouTube to try to fix them. + * sync: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {} + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.captions.insert * @memberOf! () * @@ -4952,6 +5244,63 @@ export namespace youtube_v3 { /** * youtube.captions.list * @desc Returns a list of caption tracks that are associated with a specified video. Note that the API response does not contain the actual captions and that the captions.download method provides the ability to retrieve a caption track. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.captions.list({ + * // The id parameter specifies a comma-separated list of IDs that identify the caption resources that should be retrieved. Each ID must identify a caption track associated with the specified video. + * id: 'placeholder-value', + * // ID of the Google+ Page for the channel that the request is on behalf of. + * onBehalfOf: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // The part parameter specifies a comma-separated list of one or more caption resource parts that the API response will include. The part names that you can include in the parameter value are id and snippet. + * part: 'placeholder-value', + * // The videoId parameter specifies the YouTube video ID of the video for which the API should return caption tracks. + * videoId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.captions.list * @memberOf! () * @@ -5029,6 +5378,77 @@ export namespace youtube_v3 { /** * youtube.captions.update * @desc Updates a caption track. When updating a caption track, you can change the track's draft status, upload a new caption file for the track, or both. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.captions.update({ + * // ID of the Google+ Page for the channel that the request is be on behalf of + * onBehalfOf: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. Set the property value to snippet if you are updating the track's draft status. Otherwise, set the property value to id. + * part: 'placeholder-value', + * // Note: The API server only processes the parameter value if the request contains an updated caption file. + * // + * // The sync parameter indicates whether YouTube should automatically synchronize the caption file with the audio track of the video. If you set the value to true, YouTube will automatically synchronize the caption track with the audio track. + * sync: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {} + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.captions.update * @memberOf! () * @@ -5279,6 +5699,70 @@ export namespace youtube_v3 { /** * youtube.channelBanners.insert * @desc Uploads a channel banner image to YouTube. This method represents the first two steps in a three-step process to update the banner image for a channel: - Call the channelBanners.insert method to upload the binary image data to YouTube. The image must have a 16:9 aspect ratio and be at least 2120x1192 pixels. - Extract the url property's value from the response that the API returns for step 1. - Call the channels.update method to update the channel's branding settings. Set the brandingSettings.image.bannerExternalUrl property's value to the URL obtained in step 2. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.upload', + * ], + * }); + * + * // 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 youtube.channelBanners.insert({ + * // The channelId parameter identifies the YouTube channel to which the banner is uploaded. The channelId parameter was introduced as a required parameter in May 2017. As this was a backward-incompatible change, channelBanners.insert requests that do not specify this parameter will not return an error until six months have passed from the time that the parameter was introduced. Please see the API Terms of Service for the official policy regarding backward incompatible changes and the API revision history for the exact date that the parameter was introduced. + * channelId: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "url": "my_url" + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "kind": "my_kind", + * // "url": "my_url" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.channelBanners.insert * @memberOf! () * @@ -5407,6 +5891,86 @@ export namespace youtube_v3 { /** * youtube.channels.list * @desc Returns a collection of zero or more channel resources that match the request criteria. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * 'https://www.googleapis.com/auth/youtubepartner-channel-audit', + * ], + * }); + * + * // 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 youtube.channels.list({ + * // The categoryId parameter specifies a YouTube guide category, thereby requesting YouTube channels associated with that category. + * categoryId: 'placeholder-value', + * // The forUsername parameter specifies a YouTube username, thereby requesting the channel associated with that username. + * forUsername: 'placeholder-value', + * // The hl parameter should be used for filter out the properties that are not in the given language. Used for the brandingSettings part. + * hl: 'placeholder-value', + * // The id parameter specifies a comma-separated list of the YouTube channel ID(s) for the resource(s) that are being retrieved. In a channel resource, the id property specifies the channel's YouTube channel ID. + * id: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // Set this parameter's value to true to instruct the API to only return channels managed by the content owner that the onBehalfOfContentOwner parameter specifies. The user must be authenticated as a CMS account linked to the specified content owner and onBehalfOfContentOwner must be provided. + * managedByMe: 'placeholder-value', + * // The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * maxResults: 'placeholder-value', + * // Set this parameter's value to true to instruct the API to only return channels owned by the authenticated user. + * mine: 'placeholder-value', + * // Use the subscriptions.list method and its mySubscribers parameter to retrieve a list of subscribers to the authenticated user's channel. + * mySubscribers: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * pageToken: 'placeholder-value', + * // The part parameter specifies a comma-separated list of one or more channel resource properties that the API response will include. + * // + * // If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channel resource, the contentDetails property contains other properties, such as the uploads properties. As such, if you set part=contentDetails, the API response will also contain all of those nested properties. + * part: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "pageInfo": {}, + * // "prevPageToken": "my_prevPageToken", + * // "tokenPagination": {}, + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.channels.list * @memberOf! () * @@ -5490,6 +6054,90 @@ export namespace youtube_v3 { /** * youtube.channels.update * @desc Updates a channel's metadata. Note that this method currently only supports updates to the channel resource's brandingSettings and invideoPromotion objects and their child properties. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.channels.update({ + * // The onBehalfOfContentOwner parameter indicates that the authenticated user is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. + * // + * // The API currently only allows the parameter value to be set to either brandingSettings or invideoPromotion. (You cannot update both of those parts with a single request.) + * // + * // Note that this method overrides the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "auditDetails": {}, + * // "brandingSettings": {}, + * // "contentDetails": {}, + * // "contentOwnerDetails": {}, + * // "conversionPings": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "invideoPromotion": {}, + * // "kind": "my_kind", + * // "localizations": {}, + * // "snippet": {}, + * // "statistics": {}, + * // "status": {}, + * // "topicDetails": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "auditDetails": {}, + * // "brandingSettings": {}, + * // "contentDetails": {}, + * // "contentOwnerDetails": {}, + * // "conversionPings": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "invideoPromotion": {}, + * // "kind": "my_kind", + * // "localizations": {}, + * // "snippet": {}, + * // "statistics": {}, + * // "status": {}, + * // "topicDetails": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.channels.update * @memberOf! () * @@ -5642,6 +6290,49 @@ export namespace youtube_v3 { /** * youtube.channelSections.delete * @desc Deletes a channelSection. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.channelSections.delete({ + * // The id parameter specifies the YouTube channelSection ID for the resource that is being deleted. In a channelSection resource, the id property specifies the YouTube channelSection ID. + * id: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.channelSections.delete * @memberOf! () * @@ -5715,6 +6406,82 @@ export namespace youtube_v3 { /** * youtube.channelSections.insert * @desc Adds a channelSection for the authenticated user's channel. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.channelSections.insert({ + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. + * // + * // This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * onBehalfOfContentOwnerChannel: 'placeholder-value', + * // The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. + * // + * // The part names that you can include in the parameter value are snippet and contentDetails. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "localizations": {}, + * // "snippet": {}, + * // "targeting": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "localizations": {}, + * // "snippet": {}, + * // "targeting": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.channelSections.insert * @memberOf! () * @@ -5792,6 +6559,69 @@ export namespace youtube_v3 { /** * youtube.channelSections.list * @desc Returns channelSection resources that match the API request criteria. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.channelSections.list({ + * // The channelId parameter specifies a YouTube channel ID. The API will only return that channel's channelSections. + * channelId: 'placeholder-value', + * // The hl parameter indicates that the snippet.localized property values in the returned channelSection resources should be in the specified language if localized values for that language are available. For example, if the API request specifies hl=de, the snippet.localized properties in the API response will contain German titles if German titles are available. Channel owners can provide localized channel section titles using either the channelSections.insert or channelSections.update method. + * hl: 'placeholder-value', + * // The id parameter specifies a comma-separated list of the YouTube channelSection ID(s) for the resource(s) that are being retrieved. In a channelSection resource, the id property specifies the YouTube channelSection ID. + * id: 'placeholder-value', + * // Set this parameter's value to true to retrieve a feed of the authenticated user's channelSections. + * mine: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // The part parameter specifies a comma-separated list of one or more channelSection resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails. + * // + * // If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channelSection resource, the snippet property contains other properties, such as a display title for the channelSection. If you set part=snippet, the API response will also contain all of those nested properties. + * part: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.channelSections.list * @memberOf! () * @@ -5878,6 +6708,76 @@ export namespace youtube_v3 { /** * youtube.channelSections.update * @desc Update a channelSection. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.channelSections.update({ + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. + * // + * // The part names that you can include in the parameter value are snippet and contentDetails. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "localizations": {}, + * // "snippet": {}, + * // "targeting": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "localizations": {}, + * // "snippet": {}, + * // "targeting": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.channelSections.update * @memberOf! () * @@ -6056,6 +6956,41 @@ export namespace youtube_v3 { /** * youtube.comments.delete * @desc Deletes a comment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube.force-ssl'], + * }); + * + * // 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 youtube.comments.delete({ + * // The id parameter specifies the comment ID for the resource that is being deleted. + * id: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.comments.delete * @memberOf! () * @@ -6127,6 +7062,60 @@ export namespace youtube_v3 { /** * youtube.comments.insert * @desc Creates a reply to an existing comment. Note: To create a top-level comment, use the commentThreads.insert method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube.force-ssl'], + * }); + * + * // 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 youtube.comments.insert({ + * // The part parameter identifies the properties that the API response will include. Set the parameter value to snippet. The snippet part has a quota cost of 2 units. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.comments.insert * @memberOf! () * @@ -6199,6 +7188,69 @@ export namespace youtube_v3 { /** * youtube.comments.list * @desc Returns a list of comments that match the API request parameters. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube.force-ssl'], + * }); + * + * // 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 youtube.comments.list({ + * // The id parameter specifies a comma-separated list of comment IDs for the resources that are being retrieved. In a comment resource, the id property specifies the comment's ID. + * id: 'placeholder-value', + * // The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * // + * // Note: This parameter is not supported for use in conjunction with the id parameter. + * maxResults: 'placeholder-value', + * // The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identifies the next page of the result that can be retrieved. + * // + * // Note: This parameter is not supported for use in conjunction with the id parameter. + * pageToken: 'placeholder-value', + * // The parentId parameter specifies the ID of the comment for which replies should be retrieved. + * // + * // Note: YouTube currently supports replies only for top-level comments. However, replies to replies may be supported in the future. + * parentId: 'placeholder-value', + * // The part parameter specifies a comma-separated list of one or more comment resource properties that the API response will include. + * part: 'placeholder-value', + * // This parameter indicates whether the API should return comments formatted as HTML or as plain text. + * textFormat: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "pageInfo": {}, + * // "tokenPagination": {}, + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.comments.list * @memberOf! () * @@ -6277,6 +7329,41 @@ export namespace youtube_v3 { /** * youtube.comments.markAsSpam * @desc Expresses the caller's opinion that one or more comments should be flagged as spam. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube.force-ssl'], + * }); + * + * // 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 youtube.comments.markAsSpam({ + * // The id parameter specifies a comma-separated list of IDs of comments that the caller believes should be classified as spam. + * id: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.comments.markAsSpam * @memberOf! () * @@ -6349,6 +7436,47 @@ export namespace youtube_v3 { /** * youtube.comments.setModerationStatus * @desc Sets the moderation status of one or more comments. The API request must be authorized by the owner of the channel or video associated with the comments. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube.force-ssl'], + * }); + * + * // 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 youtube.comments.setModerationStatus({ + * // The banAuthor parameter lets you indicate that you want to automatically reject any additional comments written by the comment's author. Set the parameter value to true to ban the author. + * // + * // Note: This parameter is only valid if the moderationStatus parameter is also set to rejected. + * banAuthor: 'placeholder-value', + * // The id parameter specifies a comma-separated list of IDs that identify the comments for which you are updating the moderation status. + * id: 'placeholder-value', + * // Identifies the new moderation status of the specified comments. + * moderationStatus: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.comments.setModerationStatus * @memberOf! () * @@ -6423,6 +7551,60 @@ export namespace youtube_v3 { /** * youtube.comments.update * @desc Modifies a comment. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube.force-ssl'], + * }); + * + * // 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 youtube.comments.update({ + * // The part parameter identifies the properties that the API response will include. You must at least include the snippet part in the parameter value since that part contains all of the properties that the API request can update. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.comments.update * @memberOf! () * @@ -6609,6 +7791,62 @@ export namespace youtube_v3 { /** * youtube.commentThreads.insert * @desc Creates a new top-level comment. To add a reply to an existing comment, use the comments.insert method instead. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube.force-ssl'], + * }); + * + * // 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 youtube.commentThreads.insert({ + * // The part parameter identifies the properties that the API response will include. Set the parameter value to snippet. The snippet part has a quota cost of 2 units. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "replies": {}, + * // "snippet": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "replies": {}, + * // "snippet": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.commentThreads.insert * @memberOf! () * @@ -6684,6 +7922,83 @@ export namespace youtube_v3 { /** * youtube.commentThreads.list * @desc Returns a list of comment threads that match the API request parameters. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube.force-ssl'], + * }); + * + * // 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 youtube.commentThreads.list({ + * // The allThreadsRelatedToChannelId parameter instructs the API to return all comment threads associated with the specified channel. The response can include comments about the channel or about the channel's videos. + * allThreadsRelatedToChannelId: 'placeholder-value', + * // The channelId parameter instructs the API to return comment threads containing comments about the specified channel. (The response will not include comments left on videos that the channel uploaded.) + * channelId: 'placeholder-value', + * // The id parameter specifies a comma-separated list of comment thread IDs for the resources that should be retrieved. + * id: 'placeholder-value', + * // The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * // + * // Note: This parameter is not supported for use in conjunction with the id parameter. + * maxResults: 'placeholder-value', + * // Set this parameter to limit the returned comment threads to a particular moderation state. + * // + * // Note: This parameter is not supported for use in conjunction with the id parameter. + * moderationStatus: 'placeholder-value', + * // The order parameter specifies the order in which the API response should list comment threads. Valid values are: + * // - time - Comment threads are ordered by time. This is the default behavior. + * // - relevance - Comment threads are ordered by relevance.Note: This parameter is not supported for use in conjunction with the id parameter. + * order: 'placeholder-value', + * // The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identifies the next page of the result that can be retrieved. + * // + * // Note: This parameter is not supported for use in conjunction with the id parameter. + * pageToken: 'placeholder-value', + * // The part parameter specifies a comma-separated list of one or more commentThread resource properties that the API response will include. + * part: 'placeholder-value', + * // The searchTerms parameter instructs the API to limit the API response to only contain comments that contain the specified search terms. + * // + * // Note: This parameter is not supported for use in conjunction with the id parameter. + * searchTerms: 'placeholder-value', + * // Set this parameter's value to html or plainText to instruct the API to return the comments left by users in html formatted or in plain text. + * textFormat: 'placeholder-value', + * // The videoId parameter instructs the API to return comment threads associated with the specified video ID. + * videoId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "pageInfo": {}, + * // "tokenPagination": {}, + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.commentThreads.list * @memberOf! () * @@ -6775,6 +8090,62 @@ export namespace youtube_v3 { /** * youtube.commentThreads.update * @desc Modifies the top-level comment in a comment thread. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube.force-ssl'], + * }); + * + * // 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 youtube.commentThreads.update({ + * // The part parameter specifies a comma-separated list of commentThread resource properties that the API response will include. You must at least include the snippet part in the parameter value since that part contains all of the properties that the API request can update. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "replies": {}, + * // "snippet": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "replies": {}, + * // "snippet": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.commentThreads.update * @memberOf! () * @@ -6944,6 +8315,65 @@ export namespace youtube_v3 { /** * youtube.guideCategories.list * @desc Returns a list of categories that can be associated with YouTube channels. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.guideCategories.list({ + * // The hl parameter specifies the language that will be used for text values in the API response. + * hl: 'placeholder-value', + * // The id parameter specifies a comma-separated list of the YouTube channel category ID(s) for the resource(s) that are being retrieved. In a guideCategory resource, the id property specifies the YouTube channel category ID. + * id: 'placeholder-value', + * // The part parameter specifies the guideCategory resource properties that the API response will include. Set the parameter value to snippet. + * part: 'placeholder-value', + * // The regionCode parameter instructs the API to return the list of guide categories available in the specified country. The parameter value is an ISO 3166-1 alpha-2 country code. + * regionCode: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "pageInfo": {}, + * // "prevPageToken": "my_prevPageToken", + * // "tokenPagination": {}, + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.guideCategories.list * @memberOf! () * @@ -7060,6 +8490,57 @@ export namespace youtube_v3 { /** * youtube.i18nLanguages.list * @desc Returns a list of application languages that the YouTube website supports. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.i18nLanguages.list({ + * // The hl parameter specifies the language that should be used for text values in the API response. + * hl: 'placeholder-value', + * // The part parameter specifies the i18nLanguage resource properties that the API response will include. Set the parameter value to snippet. + * part: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.i18nLanguages.list * @memberOf! () * @@ -7161,6 +8642,57 @@ export namespace youtube_v3 { /** * youtube.i18nRegions.list * @desc Returns a list of content regions that the YouTube website supports. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.i18nRegions.list({ + * // The hl parameter specifies the language that should be used for text values in the API response. + * hl: 'placeholder-value', + * // The part parameter specifies the i18nRegion resource properties that the API response will include. Set the parameter value to snippet. + * part: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.i18nRegions.list * @memberOf! () * @@ -7260,6 +8792,69 @@ export namespace youtube_v3 { /** * youtube.liveBroadcasts.bind * @desc Binds a YouTube broadcast to a stream or removes an existing binding between a broadcast and a stream. A broadcast can only be bound to one video stream, though a video stream may be bound to more than one broadcast. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * ], + * }); + * + * // 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 youtube.liveBroadcasts.bind({ + * // The id parameter specifies the unique ID of the broadcast that is being bound to a video stream. + * id: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. + * // + * // This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * onBehalfOfContentOwnerChannel: 'placeholder-value', + * // The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. + * part: 'placeholder-value', + * // The streamId parameter specifies the unique ID of the video stream that is being bound to a broadcast. If this parameter is omitted, the API will remove any existing binding between the broadcast and a video stream. + * streamId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {}, + * // "statistics": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.liveBroadcasts.bind * @memberOf! () * @@ -7338,6 +8933,77 @@ export namespace youtube_v3 { /** * youtube.liveBroadcasts.control * @desc Controls the settings for a slate that can be displayed in the broadcast stream. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * ], + * }); + * + * // 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 youtube.liveBroadcasts.control({ + * // The displaySlate parameter specifies whether the slate is being enabled or disabled. + * displaySlate: 'placeholder-value', + * // The id parameter specifies the YouTube live broadcast ID that uniquely identifies the broadcast in which the slate is being updated. + * id: 'placeholder-value', + * // The offsetTimeMs parameter specifies a positive time offset when the specified slate change will occur. The value is measured in milliseconds from the beginning of the broadcast's monitor stream, which is the time that the testing phase for the broadcast began. Even though it is specified in milliseconds, the value is actually an approximation, and YouTube completes the requested action as closely as possible to that time. + * // + * // If you do not specify a value for this parameter, then YouTube performs the action as soon as possible. See the Getting started guide for more details. + * // + * // Important: You should only specify a value for this parameter if your broadcast stream is delayed. + * offsetTimeMs: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. + * // + * // This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * onBehalfOfContentOwnerChannel: 'placeholder-value', + * // The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. + * part: 'placeholder-value', + * // The walltime parameter specifies the wall clock time at which the specified slate change will occur. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sssZ) format. + * walltime: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {}, + * // "statistics": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.liveBroadcasts.control * @memberOf! () * @@ -7418,6 +9084,54 @@ export namespace youtube_v3 { /** * youtube.liveBroadcasts.delete * @desc Deletes a broadcast. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * ], + * }); + * + * // 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 youtube.liveBroadcasts.delete({ + * // The id parameter specifies the YouTube live broadcast ID for the resource that is being deleted. + * id: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. + * // + * // This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * onBehalfOfContentOwnerChannel: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.liveBroadcasts.delete * @memberOf! () * @@ -7492,6 +9206,81 @@ export namespace youtube_v3 { /** * youtube.liveBroadcasts.insert * @desc Creates a broadcast. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * ], + * }); + * + * // 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 youtube.liveBroadcasts.insert({ + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. + * // + * // This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * onBehalfOfContentOwnerChannel: 'placeholder-value', + * // The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. + * // + * // The part properties that you can include in the parameter value are id, snippet, contentDetails, and status. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {}, + * // "statistics": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {}, + * // "statistics": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.liveBroadcasts.insert * @memberOf! () * @@ -7569,6 +9358,80 @@ export namespace youtube_v3 { /** * youtube.liveBroadcasts.list * @desc Returns a list of YouTube broadcasts that match the API request parameters. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.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 youtube.liveBroadcasts.list({ + * // The broadcastStatus parameter filters the API response to only include broadcasts with the specified status. + * broadcastStatus: 'placeholder-value', + * // The broadcastType parameter filters the API response to only include broadcasts with the specified type. This is only compatible with the mine filter for now. + * broadcastType: 'placeholder-value', + * // The id parameter specifies a comma-separated list of YouTube broadcast IDs that identify the broadcasts being retrieved. In a liveBroadcast resource, the id property specifies the broadcast's ID. + * id: 'placeholder-value', + * // The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * maxResults: 'placeholder-value', + * // The mine parameter can be used to instruct the API to only return broadcasts owned by the authenticated user. Set the parameter value to true to only retrieve your own broadcasts. + * mine: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. + * // + * // This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * onBehalfOfContentOwnerChannel: 'placeholder-value', + * // The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * pageToken: 'placeholder-value', + * // The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. + * part: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "pageInfo": {}, + * // "prevPageToken": "my_prevPageToken", + * // "tokenPagination": {}, + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.liveBroadcasts.list * @memberOf! () * @@ -7658,6 +9521,69 @@ export namespace youtube_v3 { /** * youtube.liveBroadcasts.transition * @desc Changes the status of a YouTube live broadcast and initiates any processes associated with the new status. For example, when you transition a broadcast's status to testing, YouTube starts to transmit video to that broadcast's monitor stream. Before calling this method, you should confirm that the value of the status.streamStatus property for the stream bound to your broadcast is active. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * ], + * }); + * + * // 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 youtube.liveBroadcasts.transition({ + * // The broadcastStatus parameter identifies the state to which the broadcast is changing. Note that to transition a broadcast to either the testing or live state, the status.streamStatus must be active for the stream that the broadcast is bound to. + * broadcastStatus: 'placeholder-value', + * // The id parameter specifies the unique ID of the broadcast that is transitioning to another status. + * id: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. + * // + * // This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * onBehalfOfContentOwnerChannel: 'placeholder-value', + * // The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. + * part: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {}, + * // "statistics": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.liveBroadcasts.transition * @memberOf! () * @@ -7736,6 +9662,83 @@ export namespace youtube_v3 { /** * youtube.liveBroadcasts.update * @desc Updates a broadcast. For example, you could modify the broadcast settings defined in the liveBroadcast resource's contentDetails object. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * ], + * }); + * + * // 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 youtube.liveBroadcasts.update({ + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. + * // + * // This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * onBehalfOfContentOwnerChannel: 'placeholder-value', + * // The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. + * // + * // The part properties that you can include in the parameter value are id, snippet, contentDetails, and status. + * // + * // Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a broadcast's privacy status is defined in the status part. As such, if your request is updating a private or unlisted broadcast, and the request's part parameter value includes the status part, the broadcast's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the broadcast will revert to the default privacy setting. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {}, + * // "statistics": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {}, + * // "statistics": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.liveBroadcasts.update * @memberOf! () * @@ -8027,6 +10030,44 @@ export namespace youtube_v3 { /** * youtube.liveChatBans.delete * @desc Removes a chat ban. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * ], + * }); + * + * // 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 youtube.liveChatBans.delete({ + * // The id parameter identifies the chat ban to remove. The value uniquely identifies both the ban and the chat. + * id: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.liveChatBans.delete * @memberOf! () * @@ -8099,6 +10140,63 @@ export namespace youtube_v3 { /** * youtube.liveChatBans.insert * @desc Adds a new ban to the chat. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * ], + * }); + * + * // 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 youtube.liveChatBans.insert({ + * // The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response returns. Set the parameter value to snippet. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.liveChatBans.insert * @memberOf! () * @@ -8211,6 +10309,44 @@ export namespace youtube_v3 { /** * youtube.liveChatMessages.delete * @desc Deletes a chat message. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * ], + * }); + * + * // 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 youtube.liveChatMessages.delete({ + * // The id parameter specifies the YouTube chat message ID of the resource that is being deleted. + * id: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.liveChatMessages.delete * @memberOf! () * @@ -8283,6 +10419,65 @@ export namespace youtube_v3 { /** * youtube.liveChatMessages.insert * @desc Adds a message to a live chat. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * ], + * }); + * + * // 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 youtube.liveChatMessages.insert({ + * // The part parameter serves two purposes. It identifies the properties that the write operation will set as well as the properties that the API response will include. Set the parameter value to snippet. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "authorDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "authorDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.liveChatMessages.insert * @memberOf! () * @@ -8358,6 +10553,71 @@ export namespace youtube_v3 { /** * youtube.liveChatMessages.list * @desc Lists live chat messages for a specific chat. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.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 youtube.liveChatMessages.list({ + * // The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method. + * // + * // If localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language. + * hl: 'placeholder-value', + * // The liveChatId parameter specifies the ID of the chat whose messages will be returned. + * liveChatId: 'placeholder-value', + * // The maxResults parameter specifies the maximum number of messages that should be returned in the result set. + * maxResults: 'placeholder-value', + * // The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identify other pages that could be retrieved. + * pageToken: 'placeholder-value', + * // The part parameter specifies the liveChatComment resource parts that the API response will include. Supported values are id and snippet. + * part: 'placeholder-value', + * // The profileImageSize parameter specifies the size of the user profile pictures that should be returned in the result set. Default: 88. + * profileImageSize: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "offlineAt": "my_offlineAt", + * // "pageInfo": {}, + * // "pollingIntervalMillis": 0, + * // "tokenPagination": {}, + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.liveChatMessages.list * @memberOf! () * @@ -8513,6 +10773,44 @@ export namespace youtube_v3 { /** * youtube.liveChatModerators.delete * @desc Removes a chat moderator. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * ], + * }); + * + * // 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 youtube.liveChatModerators.delete({ + * // The id parameter identifies the chat moderator to remove. The value uniquely identifies both the moderator and the chat. + * id: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.liveChatModerators.delete * @memberOf! () * @@ -8585,6 +10883,63 @@ export namespace youtube_v3 { /** * youtube.liveChatModerators.insert * @desc Adds a new moderator for the chat. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * ], + * }); + * + * // 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 youtube.liveChatModerators.insert({ + * // The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response returns. Set the parameter value to snippet. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.liveChatModerators.insert * @memberOf! () * @@ -8660,6 +11015,64 @@ export namespace youtube_v3 { /** * youtube.liveChatModerators.list * @desc Lists moderators for a live chat. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.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 youtube.liveChatModerators.list({ + * // The liveChatId parameter specifies the YouTube live chat for which the API should return moderators. + * liveChatId: 'placeholder-value', + * // The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * maxResults: 'placeholder-value', + * // The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * pageToken: 'placeholder-value', + * // The part parameter specifies the liveChatModerator resource parts that the API response will include. Supported values are id and snippet. + * part: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "pageInfo": {}, + * // "prevPageToken": "my_prevPageToken", + * // "tokenPagination": {}, + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.liveChatModerators.list * @memberOf! () * @@ -8807,6 +11220,54 @@ export namespace youtube_v3 { /** * youtube.liveStreams.delete * @desc Deletes a video stream. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * ], + * }); + * + * // 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 youtube.liveStreams.delete({ + * // The id parameter specifies the YouTube live stream ID for the resource that is being deleted. + * id: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. + * // + * // This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * onBehalfOfContentOwnerChannel: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.liveStreams.delete * @memberOf! () * @@ -8881,6 +11342,81 @@ export namespace youtube_v3 { /** * youtube.liveStreams.insert * @desc Creates a video stream. The stream enables you to send your video to YouTube, which can then broadcast the video to your audience. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * ], + * }); + * + * // 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 youtube.liveStreams.insert({ + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. + * // + * // This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * onBehalfOfContentOwnerChannel: 'placeholder-value', + * // The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. + * // + * // The part properties that you can include in the parameter value are id, snippet, cdn, and status. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "cdn": {}, + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cdn": {}, + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.liveStreams.insert * @memberOf! () * @@ -8958,6 +11494,76 @@ export namespace youtube_v3 { /** * youtube.liveStreams.list * @desc Returns a list of video streams that match the API request parameters. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.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 youtube.liveStreams.list({ + * // The id parameter specifies a comma-separated list of YouTube stream IDs that identify the streams being retrieved. In a liveStream resource, the id property specifies the stream's ID. + * id: 'placeholder-value', + * // The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * maxResults: 'placeholder-value', + * // The mine parameter can be used to instruct the API to only return streams owned by the authenticated user. Set the parameter value to true to only retrieve your own streams. + * mine: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. + * // + * // This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * onBehalfOfContentOwnerChannel: 'placeholder-value', + * // The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * pageToken: 'placeholder-value', + * // The part parameter specifies a comma-separated list of one or more liveStream resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, cdn, and status. + * part: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "pageInfo": {}, + * // "prevPageToken": "my_prevPageToken", + * // "tokenPagination": {}, + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.liveStreams.list * @memberOf! () * @@ -9039,6 +11645,83 @@ export namespace youtube_v3 { /** * youtube.liveStreams.update * @desc Updates a video stream. If the properties that you want to change cannot be updated, then you need to create a new stream with the proper settings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * ], + * }); + * + * // 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 youtube.liveStreams.update({ + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. + * // + * // This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * onBehalfOfContentOwnerChannel: 'placeholder-value', + * // The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. + * // + * // The part properties that you can include in the parameter value are id, snippet, cdn, and status. + * // + * // Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. If the request body does not specify a value for a mutable property, the existing value for that property will be removed. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "cdn": {}, + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cdn": {}, + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.liveStreams.update * @memberOf! () * @@ -9229,6 +11912,69 @@ export namespace youtube_v3 { /** * youtube.members.list * @desc Lists members for a channel. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.channel-memberships.creator', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.members.list({ + * // The filterByMemberChannelId parameter represents a comma separated list of channel IDs. Only data about members that are part of this list will be included in the response. It can be used to efficiently check whether specific users are entitled to perks offered via third parties. + * filterByMemberChannelId: 'placeholder-value', + * // The hasAccessToLevel parameter specifies, when set, the ID of a pricing level that members from the results set should have access to. When not set, all members will be considered, regardless of their active pricing level. + * hasAccessToLevel: 'placeholder-value', + * // The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * maxResults: 'placeholder-value', + * // The mode parameter specifies which channel members to return. + * mode: 'placeholder-value', + * // The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * pageToken: 'placeholder-value', + * // The part parameter specifies the member resource parts that the API response will include. Set the parameter value to snippet. + * part: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "pageInfo": {}, + * // "tokenPagination": {}, + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.members.list * @memberOf! () * @@ -9346,6 +12092,56 @@ export namespace youtube_v3 { /** * youtube.membershipsLevels.list * @desc Lists pricing levels for a channel. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.channel-memberships.creator', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.membershipsLevels.list({ + * // The part parameter specifies the membershipsLevel resource parts that the API response will include. Supported values are id and snippet. + * part: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.membershipsLevels.list * @memberOf! () * @@ -9449,6 +12245,49 @@ export namespace youtube_v3 { /** * youtube.playlistItems.delete * @desc Deletes a playlist item. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.playlistItems.delete({ + * // The id parameter specifies the YouTube playlist item ID for the playlist item that is being deleted. In a playlistItem resource, the id property specifies the playlist item's ID. + * id: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.playlistItems.delete * @memberOf! () * @@ -9522,6 +12361,72 @@ export namespace youtube_v3 { /** * youtube.playlistItems.insert * @desc Adds a resource to a playlist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.playlistItems.insert({ + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.playlistItems.insert * @memberOf! () * @@ -9598,6 +12503,75 @@ export namespace youtube_v3 { /** * youtube.playlistItems.list * @desc Returns a collection of playlist items that match the API request parameters. You can retrieve all of the playlist items in a specified playlist or retrieve one or more playlist items by their unique IDs. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.playlistItems.list({ + * // The id parameter specifies a comma-separated list of one or more unique playlist item IDs. + * id: 'placeholder-value', + * // The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * maxResults: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * pageToken: 'placeholder-value', + * // The part parameter specifies a comma-separated list of one or more playlistItem resource properties that the API response will include. + * // + * // If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlistItem resource, the snippet property contains numerous fields, including the title, description, position, and resourceId properties. As such, if you set part=snippet, the API response will contain all of those properties. + * part: 'placeholder-value', + * // The playlistId parameter specifies the unique ID of the playlist for which you want to retrieve playlist items. Note that even though this is an optional parameter, every request to retrieve playlist items must specify a value for either the id parameter or the playlistId parameter. + * playlistId: 'placeholder-value', + * // The videoId parameter specifies that the request should return only the playlist items that contain the specified video. + * videoId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "pageInfo": {}, + * // "prevPageToken": "my_prevPageToken", + * // "tokenPagination": {}, + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.playlistItems.list * @memberOf! () * @@ -9680,6 +12654,74 @@ export namespace youtube_v3 { /** * youtube.playlistItems.update * @desc Modifies a playlist item. For example, you could update the item's position in the playlist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.playlistItems.update({ + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. + * // + * // Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a playlist item can specify a start time and end time, which identify the times portion of the video that should play when users watch the video in the playlist. If your request is updating a playlist item that sets these values, and the request's part parameter value includes the contentDetails part, the playlist item's start and end times will be updated to whatever value the request body specifies. If the request body does not specify values, the existing start and end times will be removed and replaced with the default settings. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.playlistItems.update * @memberOf! () * @@ -9858,6 +12900,49 @@ export namespace youtube_v3 { /** * youtube.playlists.delete * @desc Deletes a playlist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.playlists.delete({ + * // The id parameter specifies the YouTube playlist ID for the playlist that is being deleted. In a playlist resource, the id property specifies the playlist's ID. + * id: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.playlists.delete * @memberOf! () * @@ -9930,6 +13015,82 @@ export namespace youtube_v3 { /** * youtube.playlists.insert * @desc Creates a playlist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.playlists.insert({ + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. + * // + * // This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * onBehalfOfContentOwnerChannel: 'placeholder-value', + * // The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "localizations": {}, + * // "player": {}, + * // "snippet": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "localizations": {}, + * // "player": {}, + * // "snippet": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.playlists.insert * @memberOf! () * @@ -10004,6 +13165,83 @@ export namespace youtube_v3 { /** * youtube.playlists.list * @desc Returns a collection of playlists that match the API request parameters. For example, you can retrieve all playlists that the authenticated user owns, or you can retrieve one or more playlists by their unique IDs. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.playlists.list({ + * // This value indicates that the API should only return the specified channel's playlists. + * channelId: 'placeholder-value', + * // The hl parameter should be used for filter out the properties that are not in the given language. Used for the snippet part. + * hl: 'placeholder-value', + * // The id parameter specifies a comma-separated list of the YouTube playlist ID(s) for the resource(s) that are being retrieved. In a playlist resource, the id property specifies the playlist's YouTube playlist ID. + * id: 'placeholder-value', + * // The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * maxResults: 'placeholder-value', + * // Set this parameter's value to true to instruct the API to only return playlists owned by the authenticated user. + * mine: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. + * // + * // This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * onBehalfOfContentOwnerChannel: 'placeholder-value', + * // The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * pageToken: 'placeholder-value', + * // The part parameter specifies a comma-separated list of one or more playlist resource properties that the API response will include. + * // + * // If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlist resource, the snippet property contains properties like author, title, description, tags, and timeCreated. As such, if you set part=snippet, the API response will contain all of those properties. + * part: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "pageInfo": {}, + * // "prevPageToken": "my_prevPageToken", + * // "tokenPagination": {}, + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.playlists.list * @memberOf! () * @@ -10087,6 +13325,78 @@ export namespace youtube_v3 { /** * youtube.playlists.update * @desc Modifies a playlist. For example, you could change a playlist's title, description, or privacy status. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.playlists.update({ + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. + * // + * // Note that this method will override the existing values for mutable properties that are contained in any parts that the request body specifies. For example, a playlist's description is contained in the snippet part, which must be included in the request body. If the request does not specify a value for the snippet.description property, the playlist's existing description will be deleted. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "localizations": {}, + * // "player": {}, + * // "snippet": {}, + * // "status": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "localizations": {}, + * // "player": {}, + * // "snippet": {}, + * // "status": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.playlists.update * @memberOf! () * @@ -10270,6 +13580,134 @@ export namespace youtube_v3 { /** * youtube.search.list * @desc Returns a collection of search results that match the query parameters specified in the API request. By default, a search result set identifies matching video, channel, and playlist resources, but you can also configure queries to only retrieve a specific type of resource. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.search.list({ + * // The channelId parameter indicates that the API response should only contain resources created by the channel + * channelId: 'placeholder-value', + * // The channelType parameter lets you restrict a search to a particular type of channel. + * channelType: 'placeholder-value', + * // The eventType parameter restricts a search to broadcast events. If you specify a value for this parameter, you must also set the type parameter's value to video. + * eventType: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The forContentOwner parameter restricts the search to only retrieve resources owned by the content owner specified by the onBehalfOfContentOwner parameter. The user must be authenticated using a CMS account linked to the specified content owner and onBehalfOfContentOwner must be provided. + * forContentOwner: 'placeholder-value', + * // The forDeveloper parameter restricts the search to only retrieve videos uploaded via the developer's application or website. The API server uses the request's authorization credentials to identify the developer. Therefore, a developer can restrict results to videos uploaded through the developer's own app or website but not to videos uploaded through other apps or sites. + * forDeveloper: 'placeholder-value', + * // The forMine parameter restricts the search to only retrieve videos owned by the authenticated user. If you set this parameter to true, then the type parameter's value must also be set to video. + * forMine: 'placeholder-value', + * // The location parameter, in conjunction with the locationRadius parameter, defines a circular geographic area and also restricts a search to videos that specify, in their metadata, a geographic location that falls within that area. The parameter value is a string that specifies latitude/longitude coordinates e.g. (37.42307,-122.08427). + * // + * // + * // - The location parameter value identifies the point at the center of the area. + * // - The locationRadius parameter specifies the maximum distance that the location associated with a video can be from that point for the video to still be included in the search results.The API returns an error if your request specifies a value for the location parameter but does not also specify a value for the locationRadius parameter. + * location: 'placeholder-value', + * // The locationRadius parameter, in conjunction with the location parameter, defines a circular geographic area. + * // + * // The parameter value must be a floating point number followed by a measurement unit. Valid measurement units are m, km, ft, and mi. For example, valid parameter values include 1500m, 5km, 10000ft, and 0.75mi. The API does not support locationRadius parameter values larger than 1000 kilometers. + * // + * // Note: See the definition of the location parameter for more information. + * locationRadius: 'placeholder-value', + * // The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * maxResults: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // The order parameter specifies the method that will be used to order resources in the API response. + * order: 'placeholder-value', + * // The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * pageToken: 'placeholder-value', + * // The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. Set the parameter value to snippet. + * part: 'placeholder-value', + * // The publishedAfter parameter indicates that the API response should only contain resources created after the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z). + * publishedAfter: 'placeholder-value', + * // The publishedBefore parameter indicates that the API response should only contain resources created before the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z). + * publishedBefore: 'placeholder-value', + * // The q parameter specifies the query term to search for. + * // + * // Your request can also use the Boolean NOT (-) and OR (|) operators to exclude videos or to find videos that are associated with one of several search terms. For example, to search for videos matching either "boating" or "sailing", set the q parameter value to boating|sailing. Similarly, to search for videos matching either "boating" or "sailing" but not "fishing", set the q parameter value to boating|sailing -fishing. Note that the pipe character must be URL-escaped when it is sent in your API request. The URL-escaped value for the pipe character is %7C. + * q: 'placeholder-value', + * // The regionCode parameter instructs the API to return search results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code. + * regionCode: 'placeholder-value', + * // The relatedToVideoId parameter retrieves a list of videos that are related to the video that the parameter value identifies. The parameter value must be set to a YouTube video ID and, if you are using this parameter, the type parameter must be set to video. + * relatedToVideoId: 'placeholder-value', + * // The relevanceLanguage parameter instructs the API to return search results that are most relevant to the specified language. The parameter value is typically an ISO 639-1 two-letter language code. However, you should use the values zh-Hans for simplified Chinese and zh-Hant for traditional Chinese. Please note that results in other languages will still be returned if they are highly relevant to the search query term. + * relevanceLanguage: 'placeholder-value', + * // The safeSearch parameter indicates whether the search results should include restricted content as well as standard content. + * safeSearch: 'placeholder-value', + * // The topicId parameter indicates that the API response should only contain resources associated with the specified topic. The value identifies a Freebase topic ID. + * topicId: 'placeholder-value', + * // The type parameter restricts a search query to only retrieve a particular type of resource. The value is a comma-separated list of resource types. + * type: 'placeholder-value', + * // The videoCaption parameter indicates whether the API should filter video search results based on whether they have captions. If you specify a value for this parameter, you must also set the type parameter's value to video. + * videoCaption: 'placeholder-value', + * // The videoCategoryId parameter filters video search results based on their category. If you specify a value for this parameter, you must also set the type parameter's value to video. + * videoCategoryId: 'placeholder-value', + * // The videoDefinition parameter lets you restrict a search to only include either high definition (HD) or standard definition (SD) videos. HD videos are available for playback in at least 720p, though higher resolutions, like 1080p, might also be available. If you specify a value for this parameter, you must also set the type parameter's value to video. + * videoDefinition: 'placeholder-value', + * // The videoDimension parameter lets you restrict a search to only retrieve 2D or 3D videos. If you specify a value for this parameter, you must also set the type parameter's value to video. + * videoDimension: 'placeholder-value', + * // The videoDuration parameter filters video search results based on their duration. If you specify a value for this parameter, you must also set the type parameter's value to video. + * videoDuration: 'placeholder-value', + * // The videoEmbeddable parameter lets you to restrict a search to only videos that can be embedded into a webpage. If you specify a value for this parameter, you must also set the type parameter's value to video. + * videoEmbeddable: 'placeholder-value', + * // The videoLicense parameter filters search results to only include videos with a particular license. YouTube lets video uploaders choose to attach either the Creative Commons license or the standard YouTube license to each of their videos. If you specify a value for this parameter, you must also set the type parameter's value to video. + * videoLicense: 'placeholder-value', + * // The videoSyndicated parameter lets you to restrict a search to only videos that can be played outside youtube.com. If you specify a value for this parameter, you must also set the type parameter's value to video. + * videoSyndicated: 'placeholder-value', + * // The videoType parameter lets you restrict a search to a particular type of videos. If you specify a value for this parameter, you must also set the type parameter's value to video. + * videoType: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "pageInfo": {}, + * // "prevPageToken": "my_prevPageToken", + * // "regionCode": "my_regionCode", + * // "tokenPagination": {}, + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.search.list * @memberOf! () * @@ -10509,6 +13947,63 @@ export namespace youtube_v3 { /** * youtube.sponsors.list * @desc Lists sponsors for a channel. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.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 youtube.sponsors.list({ + * // The filter parameter specifies which channel sponsors to return. + * filter: 'placeholder-value', + * // The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * maxResults: 'placeholder-value', + * // The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * pageToken: 'placeholder-value', + * // The part parameter specifies the sponsor resource parts that the API response will include. Supported values are id and snippet. + * part: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "pageInfo": {}, + * // "tokenPagination": {}, + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.sponsors.list * @memberOf! () * @@ -10616,6 +14111,45 @@ export namespace youtube_v3 { /** * youtube.subscriptions.delete * @desc Deletes a subscription. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.subscriptions.delete({ + * // The id parameter specifies the YouTube subscription ID for the resource that is being deleted. In a subscription resource, the id property specifies the YouTube subscription ID. + * id: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.subscriptions.delete * @memberOf! () * @@ -10688,6 +14222,68 @@ export namespace youtube_v3 { /** * youtube.subscriptions.insert * @desc Adds a subscription for the authenticated user's channel. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.subscriptions.insert({ + * // The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {}, + * // "subscriberSnippet": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {}, + * // "subscriberSnippet": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.subscriptions.insert * @memberOf! () * @@ -10763,6 +14359,89 @@ export namespace youtube_v3 { /** * youtube.subscriptions.list * @desc Returns subscription resources that match the API request criteria. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.subscriptions.list({ + * // The channelId parameter specifies a YouTube channel ID. The API will only return that channel's subscriptions. + * channelId: 'placeholder-value', + * // The forChannelId parameter specifies a comma-separated list of channel IDs. The API response will then only contain subscriptions matching those channels. + * forChannelId: 'placeholder-value', + * // The id parameter specifies a comma-separated list of the YouTube subscription ID(s) for the resource(s) that are being retrieved. In a subscription resource, the id property specifies the YouTube subscription ID. + * id: 'placeholder-value', + * // The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * maxResults: 'placeholder-value', + * // Set this parameter's value to true to retrieve a feed of the authenticated user's subscriptions. + * mine: 'placeholder-value', + * // Set this parameter's value to true to retrieve a feed of the subscribers of the authenticated user in reverse chronological order (newest first). + * myRecentSubscribers: 'placeholder-value', + * // Set this parameter's value to true to retrieve a feed of the subscribers of the authenticated user in no particular order. + * mySubscribers: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. + * // + * // This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * onBehalfOfContentOwnerChannel: 'placeholder-value', + * // The order parameter specifies the method that will be used to sort resources in the API response. + * order: 'placeholder-value', + * // The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * pageToken: 'placeholder-value', + * // The part parameter specifies a comma-separated list of one or more subscription resource properties that the API response will include. + * // + * // If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a subscription resource, the snippet property contains other properties, such as a display title for the subscription. If you set part=snippet, the API response will also contain all of those nested properties. + * part: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "pageInfo": {}, + * // "prevPageToken": "my_prevPageToken", + * // "tokenPagination": {}, + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.subscriptions.list * @memberOf! () * @@ -10943,6 +14622,65 @@ export namespace youtube_v3 { /** * youtube.superChatEvents.list * @desc Lists Super Chat events for a channel. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.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 youtube.superChatEvents.list({ + * // The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method. + * // + * // If localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language. + * hl: 'placeholder-value', + * // The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * maxResults: 'placeholder-value', + * // The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * pageToken: 'placeholder-value', + * // The part parameter specifies the superChatEvent resource parts that the API response will include. Supported values are id and snippet. + * part: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "pageInfo": {}, + * // "tokenPagination": {}, + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.superChatEvents.list * @memberOf! () * @@ -11059,6 +14797,67 @@ export namespace youtube_v3 { /** * youtube.thumbnails.set * @desc Uploads a custom video thumbnail to YouTube and sets it for a video. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.upload', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.thumbnails.set({ + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // The videoId parameter specifies a YouTube video ID for which the custom video thumbnail is being provided. + * videoId: 'placeholder-value', + * + * requestBody: { + * // request body parameters + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.thumbnails.set * @memberOf! () * @@ -11185,6 +14984,56 @@ export namespace youtube_v3 { /** * youtube.videoAbuseReportReasons.list * @desc Returns a list of abuse reasons that can be used for reporting abusive videos. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.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 youtube.videoAbuseReportReasons.list({ + * // The hl parameter specifies the language that should be used for text values in the API response. + * hl: 'placeholder-value', + * // The part parameter specifies the videoCategory resource parts that the API response will include. Supported values are id and snippet. + * part: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.videoAbuseReportReasons.list * @memberOf! () * @@ -11293,6 +15142,65 @@ export namespace youtube_v3 { /** * youtube.videoCategories.list * @desc Returns a list of categories that can be associated with YouTube videos. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.videoCategories.list({ + * // The hl parameter specifies the language that should be used for text values in the API response. + * hl: 'placeholder-value', + * // The id parameter specifies a comma-separated list of video category IDs for the resources that you are retrieving. + * id: 'placeholder-value', + * // The part parameter specifies the videoCategory resource properties that the API response will include. Set the parameter value to snippet. + * part: 'placeholder-value', + * // The regionCode parameter instructs the API to return the list of video categories available in the specified country. The parameter value is an ISO 3166-1 alpha-2 country code. + * regionCode: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "pageInfo": {}, + * // "prevPageToken": "my_prevPageToken", + * // "tokenPagination": {}, + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.videoCategories.list * @memberOf! () * @@ -11409,6 +15317,49 @@ export namespace youtube_v3 { /** * youtube.videos.delete * @desc Deletes a YouTube video. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.videos.delete({ + * // The id parameter specifies the YouTube video ID for the resource that is being deleted. In a video resource, the id property specifies the video's ID. + * id: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.videos.delete * @memberOf! () * @@ -11478,6 +15429,58 @@ export namespace youtube_v3 { /** * youtube.videos.getRating * @desc Retrieves the ratings that the authorized user gave to a list of specified videos. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.videos.getRating({ + * // The id parameter specifies a comma-separated list of the YouTube video ID(s) for the resource(s) for which you are retrieving rating data. In a video resource, the id property specifies the video's ID. + * id: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.videos.getRating * @memberOf! () * @@ -11556,6 +15559,115 @@ export namespace youtube_v3 { /** * youtube.videos.insert * @desc Uploads a video to YouTube and optionally sets the video's metadata. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.upload', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.videos.insert({ + * // The autoLevels parameter indicates whether YouTube should automatically enhance the video's lighting and color. + * autoLevels: 'placeholder-value', + * // The notifySubscribers parameter indicates whether YouTube should send a notification about the new video to users who subscribe to the video's channel. A parameter value of True indicates that subscribers will be notified of newly uploaded videos. However, a channel owner who is uploading many videos might prefer to set the value to False to avoid sending a notification about each new video to the channel's subscribers. + * notifySubscribers: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. + * // + * // This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * onBehalfOfContentOwnerChannel: 'placeholder-value', + * // The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. + * // + * // Note that not all parts contain properties that can be set when inserting or updating a video. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response. + * part: 'placeholder-value', + * // The stabilize parameter indicates whether YouTube should adjust the video to remove shaky camera motions. + * stabilize: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ageGating": {}, + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "fileDetails": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "liveStreamingDetails": {}, + * // "localizations": {}, + * // "monetizationDetails": {}, + * // "player": {}, + * // "processingDetails": {}, + * // "projectDetails": {}, + * // "recordingDetails": {}, + * // "snippet": {}, + * // "statistics": {}, + * // "status": {}, + * // "suggestions": {}, + * // "topicDetails": {} + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ageGating": {}, + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "fileDetails": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "liveStreamingDetails": {}, + * // "localizations": {}, + * // "monetizationDetails": {}, + * // "player": {}, + * // "processingDetails": {}, + * // "projectDetails": {}, + * // "recordingDetails": {}, + * // "snippet": {}, + * // "statistics": {}, + * // "status": {}, + * // "suggestions": {}, + * // "topicDetails": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.videos.insert * @memberOf! () * @@ -11637,6 +15749,93 @@ export namespace youtube_v3 { /** * youtube.videos.list * @desc Returns a list of videos that match the API request parameters. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.videos.list({ + * // The chart parameter identifies the chart that you want to retrieve. + * chart: 'placeholder-value', + * // The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method. + * // + * // If localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language. + * hl: 'placeholder-value', + * // The id parameter specifies a comma-separated list of the YouTube video ID(s) for the resource(s) that are being retrieved. In a video resource, the id property specifies the video's ID. + * id: 'placeholder-value', + * // DEPRECATED + * locale: 'placeholder-value', + * // The maxHeight parameter specifies a maximum height of the embedded player. If maxWidth is provided, maxHeight may not be reached in order to not violate the width request. + * maxHeight: 'placeholder-value', + * // The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * // + * // Note: This parameter is supported for use in conjunction with the myRating and chart parameters, but it is not supported for use in conjunction with the id parameter. + * maxResults: 'placeholder-value', + * // The maxWidth parameter specifies a maximum width of the embedded player. If maxHeight is provided, maxWidth may not be reached in order to not violate the height request. + * maxWidth: 'placeholder-value', + * // Set this parameter's value to like or dislike to instruct the API to only return videos liked or disliked by the authenticated user. + * myRating: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * // + * // Note: This parameter is supported for use in conjunction with the myRating and chart parameters, but it is not supported for use in conjunction with the id parameter. + * pageToken: 'placeholder-value', + * // The part parameter specifies a comma-separated list of one or more video resource properties that the API response will include. + * // + * // If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a video resource, the snippet property contains the channelId, title, description, tags, and categoryId properties. As such, if you set part=snippet, the API response will contain all of those properties. + * part: 'placeholder-value', + * // The regionCode parameter instructs the API to select a video chart available in the specified region. This parameter can only be used in conjunction with the chart parameter. The parameter value is an ISO 3166-1 alpha-2 country code. + * regionCode: 'placeholder-value', + * // The videoCategoryId parameter identifies the video category for which the chart should be retrieved. This parameter can only be used in conjunction with the chart parameter. By default, charts are not restricted to a particular category. + * videoCategoryId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "etag": "my_etag", + * // "eventId": "my_eventId", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "pageInfo": {}, + * // "prevPageToken": "my_prevPageToken", + * // "tokenPagination": {}, + * // "visitorId": "my_visitorId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.videos.list * @memberOf! () * @@ -11719,6 +15918,47 @@ export namespace youtube_v3 { /** * youtube.videos.rate * @desc Add a like or dislike rating to a video or remove a rating from a video. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.videos.rate({ + * // The id parameter specifies the YouTube video ID of the video that is being rated or having its rating removed. + * id: 'placeholder-value', + * // Specifies the rating to record. + * rating: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.videos.rate * @memberOf! () * @@ -11791,6 +16031,59 @@ export namespace youtube_v3 { /** * youtube.videos.reportAbuse * @desc Report abuse for a video. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.videos.reportAbuse({ + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "comments": "my_comments", + * // "language": "my_language", + * // "reasonId": "my_reasonId", + * // "secondaryReasonId": "my_secondaryReasonId", + * // "videoId": "my_videoId" + * // } + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.videos.reportAbuse * @memberOf! () * @@ -11864,6 +16157,100 @@ export namespace youtube_v3 { /** * youtube.videos.update * @desc Updates a video's metadata. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.videos.update({ + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. + * // + * // Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a video's privacy setting is contained in the status part. As such, if your request is updating a private video, and the request's part parameter value includes the status part, the video's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the video will revert to the default privacy setting. + * // + * // In addition, not all parts contain properties that can be set when inserting or updating a video. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response. + * part: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "ageGating": {}, + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "fileDetails": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "liveStreamingDetails": {}, + * // "localizations": {}, + * // "monetizationDetails": {}, + * // "player": {}, + * // "processingDetails": {}, + * // "projectDetails": {}, + * // "recordingDetails": {}, + * // "snippet": {}, + * // "statistics": {}, + * // "status": {}, + * // "suggestions": {}, + * // "topicDetails": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "ageGating": {}, + * // "contentDetails": {}, + * // "etag": "my_etag", + * // "fileDetails": {}, + * // "id": "my_id", + * // "kind": "my_kind", + * // "liveStreamingDetails": {}, + * // "localizations": {}, + * // "monetizationDetails": {}, + * // "player": {}, + * // "processingDetails": {}, + * // "projectDetails": {}, + * // "recordingDetails": {}, + * // "snippet": {}, + * // "statistics": {}, + * // "status": {}, + * // "suggestions": {}, + * // "topicDetails": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.videos.update * @memberOf! () * @@ -12134,6 +16521,66 @@ export namespace youtube_v3 { /** * youtube.watermarks.set * @desc Uploads a watermark image to YouTube and sets it for a channel. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtube.upload', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.watermarks.set({ + * // The channelId parameter specifies the YouTube channel ID for which the watermark is being provided. + * channelId: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "imageBytes": "my_imageBytes", + * // "imageUrl": "my_imageUrl", + * // "position": {}, + * // "targetChannelId": "my_targetChannelId", + * // "timing": {} + * // } + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.watermarks.set * @memberOf! () * @@ -12214,6 +16661,49 @@ export namespace youtube_v3 { /** * youtube.watermarks.unset * @desc Deletes a channel's watermark image. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtube.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 youtube = google.youtube('v3'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.force-ssl', + * 'https://www.googleapis.com/auth/youtubepartner', + * ], + * }); + * + * // 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 youtube.watermarks.unset({ + * // The channelId parameter specifies the YouTube channel ID for which the watermark is being unset. + * channelId: 'placeholder-value', + * // Note: This parameter is intended exclusively for YouTube content partners. + * // + * // The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * }); + * console.log(res.data); + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtube.watermarks.unset * @memberOf! () * diff --git a/src/apis/youtubeAnalytics/v2.ts b/src/apis/youtubeAnalytics/v2.ts index f407b57f4e6..b576e65d28f 100644 --- a/src/apis/youtubeAnalytics/v2.ts +++ b/src/apis/youtubeAnalytics/v2.ts @@ -361,6 +361,65 @@ export namespace youtubeAnalytics_v2 { /** * youtubeAnalytics.groupItems.delete * @desc Removes an item from a group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtubeAnalytics.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 youtubeAnalytics = google.youtubeAnalytics('v2'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * 'https://www.googleapis.com/auth/yt-analytics-monetary.readonly', + * 'https://www.googleapis.com/auth/yt-analytics.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 youtubeAnalytics.groupItems.delete({ + * // The `id` parameter specifies the YouTube group item ID of the group item + * // that is being deleted. + * id: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. **Note:** + * // This parameter is intended exclusively for YouTube content partners that + * // own and manage many different YouTube channels. + * // + * // The `onBehalfOfContentOwner` parameter indicates that the request's + * // authorization credentials identify a YouTube user who is acting on behalf + * // of the content owner specified in the parameter value. It allows content + * // owners to authenticate once and get access to all their video and channel + * // data, without having to provide authentication credentials for each + * // individual channel. The account that the user authenticates with must be + * // linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "errors": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtubeAnalytics.groupItems.delete * @memberOf! () * @@ -434,6 +493,80 @@ export namespace youtubeAnalytics_v2 { /** * youtubeAnalytics.groupItems.insert * @desc Creates a group item. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtubeAnalytics.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 youtubeAnalytics = google.youtubeAnalytics('v2'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * 'https://www.googleapis.com/auth/yt-analytics-monetary.readonly', + * 'https://www.googleapis.com/auth/yt-analytics.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 youtubeAnalytics.groupItems.insert({ + * // This parameter can only be used in a properly authorized request. **Note:** + * // This parameter is intended exclusively for YouTube content partners that + * // own and manage many different YouTube channels. + * // + * // The `onBehalfOfContentOwner` parameter indicates that the request's + * // authorization credentials identify a YouTube user who is acting on behalf + * // of the content owner specified in the parameter value. It allows content + * // owners to authenticate once and get access to all their video and channel + * // data, without having to provide authentication credentials for each + * // individual channel. The account that the user authenticates with must be + * // linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "errors": {}, + * // "etag": "my_etag", + * // "groupId": "my_groupId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "resource": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "errors": {}, + * // "etag": "my_etag", + * // "groupId": "my_groupId", + * // "id": "my_id", + * // "kind": "my_kind", + * // "resource": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtubeAnalytics.groupItems.insert * @memberOf! () * @@ -507,6 +640,68 @@ export namespace youtubeAnalytics_v2 { /** * youtubeAnalytics.groupItems.list * @desc Returns a collection of group items that match the API request parameters. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtubeAnalytics.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 youtubeAnalytics = google.youtubeAnalytics('v2'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * 'https://www.googleapis.com/auth/yt-analytics-monetary.readonly', + * 'https://www.googleapis.com/auth/yt-analytics.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 youtubeAnalytics.groupItems.list({ + * // The `groupId` parameter specifies the unique ID of the group for which you + * // want to retrieve group items. + * groupId: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. **Note:** + * // This parameter is intended exclusively for YouTube content partners that + * // own and manage many different YouTube channels. + * // + * // The `onBehalfOfContentOwner` parameter indicates that the request's + * // authorization credentials identify a YouTube user who is acting on behalf + * // of the content owner specified in the parameter value. It allows content + * // owners to authenticate once and get access to all their video and channel + * // data, without having to provide authentication credentials for each + * // individual channel. The account that the user authenticates with must be + * // linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "errors": {}, + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtubeAnalytics.groupItems.list * @memberOf! () * @@ -637,6 +832,65 @@ export namespace youtubeAnalytics_v2 { /** * youtubeAnalytics.groups.delete * @desc Deletes a group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtubeAnalytics.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 youtubeAnalytics = google.youtubeAnalytics('v2'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * 'https://www.googleapis.com/auth/yt-analytics-monetary.readonly', + * 'https://www.googleapis.com/auth/yt-analytics.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 youtubeAnalytics.groups.delete({ + * // The `id` parameter specifies the YouTube group ID of the group that is + * // being deleted. + * id: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. **Note:** + * // This parameter is intended exclusively for YouTube content partners that + * // own and manage many different YouTube channels. + * // + * // The `onBehalfOfContentOwner` parameter indicates that the request's + * // authorization credentials identify a YouTube user who is acting on behalf + * // of the content owner specified in the parameter value. It allows content + * // owners to authenticate once and get access to all their video and channel + * // data, without having to provide authentication credentials for each + * // individual channel. The account that the user authenticates with must be + * // linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "errors": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtubeAnalytics.groups.delete * @memberOf! () * @@ -709,6 +963,80 @@ export namespace youtubeAnalytics_v2 { /** * youtubeAnalytics.groups.insert * @desc Creates a group. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtubeAnalytics.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 youtubeAnalytics = google.youtubeAnalytics('v2'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * 'https://www.googleapis.com/auth/yt-analytics-monetary.readonly', + * 'https://www.googleapis.com/auth/yt-analytics.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 youtubeAnalytics.groups.insert({ + * // This parameter can only be used in a properly authorized request. **Note:** + * // This parameter is intended exclusively for YouTube content partners that + * // own and manage many different YouTube channels. + * // + * // The `onBehalfOfContentOwner` parameter indicates that the request's + * // authorization credentials identify a YouTube user who is acting on behalf + * // of the content owner specified in the parameter value. It allows content + * // owners to authenticate once and get access to all their video and channel + * // data, without having to provide authentication credentials for each + * // individual channel. The account that the user authenticates with must be + * // linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentDetails": {}, + * // "errors": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentDetails": {}, + * // "errors": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtubeAnalytics.groups.insert * @memberOf! () * @@ -779,6 +1107,82 @@ export namespace youtubeAnalytics_v2 { /** * youtubeAnalytics.groups.list * @desc Returns a collection of groups that match the API request parameters. For example, you can retrieve all groups that the authenticated user owns, or you can retrieve one or more groups by their unique IDs. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtubeAnalytics.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 youtubeAnalytics = google.youtubeAnalytics('v2'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * 'https://www.googleapis.com/auth/yt-analytics-monetary.readonly', + * 'https://www.googleapis.com/auth/yt-analytics.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 youtubeAnalytics.groups.list({ + * // The `id` parameter specifies a comma-separated list of the YouTube group + * // ID(s) for the resource(s) that are being retrieved. Each group must be + * // owned by the authenticated user. In a `group` resource, the `id` property + * // specifies the group's YouTube group ID. + * // + * // Note that if you do not specify a value for the `id` parameter, then you + * // must set the `mine` parameter to `true`. + * id: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. Set this + * // parameter's value to true to retrieve all groups owned by the authenticated + * // user. + * mine: 'placeholder-value', + * // This parameter can only be used in a properly authorized request. **Note:** + * // This parameter is intended exclusively for YouTube content partners that + * // own and manage many different YouTube channels. + * // + * // The `onBehalfOfContentOwner` parameter indicates that the request's + * // authorization credentials identify a YouTube user who is acting on behalf + * // of the content owner specified in the parameter value. It allows content + * // owners to authenticate once and get access to all their video and channel + * // data, without having to provide authentication credentials for each + * // individual channel. The account that the user authenticates with must be + * // linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * // The `pageToken` parameter identifies a specific page in the result set that + * // should be returned. In an API response, the `nextPageToken` property + * // identifies the next page that can be retrieved. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "errors": {}, + * // "etag": "my_etag", + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtubeAnalytics.groups.list * @memberOf! () * @@ -853,6 +1257,80 @@ export namespace youtubeAnalytics_v2 { /** * youtubeAnalytics.groups.update * @desc Modifies a group. For example, you could change a group's title. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtubeAnalytics.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 youtubeAnalytics = google.youtubeAnalytics('v2'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * 'https://www.googleapis.com/auth/yt-analytics-monetary.readonly', + * 'https://www.googleapis.com/auth/yt-analytics.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 youtubeAnalytics.groups.update({ + * // This parameter can only be used in a properly authorized request. **Note:** + * // This parameter is intended exclusively for YouTube content partners that + * // own and manage many different YouTube channels. + * // + * // The `onBehalfOfContentOwner` parameter indicates that the request's + * // authorization credentials identify a YouTube user who is acting on behalf + * // of the content owner specified in the parameter value. It allows content + * // owners to authenticate once and get access to all their video and channel + * // data, without having to provide authentication credentials for each + * // individual channel. The account that the user authenticates with must be + * // linked to the specified YouTube content owner. + * onBehalfOfContentOwner: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentDetails": {}, + * // "errors": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "contentDetails": {}, + * // "errors": {}, + * // "etag": "my_etag", + * // "id": "my_id", + * // "kind": "my_kind", + * // "snippet": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtubeAnalytics.groups.update * @memberOf! () * @@ -1001,6 +1479,121 @@ export namespace youtubeAnalytics_v2 { /** * youtubeAnalytics.reports.query * @desc Retrieve your YouTube Analytics reports. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtubeAnalytics.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 youtubeAnalytics = google.youtubeAnalytics('v2'); + * + * 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/youtube', + * 'https://www.googleapis.com/auth/youtube.readonly', + * 'https://www.googleapis.com/auth/youtubepartner', + * 'https://www.googleapis.com/auth/yt-analytics-monetary.readonly', + * 'https://www.googleapis.com/auth/yt-analytics.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 youtubeAnalytics.reports.query({ + * // The currency to which financial metrics should be converted. The default is + * // US Dollar (USD). If the result contains no financial metrics, this flag + * // will be ignored. Responds with an error if the specified currency is not + * // recognized.", + * // pattern: [A-Z]{3} + * currency: 'placeholder-value', + * // A comma-separated list of YouTube Analytics dimensions, such as `views` or + * // `ageGroup,gender`. See the [Available + * // Reports](/youtube/analytics/v2/available_reports) document for a list of + * // the reports that you can retrieve and the dimensions used for those + * // reports. Also see the [Dimensions](/youtube/analytics/v2/dimsmets/dims) + * // document for definitions of those dimensions." + * // pattern: [0-9a-zA-Z,]+ + * dimensions: 'placeholder-value', + * // The end date for fetching YouTube Analytics data. The value should be in + * // `YYYY-MM-DD` format. + * // required: true, pattern: [0-9]{4}-[0-9]{2}-[0-9]{2} + * endDate: 'placeholder-value', + * // A list of filters that should be applied when retrieving YouTube Analytics + * // data. The [Available Reports](/youtube/analytics/v2/available_reports) + * // document identifies the dimensions that can be used to filter each report, + * // and the [Dimensions](/youtube/analytics/v2/dimsmets/dims) document defines + * // those dimensions. If a request uses multiple filters, join them together + * // with a semicolon (`;`), and the returned result table will satisfy both + * // filters. For example, a filters parameter value of + * // `video==dMH0bHeiRNg;country==IT` restricts the result set to include data + * // for the given video in Italy.", + * filters: 'placeholder-value', + * // Identifies the YouTube channel or content owner for which you are + * // retrieving YouTube Analytics data. + * // + * // - To request data for a YouTube user, set the `ids` parameter value to + * // `channel==CHANNEL_ID`, where `CHANNEL_ID` specifies the unique YouTube + * // channel ID. + * // - To request data for a YouTube CMS content owner, set the `ids` parameter + * // value to `contentOwner==OWNER_NAME`, where `OWNER_NAME` is the CMS name + * // of the content owner. + * // required: true, pattern: [a-zA-Z]+==[a-zA-Z0-9_+-]+ + * ids: 'placeholder-value', + * // If set to true historical data (i.e. channel data from before the linking + * // of the channel to the content owner) will be retrieved.", + * includeHistoricalChannelData: 'placeholder-value', + * // The maximum number of rows to include in the response.", + * // minValue: 1 + * maxResults: 'placeholder-value', + * // A comma-separated list of YouTube Analytics metrics, such as `views` or + * // `likes,dislikes`. See the + * // [Available Reports](/youtube/analytics/v2/available_reports) document for + * // a list of the reports that you can retrieve and the metrics + * // available in each report, and see the + * // [Metrics](/youtube/analytics/v2/dimsmets/mets) document for definitions of + * // those metrics. + * // required: true, pattern: [0-9a-zA-Z,]+ + * metrics: 'placeholder-value', + * // A comma-separated list of dimensions or metrics that determine the sort + * // order for YouTube Analytics data. By default the sort order is ascending. + * // The '`-`' prefix causes descending sort order.", + * // pattern: [-0-9a-zA-Z,]+ + * sort: 'placeholder-value', + * // The start date for fetching YouTube Analytics data. The value should be in + * // `YYYY-MM-DD` format. + * // required: true, pattern: "[0-9]{4}-[0-9]{2}-[0-9]{2} + * startDate: 'placeholder-value', + * // An index of the first entity to retrieve. Use this parameter as a + * // pagination mechanism along with the max-results parameter (one-based, + * // inclusive).", + * // minValue: 1 + * startIndex: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "columnHeaders": [], + * // "errors": {}, + * // "kind": "my_kind", + * // "rows": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtubeAnalytics.reports.query * @memberOf! () * diff --git a/src/apis/youtubereporting/v1.ts b/src/apis/youtubereporting/v1.ts index de61edbbd79..51d11967a9e 100644 --- a/src/apis/youtubereporting/v1.ts +++ b/src/apis/youtubereporting/v1.ts @@ -586,6 +586,68 @@ export namespace youtubereporting_v1 { /** * youtubereporting.jobs.create * @desc Creates a job and returns it. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtubereporting.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 youtubereporting = google.youtubereporting('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/yt-analytics-monetary.readonly', + * 'https://www.googleapis.com/auth/yt-analytics.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 youtubereporting.jobs.create({ + * // The content owner's external ID on which behalf the user is acting on. If + * // not set, the user is acting for himself (his own channel). + * onBehalfOfContentOwner: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "createTime": "my_createTime", + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "name": "my_name", + * // "reportTypeId": "my_reportTypeId", + * // "systemManaged": false + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "name": "my_name", + * // "reportTypeId": "my_reportTypeId", + * // "systemManaged": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtubereporting.jobs.create * @memberOf! () * @@ -656,6 +718,50 @@ export namespace youtubereporting_v1 { /** * youtubereporting.jobs.delete * @desc Deletes a job. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtubereporting.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 youtubereporting = google.youtubereporting('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/yt-analytics-monetary.readonly', + * 'https://www.googleapis.com/auth/yt-analytics.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 youtubereporting.jobs.delete({ + * // The ID of the job to delete. + * jobId: 'placeholder-value', + * // The content owner's external ID on which behalf the user is acting on. If + * // not set, the user is acting for himself (his own channel). + * onBehalfOfContentOwner: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtubereporting.jobs.delete * @memberOf! () * @@ -726,6 +832,57 @@ export namespace youtubereporting_v1 { /** * youtubereporting.jobs.get * @desc Gets a job. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtubereporting.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 youtubereporting = google.youtubereporting('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/yt-analytics-monetary.readonly', + * 'https://www.googleapis.com/auth/yt-analytics.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 youtubereporting.jobs.get({ + * // The ID of the job to retrieve. + * jobId: 'placeholder-value', + * // The content owner's external ID on which behalf the user is acting on. If + * // not set, the user is acting for himself (his own channel). + * onBehalfOfContentOwner: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "expireTime": "my_expireTime", + * // "id": "my_id", + * // "name": "my_name", + * // "reportTypeId": "my_reportTypeId", + * // "systemManaged": false + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtubereporting.jobs.get * @memberOf! () * @@ -796,6 +953,63 @@ export namespace youtubereporting_v1 { /** * youtubereporting.jobs.list * @desc Lists jobs. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtubereporting.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 youtubereporting = google.youtubereporting('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/yt-analytics-monetary.readonly', + * 'https://www.googleapis.com/auth/yt-analytics.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 youtubereporting.jobs.list({ + * // If set to true, also system-managed jobs will be returned; otherwise only + * // user-created jobs will be returned. System-managed jobs can neither be + * // modified nor deleted. + * includeSystemManaged: 'placeholder-value', + * // The content owner's external ID on which behalf the user is acting on. If + * // not set, the user is acting for himself (his own channel). + * onBehalfOfContentOwner: 'placeholder-value', + * // Requested page size. Server may return fewer jobs than requested. + * // If unspecified, server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. Typically, + * // this is the value of + * // ListReportTypesResponse.next_page_token + * // returned in response to the previous call to the `ListJobs` method. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "jobs": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtubereporting.jobs.list * @memberOf! () * @@ -947,6 +1161,60 @@ export namespace youtubereporting_v1 { /** * youtubereporting.jobs.reports.get * @desc Gets the metadata of a specific report. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtubereporting.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 youtubereporting = google.youtubereporting('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/yt-analytics-monetary.readonly', + * 'https://www.googleapis.com/auth/yt-analytics.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 youtubereporting.jobs.reports.get({ + * // The ID of the job. + * jobId: 'placeholder-value', + * // The content owner's external ID on which behalf the user is acting on. If + * // not set, the user is acting for himself (his own channel). + * onBehalfOfContentOwner: 'placeholder-value', + * // The ID of the report to retrieve. + * reportId: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "createTime": "my_createTime", + * // "downloadUrl": "my_downloadUrl", + * // "endTime": "my_endTime", + * // "id": "my_id", + * // "jobExpireTime": "my_jobExpireTime", + * // "jobId": "my_jobId", + * // "startTime": "my_startTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtubereporting.jobs.reports.get * @memberOf! () * @@ -1021,6 +1289,69 @@ export namespace youtubereporting_v1 { /** * youtubereporting.jobs.reports.list * @desc Lists reports created by a specific job. Returns NOT_FOUND if the job does not exist. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtubereporting.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 youtubereporting = google.youtubereporting('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/yt-analytics-monetary.readonly', + * 'https://www.googleapis.com/auth/yt-analytics.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 youtubereporting.jobs.reports.list({ + * // If set, only reports created after the specified date/time are returned. + * createdAfter: 'placeholder-value', + * // The ID of the job. + * jobId: 'placeholder-value', + * // The content owner's external ID on which behalf the user is acting on. If + * // not set, the user is acting for himself (his own channel). + * onBehalfOfContentOwner: 'placeholder-value', + * // Requested page size. Server may return fewer report types than requested. + * // If unspecified, server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. Typically, + * // this is the value of + * // ListReportsResponse.next_page_token + * // returned in response to the previous call to the `ListReports` method. + * pageToken: 'placeholder-value', + * // If set, only reports whose start time is greater than or equal the + * // specified date/time are returned. + * startTimeAtOrAfter: 'placeholder-value', + * // If set, only reports whose start time is smaller than the specified + * // date/time are returned. + * startTimeBefore: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "reports": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtubereporting.jobs.reports.list * @memberOf! () * @@ -1165,6 +1496,78 @@ export namespace youtubereporting_v1 { /** * youtubereporting.media.download * @desc Method for media download. Download is supported on the URI `/v1/media/{+name}?alt=media`. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtubereporting.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 youtubereporting = google.youtubereporting('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/yt-analytics-monetary.readonly', + * 'https://www.googleapis.com/auth/yt-analytics.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 youtubereporting.media.download({ + * // Name of the media that is being downloaded. + * resourceName: '.*', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "algorithm": "my_algorithm", + * // "bigstoreObjectRef": "my_bigstoreObjectRef", + * // "blobRef": "my_blobRef", + * // "blobstore2Info": {}, + * // "compositeMedia": [], + * // "contentType": "my_contentType", + * // "contentTypeInfo": {}, + * // "cosmoBinaryReference": "my_cosmoBinaryReference", + * // "crc32cHash": 0, + * // "diffChecksumsResponse": {}, + * // "diffDownloadResponse": {}, + * // "diffUploadRequest": {}, + * // "diffUploadResponse": {}, + * // "diffVersionResponse": {}, + * // "downloadParameters": {}, + * // "filename": "my_filename", + * // "hash": "my_hash", + * // "hashVerified": false, + * // "inline": "my_inline", + * // "isPotentialRetry": false, + * // "length": "my_length", + * // "md5Hash": "my_md5Hash", + * // "mediaId": "my_mediaId", + * // "objectId": {}, + * // "path": "my_path", + * // "referenceType": "my_referenceType", + * // "sha1Hash": "my_sha1Hash", + * // "sha256Hash": "my_sha256Hash", + * // "timestamp": "my_timestamp", + * // "token": "my_token" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtubereporting.media.download * @memberOf! () * @@ -1258,6 +1661,63 @@ export namespace youtubereporting_v1 { /** * youtubereporting.reportTypes.list * @desc Lists report types. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/youtubereporting.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 youtubereporting = google.youtubereporting('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/yt-analytics-monetary.readonly', + * 'https://www.googleapis.com/auth/yt-analytics.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 youtubereporting.reportTypes.list({ + * // If set to true, also system-managed report types will be returned; + * // otherwise only the report types that can be used to create new reporting + * // jobs will be returned. + * includeSystemManaged: 'placeholder-value', + * // The content owner's external ID on which behalf the user is acting on. If + * // not set, the user is acting for himself (his own channel). + * onBehalfOfContentOwner: 'placeholder-value', + * // Requested page size. Server may return fewer report types than requested. + * // If unspecified, server will pick an appropriate default. + * pageSize: 'placeholder-value', + * // A token identifying a page of results the server should return. Typically, + * // this is the value of + * // ListReportTypesResponse.next_page_token + * // returned in response to the previous call to the `ListReportTypes` method. + * pageToken: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "nextPageToken": "my_nextPageToken", + * // "reportTypes": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * * @alias youtubereporting.reportTypes.list * @memberOf! () * diff --git a/src/generator/filters.ts b/src/generator/filters.ts new file mode 100644 index 00000000000..fd9cb89aaac --- /dev/null +++ b/src/generator/filters.ts @@ -0,0 +1,170 @@ +// Copyright 2020 Google LLC +// +// 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 {SchemaItem, SchemaMethod, SchemaParameters} from 'googleapis-common'; + +export function getObjectType(item: SchemaItem): string { + if (item.additionalProperties) { + const valueType = getType(item.additionalProperties); + return `{ [key: string]: ${valueType}; }`; + } else if (item.properties) { + const fields = item.properties; + const objectType = Object.keys(fields) + .map(field => `${cleanPropertyName(field)}?: ${getType(fields[field])};`) + .join(' '); + return `{ ${objectType} }`; + } else { + return 'any'; + } +} + +export function isSimpleType(type: string): boolean { + if (type.indexOf('{') > -1) { + return false; + } + return true; +} + +export function cleanPropertyName(prop: string) { + const match = prop.match(/[-@.]/); + return match ? `'${prop}'` : prop; +} + +export function camelify(name: string) { + // If the name has a `-`, remove it and camelize. + // Ex: `well-known` => `wellKnown` + if (name.includes('-')) { + const parts = name.split('-').filter(x => !!x); + name = parts + .map((part, i) => { + if (i === 0) { + return part; + } + return part.charAt(0).toUpperCase() + part.slice(1); + }) + .join(''); + } + return name; +} + +export function getType(item: SchemaItem): string { + if (item.$ref) { + return `Schema$${item.$ref}`; + } + switch (item.type) { + case 'integer': + return 'number'; + case 'object': + return getObjectType(item); + case 'array': { + const innerType = getType(item.items!); + if (isSimpleType(innerType)) { + return `${innerType}[]`; + } else { + return `Array<${innerType}>`; + } + } + default: + return item.type!; + } +} + +/** + * A multi-line string is turned into one line. + * @param str String to process + * @return Single line string processed + */ +export function oneLine(str?: string) { + return str ? str.replace(/\n/g, ' ') : ''; +} + +/** + * Clean a string of comment tags. + * @param str String to process + * @return Single line string processed + */ +export function cleanComments(str?: string) { + // Convert /* into /x and */ into x/ + return str ? str.replace(/\*\//g, 'x/').replace(/\/\*/g, '/x') : ''; +} + +export function getPathParams(params: SchemaParameters) { + const pathParams = new Array(); + if (typeof params !== 'object') { + params = {}; + } + Object.keys(params).forEach(key => { + if (params[key].location === 'path') { + pathParams.push(key); + } + }); + return pathParams; +} + +export function getSafeParamName(param: string) { + if (RESERVED_PARAMS.indexOf(param) !== -1) { + return param + '_'; + } + return param; +} + +export function hasResourceParam(method: SchemaMethod): boolean { + return !!method.parameters && !!method.parameters['resource']; +} + +const RESERVED_PARAMS = ['resource', 'media', 'auth']; + +/** + * Build a string used to create a URL from the discovery doc provided URL. + * replace double slashes with single slash (except in https://) + * @private + * @param input URL to build from + * @return Resulting built URL + */ +export function buildurl(input?: string) { + return input ? `'${input}'`.replace(/([^:]\/)\/+/g, '$1') : ''; +} + +export function cleanPaths(str?: string) { + return str + ? str + .replace(/\/\*\//gi, '/x/') + .replace(/\/\*`/gi, '/x') + .replace(/\*\//gi, 'x/') + .replace(/\\n/gi, 'x/') + : ''; +} + +/** + * Attempt to turn a regex into a more human readable form. + * @param regex pattern for the given parameter + */ +export function unRegex(regex: string): string { + // example: ^projects/[^/]+$' ==> projects/my-project + let pattern = regex; + if (typeof regex !== 'string') { + return ''; + } + // remove leading ^ + if (pattern.startsWith('^')) { + pattern = pattern.slice(1); + } + // remove trailing $ + if (pattern.endsWith('$')) { + pattern = pattern.slice(0, pattern.length - 1); + } + // replace projects placeholders + pattern = pattern.replace(/\^?(\w+)s\/\[\^\/\]\+\$?/g, '$1s/my-$1'); + return pattern; +} diff --git a/src/generator/generator.ts b/src/generator/generator.ts index 6ff875b161a..41317c12251 100644 --- a/src/generator/generator.ts +++ b/src/generator/generator.ts @@ -1,4 +1,5 @@ // Copyright 2014 Google LLC +// // 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 @@ -12,17 +13,7 @@ // limitations under the License. import * as fs from 'fs'; -import {GaxiosOptions} from 'gaxios'; -import {DefaultTransporter} from 'google-auth-library'; -import { - FragmentResponse, - Schema, - SchemaItem, - SchemaMethod, - SchemaParameters, - SchemaResource, - Schemas, -} from 'googleapis-common'; +import {Schema, Schemas} from 'googleapis-common'; import * as mkdirp from 'mkdirp'; import * as nunjucks from 'nunjucks'; import * as path from 'path'; @@ -31,140 +22,26 @@ import * as util from 'util'; import Q from 'p-queue'; import * as prettier from 'prettier'; import {downloadDiscoveryDocs} from './download'; +import * as filters from './filters'; +import {addFragments, generateSamples} from './samplegen'; const writeFile = util.promisify(fs.writeFile); const readDir = util.promisify(fs.readdir); const readFile = util.promisify(fs.readFile); - -const FRAGMENT_URL = - 'https://storage.googleapis.com/apisnippets-staging/public/'; +const stat = util.promisify(fs.stat); const srcPath = path.join(__dirname, '../../../src'); const TEMPLATES_DIR = path.join(srcPath, 'generator/templates'); const API_TEMPLATE = path.join(TEMPLATES_DIR, 'api-endpoint.njk'); -const RESERVED_PARAMS = ['resource', 'media', 'auth']; export interface GeneratorOptions { debug?: boolean; includePrivate?: boolean; } -function getObjectType(item: SchemaItem): string { - if (item.additionalProperties) { - const valueType = getType(item.additionalProperties); - return `{ [key: string]: ${valueType}; }`; - } else if (item.properties) { - const fields = item.properties; - const objectType = Object.keys(fields) - .map(field => `${cleanPropertyName(field)}?: ${getType(fields[field])};`) - .join(' '); - return `{ ${objectType} }`; - } else { - return 'any'; - } -} - -function isSimpleType(type: string): boolean { - if (type.indexOf('{') > -1) { - return false; - } - return true; -} - -function cleanPropertyName(prop: string) { - const match = prop.match(/[-@.]/g); - return match ? `'${prop}'` : prop; -} - -function camelify(name: string) { - // If the name has a `-`, remove it and camelize. - // Ex: `well-known` => `wellKnown` - if (name.includes('-')) { - const parts = name.split('-').filter(x => !!x); - name = parts - .map((part, i) => { - if (i === 0) { - return part; - } - return part.charAt(0).toUpperCase() + part.slice(1); - }) - .join(''); - } - return name; -} - -function getType(item: SchemaItem): string { - if (item.$ref) { - return `Schema$${item.$ref}`; - } - switch (item.type) { - case 'integer': - return 'number'; - case 'object': - return getObjectType(item); - case 'array': { - const innerType = getType(item.items!); - if (isSimpleType(innerType)) { - return `${innerType}[]`; - } else { - return `Array<${innerType}>`; - } - } - default: - return item.type!; - } -} - export class Generator { - private transporter = new DefaultTransporter(); - private requestQueue = new Q({concurrency: 50}); private env: nunjucks.Environment; - - /** - * A multi-line string is turned into one line. - * @param str String to process - * @return Single line string processed - */ - private oneLine(str?: string) { - return str ? str.replace(/\n/g, ' ') : ''; - } - - /** - * Clean a string of comment tags. - * @param str String to process - * @return Single line string processed - */ - private cleanComments(str?: string) { - // Convert /* into /x and */ into x/ - return str ? str.replace(/\*\//g, 'x/').replace(/\/\*/g, '/x') : ''; - } - - private getPathParams(params: SchemaParameters) { - const pathParams = new Array(); - if (typeof params !== 'object') { - params = {}; - } - Object.keys(params).forEach(key => { - if (params[key].location === 'path') { - pathParams.push(key); - } - }); - return pathParams; - } - - private getSafeParamName(param: string) { - if (RESERVED_PARAMS.indexOf(param) !== -1) { - return param + '_'; - } - return param; - } - - private hasResourceParam(method: SchemaMethod) { - return method.parameters && method.parameters['resource']; - } - private options: GeneratorOptions; - private state = new Map(); /** @@ -177,34 +54,16 @@ export class Generator { new nunjucks.FileSystemLoader(TEMPLATES_DIR), {trimBlocks: true} ); - this.env.addFilter('buildurl', buildurl); - this.env.addFilter('oneLine', this.oneLine); - this.env.addFilter('getType', getType); - this.env.addFilter('cleanPropertyName', cleanPropertyName); - this.env.addFilter('cleanComments', this.cleanComments); - this.env.addFilter('camelify', camelify); - this.env.addFilter('getPathParams', this.getPathParams); - this.env.addFilter('getSafeParamName', this.getSafeParamName); - this.env.addFilter('hasResourceParam', this.hasResourceParam); - this.env.addFilter('cleanPaths', str => { - return str - ? str - .replace(/\/\*\//gi, '/x/') - .replace(/\/\*`/gi, '/x') - .replace(/\*\//gi, 'x/') - .replace(/\\n/gi, 'x/') - : ''; - }); - } - - /** - * Add a requests to the rate limited queue. - * @param opts Options to pass to the default transporter - */ - private request(opts: GaxiosOptions) { - return this.requestQueue.add(() => { - return this.transporter.request(opts); - }); + this.env.addFilter('buildurl', filters.buildurl); + this.env.addFilter('oneLine', filters.oneLine); + this.env.addFilter('getType', filters.getType); + this.env.addFilter('cleanPropertyName', filters.cleanPropertyName); + this.env.addFilter('cleanComments', filters.cleanComments); + this.env.addFilter('camelify', filters.camelify); + this.env.addFilter('getPathParams', filters.getPathParams); + this.env.addFilter('getSafeParamName', filters.getSafeParamName); + this.env.addFilter('hasResourceParam', filters.hasResourceParam); + this.env.addFilter('cleanPaths', filters.cleanPaths); } /** @@ -292,6 +151,7 @@ export class Generator { await queue.onIdle(); await this.generateIndex(apis); } catch (e) { + console.error(e); console.log(util.inspect(this.state, {maxArrayLength: null})); } } @@ -306,7 +166,7 @@ export class Generator { const files: string[] = await readDir(apisPath); for (const file of files) { const filePath = path.join(apisPath, file); - if (!(await util.promisify(fs.stat)(filePath)).isDirectory()) { + if (!(await stat(filePath)).isDirectory()) { continue; } apis[file] = {}; @@ -340,73 +200,6 @@ export class Generator { await this.render('root-index.njk', {apis}, rootIndexPath); } - /** - * Given a discovery doc, parse it and recursively iterate over the various - * embedded links. - */ - private getFragmentsForSchema( - apiDiscoveryUrl: string, - schema: SchemaResource, - apiPath: string, - tasks: Array<() => Promise> - ) { - if (schema.methods) { - for (const methodName in schema.methods) { - // eslint-disable-next-line no-prototype-builtins - if (schema.methods.hasOwnProperty(methodName)) { - const methodSchema = schema.methods[methodName]; - methodSchema.sampleUrl = apiPath + '.' + methodName + '.frag.json'; - tasks.push(async () => { - this.logResult(apiDiscoveryUrl, 'Making fragment request...'); - this.logResult(apiDiscoveryUrl, methodSchema.sampleUrl); - try { - const res = await this.request({ - url: methodSchema.sampleUrl, - }); - this.logResult(apiDiscoveryUrl, 'Fragment request complete.'); - if ( - res.data && - res.data.codeFragment && - res.data.codeFragment['Node.js'] - ) { - let fragment = res.data.codeFragment['Node.js'].fragment; - fragment = fragment.replace(/\/\*/gi, '/<'); - fragment = fragment.replace(/\*\//gi, '>/'); - fragment = fragment.replace(/`\*/gi, '`<'); - fragment = fragment.replace(/\*`/gi, '>`'); - const lines = fragment.split('\n'); - lines.forEach((line: string, i: number) => { - lines[i] = '*' + (line ? ' ' + lines[i] : ''); - }); - fragment = lines.join('\n'); - methodSchema.fragment = fragment; - } - } catch (err) { - this.logResult(apiDiscoveryUrl, `Fragment request err: ${err}`); - if (!err.message || err.message.indexOf('AccessDenied') === -1) { - throw err; - } - this.logResult(apiDiscoveryUrl, 'Ignoring error.'); - } - }); - } - } - } - if (schema.resources) { - for (const resourceName in schema.resources) { - // eslint-disable-next-line no-prototype-builtins - if (schema.resources.hasOwnProperty(resourceName)) { - this.getFragmentsForSchema( - apiDiscoveryUrl, - schema.resources[resourceName], - apiPath + '.' + resourceName, - tasks - ); - } - } - } - } - /** * Generate API file given discovery URL * @param apiDiscoveryUri URL or filename of discovery doc for API @@ -431,27 +224,17 @@ export class Generator { } private async generate(apiDiscoveryUrl: string, schema: Schema) { - this.logResult(apiDiscoveryUrl, 'Discovery doc request complete.'); - const tasks = new Array<() => Promise>(); - this.getFragmentsForSchema( - apiDiscoveryUrl, - schema, - `${FRAGMENT_URL}${schema.name}/${schema.version}/0/${schema.name}`, - tasks - ); - - // e.g. apis/drive/v2.js - const exportFilename = path.join( - srcPath, - 'apis', - schema.name, - schema.version + '.ts' - ); - this.logResult(apiDiscoveryUrl, 'Downloading snippets...'); - await Promise.all(tasks.map(t => t())); this.logResult(apiDiscoveryUrl, 'Generating APIs...'); + const apiPath = path.join(srcPath, 'apis', schema.name); + const exportFilename = path.join(apiPath, schema.version + '.ts'); await mkdirp(path.dirname(exportFilename)); + // populate the `method.fragment` property with samples + addFragments(schema); + // generate the API (ex: src/apis/youtube/v3.ts) await this.render(API_TEMPLATE, {api: schema}, exportFilename); + // generate samples on disk at: + // src/apis//samples// + // generateSamples(apiPath, schema); this.logResult(apiDiscoveryUrl, 'Template generation complete.'); return exportFilename; } @@ -474,14 +257,3 @@ export class Generator { await writeFile(outputPath, output, {encoding: 'utf8'}); } } - -/** - * Build a string used to create a URL from the discovery doc provided URL. - * replace double slashes with single slash (except in https://) - * @private - * @param input URL to build from - * @return Resulting built URL - */ -function buildurl(input?: string) { - return input ? `'${input}'`.replace(/([^:]\/)\/+/g, '$1') : ''; -} diff --git a/src/generator/samplegen.ts b/src/generator/samplegen.ts new file mode 100644 index 00000000000..d140307d7e0 --- /dev/null +++ b/src/generator/samplegen.ts @@ -0,0 +1,172 @@ +// Copyright 2020 Google LLC +// 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 * as path from 'path'; +import * as mkdirp from 'mkdirp'; +import * as prettier from 'prettier'; +import { + Schema, + SchemaMethod, + SchemaMethods, + SchemaResources, + SchemaItem, + SchemaItems, +} from 'googleapis-common'; +import * as nunjucks from 'nunjucks'; +import * as filters from './filters'; +import * as fs from 'fs'; +import * as util from 'util'; + +const writeFile = util.promisify(fs.writeFile); +const srcPath = path.join(__dirname, '../../../src'); +const TEMPLATES_DIR = path.join(srcPath, 'generator/templates'); +// eslint-disable-next-line @typescript-eslint/no-var-requires +const prettierConfig: prettier.Options = require('../../../node_modules/gts/.prettierrc.json'); +prettierConfig.parser = 'babel'; + +const env = new nunjucks.Environment( + new nunjucks.FileSystemLoader(TEMPLATES_DIR), + {trimBlocks: true} +); +env.addFilter('unRegex', filters.unRegex); +env.addFilter('cleanPropertyName', filters.cleanPropertyName); +env.addFilter('cleanComments', filters.cleanComments); + +interface SampleData { + api: Schema; + method: SchemaMethod; + responseExample?: {}; + requestExample?: {}; + standalone?: boolean; +} + +/** + * Given a top level Schema, collect every method on all resource objects. + * Generate a sample, format it, and and attach to the `method.fragment` field. + * @param schema Top level schema for the API. + */ +export async function addFragments(schema: Schema) { + const methods = getAllMethods(schema); + for (const method of methods) { + const sampleData = getSample(schema, method); + sampleData.standalone = false; + let sample = env.render('sample.njk', sampleData); + sample = prettier.format(sample, prettierConfig); + method.fragment = sample; + } +} + +/** + * Generate all samples, and write them into the samples folder on disk. + * @param apiPath Location on disk where the API lives. + * @param schema The top level Schema containing API information. + */ +export async function generateSamples(apiPath: string, schema: Schema) { + const samplesPath = path.join(apiPath, 'samples', schema.version); + await mkdirp(samplesPath); + const methods = getAllMethods(schema); + for (const method of methods) { + const sampleData = getSample(schema, method); + sampleData.standalone = true; + const samplePath = path.join(samplesPath, `${method.id}.js`); + let sample = env.render('sample.njk', sampleData); + sample = prettier.format(sample, prettierConfig); + await writeFile(samplePath, sample, {encoding: 'utf8'}); + } +} + +function getSample(schema: Schema, method: SchemaMethod) { + let responseExample: undefined | {}; + if (method.response) { + const item = schema.schemas[method.response.$ref!]; + responseExample = flattenSchema(item, schema.schemas); + } + let requestExample: {} | undefined; + if (method.request) { + const item = schema.schemas[method.request.$ref!]; + requestExample = flattenSchema(item, schema.schemas); + } + const sampleData: SampleData = { + api: schema, + method, + responseExample, + requestExample, + }; + return sampleData; +} + +interface MethodBag { + methods?: SchemaMethods; + resources?: SchemaResources; +} + +/** + * Iterate over items in the schema recursively, and return a flattened + * list of all methods. + * @param bag + * @param methods + */ +export function getAllMethods(bag: MethodBag, methods?: SchemaMethod[]) { + if (!methods) { + methods = new Array(); + } + if (bag.methods) { + for (const m of Object.keys(bag.methods)) { + methods.push(bag.methods[m]); + } + } + if (bag.resources) { + for (const r of Object.keys(bag.resources)) { + getAllMethods(bag.resources[r], methods); + } + } + return methods; +} + +/** + * Provide a flattened representation of what the structure for a + * given request or response could look like. + */ +function flattenSchema(item: SchemaItem, schemas: SchemaItems) { + // tslint:disable-next-line no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const result: any = {}; + if (item.properties) { + for (const [name, details] of Object.entries(item.properties)) { + result[name] = getExamplePropertyValue(name, details, schemas); + } + } + return result; +} + +function getExamplePropertyValue( + name: string, + details: SchemaItem, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + schemas: SchemaItems +): {} { + switch (details.type) { + case 'string': + return `my_${name}`; + case 'boolean': + return false; + case 'object': + return {}; + case 'integer': + return 0; + case 'array': + return []; + default: + return {}; + } +} diff --git a/src/generator/templates/method-partial.njk b/src/generator/templates/method-partial.njk index 2f7a5ca23f2..9487c775129 100644 --- a/src/generator/templates/method-partial.njk +++ b/src/generator/templates/method-partial.njk @@ -10,7 +10,7 @@ {% endif %} {% if m.fragment %} * @example - * {{ m.fragment|safe }} + * {{ m.fragment|safe|replace("\n", "\n * ") }} {% endif %} * @alias {{ m.id }} * @memberOf! {{ api.name }}({{ api.version }}) diff --git a/src/generator/templates/sample.njk b/src/generator/templates/sample.njk new file mode 100644 index 00000000000..e98c155a8fc --- /dev/null +++ b/src/generator/templates/sample.njk @@ -0,0 +1,77 @@ +{% if standalone %} +{% include "license.njk" %} + +// THIS FILE IS AUTO-GENERATED + +// {{ method.id }} +// +{% if method.description %} +// {{ method.description|cleanComments|safe|replace("\n", "\n // ") }} +{% endif %} +{% endif %} +// Before running the sample: +// - Enable the API at: +// https://console.developers.google.com/apis/api/{{api.name}}.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 {{api.name}} = google.{{api.name}}('{{api.version}}'); + +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: [ + {% for scope in method.scopes %}'{{scope}}', + {% endfor %} + ], + }); + + // 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 {{method.id}}({ + {% if method.parameters %} + {% for pname, p in method.parameters|dictsort %} + {% if p.description %} // {{ p.description|cleanComments|safe|replace('\n', '\n// ') }}{% endif %} + + {{ pname|cleanPropertyName|safe }}: {% if p.pattern %}'{{ p.pattern|unRegex }}'{% else %}'placeholder-value'{% endif %}, + {% endfor %} + {% endif %} + {% if method.request %} + + // Request body metadata + requestBody: { + // request body parameters + // {{ requestExample | dump(2) | safe | replace('\n', '\n // ') }} + }, + {% elif method.supportsMediaUpload and method.mediaUpload.protocols.simple.multipart %} + + requestBody: { + // request body parameters + }, + {% endif %} + {% if method.supportsMediaUpload %} + media: { + mimeType: 'placeholder-value', + body: 'placeholder-value', + }, + {% endif %} + + }); + console.log(res.data); + + {% if responseExample %} + // Example response + // {{ responseExample | dump(2) | safe | replace('\n', '\n // ') }} + {% endif %} +} + +main().catch(e => { + console.error(e); + throw e; +}); diff --git a/test/fixtures/discovery/webfonts-v1.json b/test/fixtures/discovery/webfonts-v1.json new file mode 100644 index 00000000000..5e0c6dac67d --- /dev/null +++ b/test/fixtures/discovery/webfonts-v1.json @@ -0,0 +1,175 @@ +{ + "basePath": "/webfonts/v1/", + "baseUrl": "https://www.googleapis.com/webfonts/v1/", + "batchPath": "batch/webfonts/v1", + "description": "Accesses the metadata for all families served by Google Fonts, providing a list of families currently available (including available styles and a list of supported script subsets).", + "discoveryVersion": "v1", + "documentationLink": "https://developers.google.com/fonts/docs/developer_api", + "etag": "\"u9GIe6H63LSGq-9_t39K2Zx_EAc/5_fiJZHCPuxNkgUtCVK8tszhsbo\"", + "icons": { + "x16": "https://www.google.com/images/icons/feature/font_api-16.png", + "x32": "https://www.google.com/images/icons/feature/font_api-32.gif" + }, + "id": "webfonts:v1", + "kind": "discovery#restDescription", + "name": "webfonts", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "alt": { + "default": "json", + "description": "Data format for the response.", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "An opaque string that represents a user for quota purposes. Must not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "userIp": { + "description": "Deprecated. Please use quotaUser instead.", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "webfonts": { + "methods": { + "list": { + "description": "Retrieves the list of fonts currently served by the Google Fonts Developer API", + "httpMethod": "GET", + "id": "webfonts.webfonts.list", + "parameters": { + "sort": { + "description": "Enables sorting of the list", + "enum": [ + "alpha", + "date", + "popularity", + "style", + "trending" + ], + "enumDescriptions": [ + "Sort alphabetically", + "Sort by date added", + "Sort by popularity", + "Sort by number of styles", + "Sort by trending" + ], + "location": "query", + "type": "string" + } + }, + "path": "webfonts", + "response": { + "$ref": "WebfontList" + } + } + } + } + }, + "revision": "20200302", + "rootUrl": "https://www.googleapis.com/", + "schemas": { + "Webfont": { + "id": "Webfont", + "properties": { + "category": { + "description": "The category of the font.", + "type": "string" + }, + "family": { + "description": "The name of the font.", + "type": "string" + }, + "files": { + "additionalProperties": { + "description": "The font file URL (value) for an specific variant (key).", + "type": "string" + }, + "description": "The font files (with all supported scripts) for each one of the available variants, as a key : value map.", + "type": "object" + }, + "kind": { + "default": "webfonts#webfont", + "description": "This kind represents a webfont object in the webfonts service.", + "type": "string" + }, + "lastModified": { + "description": "The date (format \"yyyy-MM-dd\") the font was modified for the last time.", + "format": "date", + "type": "string" + }, + "subsets": { + "description": "The scripts supported by the font.", + "items": { + "type": "string" + }, + "type": "array" + }, + "variants": { + "description": "The available variants for the font.", + "items": { + "type": "string" + }, + "type": "array" + }, + "version": { + "description": "The font version.", + "type": "string" + } + }, + "type": "object" + }, + "WebfontList": { + "id": "WebfontList", + "properties": { + "items": { + "description": "The list of fonts currently served by the Google Fonts API.", + "items": { + "$ref": "Webfont" + }, + "type": "array" + }, + "kind": { + "default": "webfonts#webfontList", + "description": "This kind represents a list of webfont objects in the webfonts service.", + "type": "string" + } + }, + "type": "object" + } + }, + "servicePath": "webfonts/v1/", + "title": "Google Fonts Developer API", + "version": "v1" +} \ No newline at end of file diff --git a/test/test.filters.ts b/test/test.filters.ts new file mode 100644 index 00000000000..81555ab269d --- /dev/null +++ b/test/test.filters.ts @@ -0,0 +1,158 @@ +// Copyright 2020 Google LLC +// +// 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 * as assert from 'assert'; +import {describe, it} from 'mocha'; +import * as filters from '../src/generator/filters'; +import {SchemaMethod, SchemaParameters, SchemaItem} from 'googleapis-common'; + +describe(__filename, () => { + it('should convert a dashed word to camelcase', () => { + const param = 'well-known'; + const expected = 'wellKnown'; + const result = filters.camelify(param); + assert.strictEqual(result, expected); + }); + + it('should strip /* comments from disco', () => { + const param = 'This would /* cause problems */ for sure'; + const expected = 'This would /x cause problems x/ for sure'; + const result = filters.cleanComments(param); + assert.strictEqual(result, expected); + }); + + it('should strip reserved characters from paths', () => { + const param = '/*/ /*` boop */'; + const expected = '/x/ /x boop x/'; + const result = filters.cleanPaths(param); + assert.strictEqual(result, expected); + }); + + it('should strip reserved characters property names', () => { + const param = 'property-name'; + const expected = "'property-name'"; + const result = filters.cleanPropertyName(param); + assert.strictEqual(result, expected); + }); + + it('should check for simple types', () => { + assert.strictEqual(filters.isSimpleType('{}'), false); + assert.strictEqual(filters.isSimpleType('1'), true); + }); + + it('should create one liners', () => { + const original = '1\n2\n3'; + const expected = '1 2 3'; + assert.strictEqual(filters.oneLine(original), expected); + }); + + it('should convert regex paths to examples', () => { + const path = '^projects/[^/]+$'; + const expected = 'projects/my-project'; + const result = filters.unRegex(path); + assert.strictEqual(result, expected); + assert.strictEqual(filters.unRegex((1 as {}) as string), ''); + }); + + it('should remove double slashes from urls', () => { + const original = 'https://github.com//googleapis//google-cloud-node'; + const expected = "'https://github.com/googleapis/google-cloud-node'"; + assert.strictEqual(filters.buildurl(original), expected); + }); + + it('should find resource params', () => { + const withResource = ({ + parameters: { + resource: {}, + }, + } as {}) as SchemaMethod; + assert.strictEqual(filters.hasResourceParam(withResource), true); + const withoutResource1 = {} as SchemaMethod; + assert.strictEqual(filters.hasResourceParam(withoutResource1), false); + const withoutResource2 = { + parameters: {}, + } as SchemaMethod; + assert.strictEqual(filters.hasResourceParam(withoutResource2), false); + }); + + it('should get safe param name', () => { + const original = 'resource'; + const expected = 'resource_'; + assert.strictEqual(filters.getSafeParamName(original), expected); + assert.strictEqual(filters.getSafeParamName('ok'), 'ok'); + }); + + it('should get path parameters', () => { + let emptyParams: SchemaParameters; + assert.deepStrictEqual(filters.getPathParams(emptyParams!), []); + + const params = ({ + 1: { + location: 'path', + }, + 2: {}, + } as {}) as SchemaParameters; + const expected = ['1']; + assert.deepStrictEqual(filters.getPathParams(params), expected); + }); + + it('should get a ref type', () => { + const item1 = { + $ref: 'Food', + }; + const expected1 = 'Schema$Food'; + assert.strictEqual(filters.getType(item1), expected1); + }); + + it('should get an integer type', () => { + const item2 = { + type: 'integer', + } as SchemaItem; + const expected2 = 'number'; + assert.strictEqual(filters.getType(item2), expected2); + }); + + it('should get a boolean type', () => { + const item3 = { + type: 'boolean', + } as SchemaItem; + const expected3 = 'boolean'; + assert.strictEqual(filters.getType(item3), expected3); + }); + + it('should get object type for any', () => { + assert.strictEqual(filters.getObjectType({}), 'any'); + }); + + it('should get object type for item.properties', () => { + const item = { + properties: { + count: { + type: 'integer', + }, + }, + } as SchemaItem; + assert.strictEqual(filters.getObjectType(item), '{ count?: number; }'); + }); + + it('should get object type for item.additionalProperties', () => { + const item = { + additionalProperties: { + type: 'any', + }, + } as SchemaItem; + const expected = '{ [key: string]: any; }'; + assert.strictEqual(filters.getObjectType(item), expected); + }); +}); diff --git a/test/test.samplegen.ts b/test/test.samplegen.ts new file mode 100644 index 00000000000..f82240b312f --- /dev/null +++ b/test/test.samplegen.ts @@ -0,0 +1,29 @@ +// Copyright 2020 Google LLC +// +// 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 * as assert from 'assert'; +import {describe, it} from 'mocha'; +import {addFragments, getAllMethods} from '../src/generator/samplegen'; + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const schema = require('../../test/fixtures/discovery/webfonts-v1.json'); + +describe.only(__filename, () => { + it('should add fragments', () => { + addFragments(schema); + const methods = getAllMethods(schema); + assert.strictEqual(methods.length, 1); + assert.ok(methods[0].fragment); + }); +});